/* ==========================================================================
   PopupPanel — Tasarım Sistemi v2
   Tokenlar → temel → bileşenler → yerleşim → yardımcılar
   Açık / koyu / sistem teması. Renkler HSL kanallarıyla tanımlı, opaklık
   varyasyonları color-mix() ile üretilir.
   ========================================================================== */

/* --------------------------------------------------------------- 1. Tokenlar */
:root {
  color-scheme: light;

  /* Nötr yüzeyler */
  --bg:            #f7f8fb;
  --bg-subtle:     #eef1f6;
  --surface:       #ffffff;
  --surface-2:     #fbfcfe;
  --surface-hover: #f4f6fa;
  --overlay:       rgba(15, 23, 42, .45);

  /* Metin */
  --text:          #0d1424;
  --text-muted:    #5b6577;
  --text-subtle:   #8b94a5;
  --text-invert:   #ffffff;

  /* Çizgiler */
  --line:          #e4e8f0;
  --line-strong:   #d3d9e4;

  /* Marka */
  --brand:         #5b5bd6;
  --brand-hover:   #4f4fc4;
  --brand-soft:    #eeeefc;
  --brand-border:  #d7d7f7;
  --brand-text:    #4a4ab8;

  /* Anlamsal */
  --ok:            #12855c;
  --ok-soft:       #e4f7ee;
  --ok-border:     #b6e8d2;
  --warn:          #a86413;
  --warn-soft:     #fdf3e3;
  --warn-border:   #f2ddb5;
  --err:           #cc3341;
  --err-soft:      #fdeceE;
  --err-border:    #f6c9cd;
  --info:          #1a6fbf;
  --info-soft:     #e8f2fd;
  --info-border:   #bfdcf7;

  /* Grafik serileri */
  --c1: #5b5bd6;  --c2: #0d9dd8;  --c3: #12855c;
  --c4: #d97706;  --c5: #cc3341;  --c6: #7c3aed;

  /* Yarıçap */
  --r-xs: 6px;  --r-sm: 8px;  --r-md: 10px;  --r-lg: 14px;  --r-xl: 20px;  --r-full: 999px;

  /* Gölge */
  --sh-xs: 0 1px 2px rgba(13, 20, 36, .05);
  --sh-sm: 0 1px 2px rgba(13, 20, 36, .06), 0 1px 3px rgba(13, 20, 36, .04);
  --sh-md: 0 2px 4px rgba(13, 20, 36, .05), 0 8px 20px -6px rgba(13, 20, 36, .10);
  --sh-lg: 0 8px 16px -6px rgba(13, 20, 36, .10), 0 24px 48px -12px rgba(13, 20, 36, .18);
  --sh-focus: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);

  /* Ölçü */
  --side-w: 250px;
  --top-h: 58px;
  --gap: 18px;

  /* Tipografi */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0a0e17;
  --bg-subtle:     #10151f;
  --surface:       #131926;
  --surface-2:     #171d2c;
  --surface-hover: #1c2434;
  --overlay:       rgba(2, 5, 12, .68);

  --text:          #e9edf5;
  --text-muted:    #98a3b6;
  --text-subtle:   #6d788c;
  --text-invert:   #0a0e17;

  --line:          #232b3b;
  --line-strong:   #2f394c;

  --brand:         #7b7bf0;
  --brand-hover:   #8f8ff5;
  --brand-soft:    #1c1f3d;
  --brand-border:  #333673;
  --brand-text:    #a9a9f8;

  --ok:            #35c98e;   --ok-soft:   #0e2a20;  --ok-border:   #1c4a38;
  --warn:          #e5a34a;   --warn-soft: #2c2010;  --warn-border: #4d3a1a;
  --err:           #f4707d;   --err-soft:  #2e1418;  --err-border:  #55242c;
  --info:          #55b0f5;   --info-soft: #0d2438;  --info-border: #1b4667;

  --c1: #7b7bf0;  --c2: #38b6ea;  --c3: #35c98e;
  --c4: #e5a34a;  --c5: #f4707d;  --c6: #a175f5;

  --sh-xs: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --sh-md: 0 2px 6px rgba(0, 0, 0, .45), 0 10px 24px -8px rgba(0, 0, 0, .6);
  --sh-lg: 0 10px 24px -8px rgba(0, 0, 0, .6), 0 30px 60px -16px rgba(0, 0, 0, .75);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0a0e17; --bg-subtle: #10151f; --surface: #131926; --surface-2: #171d2c;
    --surface-hover: #1c2434; --overlay: rgba(2, 5, 12, .68);
    --text: #e9edf5; --text-muted: #98a3b6; --text-subtle: #6d788c; --text-invert: #0a0e17;
    --line: #232b3b; --line-strong: #2f394c;
    --brand: #7b7bf0; --brand-hover: #8f8ff5; --brand-soft: #1c1f3d;
    --brand-border: #333673; --brand-text: #a9a9f8;
    --ok: #35c98e; --ok-soft: #0e2a20; --ok-border: #1c4a38;
    --warn: #e5a34a; --warn-soft: #2c2010; --warn-border: #4d3a1a;
    --err: #f4707d; --err-soft: #2e1418; --err-border: #55242c;
    --info: #55b0f5; --info-soft: #0d2438; --info-border: #1b4667;
    --c1: #7b7bf0; --c2: #38b6ea; --c3: #35c98e; --c4: #e5a34a; --c5: #f4707d; --c6: #a175f5;
    --sh-xs: 0 1px 2px rgba(0,0,0,.4);
    --sh-sm: 0 1px 2px rgba(0,0,0,.5);
    --sh-md: 0 2px 6px rgba(0,0,0,.45), 0 10px 24px -8px rgba(0,0,0,.6);
    --sh-lg: 0 10px 24px -8px rgba(0,0,0,.6), 0 30px 60px -16px rgba(0,0,0,.75);
  }
}

/* ----------------------------------------------------------------- 2. Temel */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.018em; font-weight: 650; }
h1 { font-size: 22px; letter-spacing: -.026em; font-weight: 700; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }

/* Varsayılan ikon boyutu — bileşenler kendi boyutlarını ezer. */
svg { display: block; width: 16px; height: 16px; flex: 0 0 auto; }
/* İçinde ikon olan satır içi bağlantı/etiketler */
.ilink, .iflex { display: inline-flex; align-items: center; gap: 6px; }
img { max-width: 100%; }

::selection { background: color-mix(in srgb, var(--brand) 26%, transparent); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* İnce kaydırma çubuğu */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: var(--r-full);
  border: 3px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* -------------------------------------------------------------- 3. Yerleşim */
.shell { display: flex; min-height: 100vh; }

.side {
  width: var(--side-w); flex: 0 0 var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}

.side-head { padding: 16px 16px 12px; display: flex; align-items: center; gap: 10px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
  background: linear-gradient(140deg, var(--brand), var(--c6));
  display: grid; place-items: center; color: #fff; box-shadow: var(--sh-sm);
}
.logo-mark svg { width: 17px; height: 17px; }
.logo-text { font-weight: 700; font-size: 15px; letter-spacing: -.02em; }
.logo-text small { display: block; font-size: 11px; font-weight: 500; color: var(--text-subtle); letter-spacing: 0; }

.side-search {
  margin: 0 12px 10px; padding: 7px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-subtle);
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  color: var(--text-subtle); font-size: 13px; width: calc(100% - 24px);
  font-family: inherit; transition: border-color .15s var(--ease), background .15s var(--ease);
}
.side-search:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.side-search svg { width: 14px; height: 14px; flex: 0 0 14px; }
.side-search kbd { margin-left: auto; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-subtle); padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-muted); font-weight: 550; font-size: 13.5px;
  position: relative; transition: background .13s var(--ease), color .13s var(--ease);
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .85; }
.nav-item.on { background: var(--brand-soft); color: var(--brand-text); font-weight: 620; }
.nav-item.on svg { opacity: 1; }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 650; padding: 1px 7px;
  border-radius: var(--r-full); background: var(--bg-subtle); color: var(--text-muted);
}
.nav-item.on .count { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-text); }

.side-foot { border-top: 1px solid var(--line); padding: 10px; }

.usermenu { position: relative; }
.usermenu-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border-radius: var(--r-sm); border: 0; background: none;
  cursor: pointer; font: inherit; color: var(--text); text-align: left;
  transition: background .13s var(--ease);
}
.usermenu-btn:hover { background: var(--surface-hover); }
.avatar {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--r-full);
  background: linear-gradient(140deg, var(--brand), var(--c6));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px;
}
.usermenu-txt { min-width: 0; flex: 1; }
.usermenu-txt strong { display: block; font-size: 12.8px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usermenu-txt span { display: block; font-size: 11.5px; color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-lg); padding: 5px; z-index: 60;
  opacity: 0; transform: translateY(6px) scale(.98); pointer-events: none;
  transition: opacity .16s var(--ease), transform .16s var(--ease-out);
}
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border-radius: var(--r-xs); border: 0; background: none;
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer; text-align: left;
}
.menu-item:hover { background: var(--surface-hover); text-decoration: none; }
.menu-item svg { width: 15px; height: 15px; opacity: .7; }
.menu-item.danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 2px; }
.menu-head { font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-subtle); padding: 7px 9px 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--top-h); flex: 0 0 var(--top-h);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  display: flex; align-items: center; gap: 12px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.crumbs { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); min-width: 0; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { color: var(--text-subtle); opacity: .6; }
.crumbs .now { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: none; color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot {
  position: absolute; top: 5px; right: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--err); border: 2px solid var(--surface);
}

.content { padding: 22px 22px 72px; flex: 1; }
.content.narrow { max-width: 960px; }

/* -------------------------------------------------------------- 4. Başlıklar */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-head .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* -------------------------------------------------------------- 5. Bileşenler */

/* Kart */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.card-pad { padding: 18px; }
.card-head {
  padding: 15px 18px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { width: 16px; height: 16px; color: var(--text-muted); }
.card-head .sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 18px; }
.card-foot { padding: 13px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card + .card { margin-top: var(--gap); }
/* Izgara/kolon içinde boşluğu `gap` verir; ardışık kart marjı sıfırlanır. */
.grid > .card + .card, .flex-col > .card + .card, .g2 > .card, .g3 > .card, .g4 > .card { margin-top: 0; }
.card.flat { box-shadow: none; }
.card.glow { border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-soft), var(--sh-sm); }

/* Izgaralar */
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) { .g-2-1 { grid-template-columns: 1fr; } }

/* KPI */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px 12px; box-shadow: var(--sh-sm); position: relative; overflow: hidden;
}
.stat-top { display: flex; align-items: center; gap: 8px; }
.stat-ico {
  width: 26px; height: 26px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-text); flex: 0 0 26px;
}
.stat-ico svg { width: 14px; height: 14px; }
.stat-lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); letter-spacing: .01em; }
.stat-val {
  font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 7px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12px; color: var(--text-muted); }
.stat-spark { position: absolute; right: 0; bottom: 0; width: 96px; height: 38px; opacity: .5; pointer-events: none; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 11.5px;
  padding: 1px 6px; border-radius: var(--r-full); }
.delta.up { color: var(--ok); background: var(--ok-soft); }
.delta.down { color: var(--err); background: var(--err-soft); }
.delta.flat { color: var(--text-muted); background: var(--bg-subtle); }
.delta svg { width: 11px; height: 11px; }

/* Buton */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .13s var(--ease), border-color .13s var(--ease), transform .06s var(--ease), box-shadow .13s var(--ease);
  box-shadow: var(--sh-xs);
}
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(13,20,36,.12), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: none; box-shadow: none; color: var(--text-muted); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--err); border-color: var(--err-border); background: var(--surface); }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { padding: 5px 10px; font-size: 12.2px; border-radius: var(--r-xs); }
.btn.sm svg { width: 13px; height: 13px; }
.btn.lg { padding: 11px 20px; font-size: 14px; border-radius: var(--r-md); }
.btn.block { width: 100%; }
.btn.icon { padding: 7px; }
.btn-group { display: inline-flex; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--sh-xs); }
.btn-group .btn { border: 0; border-radius: 0; box-shadow: none; }
.btn-group .btn + .btn { border-left: 1px solid var(--line); }
.btn-group .btn.on { background: var(--brand-soft); color: var(--brand-text); }

/* Rozet */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 650; letter-spacing: .005em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.b-active, .b-ok      { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-border); }
.b-draft, .b-neutral  { background: var(--bg-subtle); color: var(--text-muted); border-color: var(--line); }
.b-paused, .b-warn    { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.b-no, .b-err         { background: var(--err-soft);  color: var(--err);  border-color: var(--err-border); }
.b-info               { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.b-brand              { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-border); }

/* Tablo */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-subtle); font-weight: 700; padding: 9px 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
th:first-child { border-top-left-radius: 0; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background .1s var(--ease); }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.sel { background: var(--brand-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t-main { font-weight: 600; color: var(--text); }
.t-sub { font-size: 12px; color: var(--text-subtle); margin-top: 1px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: .35; transition: opacity .13s var(--ease); }
tbody tr:hover .row-actions { opacity: 1; }

/* Form */
label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
label .hint { font-weight: 400; color: var(--text-subtle); }
.field { margin-bottom: 14px; }
.field > .help { font-size: 12px; color: var(--text-subtle); margin-top: 5px; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel],
input[type=number], input[type=date], input[type=datetime-local], input[type=search],
select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; background: var(--surface); color: var(--text);
  transition: border-color .13s var(--ease), box-shadow .13s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--sh-focus);
}
input:disabled, select:disabled, textarea:disabled { background: var(--bg-subtle); color: var(--text-subtle); cursor: not-allowed; }
textarea { resize: vertical; min-height: 70px; line-height: 1.55; }
select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b94a5' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
input[type=color] {
  width: 38px; height: 32px; padding: 3px; border: 1px solid var(--line-strong);
  border-radius: var(--r-xs); background: var(--surface); cursor: pointer; flex: 0 0 38px;
}
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
input[type=range] {
  width: 100%; height: 20px; appearance: none; background: none; cursor: pointer;
}
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type=range]::-webkit-slider-thumb {
  appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--brand);
  border: 2px solid var(--surface); box-shadow: var(--sh-sm); margin-top: -5.5px;
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--brand);
  border: 2px solid var(--surface); box-shadow: var(--sh-sm);
}

.row { display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1; min-width: 130px; }
.row > .shrink { flex: 0 0 auto; min-width: 0; }

/* Anahtar (switch) */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 20px; border-radius: var(--r-full); background: var(--line-strong);
  position: relative; flex: 0 0 34px; transition: background .18s var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: var(--sh-sm);
  transition: transform .18s var(--ease-out);
}
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: var(--sh-focus); }

/* Onay kutusu */
.check { display: inline-flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 13px; }
.check input[type=checkbox] {
  appearance: none; width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface);
  cursor: pointer; position: relative; transition: background .13s var(--ease), border-color .13s var(--ease);
}
.check input[type=checkbox]:checked { background: var(--brand); border-color: var(--brand); }
.check input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 5px; top: 1.5px; width: 4px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(43deg);
}
.check input[type=checkbox]:focus-visible { box-shadow: var(--sh-focus); }

/* Segment kontrolü */
.seg { display: inline-flex; background: var(--bg-subtle); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 5px 11px; border-radius: var(--r-xs); color: var(--text-muted); cursor: pointer;
  transition: background .13s var(--ease), color .13s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-xs); }

/* Sekmeler */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 13px; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: color .13s var(--ease), border-color .13s var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--brand-text); border-bottom-color: var(--brand); }

/* Mesaj kutusu */
.msg {
  padding: 11px 14px; border-radius: var(--r-md); font-size: 13.2px;
  margin-bottom: 16px; border: 1px solid; display: flex; gap: 10px; align-items: flex-start;
}
.msg svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1.5px; }
.msg.ok   { background: var(--ok-soft);   color: var(--ok);   border-color: var(--ok-border); }
.msg.err  { background: var(--err-soft);  color: var(--err);  border-color: var(--err-border); }
.msg.info { background: var(--info-soft); color: var(--info); border-color: var(--info-border); }
.msg.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }
.msg a { color: inherit; text-decoration: underline; }

/* Boş durum */
.empty { text-align: center; padding: 52px 22px; }
.empty-ico {
  width: 46px; height: 46px; border-radius: var(--r-lg); margin: 0 auto 14px;
  background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center;
}
.empty-ico svg { width: 22px; height: 22px; }
.empty h3 { font-size: 15px; margin-bottom: 5px; }
.empty p { color: var(--text-muted); font-size: 13.5px; max-width: 400px; margin: 0 auto; }
.empty .btn { margin-top: 16px; }

/* İlerleme */
.bar-track { height: 6px; border-radius: var(--r-full); background: var(--bg-subtle); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--r-full); background: var(--brand); transition: width .5s var(--ease-out); }
.bar-fill.ok { background: var(--ok); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.err { background: var(--err); }

/* Liste (kırılım) */
.blist { display: flex; flex-direction: column; gap: 11px; }
.blist-row .t { display: flex; justify-content: space-between; gap: 10px; font-size: 12.8px; margin-bottom: 5px; }
.blist-row .t .v { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Kod */
code.block, .code {
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6;
  background: #0d1220; color: #d5dcec; padding: 13px 15px; border-radius: var(--r-md);
  display: block; overflow-x: auto; white-space: pre; border: 1px solid #1b2438;
}
code.inline {
  font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-subtle);
  padding: 1.5px 6px; border-radius: 5px; color: var(--text); border: 1px solid var(--line);
}
kbd {
  font-family: var(--font); font-size: 10.5px; font-weight: 650; line-height: 1;
  padding: 3px 5px; border-radius: 5px; background: var(--bg-subtle);
  border: 1px solid var(--line-strong); border-bottom-width: 2px; color: var(--text-muted);
}

/* Modal */
dialog {
  border: 0; padding: 0; background: var(--surface); color: var(--text);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  max-width: 540px; width: calc(100vw - 32px); max-height: calc(100vh - 64px);
}
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
dialog[open] { animation: dlgIn .22s var(--ease-out); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.dlg-h { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.dlg-h h2 { margin: 0; }
.dlg-h .sub { font-size: 12.8px; color: var(--text-muted); margin-top: 3px; }
.dlg-b { padding: 20px 22px; overflow-y: auto; }
.dlg-f { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end;
  gap: 9px; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
dialog.wide { max-width: 860px; }

/* Çekmece (drawer) */
.drawer-bg {
  position: fixed; inset: 0; background: var(--overlay); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease);
}
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: var(--surface); border-left: 1px solid var(--line); z-index: 91;
  box-shadow: var(--sh-lg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .26s var(--ease-out);
}
.drawer.open { transform: none; }
.drawer-h { padding: 17px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-b { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  display: flex; gap: 9px; flex-wrap: wrap; }

/* Komut paleti */
.cmdk-bg {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  backdrop-filter: blur(3px);
}
.cmdk-bg.open { display: flex; animation: fadeIn .14s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.cmdk {
  width: 100%; max-width: 570px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden;
  animation: dlgIn .2s var(--ease-out); display: flex; flex-direction: column; max-height: 68vh;
}
.cmdk-in { display: flex; align-items: center; gap: 11px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.cmdk-in svg { width: 17px; height: 17px; color: var(--text-subtle); flex: 0 0 17px; }
.cmdk-in input { border: 0; padding: 0; font-size: 15px; background: none; }
.cmdk-in input:focus { box-shadow: none; }
.cmdk-list { overflow-y: auto; padding: 7px; }
.cmdk-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-subtle); padding: 9px 10px 5px; }
.cmdk-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13.5px; color: var(--text);
}
.cmdk-item svg { width: 16px; height: 16px; color: var(--text-subtle); flex: 0 0 16px; }
.cmdk-item .meta { margin-left: auto; font-size: 11.5px; color: var(--text-subtle); }
.cmdk-item.on, .cmdk-item:hover { background: var(--brand-soft); color: var(--brand-text); }
.cmdk-item.on svg, .cmdk-item:hover svg { color: var(--brand-text); }
.cmdk-empty { padding: 30px 16px; text-align: center; color: var(--text-subtle); font-size: 13px; }
.cmdk-foot { border-top: 1px solid var(--line); padding: 9px 14px; display: flex; gap: 14px;
  font-size: 11.5px; color: var(--text-subtle); background: var(--surface-2); }
.cmdk-foot span { display: flex; align-items: center; gap: 5px; }

/* Toast */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px;
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-lg); font-size: 13.2px; font-weight: 550; color: var(--text);
  pointer-events: auto; animation: toastIn .26s var(--ease-out); max-width: 440px;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.toast.out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
.toast .ti { width: 18px; height: 18px; flex: 0 0 18px; }
.toast.ok .ti { color: var(--ok); }
.toast.err .ti { color: var(--err); }
.toast.info .ti { color: var(--info); }

/* Skeleton */
.sk { background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--surface-hover) 37%, var(--bg-subtle) 63%);
  background-size: 400% 100%; animation: skl 1.4s ease infinite; border-radius: var(--r-xs); }
@keyframes skl { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* İpucu (tooltip) */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%) translateY(3px); background: var(--text); color: var(--surface);
  padding: 5px 9px; border-radius: var(--r-xs); font-size: 11.5px; font-weight: 550;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .14s var(--ease), transform .14s var(--ease);
  z-index: 70;
}
[data-tip]:hover::after { opacity: 1; transform: translateX(-50%); }

/* Ayırıcı */
.hr { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

/* Onboarding */
.steps { display: flex; flex-direction: column; gap: 2px; }
.step { display: flex; gap: 12px; padding: 11px 12px; border-radius: var(--r-md); align-items: center;
  transition: background .13s var(--ease); }
.step:hover { background: var(--surface-hover); }
.step-n {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; border: 1.5px solid var(--line-strong); color: var(--text-subtle);
}
.step.done .step-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .step-t { color: var(--text-muted); text-decoration: line-through; }
.step-t { flex: 1; font-size: 13.3px; font-weight: 550; }
.step-t small { display: block; font-weight: 400; color: var(--text-subtle); font-size: 12px; text-decoration: none; }

/* --------------------------------------------------------------- 6. Yardımcı */
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.b { font-weight: 650; }
.num { font-variant-numeric: tabular-nums; }
.mt { margin-top: 16px; } .mt-s { margin-top: 9px; } .mt-l { margin-top: 26px; }
.mb { margin-bottom: 16px; } .mb-s { margin-bottom: 9px; }
.flex { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.flex-col { display: flex; flex-direction: column; gap: 9px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.right { margin-left: auto; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.chart-box { position: relative; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); position: relative; }
.dot-live::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: var(--ok); opacity: .35; animation: pulse 1.9s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(1.9); opacity: 0; } }

/* --------------------------------------------------------------- 7. Duyarlı */
@media (max-width: 900px) {
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%);
    transition: transform .25s var(--ease-out); box-shadow: var(--sh-lg);
  }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 39; display: none; }
  .side-scrim.open { display: block; }
  .main { width: 100%; }
  .content { padding: 16px 14px 60px; }
  .topbar { padding: 0 14px; }
  .menu-toggle { display: grid !important; }
  .g-2-1 { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
}
.menu-toggle { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .side, .topbar, .page-actions, .toasts { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ddd; }
}
