
:root{
  --bg:#f4f6f9;
  --panel:#ffffff;
  --border:#dce3ea;
  --text:#0f172a;
  --muted:#64748b;
  --primary:#1f3a63;
  --shadow: 0 8px 24px rgba(15,23,42,.08);
  --radius: 14px;
  --sidebar-w: 260px;
}
*{box-sizing:border-box}
html,body{height:100%;max-width:100%;overflow-x:hidden}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans";
  color:var(--text);
  background:var(--bg);
}
a{color:inherit;text-decoration:none}
.wrap{width:100%;max-width:none;min-width:0;margin:0;padding:16px clamp(10px,1.2vw,18px) 24px}
.app{min-height:100vh;display:flex;width:100%;max-width:100%;overflow-x:clip}
.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  background:linear-gradient(180deg, var(--primary), #163053);
  color:#eaf1ff;
  position:sticky;top:0;height:100vh;
  padding:16px 12px;overflow-y:auto;overflow-x:hidden;
  border-right:1px solid rgba(255,255,255,.08);
}
.brand{display:flex;align-items:center;gap:10px;padding:10px 12px 14px}
.brand .logo{
  width:36px;height:36px;border-radius:10px;
  background:rgba(255,255,255,.12);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
}
.brand .t1{font-weight:800;letter-spacing:.3px}
.brand .t2{font-size:12px;opacity:.85}
.nav{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.nav a{
  display:flex;align-items:center;gap:10px;
  padding:10px 12px;border-radius:12px;
  color:#eaf1ff;opacity:.92;
}
.nav a:hover{background:rgba(255,255,255,.10);opacity:1}
.nav a.active{background:rgba(255,255,255,.16);opacity:1}
.sidebar-footer{margin-top:auto;padding:12px;opacity:.9;font-size:12px}
.sidebar-footer .pill{display:inline-block;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.12)}
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{
  position:sticky;top:0;z-index:20;
  background:rgba(244,246,249,.9);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.topbar-inner{
  width:100%;max-width:none;margin:0;
  padding:12px clamp(10px,1.2vw,18px);
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.topbar-left{display:flex;align-items:center;gap:10px;min-width:0}
.hamb{
  display:none;
  border:1px solid var(--border);
  background:#fff;border-radius:12px;
  padding:8px 10px;cursor:pointer;
}
.page-title{font-weight:800}
.subline{font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar-right{display:flex;align-items:center;gap:10px}
.chip{border:1px solid var(--border);background:#fff;padding:8px 10px;border-radius:999px;font-size:13px;color:var(--muted)}
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 12px;border-radius:12px;
  border:1px solid var(--border);background:#fff;cursor:pointer;
  color:var(--primary);font-weight:700;
}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn:active{transform:translateY(1px)}
.card{
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:16px;margin-bottom:14px;
}
.muted{color:var(--muted);font-size:13px}
.grid{display:grid;gap:12px}
.grid-2{grid-template-columns:1fr 1fr}
.grid-3{grid-template-columns:repeat(4,1fr)}
@media (max-width:920px){.grid-2{grid-template-columns:1fr}.grid-3{grid-template-columns:1fr}}
table{width:100%;border-collapse:separate;border-spacing:0}
th,td{padding:10px;border-bottom:1px solid var(--border);font-size:13px}
th{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
tr:hover td{background:#f8fafc}
td.actions{white-space:nowrap;text-align:right}
.badge{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--border);font-size:12px;background:#fff;
}
.badge.blue{border-color:#93c5fd;background:#eff6ff;color:#1d4ed8}
.badge.orange{border-color:#fdba74;background:#fff7ed;color:#9a3412}
.badge.green{border-color:#86efac;background:#f0fdf4;color:#166534}
.badge.red{border-color:#fca5a5;background:#fef2f2;color:#991b1b}
.badge.purple{border-color:#d8b4fe;background:#faf5ff;color:#6b21a8}
.pill{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;border:1px solid var(--border);background:#fff;font-size:12px;color:var(--muted)}
input,select,textarea{width:100%;padding:10px 12px;border-radius:12px;border:1px solid var(--border);background:#fff;outline:none}
textarea{resize:vertical}
hr{border:none;border-top:1px solid var(--border);margin:14px 0}
.mobile-drawer{
  display:none;position:fixed;inset:0;z-index:50;
  background:rgba(15,23,42,.45);
}
.mobile-drawer .panel{
  width:var(--sidebar-w);height:100%;
  background:linear-gradient(180deg, var(--primary), #163053);
  padding:16px 12px;color:#eaf1ff;box-shadow:var(--shadow);
}
@media (max-width:980px){
  .sidebar{display:none}
  .hamb{display:inline-flex}
  .mobile-drawer{display:block;visibility:hidden;opacity:0;transition:.15s}
  .mobile-drawer.open{visibility:visible;opacity:1}
}

/* ===== Horizontal (table-free) UI blocks ===== */
.hrow{
  display:grid;
  grid-template-columns:60px 1.4fr 1fr 1.2fr auto;
  gap:14px;
  align-items:center;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}
.hrow + .hrow{margin-top:10px}
.avatar{
  width:52px;height:52px;border-radius:12px;
  object-fit:contain;
  background:#f6f7f9;
  border:1px solid var(--border);
  padding:6px;
}
.title{font-weight:800;line-height:1.2}
.sub{font-size:12px;color:var(--muted);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.actions{display:flex;gap:10px;align-items:center;justify-content:flex-end;white-space:nowrap}

.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:6px}
.field.full{grid-column:1/-1}

@media (max-width:900px){
  .hrow{grid-template-columns:52px 1fr;}
  .hrow > :nth-child(3),
  .hrow > :nth-child(4){grid-column:1/-1;}
  .actions{grid-column:1/-1;justify-content:flex-start;flex-wrap:wrap}
  .form-grid{grid-template-columns:1fr}
}


/* sticky header tables */
.table-sticky { width:100%; border-collapse:collapse; }
.table-sticky thead th{ position:sticky; top:0; z-index:2; background:#f3f4f6; }
.table-sticky td, .table-sticky th{ white-space:nowrap; }
.table-sticky td:nth-child(5){ white-space:normal; max-width:520px; }


/* === Tabs: Ekrana yay (kurumsal) === */
.tabs-spread{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.tabs-spread .btn{width:100%;justify-content:center;white-space:nowrap}
@media (max-width:520px){.tabs-spread{grid-template-columns:1fr}}


/* ===== PREMIUM TABS (Kurumsal & Sade) ===== */
.tabs-spread{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:0;
  border-bottom:1px solid #e5e7eb;
  margin-top:10px;
  margin-bottom:10px;

  position: sticky;
  top: 10px;
  background: var(--panel);
  z-index: 25;
  padding-top: 6px;
}
.tabs-spread .tab-btn{
  background: transparent;
  border: none;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  position: relative;
  transition: all .18s ease;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
}
.tabs-spread .tab-btn:hover{ color:#111827; }
.tabs-spread .tab-btn.active{
  color:#111827;
  font-weight: 600;
}
.tabs-spread .tab-btn.active::after{
  content:"";
  position:absolute;
  left: 20%;
  bottom: -1px;
  width: 60%;
  height: 3px;
  background:#2563eb;
  border-radius: 10px;
}
/* küçük sayaç */
.tabs-spread .tab-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background:#eef2ff;
  color:#1e3a8a;
  font-size: 12px;
  font-weight: 600;
}
/* gecikmiş chip (kırmızı) */
.tabs-spread .tab-badge.badge.red{
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 999px;
}

/* çok dar ekranlarda tabs tek satırdan taşmasın */
@media (max-width: 520px){
  .tabs-spread{ grid-template-columns:1fr; }
  .tabs-spread .tab-btn{ justify-content:space-between; padding: 10px 12px; }
  .tabs-spread .tab-btn.active::after{ left:0; width:100%; }
}


.badge.gray{background:#e5e7eb;color:#111827}

/* Tabs sticky (dashboard) */
.tabs-sticky{
  position: sticky;
  top: 8px;
  background: #fff;
  z-index: 20;
}

.btn.danger{background:#dc2626;border-color:#dc2626;color:#fff}
.btn.danger:hover{filter:brightness(0.95)}


.main,.topbar,.topbar-inner,.card,.hrow,.form-grid{min-width:0;max-width:100%;}
img,svg,canvas,iframe,video{max-width:100%;height:auto;}
.topbar-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;min-width:0;}
.chip,.btn{max-width:100%;}
table{max-width:100%;}
@media (max-width:1200px){.topbar-inner{align-items:flex-start}.topbar-right{justify-content:flex-start}}
@media (max-width:980px){.wrap{padding:14px 10px 20px}.topbar-right{gap:8px}}
