/* takip.cloverlight.net — Cam & Derinlik taban teması (design-system/tokens.json) + akinti.css üstte.
   Renkler yalnız token üzerinden; literal hex yalnız :root token tanımlarında. */
:root {
  --p-surface: #F3F5F1; --p-card: rgba(255,255,255,0.72); --p-card-solid: #FFFFFF;
  --p-line: rgba(23,26,22,0.08); --p-ink: #171A16; --p-stone: #4B524A; --p-faint: #8A9187;
  --brand: #0B3C5C; --brand-lift: #146C93; --brand-deep: #041826;
  --brand-soft: rgba(11,60,92,0.09); --brand-line: rgba(11,60,92,0.28);
  --amber: #B45309; --amber-soft: rgba(180,83,9,0.1); --red: #B3261E; --red-soft: rgba(179,38,30,0.1);
  --green: #1F7A4D; --green-soft: rgba(31,122,77,0.11);
  --shadow-sm: 0 4px 14px -8px rgba(23,26,22,0.25), inset 0 1px 0 rgba(255,255,255,0.6);
  --shadow-md: 0 14px 34px -16px rgba(23,26,22,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
  --shadow-lg: 0 34px 70px -28px rgba(23,26,22,0.5), inset 0 1px 0 rgba(255,255,255,0.75);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --p-surface: #0B0F0C; --p-card: rgba(255,255,255,0.07); --p-card-solid: #141A15;
    --p-line: rgba(255,255,255,0.12); --p-ink: #F4F7F3; --p-stone: rgba(244,247,243,0.66); --p-faint: rgba(244,247,243,0.45);
    --brand: #4FC6EC; --brand-lift: #4FC6EC; --brand-deep: #0B3C5C;
    --brand-soft: rgba(79,198,236,0.14); --brand-line: rgba(79,198,236,0.3);
    --amber: #E08A34; --amber-soft: rgba(224,138,52,0.14); --red: #F0847A; --red-soft: rgba(240,132,122,0.14);
    --green: #4CC38A; --green-soft: rgba(76,195,138,0.14);
    --shadow-sm: 0 8px 24px -14px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.08);
    --shadow-md: 0 22px 50px -26px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.11);
    --shadow-lg: 0 34px 74px -28px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.13);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font-body); color: var(--p-ink); background-color: var(--p-surface);
  background-image: radial-gradient(900px 500px at 85% -10%, var(--brand-soft), transparent 70%),
                    radial-gradient(700px 500px at -10% 110%, var(--brand-soft), transparent 70%);
  background-attachment: fixed;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
a { color: var(--brand); }
.mono { font-family: var(--ak-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--p-stone); }
.faint { color: var(--p-faint); }
[hidden] { display: none !important; }

/* ---------- Kabuk ---------- */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.app-sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; color: #E7EEF3; display: flex; flex-direction: column; gap: 22px; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.sidebar-brand img { border-radius: 6px; }
.sidebar-brand div { font-size: 19px; font-weight: 600; color: #fff; }
.sidebar-brand small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: rgba(231,238,243,.6); font-family: var(--ak-mono); }
.app-sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.app-sidebar nav .group { margin: 14px 10px 4px; font: 500 10.5px var(--ak-mono); letter-spacing: .14em; text-transform: uppercase; color: rgba(231,238,243,.45); }
.sidebar-link { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 12px; border: 1px solid transparent; color: rgba(231,238,243,.82); text-decoration: none; font-weight: 500; }
.sidebar-link:hover { background: rgba(255,255,255,.06); }
.sidebar-link .count { font: 600 11px var(--ak-mono); padding: 1px 8px; border-radius: 999px; background: rgba(79,198,236,.18); color: #BFF0FF; }
.sidebar-foot { margin-top: auto; padding: 10px; font-size: 12px; color: rgba(231,238,243,.6); }
.sidebar-foot button { margin-top: 8px; width: 100%; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.app-topbar { top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 32px; border-bottom: 1px solid var(--p-line); }
.app-topbar h1 { font-size: 22px; }
.app-content { flex: 1; padding: 24px 32px 48px; }
.page > * + * { margin-top: 16px; }

/* ---------- Malzeme ---------- */
.card { position: relative; background-color: var(--p-card); border: 1px solid var(--p-line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); transition: border-color .25s ease, transform .35s var(--ease), box-shadow .35s var(--ease); }
@supports not (backdrop-filter: blur(1px)) { .card { background-color: var(--p-card-solid); } }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; }
.kpi-card { background-color: var(--p-card); border: 1px solid var(--p-line); border-radius: 16px; padding: 14px 16px; cursor: pointer; text-align: left; color: inherit; font: inherit; box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%); isolation: isolate; }
.kpi-card:hover { transform: translateY(-2px); border-color: var(--brand-line); }
.kpi-card.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }
.kpi-label { font: 500 10.5px var(--ak-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--p-stone); }
.kpi-value { font-family: var(--ak-display); font-size: 28px; font-weight: 600; line-height: 1.15; margin-top: 4px; }

/* ---------- Form & buton ---------- */
input, select, textarea { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--p-line); background: var(--p-card-solid); color: var(--p-ink); font: inherit; }
textarea { min-height: 70px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
label.field { display: block; font-size: 12px; color: var(--p-stone); }
label.field > span { display: block; margin-bottom: 4px; font: 500 10.5px var(--ak-mono); letter-spacing: .12em; text-transform: uppercase; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--p-ink); cursor: pointer; }

.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 8px 16px; border-radius: 14px; border: 1px solid transparent; cursor: pointer; font: 600 13.5px var(--font-body); text-decoration: none;
  transition: transform .2s var(--ease), filter .2s ease, background .2s ease; color: #fff; background: linear-gradient(135deg, var(--brand-lift), var(--brand)); box-shadow: 0 10px 24px -14px var(--brand); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-secondary { color: var(--p-ink); background: var(--p-card); border-color: var(--p-line); box-shadow: var(--shadow-sm); }
.btn-ghost { color: var(--p-stone); background: transparent; box-shadow: none; }
.btn-sm { min-height: 30px; padding: 4px 11px; border-radius: 10px; font-size: 12.5px; }
.btn-ok { background: linear-gradient(135deg, var(--green), var(--green)); box-shadow: 0 10px 24px -14px var(--green); }
.app-sidebar .btn-secondary { color: #E7EEF3; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.toolbar .grow { flex: 1; min-width: 220px; }

/* ---------- Rozet ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--brand-soft); color: var(--brand); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.neutral { background: var(--p-line); color: var(--p-stone); }

/* ---------- Vaka listesi (alt alta) ---------- */
.cases { display: flex; flex-direction: column; gap: 10px; }
.case { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; padding: 16px 20px; border-radius: 18px; cursor: pointer; }
.case:hover { transform: translateY(-2px); }
.case.done { opacity: .62; }
.case-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.case-acc { font-weight: 600; }
.case-msg { margin-top: 6px; color: var(--p-stone); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.case-meta { margin-top: 6px; font-size: 12px; color: var(--p-faint); display: flex; flex-wrap: wrap; gap: 14px; }
.case-side { text-align: right; font-size: 12px; color: var(--p-faint); white-space: nowrap; }
.age.late { color: var(--red); font-weight: 600; }
.age.mid { color: var(--amber); font-weight: 600; }

.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand-line); background: transparent; display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .25s var(--ease); flex-shrink: 0; }
.tick:hover { border-color: var(--green); color: var(--green); }
.tick.on { background: var(--green); border-color: var(--green); color: #fff; }
.tick svg { width: 16px; height: 16px; }

.empty { text-align: center; padding: 56px 20px; color: var(--p-stone); }
.empty strong { display: block; font-family: var(--ak-display); font-size: 20px; color: var(--p-ink); margin-bottom: 4px; }

/* ---------- Detay paneli ---------- */
.drawer-bg { position: fixed; inset: 0; background: rgba(2,11,18,.42); z-index: 20; animation: fade .25s var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); z-index: 21; background: var(--p-card-solid); border-left: 1px solid var(--p-line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .35s var(--ease); }
.drawer-head { padding: 20px 24px 14px; border-bottom: 1px solid var(--p-line); }
.drawer-head h2 { font-family: var(--ak-display); font-size: 20px; margin-top: 6px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 24px; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--p-line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drawer-foot textarea { min-height: 40px; flex: 1 1 100%; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 16px; }
.facts dt { color: var(--p-faint); font: 500 10.5px var(--ak-mono); letter-spacing: .12em; text-transform: uppercase; padding-top: 3px; }
.facts dd { margin: 0; }
.copy { cursor: pointer; border-bottom: 1px dashed var(--brand-line); }

.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.msg.warehouse { background: var(--brand-soft); border: 1px solid var(--brand-line); align-self: flex-start; }
.msg.user { background: var(--p-surface); border: 1px solid var(--p-line); align-self: flex-end; }
.msg .who { display: block; font: 500 10.5px var(--ak-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--p-faint); margin-bottom: 4px; }

.creds { margin: 16px 0; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--amber); background: var(--amber-soft); font-size: 13px; }
.creds .row { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 6px; }
.creds code { font-family: var(--ak-mono); font-size: 13px; }

/* ---------- Tablo ---------- */
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--p-line); background-color: var(--p-card); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 10px 14px; font: 600 11px var(--ak-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--p-stone); border-bottom: 1px solid var(--p-line); }
td { padding: 10px 14px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--brand-soft); }

/* ---------- Kullanıcı formu ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--p-line); background: var(--p-card); cursor: pointer; font-size: 12.5px; }
.chips label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.section-title { font: 500 10.5px var(--ak-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--p-stone); margin: 18px 0 8px; }

/* ---------- Giriş ---------- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(800px 500px at 50% 30%, #0b3c5c, #020b12 70%); }
.login-card { width: min(380px, 100%); padding: 32px; border-radius: 22px; border: 1px solid rgba(255,255,255,.12); color: #E7EEF3;
  -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); }
.login-card h1 { font-size: 26px; margin: 14px 0 4px; color: #fff; }
.login-card p { margin: 0 0 20px; color: rgba(231,238,243,.65); font-size: 13px; }
.login-card label.field { color: rgba(231,238,243,.7); margin-bottom: 12px; }
.login-card input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }
.login-card .btn { width: 100%; margin-top: 8px; }
.err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-card .err { color: #F0847A; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 40; padding: 10px 18px; border-radius: 999px; background: var(--brand-deep); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); animation: fade .25s var(--ease); }

/* ---------- Mobil ---------- */
@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-value { font-size: 22px; }
  .toolbar select { max-width: 100%; }
  .app-sidebar { position: relative; height: auto; padding: 12px 16px; gap: 10px; }
  .app-sidebar nav { flex-direction: row; overflow-x: auto; }
  .app-sidebar nav .group { display: none; }
  .sidebar-link { white-space: nowrap; }
  .sidebar-foot { display: none; }
  .app-topbar, .app-content { padding-left: 16px; padding-right: 16px; }
  .case { grid-template-columns: auto 1fr; padding: 14px 16px; }
  .case-side { grid-column: 2; text-align: left; }
  .grid2 { grid-template-columns: 1fr; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1 1 140px; }
}
