/* ============================================================
   theme.css — Personel Takip · ortak tema
   Renk/ölçü değişiklikleri sadece :root içinden yapılır.
   ============================================================ */

:root {
  --bg: #0a0e14;
  --surface: #141a22;
  --panel: #11181f;
  --panel-2: #1a222c;
  --raised: #1f2a35;
  --line: #1f2935;
  --line-soft: #2d3844;

  --text: #eef3f8;
  --text-2: #d4dce6;
  --muted: #8899ab;
  --muted-2: #748396;

  --accent: #f6851b;
  --accent-soft: rgba(246, 133, 27, 0.14);
  --info: #2b7cd6;
  --ok: #22c55e;
  --warn: #eab308;
  --danger: #ef4444;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;

  --sidebar-w: 220px;
  --header-h: 56px;
  --footer-h: 44px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
/* İnternet yoksa ikon fontu gelmez; kelimelerin taşmaması için sade bir işaret gösterilir */
.no-icons .material-symbols-rounded {
  font-size: 0 !important;
  width: 16px;
  display: inline-block;
  text-align: center;
}
.no-icons .material-symbols-rounded::before {
  content: '•';
  font-size: 15px;
  opacity: 0.7;
}

/* ===== KABUK ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  width: 100vw;
  height: 100vh;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

/* ===== SIDEBAR ===== */
.sidebar {
  grid-row: 1 / -1;
  background: var(--panel);
  padding: 16px 10px 12px;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--line);
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: var(--panel); }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 10px; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  flex-shrink: 0;
}
.brand .mark {
  background: var(--accent);
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  display: grid; place-items: center;
  font-size: 16px; font-weight: 700;
  color: #14181c;
  flex-shrink: 0;
}
.brand .name {
  font-weight: 700; font-size: 15px;
  letter-spacing: -0.3px; color: #f2f6fa;
  white-space: nowrap;
}
.brand .name span { font-weight: 400; color: #7a8b9e; font-size: 11px; display: block; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  transition: 0.15s;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  border: none;
  background: none;
  width: 100%;
  text-align: start;
}
.nav-item:hover { background: var(--raised); color: var(--text-2); }
.nav-item.active { background: var(--raised); color: var(--accent); }
.nav-item.active .material-symbols-rounded { color: var(--accent); }
.nav-item .arrow { margin-inline-start: auto; font-size: 16px; transition: transform 0.2s; }
.nav-item .arrow.open { transform: rotate(180deg); }
.nav-item .badge {
  margin-inline-start: auto;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.nav-item.soon::after {
  content: '›';
  margin-inline-start: auto;
  font-size: 9px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  padding: 1px 5px;
  border-radius: 20px;
}
.nav-item.logout { color: #c78a8a; }
.nav-item.logout:hover { background: rgba(239, 68, 68, 0.1); color: #ef6767; }

.sub-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-inline-start: 14px;
  margin: 2px 0 4px;
  border-inline-start: 1px solid var(--line);
  margin-inline-start: 16px;
}
.sub-menu.open { display: flex; }
.sub-menu .nav-item { font-size: 12.5px; padding: 7px 10px; }
.sub-menu .nav-item .material-symbols-rounded { font-size: 16px; }

.sidebar .spacer { flex: 1; min-height: 8px; }
.sidebar .version {
  font-size: 10px;
  color: #5a6b7e;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9;
}
.sidebar-overlay.active { display: block; }

/* ===== HEADER ===== */
.header {
  grid-column: 2;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  z-index: 5;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--r-sm);
}
.menu-toggle:hover { background: var(--raised); color: var(--text-2); }

.page-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}
.page-title small { display: block; font-size: 11px; font-weight: 400; color: var(--muted-2); }

.search-bar {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 12px;
  min-width: 220px;
}
.search-bar span { color: var(--muted-2); }
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 100%;
}
.search-bar input::placeholder { color: #5a6b7e; }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-actions .icon-btn {
  background: none; border: none; color: var(--muted-2);
  cursor: pointer; padding: 6px; border-radius: var(--r-sm);
}
.header-actions .icon-btn:hover { background: var(--raised); color: var(--text-2); }

.profile-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 5px 10px 5px 6px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
}
.profile-badge:hover { border-color: var(--line-soft); }
.profile-badge .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #14181c;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
}
.profile-badge .who { line-height: 1.25; }
.profile-badge .who b { display: block; font-weight: 600; font-size: 12px; }
.profile-badge .who i { font-style: normal; color: var(--muted-2); font-size: 10px; }

/* ===== ANA İÇERİK ===== */
.main {
  grid-column: 2;
  padding: 18px;
  overflow-y: auto;
  background: var(--surface);
}
.main::-webkit-scrollbar { width: 6px; }
.main::-webkit-scrollbar-thumb { background: var(--line-soft); border-radius: 10px; }

.view { display: none; }
.view.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.section-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.section-head p { font-size: 12px; color: var(--muted-2); width: 100%; margin-top: -6px; }
.section-head .grow { flex: 1; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
}
.card + .card { margin-top: 14px; }
.card h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text-2); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}
.stat .label {
  font-size: 11px; color: var(--muted-2);
  display: flex; align-items: center; gap: 6px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.stat .value { font-size: 24px; font-weight: 700; margin-top: 8px; letter-spacing: -0.6px; }
.stat .hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.stat.accent .value { color: var(--accent); }

/* ===== FİLTRE ÇUBUĞU ===== */
.toolbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px;
}
.toolbar select, .toolbar input {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 12.5px;
  outline: none;
}
.toolbar select:focus, .toolbar input:focus { border-color: var(--accent); }
.toolbar .count { margin-inline-start: auto; font-size: 12px; color: var(--muted-2); }

/* ===== DETAY KARTI ===== */
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 9px 14px; font-size: 13px; }
.dl dt { color: var(--muted-2); font-size: 12px; }
.dl dd { color: var(--text-2); }
.dl dd.big { font-size: 15px; font-weight: 600; color: var(--text); }
.money { font-variant-numeric: tabular-nums; }
.hr { height: 1px; background: var(--line); margin: 16px 0; }
.subhead {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); font-weight: 700; margin-bottom: 10px;
}

/* ===== TABLO ===== */
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: start;
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(31, 42, 53, 0.5); }
td.actions { text-align: end; white-space: nowrap; }
.empty-row { text-align: center; color: var(--muted-2); padding: 28px 14px; font-size: 13px; }

/* ===== ROZET ===== */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  background: var(--raised); color: var(--muted);
  border: 1px solid var(--line);
}
.tag.ok { background: rgba(34, 197, 94, 0.12); color: #4ade80; border-color: rgba(34, 197, 94, 0.25); }
.tag.off { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.22); }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(246, 133, 27, 0.3); }
.tag.info { background: rgba(43, 124, 214, 0.13); color: #6aa9ea; border-color: rgba(43, 124, 214, 0.28); }

/* ===== BUTON ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--raised);
  color: var(--text-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: 0.15s;
}
.btn:hover { border-color: var(--line-soft); color: var(--text); }
.btn .material-symbols-rounded { font-size: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #14181c; }
.btn.primary:hover { filter: brightness(1.08); color: #14181c; }
.btn.ghost { background: none; }
.btn.danger { color: #f87171; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.08); }
.btn.danger:hover { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.btn.sm { padding: 5px 10px; font-size: 11.5px; border-radius: var(--r-sm); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ===== FORM ===== */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field input::placeholder { color: #5a6b7e; }
.field .help { font-size: 11px; color: var(--muted-2); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(5, 8, 12, 0.75);
  backdrop-filter: blur(3px);
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.modal-overlay.open { display: grid; place-items: center; }
.modal {
  width: 100%; max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  animation: pop 0.18s ease;
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-head button {
  background: none; border: none; color: var(--muted-2);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.modal-head button:hover { color: var(--text); }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
}

/* ===== YETKİ MATRİSİ ===== */
.perm-group { margin-bottom: 14px; }
.perm-group > h5 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); margin-bottom: 8px; font-weight: 700;
}
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.perm-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12px; color: var(--text-2);
  cursor: pointer;
}
.perm-item:hover { border-color: var(--line-soft); }
.perm-item input { margin-top: 2px; accent-color: var(--accent); cursor: pointer; }
.perm-item code { display: block; font-size: 10px; color: var(--muted-2); margin-top: 2px; }

/* ===== BİLDİRİM ===== */
.toast-stack {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
}
.toast {
  background: var(--panel);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--text-2);
  min-width: 240px; max-width: 340px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  animation: slideIn 0.2s ease;
}
.toast.ok { border-inline-start-color: var(--ok); }
.toast.err { border-inline-start-color: var(--danger); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ===== BOŞ DURUM ===== */
.blank {
  text-align: center; padding: 48px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(17, 24, 31, 0.5);
}
.blank .material-symbols-rounded { font-size: 40px; color: var(--line-soft); }
.blank h3 { font-size: 15px; margin: 12px 0 6px; font-weight: 600; }
.blank p { font-size: 12.5px; color: var(--muted-2); max-width: 380px; margin: 0 auto; line-height: 1.6; }

/* ===== FOOTER ===== */
.footer {
  grid-column: 2;
  background: var(--panel);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  font-size: 11px; color: var(--muted-2);
}
.footer .links { display: flex; gap: 14px; }
.footer .links a:hover { color: var(--accent); }

/* ===== MOBİL ===== */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: var(--header-h) 1fr var(--footer-h); }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; transform: translateX(-100%);
  }
  .sidebar.open { transform: none; box-shadow: 20px 0 40px rgba(0, 0, 0, 0.5); }
  .header, .main, .footer { grid-column: 1; }
  .menu-toggle { display: block; }
  .search-bar { min-width: 0; flex: 1; }
  .header-actions .icon-btn { display: none; }
  .profile-badge .who { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .footer .links { display: none; }
  .main { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   RTL (Arapça, Farsça, Soranî) düzeltmeleri
   Yerleşimin çoğu logical property ile kendiliğinden dönüyor;
   burada yalnızca yön bilen animasyon ve konumlar var.
   ============================================================ */
html.rtl .toast-stack { right: auto; left: 16px; }
html.rtl .toast { animation-name: slideInRtl; }
@keyframes slideInRtl {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: none; }
}
html.rtl .nav-item .arrow { transform: none; }
html.rtl .backdrop .train { animation-name: trainMoveRtl; }
@keyframes trainMoveRtl {
  0% { transform: translateX(calc(100vw + 400px)); }
  100% { transform: translateX(-400px); }
}
html.rtl .money, html.rtl code { direction: ltr; unicode-bidi: embed; }

@media (max-width: 860px) {
  html.rtl .sidebar { right: 0; left: auto; transform: translateX(100%); }
  html.rtl .sidebar.open { transform: none; box-shadow: -20px 0 40px rgba(0, 0, 0, 0.5); }
}

/* ===== DİL SEÇİCİ ===== */
.dil-secici {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 20px;
  padding: 5px 9px;
  font-size: 11.5px;
  outline: none;
  cursor: pointer;
  max-width: 130px;
}
.dil-secici:focus { border-color: var(--accent); }
.footer .dil-secici { padding: 3px 8px; font-size: 11px; }

/* ===== FİŞ SATIRLARI ===== */
#fisSatirBody td { padding: 6px 8px; }
#fisSatirBody input, #fisSatirBody select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 12.5px;
  outline: none;
}
#fisSatirBody input:focus, #fisSatirBody select:focus { border-color: var(--accent); }
#fisSatirBody input.tutar { text-align: end; font-variant-numeric: tabular-nums; }
tfoot td {
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  font-weight: 600;
  font-size: 12.5px;
  background: var(--panel-2);
}
.denge-ok { color: #4ade80; }
.denge-hata { color: #f87171; }

/* ============================================================
   ONAY KUTULARI — tarayıcı varsayılanı yerine tasarlanmış kutu
   ============================================================ */
input[type="checkbox"], input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--line-soft);
  background: var(--surface);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, background .15s;
  display: inline-grid;
  place-content: center;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:hover, input[type="radio"]:hover { border-color: var(--accent); }
input[type="checkbox"]::before {
  content: '';
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform .12s ease-out;
  background: #14181c;
  clip-path: polygon(14% 45%, 0 60%, 40% 100%, 100% 22%, 84% 8%, 38% 70%);
}
input[type="radio"]::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #14181c; transform: scale(0); transition: transform .12s ease-out;
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: var(--accent); border-color: var(--accent);
}
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .45; cursor: not-allowed; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.switch { gap: 10px; }
.perm-item { align-items: center; gap: 10px; }
.perm-item input { margin-top: 0; }

/* ============================================================
   TUTAR SATIRLARI — okunur boyut ve renk
   ============================================================ */
.dl dt { font-size: 12.5px; }
.dl dd { font-size: 13.5px; font-weight: 500; }
.dl dd.money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.dl dd.big {
  font-size: 19px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--accent);
}
/* Fatura/hakediş toplam blokları */
.dl.toplamlar { gap: 10px 16px; }
.dl.toplamlar dt { font-size: 13px; color: var(--muted); }
.dl.toplamlar dd { font-size: 14.5px; }
.dl.toplamlar .ara { color: var(--text-2); }
.dl.toplamlar .indirim { color: var(--warn); }
.dl.toplamlar .vergi { color: var(--info); }
.dl.toplamlar .genel {
  font-size: 21px; font-weight: 700; color: var(--ok);
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px;
}
.dl.toplamlar dt.genel-et {
  font-size: 14px; font-weight: 700; color: var(--text);
  border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px;
}

/* ============================================================
   MENÜ ROZETLERİ — bekleyen iş sayısı
   ============================================================ */
.nav-item .rozet {
  margin-left: auto;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 20px;
  font-size: 10px; font-weight: 700;
  display: inline-grid; place-items: center;
  background: var(--danger); color: #fff;
  line-height: 1;
}
.nav-item .rozet.uyari { background: var(--warn); color: #14181c; }
.nav-item .rozet.bilgi { background: var(--info); color: #fff; }
.nav-item.soon::after { margin-left: 6px; }

/* ============================================================
   SAYFALAMA
   ============================================================ */
.sayfalama {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
  flex-wrap: wrap;
}
.sayfalama .sayfa-btn {
  min-width: 30px; height: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text-2);
  border-radius: 7px;
  font-size: 12px; cursor: pointer;
  padding: 0 8px;
}
.sayfalama .sayfa-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.sayfalama .sayfa-btn.aktif { background: var(--accent); border-color: var(--accent); color: #14181c; font-weight: 700; }
.sayfalama .sayfa-btn:disabled { opacity: .4; cursor: not-allowed; }
.sayfalama .bilgi { margin-left: auto; }

/* Modal içindeki uzun listeler için daha rahat yükseklik */
.modal .table-wrap { max-height: 46vh; overflow-y: auto; }
.modal.wide { max-width: 860px; }

/* ============================================================
   EKRANA SIĞAN DÜZEN
   Tarayıcı çubuğu yukarıdan aşağı kaymaz. Tablo TAM GENİŞLİKTE
   kalır (display:table korunur), kaydırma sarmalayıcıda olur,
   başlık satırı yapışır, sayfalama tablonun dışında altta durur.
   ============================================================ */
main {
  height: calc(100vh - var(--header-h, 62px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.view.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.view.active > .section-head,
.view.active > .stat-grid,
.view.active > .toolbar,
.view.active > .help,
.view.active > .sayfalama { flex: 0 0 auto; }

/* Dikey kaydırma YOK — sayfa boyutu ekrana göre ayarlanır.
   Yalnız çok geniş tablolarda yatay kaydırmaya izin verilir. */
.view.active > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.view.active > .table-wrap > table { width: 100%; }

/* Başlık satırı kaydırırken üstte kalır */
.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel-2);
  box-shadow: inset 0 -1px 0 var(--line);
}

/* Sayfalama tablonun dışında, her zaman altta */
.view.active > .sayfalama {
  border-top: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  background: var(--panel);
  margin-top: -1px;
}

/* Birden çok tablo/kart varsa: ekran KENDİ İÇİNDE kayar, sayfa uzamaz */
.view.active.kaydirmali {
  overflow-y: auto;
  overflow-x: hidden;
  display: block;              /* flex yerine akış: kartlar alt alta */
}
.view.active.kaydirmali > .table-wrap {
  flex: none;
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
.view.active.kaydirmali > .table-wrap > table { display: table; }
.view.active.kaydirmali > .card { overflow: visible; }

@media (max-height: 800px) {
  .stat-grid { gap: 8px; margin-bottom: 10px; }
  .stat { padding: 8px 11px; }
  .stat .value { font-size: 16px !important; }
  .stat .hint { display: none; }
  .section-head { margin-bottom: 8px; }
  .section-head p { display: none; }
  .toolbar { margin-bottom: 8px; }
}
@media (max-height: 700px) {
  .stat-grid { display: none; }          /* dar ekranda özet kutuları gizlenir */
  .section-head h2 { font-size: 15px; }
}

/* ============================================================
   SATIR RENKLENDİRME — durum bilgisi renkle okunur
   ============================================================ */
tbody tr[data-vurgu="tehlike"]  { background: rgba(239, 68, 68, .09); box-shadow: inset 3px 0 0 var(--danger); }
tbody tr[data-vurgu="uyari"]    { background: rgba(234, 179, 8, .09); box-shadow: inset 3px 0 0 var(--warn); }
tbody tr[data-vurgu="ok"]       { box-shadow: inset 3px 0 0 var(--ok); }
tbody tr[data-vurgu="bilgi"]    { background: rgba(56, 189, 248, .07); box-shadow: inset 3px 0 0 var(--info); }
tbody tr[data-vurgu="pasif"]    { opacity: .58; }
tbody tr[data-vurgu]:hover      { filter: brightness(1.12); }

/* ============================================================
   YAZDIRMA / PDF
   ============================================================ */
@media print {
  .sidebar, .app-header, .toolbar, .section-head .grow,
  .btn, .sayfalama, .modal-overlay, .toast-wrap { display: none !important; }
  main { height: auto; overflow: visible; }
  .view.active { display: block; overflow: visible; }
  .view.active > .table-wrap > table { display: table; overflow: visible; }
  body { background: #fff; color: #000; }
  .yazdir-alan { display: block !important; }
}

/* ============================================================
   GENEL BAKIŞ — canlı özet panelleri
   ============================================================ */
.ozet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ozet-kart {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 15px 16px 14px;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.3,1), border-color .18s, box-shadow .18s;
  animation: kartGir .38s cubic-bezier(.2,.8,.3,1) backwards;
}
.ozet-kart:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 26px rgba(0,0,0,.32);
}
.ozet-kart:active { transform: translateY(-1px); }

/* Kartlar sırayla belirir */
.ozet-kart:nth-child(1) { animation-delay: .02s; }
.ozet-kart:nth-child(2) { animation-delay: .06s; }
.ozet-kart:nth-child(3) { animation-delay: .10s; }
.ozet-kart:nth-child(4) { animation-delay: .14s; }
.ozet-kart:nth-child(5) { animation-delay: .18s; }
.ozet-kart:nth-child(6) { animation-delay: .22s; }
.ozet-kart:nth-child(7) { animation-delay: .26s; }
.ozet-kart:nth-child(8) { animation-delay: .30s; }

@keyframes kartGir {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* Üst çizgi — duruma göre renk */
.ozet-kart::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
  opacity: .85;
  transform: scaleX(0);
  transform-origin: left;
  animation: cizgiAc .5s .2s cubic-bezier(.2,.8,.3,1) forwards;
}
.ozet-kart[data-renk="ok"]::before { background: var(--ok); }
.ozet-kart[data-renk="uyari"]::before { background: var(--warn); }
.ozet-kart[data-renk="tehlike"]::before { background: var(--danger); }
.ozet-kart[data-renk="bilgi"]::before { background: var(--info); }
@keyframes cizgiAc { to { transform: scaleX(1); } }

.ozet-kart .ust {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ozet-kart .ust .material-symbols-rounded {
  font-size: 17px;
  padding: 6px;
  border-radius: 8px;
  background: var(--raised);
  color: var(--muted);
}
.ozet-kart[data-renk="ok"] .ust .material-symbols-rounded { color: var(--ok); background: rgba(34,197,94,.1); }
.ozet-kart[data-renk="uyari"] .ust .material-symbols-rounded { color: var(--warn); background: rgba(234,179,8,.1); }
.ozet-kart[data-renk="tehlike"] .ust .material-symbols-rounded { color: var(--danger); background: rgba(239,68,68,.1); }
.ozet-kart[data-renk="bilgi"] .ust .material-symbols-rounded { color: var(--info); background: rgba(56,189,248,.1); }

.ozet-kart .ad {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: .2px;
}
.ozet-kart .deger {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.7px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.15;
}
.ozet-kart .alt {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 4px;
  line-height: 1.45;
}
.ozet-kart .ek {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
.ozet-kart .rozet-uyari {
  position: absolute;
  top: 12px; right: 12px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 20px;
  background: var(--danger);
  color: #fff;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center;
  animation: nabiz 2s ease-in-out infinite;
}
@keyframes nabiz {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,.5); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

/* Kart içi mini sütun grafik */
.mini-grafik {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 30px;
  margin-top: 10px;
}
.mini-grafik .sutun {
  flex: 1;
  background: var(--raised);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  transform-origin: bottom;
  animation: sutunAc .45s cubic-bezier(.2,.8,.3,1) backwards;
  position: relative;
}
.ozet-kart[data-renk="ok"] .mini-grafik .sutun { background: rgba(34,197,94,.45); }
.ozet-kart[data-renk="uyari"] .mini-grafik .sutun { background: rgba(234,179,8,.45); }
.ozet-kart[data-renk="bilgi"] .mini-grafik .sutun { background: rgba(56,189,248,.4); }
.mini-grafik .sutun:last-child { opacity: 1; filter: brightness(1.5); }
@keyframes sutunAc { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Bekleyen işler listesi */
.bekleyen-liste { display: grid; gap: 7px; }
.bekleyen-satir {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  animation: kartGir .3s backwards;
}
.bekleyen-satir:hover { border-color: var(--accent); transform: translateX(3px); }
.bekleyen-satir .material-symbols-rounded { font-size: 17px; color: var(--muted); }
.bekleyen-satir .ad { flex: 1; font-size: 12.5px; color: var(--text-2); }
.bekleyen-satir .adet {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 20px;
  background: var(--warn); color: #14181c;
  font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

@media (prefers-reduced-motion: reduce) {
  .ozet-kart, .bekleyen-satir, .mini-grafik .sutun, .ozet-kart::before { animation: none; }
  .ozet-kart:hover { transform: none; }
}
