/* =========================================================
   Portal — tasarım sistemi
   ========================================================= */

:root {
  /* yüzeyler */
  --bg:        #f4f5f8;
  --surface:   #ffffff;
  --surface-2: #fafbfc;
  --line:      #e6e9ef;
  --line-soft: #eff1f5;

  /* metin */
  --ink:       #0f1219;
  --ink-2:     #495264;
  --ink-3:     #8b93a5;

  /* marka */
  --brand:     #4f46e5;
  --brand-2:   #7c3aed;
  --brand-ink: #ffffff;
  --brand-soft:#eef0fe;
  --grad:      linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);

  /* durum */
  --ok:   #0f9d58;  --ok-bg:   #e7f6ed;
  --warn: #b7791f;  --warn-bg: #fdf4e3;
  --err:  #d63a3a;  --err-bg:  #fdecec;

  /* biçim */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --shadow-1: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-2: 0 4px 12px rgba(16,24,40,.07), 0 2px 4px rgba(16,24,40,.04);
  --shadow-3: 0 18px 40px rgba(16,24,40,.13), 0 4px 12px rgba(16,24,40,.07);
  --ring: 0 0 0 3px rgba(79,70,229,.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0b0d12;
    --surface:   #14171f;
    --surface-2: #191d27;
    --line:      #242a36;
    --line-soft: #1d222c;
    --ink:       #eef1f6;
    --ink-2:     #a8b1c2;
    --ink-3:     #6d7688;
    --brand:     #7c74f5;
    --brand-soft:#1e1d3a;
    --ok:   #4ade80;  --ok-bg:   #12291c;
    --warn: #fbbf24;  --warn-bg: #2c2310;
    --err:  #f87171;  --err-bg:  #2c1616;
    --shadow-1: 0 1px 2px rgba(0,0,0,.4);
    --shadow-2: 0 4px 14px rgba(0,0,0,.45);
    --shadow-3: 0 20px 44px rgba(0,0,0,.6);
    --ring: 0 0 0 3px rgba(124,116,245,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 680; }
h2 { font-size: 17px; font-weight: 650; }
.muted { color: var(--ink-3); }
.spacer { flex: 1; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

/* ---------- kabuk (sidebar + içerik) ---------- */

.shell { display: flex; min-height: 100vh; }

.side {
  width: 244px;
  flex: 0 0 244px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 22px;
  color: var(--ink); font-weight: 680; font-size: 16px; letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  color: #fff; font-size: 17px;
  box-shadow: 0 4px 12px rgba(79,70,229,.34);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; font-size: 14.5px;
  transition: background .14s, color .14s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; }

.nav-label {
  font-size: 11px; font-weight: 650; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3);
  padding: 20px 11px 7px;
}

.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.who { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 650;
}
.who .txt { min-width: 0; }
.who .txt b { display: block; font-size: 13.5px; font-weight: 600; }
.who .txt span {
  display: block; font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.main { flex: 1; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; padding: 32px 34px 64px; }

.page-head {
  display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.page-head p { margin: 5px 0 0; color: var(--ink-3); font-size: 14px; }

/* mobil */
@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side {
    width: auto; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 6px;
    border-right: 0; border-bottom: 1px solid var(--line);
    padding: 10px 14px; overflow-x: auto;
  }
  .brand { padding: 0 12px 0 0; }
  .brand span:last-child { display: none; }
  .nav { flex-direction: row; }
  .nav a { padding: 8px 12px; white-space: nowrap; }
  .nav a span { display: none; }
  .nav-label { display: none; }
  .side-foot { margin: 0 0 0 auto; padding: 0; border: 0; }
  .who .txt { display: none; }
  .page { padding: 22px 18px 48px; }
}

/* ---------- kartlar ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 22px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
@media (max-width: 900px) { .stats { grid-template-columns: 1fr 1fr; } }

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: var(--grad); opacity: .85;
}
.stat .lbl {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
}
.stat .val {
  font-size: 30px; font-weight: 700; letter-spacing: -.03em;
  margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* ---------- rozetler ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok   { background: var(--ok-bg);   color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.err  { background: var(--err-bg);  color: var(--err); }

.type-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 620;
}

/* ---------- tablo ---------- */

.table-wrap {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-1); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 18px; }
th {
  font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); background: var(--surface-2);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { border-bottom: 1px solid var(--line-soft); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
td.num { font-variant-numeric: tabular-nums; }

.empty { padding: 56px 24px; text-align: center; }
.empty .ic {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
}
.empty h3 { font-size: 16px; margin-bottom: 5px; }
.empty p { color: var(--ink-3); margin: 0 0 18px; font-size: 14px; }

/* ---------- formlar ---------- */

label { display: block; font-size: 13px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=datetime-local], input[type=date], textarea, select {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14.5px;
  transition: border-color .14s, box-shadow .14s;
}
input:focus, textarea:focus, select:focus {
  outline: 0; border-color: var(--brand); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { resize: vertical; min-height: 74px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); flex: none; }
.check label { margin: 0; color: var(--ink); font-weight: 450; font-size: 14px; }

/* ---------- butonlar ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--grad); color: #fff;
  font: inherit; font-size: 14.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(79,70,229,.28);
  transition: transform .12s, box-shadow .16s, filter .16s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(79,70,229,.34); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.btn.ghost {
  background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-1);
}
.btn.ghost:hover { border-color: var(--ink-3); box-shadow: var(--shadow-2); }
.btn.danger { background: none; color: var(--err); border-color: var(--line); box-shadow: none; }
.btn.danger:hover { background: var(--err-bg); border-color: currentColor; box-shadow: none; }
.btn.sm { padding: 7px 13px; font-size: 13.5px; }

.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--brand); font: inherit; font-size: 13.5px; font-weight: 550;
}
.link:hover { text-decoration: underline; }
.link.danger { color: var(--err); }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer;
  transition: color .14s, border-color .14s;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ---------- uyarılar ---------- */

.alert {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 16px; border-radius: var(--r-sm);
  margin-bottom: 20px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
}
.alert.ok  { background: var(--ok-bg);  color: var(--ok);  border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert.err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 22%, transparent); }

/* ---------- grafik ---------- */

.chart { width: 100%; height: 190px; display: block; }
.chart .bar { fill: url(#g); transition: opacity .15s; }
.chart .bar:hover { opacity: .75; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--ink-3); font-size: 10.5px; }

/* ---------- giriş ekranı ---------- */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth .art { display: none; } }

.auth .art {
  background: var(--grad);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 56px; color: #fff;
}
.auth .art::after {
  content: ""; position: absolute; inset: -30% -30% auto auto;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 62%);
}
.auth .art::before {
  content: ""; position: absolute; inset: auto auto -25% -20%;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.14), transparent 62%);
}
.auth .art h2 { font-size: 30px; font-weight: 680; max-width: 15ch; position: relative; }
.auth .art p { margin: 14px 0 0; opacity: .85; max-width: 40ch; font-size: 15px; position: relative; }
.auth .art .feats { margin: 30px 0 0; padding: 0; list-style: none; position: relative; }
.auth .art .feats li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 14.5px; opacity: .9;
}

.auth .form-side { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 372px; }
.auth-card .logo {
  width: 44px; height: 44px; border-radius: 13px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 21px;
  margin-bottom: 22px; box-shadow: 0 6px 18px rgba(79,70,229,.32);
}
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--ink-3); font-size: 14.5px; margin: 0 0 26px; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-card .foot { text-align: center; margin: 18px 0 0; font-size: 13.5px; }

/* ---------- ayrıntı bileşenleri ---------- */

details.disclose > summary {
  cursor: pointer; font-weight: 600; font-size: 14.5px;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before {
  content: "+"; width: 20px; height: 20px; border-radius: 6px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
details.disclose[open] > summary::before { content: "−"; }

.copy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy-row input {
  flex: 1; min-width: 260px; font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  background: var(--surface-2);
}
