/* =====================================================================
   Exponet - Panel tasarım sistemi
   Tek dosya, harici bağımlılık yok.

   MARKA RENGİNİ DEĞİŞTİRMEK İÇİN: aşağıdaki --brand / --brand-dark /
   --brand-light / --brand-ring dört değerini güncelleyin. Başka hiçbir
   yere dokunmanız gerekmez.
   ===================================================================== */

:root {
  /* --- Marka (kendi renginizle değiştirin) --- */
  --brand:        #1a78c2;
  --brand-dark:   #145d97;
  --brand-light:  #e9f3fb;
  --brand-ring:   rgba(26, 120, 194, .22);

  /* --- Nötr --- */
  --ink:          #0f172a;
  --ink-2:        #334155;
  --muted:        #64748b;
  --line:         #e2e8f0;
  --line-soft:    #eef2f7;
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --surface-2:    #f8fafc;

  /* --- Durum --- */
  --ok:    #15803d;  --ok-bg:   #eaf6ee;
  --warn:  #b45309;  --warn-bg: #fdf3e4;
  --bad:   #b91c1c;  --bad-bg:  #fdeceb;
  --info:  #1d4ed8;  --info-bg: #eaeffd;

  --radius:    10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --shadow:    0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, .07);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, .14);

  --sidenav-w: 244px;
  --topline-h: 62px;
  --font: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

/* ---------- Sıfırlama ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; color: var(--ink); font-weight: 650; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 15px; }
p  { margin: 0 0 12px; }

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

img, svg { max-width: 100%; vertical-align: middle; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { font-size: .92em; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); }

.text-muted  { color: var(--muted); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; }  .mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }          .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }       .mb-3 { margin-bottom: 24px; }
.hidden { display: none !important; }

/* =====================================================================
   KABUK: SOL YAN MENÜ + İÇERİK
   ===================================================================== */

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

.sidenav {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 70;
  width: var(--sidenav-w);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transition: transform .2s ease;
}
.sidenav::-webkit-scrollbar { width: 6px; }
.sidenav::-webkit-scrollbar-thumb { background: #d7dee8; border-radius: 3px; }

.sidenav-brand {
  display: flex;
  align-items: center;
  height: var(--topline-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.sidenav-brand img { height: 30px; }

.sidenav-body { flex: 1 1 auto; padding: 14px 12px; }

.sidenav-group {
  padding: 16px 10px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #94a3b8;
}
.sidenav-body a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .13s ease, color .13s ease;
}
.sidenav-body a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.sidenav-body a.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 650; }
.sidenav-body a.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}
.sidenav-body a .ico { color: #94a3b8; flex: 0 0 auto; }
.sidenav-body a:hover .ico, .sidenav-body a.active .ico { color: var(--brand); }
.sidenav-body a .count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.sidenav-foot {
  flex: 0 0 auto;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* İçerik alanı */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: var(--sidenav-w);
  display: flex;
  flex-direction: column;
}

.topline {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--topline-h);
  padding: 0 26px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.topline-title { margin-right: auto; min-width: 0; }
.topline-title strong { display: block; font-size: 15px; color: var(--ink); font-weight: 650; }
.topline-title span { display: block; font-size: 12px; color: var(--muted); }

.nav-toggle {
  display: none;
  padding: 7px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  cursor: pointer;
}

/* Masaüstünde menüyü aç/kapat — yalnız admin ayarı açıkken (body.nav-collapsible).
   Tercih localStorage'da saklanır. Mobil görünürlük ayrı media query'de. */
@media (min-width: 961px) {
  body.nav-collapsible .nav-toggle { display: inline-flex; }
  .app-main { transition: margin-left .2s ease; }
  body.nav-collapsed .sidenav { transform: translateX(-100%); }
  body.nav-collapsed .app-main { margin-left: 0; }
  body.nav-collapsed .page { max-width: none; }
}

.sidenav-backdrop {
  position: fixed; inset: 0; z-index: 65;
  background: rgba(15, 23, 42, .42);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease;
}
.sidenav-backdrop.open { opacity: 1; visibility: visible; }

/* Kullanıcı menüsü */
.usermenu { position: relative; flex: 0 0 auto; }
.usermenu-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 8px;
  background: none; border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; text-align: left;
}
.usermenu-btn:hover { background: var(--surface-2); }
.avatar {
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  font-weight: 700; font-size: 13px;
}
.usermenu-name { display: flex; flex-direction: column; min-width: 0; }
.usermenu-name strong { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.usermenu-name span {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px;
}

.dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 236px; padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: all .16s ease;
}
.dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 11px;
  font: inherit; font-size: 13.5px;
  color: var(--ink-2);
  background: none; border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.dropdown .divider { height: 1px; background: var(--line); margin: 5px 4px; }
.dropdown .danger { color: var(--bad); }

/* =====================================================================
   SAYFA DÜZENİ
   ===================================================================== */

.page { flex: 1 1 auto; max-width: none; width: 100%; padding: 24px 26px 52px; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head h1 { font-size: 23px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }

/* =====================================================================
   KPI ŞERİDİ
   ===================================================================== */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  position: relative;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  display: block;
  transition: border-color .15s ease, box-shadow .15s ease;
}
a.kpi:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); text-decoration: none; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-ico {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand-light);
  color: var(--brand);
}
.kpi-value { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1.15; letter-spacing: -.02em; }
.kpi-value small { font-size: 15px; font-weight: 700; }
.kpi-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-note.up  { color: var(--ok); }
.kpi-note.down{ color: var(--bad); }
.kpi.is-alert { border-color: #f3c9c6; background: linear-gradient(180deg, #fffafa, var(--surface)); }
.kpi.is-alert .kpi-ico { background: var(--bad-bg); color: var(--bad); }
.kpi.is-alert .kpi-value { color: var(--bad); }
.kpi-value.blurred { filter: blur(8px); user-select: none; }

/* =====================================================================
   DUYURU ŞERİDİ
   ===================================================================== */

.notice {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 14px 16px; margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
}
.notice .notice-ico { flex: 0 0 auto; color: var(--brand); margin-top: 1px; }
.notice .notice-body { flex: 1 1 auto; min-width: 0; }
.notice .notice-body strong { display: block; color: var(--ink); font-size: 14.5px; font-weight: 650; }
.notice .notice-body span { font-size: 12.5px; color: var(--muted); }
.notice .notice-link { flex: 0 0 auto; font-size: 13px; font-weight: 600; white-space: nowrap; }
.notice.type-kesinti { border-left-color: var(--bad); }
.notice.type-kesinti .notice-ico { color: var(--bad); }
.notice.type-bakim { border-left-color: var(--warn); }
.notice.type-bakim .notice-ico { color: var(--warn); }

/* =====================================================================
   KARTLAR
   ===================================================================== */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.card-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.card-link { font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }

/* Hızlı işlem listesi (yan sütun) */
.quick-list { display: flex; flex-direction: column; }
.quick-list a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
}
.quick-list a:last-child { border-bottom: 0; }
.quick-list a:hover { background: var(--surface-2); color: var(--brand-dark); text-decoration: none; }
.quick-list .q-ico {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  flex: 0 0 auto;
}
.quick-list a:hover .q-ico { background: var(--brand-light); color: var(--brand); }
.quick-list .q-arrow { margin-left: auto; color: #cbd5e1; }

/* Eski isimlerle uyumluluk (bazı sayfalar hâlâ kullanıyor) */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
}
a.stat:hover { border-color: #cbd5e1; box-shadow: var(--shadow-md); text-decoration: none; }
.stat-icon {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--brand-light); color: var(--brand);
}
.stat-text { min-width: 0; }
.stat-label { font-size: 12.5px; color: var(--muted); display: block; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.25; display: block; }
.stat-note  { font-size: 12px; color: var(--muted); display: block; }

/* =====================================================================
   GRAFİK
   ===================================================================== */

.chart-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.chart-toolbar select { width: auto; min-width: 180px; padding: 8px 34px 8px 12px; font-size: 13.5px; }
.chart-toolbar select:disabled { opacity: 1; color: var(--ink-2); background-color: var(--surface); }
.chart-title { font-size: 14.5px; font-weight: 650; color: var(--ink); }

.range-tabs {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  gap: 2px;
}
.range-tabs a {
  padding: 6px 13px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: 5px;
}
.range-tabs a:hover { color: var(--ink); text-decoration: none; }
.range-tabs a.active { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow); }

.chart-wrap { position: relative; padding: 16px 10px 10px; }
.chart-canvas { display: block; width: 100%; height: 320px; }
.chart-legend { display: flex; gap: 18px; justify-content: center; padding: 4px 0 12px; font-size: 12.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.chart-tooltip {
  position: absolute; z-index: 5;
  padding: 8px 11px;
  background: var(--ink); color: #fff;
  font-size: 12.5px; line-height: 1.5;
  border-radius: 7px;
  pointer-events: none; white-space: nowrap;
  opacity: 0; transition: opacity .12s ease;
  transform: translate(-50%, -100%);
}
.chart-tooltip.show { opacity: 1; }

/* =====================================================================
   TABLOLAR
   ===================================================================== */

.table-scroll { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11.5px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}
/* Sayısal sütunlarda başlık da değerle aynı hizaya gelsin: yukarıdaki
   "table.table th" kuralı .text-right yardımcı sınıfından daha özgül
   olduğu için başlığı sola yaslı bırakıyordu. (td'de böyle bir sorun yok;
   table.table td hizalama belirtmiyor.) */
table.table th.text-right  { text-align: right; }
table.table th.text-center { text-align: center; }

table.table tbody tr:last-child td { border-bottom: 0; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td.strong { color: var(--ink); font-weight: 600; }

.table-empty { padding: 52px 24px; text-align: center; color: var(--muted); }
.table-empty svg { color: #cbd5e1; margin-bottom: 12px; }
.table-empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* Talep satırı */
.ticket-cell { display: flex; align-items: center; gap: 12px; }
.ticket-icon {
  position: relative; flex: 0 0 auto;
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--surface-2); color: var(--muted);
}
.ticket-icon .badge-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 5px;
  border-radius: 9px;
  background: var(--brand); color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}
.ticket-cell .t-subject { color: var(--ink); font-weight: 600; }
.ticket-cell .t-no { font-size: 12px; color: var(--muted); }

/* =====================================================================
   ROZETLER, UYARILAR
   ===================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 650;
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-ok    { background: var(--ok-bg);   color: var(--ok); }
.badge-warn  { background: var(--warn-bg); color: var(--warn); }
.badge-bad   { background: var(--bad-bg);  color: var(--bad); }
.badge-info  { background: var(--info-bg); color: var(--info); }
.badge-muted { background: #f1f5f9;        color: var(--muted); }

.prio { font-weight: 600; font-size: 13px; }
.prio-bad   { color: var(--bad); }
.prio-warn  { color: var(--warn); }
.prio-info  { color: var(--info); }
.prio-muted { color: var(--muted); }

.alert {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 13px 16px; margin-bottom: 16px;
  border: 1px solid; border-radius: var(--radius);
  font-size: 13.5px;
}
.alert svg { flex: 0 0 auto; margin-top: 1px; }
.alert-success { background: var(--ok-bg);   border-color: #bfe3cb; color: #14532d; }
.alert-error   { background: var(--bad-bg);  border-color: #f3c9c6; color: #7f1d1d; }
.alert-info    { background: var(--info-bg); border-color: #c7d5fa; color: #1e3a8a; }
.alert-warn    { background: var(--warn-bg); border-color: #f0d6a8; color: #78350f; }

.flash-stack { position: fixed; top: 78px; right: 24px; z-index: 200; width: 350px; max-width: calc(100vw - 32px); }
.flash-stack .alert { box-shadow: var(--shadow-lg); }

.empty-state { padding: 46px 24px; text-align: center; }
.empty-state svg { color: #cbd5e1; margin-bottom: 12px; }
.empty-state h4 { margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f6f9fc 50%, #eef2f7 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================
   FORM ÖĞELERİ
   ===================================================================== */

.field { margin-bottom: 18px; }

label, .label {
  display: block; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.label-optional { font-weight: 400; color: var(--muted); font-size: 12.5px; }

.input, input[type=text], input[type=email], input[type=password],
input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=search], select, textarea {
  width: 100%;
  padding: 10px 13px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .14s ease, box-shadow .14s ease;
  appearance: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
  cursor: pointer;
}

.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.input::placeholder, input::placeholder, textarea::placeholder { color: #94a3b8; }

.input:disabled, input:disabled, select:disabled, textarea:disabled,
.input[readonly], input[readonly], textarea[readonly] {
  background: var(--surface-2); color: var(--muted); cursor: not-allowed;
}
.input.filled, input.filled { background: var(--brand-light); border-color: #a9cfeb; color: var(--ink); }

.input.error, input.error, select.error, textarea.error {
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .10);
}
.field-error { display: block; margin-top: 5px; font-size: 12.5px; color: var(--bad); }
.field-hint  { display: block; margin-top: 5px; font-size: 12.5px; color: var(--muted); }

.input-wrap { position: relative; }
.input-wrap .toggle-pass {
  position: absolute; top: 50%; right: 10px;
  transform: translateY(-50%);
  display: flex; align-items: center; padding: 4px;
  background: none; border: 0; color: var(--muted); cursor: pointer;
}
.input-wrap .toggle-pass:hover { color: var(--ink); }
.input-wrap input { padding-right: 42px; }
/* Tarayıcının kendi şifre-göster/temizle ikonunu gizle (bizim göz butonumuzla çakışmasın) */
.input-wrap input[type="password"]::-ms-reveal,
.input-wrap input[type="password"]::-ms-clear { display: none; }

.check {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 16px;
  font-size: 13.5px; font-weight: 400; color: var(--ink-2);
  cursor: pointer;
}
.check input[type=checkbox] {
  flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0;
  accent-color: var(--brand); cursor: pointer;
}
.check a { text-decoration: underline; }

/* Butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .14s ease;
  text-decoration: none !important;
  white-space: nowrap;
}
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* Gönderim sürerken: buton disabled YAPILMAZ (name/value kaybolur),
   yalnızca tıklanamaz hâle getirilir. Bkz. app.js initFormGuard(). */
.is-busy { opacity: .6; pointer-events: none; cursor: default; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-outline { background: var(--surface); border-color: var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand-light); color: var(--brand-dark); }

.btn-ghost { background: var(--surface); border-color: #cbd5e1; color: var(--ink); }
.btn-ghost:hover { border-color: #94a3b8; background: var(--surface-2); }

.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }

.btn-link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; }
.btn-link:hover { text-decoration: underline !important; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Filtre çubuğu */
.filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.filters .field { margin: 0; min-width: 165px; }
.filters .field label { font-size: 12.5px; margin-bottom: 4px; }
.filters input, .filters select { padding: 8px 12px; font-size: 13.5px; }
.filters select { padding-right: 34px; }

/* Sayfalama */
.pagination { display: flex; gap: 5px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px; padding: 7px 11px;
  text-align: center; font-size: 13.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.pagination a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 650; }
.pagination .disabled { color: #cbd5e1; pointer-events: none; }

/* =====================================================================
   PENCERE (MODAL)
   ===================================================================== */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: 24px;
  background: rgba(15, 23, 42, .45);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform .18s ease;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 22px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; display: flex; }
.modal-close:hover { color: var(--ink); }

/* =====================================================================
   GİRİŞ / KAYIT EKRANLARI
   ===================================================================== */

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px 48px;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 12% 0%, var(--brand-light), transparent 42%),
    radial-gradient(circle at 92% 100%, #e8eef6, transparent 46%);
}

.auth-wrap { width: 100%; max-width: 430px; }
.auth-wrap.wide { max-width: 880px; }

.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand img { height: 40px; }

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px rgba(15,23,42,.07);
  overflow: hidden;
}
.auth-card-head { padding: 28px 30px 0; }
.auth-card-head h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card-head p { color: var(--muted); font-size: 13.5px; margin-bottom: 0; }
.auth-card-body { padding: 24px 30px 28px; }
.auth-card-foot {
  padding: 16px 30px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}
.auth-card-foot a { font-weight: 650; }

/* Güven şeridi (giriş ekranı altı) */
.auth-trust {
  display: flex; justify-content: center; gap: 22px; flex-wrap: wrap;
  margin-top: 22px;
  font-size: 12.5px; color: var(--muted);
}
.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust svg { color: var(--brand); }

/* Segment anahtarı (bireysel / kurumsal) */
.segment {
  display: inline-flex; width: 100%;
  padding: 4px; margin-bottom: 24px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  gap: 4px;
}
.segment button {
  flex: 1 1 0;
  padding: 10px 14px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted);
  background: none; border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .14s ease;
}
.segment button:hover { color: var(--ink); }
.segment button.active { background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow); }

/* Kayıt formu bölümleri */
.form-section { margin-bottom: 26px; }
.form-section > h4 {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 14px; padding-bottom: 9px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
}
.form-section > h4 .num {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0;
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row.one { grid-template-columns: minmax(0, 1fr); }

/* Doğrulama satırı */
.verify-row { display: flex; gap: 8px; align-items: flex-start; }
/* Yalnızca DOĞRUDAN çocuklar hizalanır. Alt seçici kullanılırsa, JS'in
   eklediği "Doğrulama Kodu" bloğundaki Doğrula butonu da 25 px margin alır
   ve satırı uzatarak kod kutusunun diğerlerinden yüksek görünmesine yol açar. */
.verify-row > .field { flex: 1 1 auto; margin-bottom: 0; }

/* Etiketi olmayan öğeler (buton, onay rozeti) etiket yüksekliği kadar
   aşağı iner ki yanındaki giriş kutusuyla aynı hizada dursun.
   Etiket: 13.5px * 1.55 satır yüksekliği + 6px alt boşluk = 26.9px
   line-height girişlerle aynı (1.55) -> yükseklik de birebir tutar. */
.verify-row > .btn {
  flex: 0 0 auto;
  margin-top: calc(13.5px * 1.55 + 6px);
  line-height: 1.55;
}
.verify-ok {
  display: flex; align-items: center; gap: 7px;
  margin-top: calc(13.5px * 1.55 + 6px);   /* etiket yüksekliği — üstteki nota bakın */
  padding: 10px 12px;
  background: var(--ok-bg); border: 1px solid #bfe3cb; border-radius: var(--radius-sm);
  color: var(--ok); font-size: 13px; font-weight: 600; white-space: nowrap;
}

/* ---------------------------------------------------------------------
   BÖLÜNMÜŞ GİRİŞ EKRANI  (solda form, sağda görsel)
   index.php <body class="auth-split"> ile kullanılır.
   Sağdaki görsel: assets/img/dc.jpeg — dosya yoksa degrade görünür.
   --------------------------------------------------------------------- */

.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: var(--surface);
}

.auth-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(24px, 5vw, 76px);
  background: var(--surface);
}
.auth-side-inner { width: 100%; max-width: 430px; margin: 0 auto; }

.auth-logo { margin-bottom: clamp(30px, 5vh, 52px); }
.auth-logo img { height: 52px; width: auto; display: block; }

.auth-title {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 10px;
}
.auth-title .up { text-transform: uppercase; }
.auth-sub { font-size: 15px; color: var(--muted); margin-bottom: 30px; }

/* ---------------------------------------------------------------------
   Uyarı penceresi (App.alert)
   --------------------------------------------------------------------- */

.app-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .38);
  animation: appAlertIn .14s ease;
}
@keyframes appAlertIn { from { opacity: 0; } to { opacity: 1; } }

.app-alert {
  width: 100%;
  max-width: 420px;
  padding: 26px 28px 22px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.app-alert-ico {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 18px;
  border-radius: 50%;
}
.app-alert-ico.warn { background: var(--bad-bg); color: var(--bad); }
.app-alert-ico.ok   { background: var(--ok-bg);  color: var(--ok); }

.app-alert h4 { font-size: 17px; margin-bottom: 6px; }
.app-alert p  { margin: 0 0 22px; font-size: 13.5px; color: var(--muted); }
.app-alert-foot { display: flex; justify-content: flex-end; }
.app-alert-foot .btn { min-width: 84px; }

/* Başarı penceresi: her şey ortalanır, buton dolu renkli ve geniş */
.app-alert.ok { text-align: center; padding: 30px 30px 26px; }
.app-alert.ok .app-alert-ico { margin: 0 auto 16px; }
.app-alert.ok h4 { font-size: 18px; margin-bottom: 8px; }
.app-alert.ok p  { margin-bottom: 24px; }
.app-alert.ok .app-alert-foot { justify-content: center; }
.app-alert.ok .app-alert-foot .btn { min-width: 136px; }

/* Metin içinde bağlantı gibi görünen, ama formu gönderen buton
   (giriş ekranındaki "Şifremi Unuttum") */
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--brand);
  cursor: pointer;
}
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }

/* Formun altındaki bağlantı satırları */
.auth-foot-line {
  margin: 26px 0 0;
  text-align: center;
  font-size: 14.5px;
  color: var(--muted);
}
.auth-foot-line a { font-weight: 700; }
.auth-back-line {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
}
.auth-back-line a { color: var(--muted); }
.auth-back-line a:hover { color: var(--brand); }

/* Bu ekranda alanlar ve butonlar bir tık daha iri.
   Alanlar çerçevesiz, açık gri-mavi dolgulu; odaklanınca beyaza dönüp
   marka renginde çerçeve alır. */
.auth-side .field { margin-bottom: 22px; }
.auth-side .field label {
  font-size: 14.5px; font-weight: 500;
  color: #5a6b7d; margin-bottom: 8px;
}
.auth-side input,
.auth-side .input {
  padding: 14px 16px;
  font-size: 15px;
  border-radius: var(--radius);
  background: #f1f4f9;
  border-color: transparent;
}
.auth-side input:focus,
.auth-side .input:focus { background: var(--surface); border-color: var(--brand); }
/* Hatalı alan: dolgu kalkar, kırmızı çerçeve gelir
   (auth-side kuralları .input.error ile aynı özgüllükte olduğu için
   burada yeniden belirtilmesi gerekiyor) */
.auth-side input.error {
  background: var(--surface);
  border-color: var(--bad);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .10);
}

.auth-side .btn-lg { padding: 15px 24px; font-size: 15.5px; font-weight: 700; border-radius: var(--radius); }
.auth-side .btn + .btn { margin-top: 14px; }
.auth-side form > .btn:first-of-type { margin-top: 4px; }

/* Sağdaki görsel sütun */
.auth-visual {
  position: relative;
  background-color: #0d1420;
  background-image:
    url("../img/dc.jpeg"),
    radial-gradient(ellipse at 50% 8%, rgba(37, 99, 235, .55), transparent 58%),
    linear-gradient(170deg, #16233a 0%, #070b12 78%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.captcha-box { margin-bottom: 18px; }
.captcha-placeholder {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  color: var(--muted); font-size: 12.5px;
}

/* =====================================================================
   DUYARLI TASARIM
   ===================================================================== */

@media (max-width: 1200px) {
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap.wide { max-width: 560px; }
}

/* Dar ekranda görsel sütun kalkar, form tek sütuna yayılır */
@media (max-width: 980px) {
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-visual { display: none; }
  .auth-side { padding: 40px 24px 56px; }
  .auth-logo img { height: 52px; }
}

@media (max-width: 960px) {
  .sidenav { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidenav.open { transform: translateX(0); }
  .app-main { margin-left: 0; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
  body { font-size: 14px; }
  h1 { font-size: 22px; }
  .page { padding: 16px 14px 40px; }
  .topline { padding: 0 14px; gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .usermenu-name { display: none; }
  .card-body { padding: 15px; }
  .card-head { padding: 13px 15px; }
  .chart-toolbar { padding: 13px 15px; }
  .chart-canvas { height: 230px; }
  .range-tabs { width: 100%; }
  .range-tabs a { flex: 1 1 0; text-align: center; padding: 7px 4px; font-size: 12.5px; }
  .flash-stack { top: auto; bottom: 14px; right: 14px; left: 14px; width: auto; }
  .auth-card-head { padding: 22px 20px 0; }
  .auth-card-body { padding: 20px; }
  .auth-card-foot { padding: 14px 20px; }
  .verify-row { flex-direction: column; }
  .verify-row > .btn, .verify-ok { margin-top: 0; width: 100%; }
  .notice { flex-wrap: wrap; }
}

/* =====================================================================
   YAZDIRMA
   ===================================================================== */

@media print {
  .sidenav, .topline, .flash-stack, .btn, .pagination, .filters, .breadcrumb { display: none !important; }
  .app-main { margin-left: 0; }
  body { background: #fff; }
  .card { border: 1px solid #ddd; box-shadow: none; }
  .page { max-width: none; padding: 0; }
}

/* =====================================================================
   Foto lightbox (galeri) — kargo ürün fotoğrafları, yeni sekmesiz
   ===================================================================== */
.lightbox {
  position: fixed; inset: 0; z-index: 1200;
  display: none; grid-template-rows: auto 1fr auto;
  background: rgba(8, 12, 22, .92); backdrop-filter: blur(2px);
}
.lightbox.open { display: grid; }
body.lb-open { overflow: hidden; }

.lightbox .lb-bar {
  grid-row: 1; grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; color: #e2e8f0;
}
.lightbox .lb-counter { font-size: 14px; font-weight: 600; letter-spacing: .3px; }

.lightbox .lb-btn {
  background: none; border: 0; color: #cbd5e1; cursor: pointer;
  line-height: 1; transition: color .15s, transform .15s;
}
.lightbox .lb-btn:hover { color: #fff; }
.lightbox .lb-close { font-size: 30px; padding: 0 4px; }

.lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  font-size: 34px; padding: 12px 16px; z-index: 2;
}
.lightbox .lb-prev { left: 6px; }
.lightbox .lb-next { right: 6px; }
.lightbox .lb-nav:hover { transform: translateY(-50%) scale(1.12); }

.lightbox .lb-stage {
  grid-row: 2; margin: 0; padding: 0 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 0; overflow: hidden;
}
.lightbox .lb-img {
  max-width: min(92vw, 1100px); max-height: 78vh;
  object-fit: contain; border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5); background: #0b1120;
}
.lightbox .lb-thumbs {
  grid-row: 3; display: flex; gap: 8px; padding: 12px 16px;
  overflow-x: auto; justify-content: center; flex-wrap: nowrap;
}
.lightbox .lb-thumb {
  flex: 0 0 auto; width: 58px; height: 58px; padding: 0;
  border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: #1e293b; cursor: pointer; opacity: .6; transition: opacity .15s, border-color .15s;
}
.lightbox .lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox .lb-thumb:hover { opacity: 1; }
.lightbox .lb-thumb.is-active { opacity: 1; border-color: #60a5fa; }

@media (max-width: 640px) {
  .lightbox .lb-img { max-height: 68vh; }
  .lightbox .lb-nav { font-size: 26px; padding: 8px 10px; }
  .lightbox .lb-thumb { width: 46px; height: 46px; }
}

/* =====================================================================
   Aşağı açılan özel liste (data-select-down) — native select yerine
   ===================================================================== */
.sd-trigger {
  width: 100%;
  padding: 10px 13px;
  font: inherit; font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  text-align: left;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.sd-trigger:hover { border-color: #94a3b8; }
.sd-trigger.is-open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.sd-trigger.error { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(185, 28, 28, .10); }
.sd-trigger .sd-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-trigger .sd-val.sd-ph { color: #94a3b8; }
.sd-trigger svg { flex: 0 0 auto; }

.sd-panel {
  z-index: 1300;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .18);
  overflow-y: auto;
  padding: 5px;
  -webkit-overflow-scrolling: touch;
}
.sd-opt {
  padding: 9px 12px;
  font-size: 14px; color: var(--ink);
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sd-opt:hover { background: var(--surface-2, #f1f5f9); }
.sd-opt.is-active { background: var(--brand-light, #e0edff); color: var(--brand, #2563eb); font-weight: 600; }
