/* =====================================================================
   Özpekler PDKS · Tasarım sistemi
   ===================================================================== */
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bg: #f5f6fa;
  --bg-2: #eef0f6;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-hover: #f2f4f9;
  --border: #e6e8f0;
  --border-strong: #d5d9e4;
  --text: #0e1526;
  --text-2: #4a5468;
  --muted: #7b8499;
  --primary: #2f5fef;
  --primary-hover: #244fd6;
  --primary-soft: #eaf0ff;
  --primary-text: #2049c7;
  --accent: #7c5cff;
  --ok: #0a8f22;        --ok-soft: #e4f6e8;
  --warn: #b77700;      --warn-soft: #fff3d6;
  --bad: #d23536;       --bad-soft: #fdeaea;
  --info: #2f5fef;      --info-soft: #eaf0ff;
  --neutral-soft: #eef0f5;
  --series-1: #257de0;
  --status-good: #0aac23; --status-warn: #fbb315; --status-bad: #dc3c3d;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .16), 0 2px 8px rgba(16, 24, 40, .06);
  --ring: 0 0 0 4px rgba(47, 95, 239, .16);
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0e17;
  --bg-2: #0f1420;
  --surface: #111725;
  --surface-2: #151c2c;
  --surface-hover: #182033;
  --border: #1f283a;
  --border-strong: #2b364c;
  --text: #e9edf5;
  --text-2: #b3bccd;
  --muted: #8790a5;
  --primary: #4d78ff;
  --primary-hover: #6a8eff;
  --primary-soft: rgba(77, 120, 255, .14);
  --primary-text: #8ea9ff;
  --ok: #37c25a;        --ok-soft: rgba(10, 172, 35, .14);
  --warn: #f2b33d;      --warn-soft: rgba(251, 179, 21, .13);
  --bad: #f06a6a;       --bad-soft: rgba(220, 60, 61, .15);
  --info: #8ea9ff;      --info-soft: rgba(77, 120, 255, .14);
  --neutral-soft: #1b2335;
  --series-1: #338ced;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  --ring: 0 0 0 4px rgba(77, 120, 255, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01', 'tnum' 0;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; color: var(--text); }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 18px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; background: var(--neutral-soft); padding: 2px 6px; border-radius: 6px; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- butonlar ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  background: var(--primary); color: #fff; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.12);
  transition: background .15s, transform .1s, box-shadow .15s, border-color .15s; text-decoration: none !important;
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-hover); }
.btn.ghost { background: transparent; color: var(--text-2); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { background: var(--bad); }
.btn.danger.soft { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn.success { background: var(--ok); }
.btn.success.soft { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field > label, .label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, input:not([type=checkbox]):not([type=radio]), select, textarea {
  font: inherit; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8499' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); }
input[readonly] { background: var(--surface-2); }
.input-icon { position: relative; }
.input-icon svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; pointer-events: none; }
.input-icon input:not([type=checkbox]), .input-icon select { padding-left: 38px; }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 10px 0; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 22px; background: var(--border-strong); position: relative; flex-shrink: 0; cursor: pointer; transition: background .2s; margin: 0; border: 0; }
.switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible { box-shadow: var(--ring); outline: none; }
.switch .t { font-weight: 550; color: var(--text); }
.switch .d { font-size: 12.5px; color: var(--muted); display: block; font-weight: 400; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }

/* ---------- kart & düzen ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.full { grid-column: 1 / -1; }
.stack > * + * { margin-top: 16px; }
.sep { height: 1px; background: var(--border); margin: 16px 0; }

/* ---------- rozet / durum ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--text-2);
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill svg.i { width: 13px; height: 13px; stroke-width: 2.2; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.live .dot { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 currentColor; } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 12.5px; font-weight: 700; color: #fff; letter-spacing: .02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.person { display: flex; align-items: center; gap: 11px; min-width: 0; }
.person .n { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- tablo ---------- */
.table-wrap { overflow: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
table.t th {
  text-align: left; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
table.t tbody tr { transition: background .12s; }
table.t tbody tr:hover td { background: var(--surface-hover); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t td.actions { text-align: right; white-space: nowrap; }
table.t tr.clickable { cursor: pointer; }

/* ---------- boş durum / iskelet ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--neutral-soft); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--text-2); }
.empty .ic svg.i { width: 24px; height: 24px; }
.empty h3 { margin-bottom: 4px; }
.skel { background: linear-gradient(90deg, var(--neutral-soft) 0%, var(--surface-hover) 50%, var(--neutral-soft) 100%); background-size: 200% 100%; animation: skel 1.2s infinite; border-radius: 8px; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- bildirim ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; min-width: 260px; max-width: 380px; padding: 13px 15px; border-radius: 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-weight: 500;
  animation: toastIn .3s var(--ease); pointer-events: auto;
}
.toast .ti { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--neutral-soft); color: var(--text-2); }
.toast .ti svg.i { width: 14px; height: 14px; stroke-width: 2.5; }
.toast.ok .ti { background: var(--ok-soft); color: var(--ok); }
.toast.bad .ti { background: var(--bad-soft); color: var(--bad); }
.toast.out { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }
@media (max-width: 600px) { .toasts { left: 12px; right: 12px; top: auto; bottom: 96px; } .toast { max-width: none; } }

/* ---------- pencere / yan panel ---------- */
.overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(8, 12, 22, .42); backdrop-filter: blur(3px); animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(500px, calc(100vw - 20px)); z-index: 1001;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: drawerIn .32s var(--ease);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { flex: 1; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 22px; }
.drawer-foot { display: flex; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 1001; width: min(440px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 24px;
  animation: pop .25s var(--ease); max-height: calc(100vh - 24px); overflow: auto;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@media (max-width: 600px) {
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheetIn .32s var(--ease); }
  .drawer-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  @keyframes sheetIn { from { transform: translateY(60px); opacity: 0; } }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- segment ---------- */
.seg { display: inline-flex; background: var(--neutral-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--text-2); height: 30px; padding: 0 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- grafik ipucu ---------- */
.viz-tip {
  position: fixed; z-index: 3000; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 11px; border-radius: 10px;
  font-size: 12.5px; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; transition: opacity .1s;
}
.viz-tip b { font-size: 14px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
