*{margin:0;padding:0;box-sizing:border-box}
:root{
  --bg:#1e1e24;--surface:rgba(43, 43, 54, 0.7);--surface2:rgba(63, 63, 78, 0.6);
  --border:rgba(255, 255, 255, 0.06); --border-hover:rgba(255, 255, 255, 0.12);
  --text:#f4f4f5;--text2:#a1a1aa;
  --accent:#64748b;--accent2:#94a3b8;
  --green:#4ade80;--yellow:#fbbf24;--red:#f87171;--blue:#60a5fa;
  --radius:16px;
  --shadow:0 8px 32px rgba(0,0,0,0.3);
  --shadow-hover:0 12px 48px rgba(0,0,0,0.4);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html { overflow-x: hidden; max-width: 100vw; }
body{
  font-family: 'Outfit', 'Google Sans Flex', 'Google Sans', 'Product Sans', 'Inter', sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(circle at top center, rgba(100, 116, 139, 0.1) 0%, transparent 50%);
  color:var(--text);
  min-height:100vh;
  max-width: 100vw;
  overflow-x:hidden;
  position: relative;
  transition: opacity 0.4s ease;
}

/* ── Mobile: login & selection screens no-scroll ── */
@media(max-width:768px) {
  body.login-mode {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
  .hero-container {
    height: 100dvh !important;
    min-height: unset !important;
    overflow: hidden !important;
  }
}
body.initializing { opacity: 0; pointer-events: none; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab-content { animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* Antigravity Hero Login Screen */
.hero-container { position: relative; width: 100%; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: #000; }
.hero-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 800px; padding: 20px; display: flex; flex-direction: column; align-items: center; animation: fadeIn 1.5s ease-out; }
.hero-logo-wrap { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; background: rgba(255,255,255,0.05); padding: 8px 24px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.1); backdrop-filter: blur(8px); }
.hero-logo { height: 28px; filter: brightness(0) invert(1); }
.hero-brand { font-size: 20px; font-weight: 500; color: #fff; letter-spacing: -0.5px; }
.hero-title { font-size: 72px; font-weight: 600; line-height: 1.05; letter-spacing: -2px; color: #fff; margin-bottom: 24px; }
.hero-subtitle { font-size: 20px; color: var(--text2); font-weight: 400; max-width: 600px; margin: 0 auto 40px; line-height: 1.5; }
.hero-actions { display: flex; gap: 16px; justify-content: center; }
.hero-btn { background: #fff; color: #000; font-weight: 600; font-size: 16px; padding: 16px 32px; border-radius: 100px; border: none; cursor: pointer; display: flex; align-items: center; gap: 10px; transition: transform 0.2s, box-shadow 0.2s; font-family: inherit;}
.hero-btn:hover { transform: scale(1.05); box-shadow: 0 0 20px rgba(255,255,255,0.2); }

/* Login Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(8px); z-index: 9999; display: flex; justify-content: center; align-items: center; padding: 20px; animation: fadeIn 0.3s; }
.login-card { position: relative; background: rgba(20, 20, 24, 0.85); border: 1px solid var(--border); border-radius: 24px; padding: 48px; width: 100%; max-width: 440px; text-align: center; box-shadow: 0 24px 48px rgba(0,0,0,0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.modal-close { position: absolute; top: 20px; right: 20px; background: transparent; border: none; color: var(--text2); font-size: 20px; cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: #fff; }
.login-card h2 { margin-bottom: 8px; font-size: 28px; color:#fff; font-weight: 600; letter-spacing: -1px; }
.login-card p { color: var(--text2); margin-bottom: 32px; font-size: 15px; }
.login-card input { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--border); color: var(--text); padding: 16px; border-radius: 12px; margin-bottom: 16px; font-family: inherit; font-size: 15px; transition: var(--transition); }
.login-card input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px rgba(59,130,246,0.2); }
.login-card button[type="submit"] { width: 100%; padding: 16px; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 8px; font-family: inherit; }
.login-error { color: #f87171; background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2); padding: 12px; border-radius: 8px; margin-top: 16px; font-size: 14px; text-align: left; }

/* Logout Button */
.btn-logout { background: transparent; color: var(--text2); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; font-family: inherit; transition: var(--transition); margin-left: auto; }
.btn-logout:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* ─── Header ─── */
.header{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:100;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
}
.header-inner{ margin:0 auto; padding:0 24px; display:flex; align-items:center; justify-content:space-between; height:56px; }
.header-left { display: flex; align-items: center; gap: 16px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.logo{
  display:flex; align-items:center; gap:12px;
  font-size:20px; font-weight:700;
  color: #e2e8f0; flex-shrink:0;
}

/* Header Action Buttons */
.header-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text2); cursor: pointer;
  font-size: 13px; font-weight: 500; font-family: inherit;
  transition: all 0.2s; white-space: nowrap;
}
.header-action-btn:hover { border-color: var(--border-hover); color: var(--text); background: rgba(255,255,255,0.04); }
.header-action-primary {
  border: none !important; background: linear-gradient(135deg, #6366f1, #818cf8) !important;
  color: #fff !important; font-weight: 600;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.header-action-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.45); }

.nav-tabs{display:flex;gap:4px;background:rgba(255,255,255,0.03);padding:3px;border-radius:10px;border:1px solid var(--border);}
.nav-tab{
  background:transparent; border:none; color:var(--text2);
  padding:7px 18px; border-radius:7px; cursor:pointer;
  font-size:13px; font-weight:500; transition:var(--transition); font-family:inherit; white-space:nowrap;
}
.nav-tab:hover{ color:var(--text); }
.nav-tab.active{
  background:rgba(255,255,255,0.1);
  color:#fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ─── Shared KPI Row ─── */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  padding: 20px 24px 0; margin: 0 auto;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; cursor: pointer; transition: var(--transition);
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--border-hover); }
.kpi-card-info { display: flex; flex-direction: column; gap: 4px; }
.kpi-card-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text2); }
.kpi-card-value { font-size: 24px; font-weight: 700; color: #fff; line-height: 1.1; }
.kpi-card svg.kpi-donut { flex-shrink: 0; }
.kpi-donut-bg { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 3.8; }
.kpi-donut-fill { fill: none; stroke-width: 3.2; stroke-linecap: round; transition: stroke-dasharray 1.2s ease-out; }
.kpi-donut-pct { fill: #fff; font-family: 'Outfit', sans-serif; font-size: 7.5px; font-weight: 700; text-anchor: middle; }

/* ─── Shared Filter Section ─── */
.filter-section {
  margin: 16px 24px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  margin-left: 24px; margin-right: 24px;
  padding: 0 24px;
}
.filter-section-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; padding: 16px 0; flex-wrap: wrap;
}
.filter-left { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-label { font-size: 11px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.filter-adv-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text2);
  cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.2s;
  white-space: nowrap; font-family: inherit; align-self: flex-end;
}
.filter-adv-btn:hover, .filter-adv-btn.active { border-color: rgba(99,102,241,0.5); color: #a5b4fc; }
.filter-search-wrap {
  position: relative; display: flex; align-items: center;
}
.filter-search-icon { position: absolute; left: 10px; color: var(--text2); pointer-events: none; }
.filter-search-input {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 8px 12px 8px 34px;
  font-size: 13px; outline: none; width: 220px; font-family: inherit;
  transition: border-color 0.2s;
}
.filter-search-input:focus { border-color: rgba(99,102,241,0.5); }
.filter-btn-clear {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--text2);
  cursor: pointer; font-size: 13px; transition: all 0.2s; font-family: inherit;
}
.filter-btn-clear:hover { color: var(--text); }
.filter-btn-apply {
  padding: 8px 20px; border-radius: 8px; border: none;
  background: #6366f1; color: #fff;
  cursor: pointer; font-size: 13px; font-weight: 600; transition: all 0.2s; font-family: inherit;
}
.filter-btn-apply:hover { background: #5254c8; }
.filter-adv-row {
  display: none; padding: 12px 0 16px; border-top: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.filter-adv-row.open { display: flex; }

/* Multi Select Dropdowns - Fixed Width */
.multi-select { position: relative; width: 150px; font-size: 13px; font-weight: 500; }
.ms-header { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--text); transition: var(--transition); white-space: nowrap; overflow: hidden; }
.ms-header:hover { border-color: var(--border-hover); background: rgba(0,0,0,0.3); }
.ms-dropdown { display: none; position: absolute; top: calc(100% + 6px); left: 0; width: 100%; min-width: 180px; background: rgba(30, 30, 36, 0.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--border); border-radius: 12px; max-height: 240px; overflow-y: auto; z-index: 200; box-shadow: var(--shadow-hover); padding: 6px; }
.multi-select.open .ms-dropdown { display: block; animation: fadeIn 0.2s; }
.ms-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; border-radius: 6px; transition: background 0.2s; user-select: none; }
.ms-option:hover { background: rgba(255,255,255,0.08); }
.ms-option input { cursor: pointer; accent-color: var(--blue); width: 14px; height: 14px; flex-shrink: 0; }
.ms-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-small{
  background:rgba(255,255,255,0.05); border:1px solid var(--border); color:var(--text);
  padding:9px 16px; border-radius:10px; cursor:pointer; font-size:13px; font-weight:500;
  transition:var(--transition); white-space:nowrap;
}
.btn-small:hover{ background:rgba(255,255,255,0.1); border-color:var(--border-hover); }
.btn-accent{
  background:linear-gradient(135deg,var(--accent),var(--accent2))!important; border:none!important; color:#fff!important;
  box-shadow: 0 4px 12px rgba(100,116,139,0.3);
}
.btn-accent:hover { box-shadow: 0 6px 16px rgba(100,116,139,0.5); transform: translateY(-1px); }
.btn-green{
  background:linear-gradient(135deg,#059669,#10b981)!important; border:none!important; color:#fff!important;
  box-shadow: 0 4px 12px rgba(16,185,129,0.2);
}
.btn-green:hover { box-shadow: 0 6px 16px rgba(16,185,129,0.4); transform: translateY(-1px); }


/* Dashboard Layout */
.kpi-top-row {
  display: flex; gap: 20px; padding: 24px 24px 0; margin: 0 24px 24px;
}
.charts-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 0 24px 24px; margin: 0; }

/* KPI Circles - full width horizontal, column layout */
.kpi-circle-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px 20px; display: flex; flex-direction: column; align-items: center;
  gap: 0; cursor: pointer; transition: var(--transition); flex: 1; text-align: center;
  animation: fadeIn 0.3s ease-out;
}
.kpi-circle-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--border-hover); }
.circular-chart { display: block; width: 150px; height: 150px; }
.circle-bg { fill: none; stroke: rgba(255,255,255,0.07); stroke-width: 3.8; }
.circle { fill: none; stroke-width: 3.2; stroke-linecap: round; transition: stroke-dasharray 1.2s ease-out; }
.circular-chart.blue .circle { stroke: #3b82f6; }
.circular-chart.green .circle { stroke: #4ade80; }
.circular-chart.yellow .circle { stroke: #fbbf24; }
.percentage { fill: #fff; font-family: 'Inter', sans-serif; font-size: 7px; font-weight: 700; text-anchor: middle; }
.kpi-circle-label { font-size: 13px; color: var(--text2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; }
.kpi-circle-value { font-size: 26px; font-weight: 700; color: #fff; line-height: 1.2; margin-top: 6px; }

/* İlçe Doughnut Grid - 6 per row */
.ilce-doughnut-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 8px;
}
.ilce-donut-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 8px; border-radius: 12px; background: rgba(0,0,0,0.15);
  border: 1px solid var(--border); transition: var(--transition);
  animation: fadeIn 0.3s ease-out;
}
.ilce-donut-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border-hover); }
.ilce-donut-item canvas { width: 100% !important; max-width: 120px; height: auto !important; }
.ilce-donut-name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.3; }
.ilce-donut-stats { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ilce-donut-stat { font-size: 11px; color: var(--text2); text-align: center; }
.ilce-donut-stat span { font-weight: 600; }

/* Custom Doughnut Legend */
.custom-doughnut-container { display: flex; flex-direction: column; align-items: center; gap: 24px; justify-content: flex-start;}
.chart-wrapper { width: 100%; }
.canvas-container { height: 260px; display: flex; justify-content: center; align-items: center; width: 100%; }
.custom-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.legend-item { display: flex; align-items: center; justify-content: space-between; font-size: 13px; padding: 10px 12px; background: rgba(0,0,0,0.2); border-radius: 8px; border: 1px solid var(--border); cursor:pointer; transition:var(--transition); }
.legend-item:hover { background: rgba(255,255,255,0.05); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.legend-label-wrap { display: flex; align-items: center; gap: 10px; }
.legend-color { width: 14px; height: 14px; border-radius: 3px; flex-shrink:0; }
.legend-val { font-weight: 700; color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-pct { color: #fff; font-size: 14px; font-weight: 700; background: rgba(255,255,255,0.1); padding: 4px 8px; border-radius: 6px;}
.legend-sub { font-size: 11px; color: var(--text2); }

.chart-card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); padding:24px; backdrop-filter: blur(8px); transition:var(--transition);
  animation: fadeIn 0.4s ease-out;
}
.chart-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.chart-card h3{ font-size:15px; font-weight:600; margin-bottom:20px; color:var(--text2); }

.tab-content{padding:0 0 60px}
#hierarchyTable, #firmaTable{ margin:24px 24px; padding:0; }

.firma-card{
  background:linear-gradient(145deg, var(--surface), rgba(24,24,27,0.4));
  border:1px solid var(--border); border-radius:var(--radius);
  padding:24px; margin-bottom:16px; transition:var(--transition);
}
.firma-card:hover{ border-color:var(--border-hover); box-shadow:var(--shadow); transform:translateY(-2px); }
.firma-card-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; border-bottom:1px solid var(--border); padding-bottom:16px;}
.firma-card-name{ font-size:18px; font-weight:700; letter-spacing:-0.5px;}
.firma-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:16px; }
.firma-stat{
  background:rgba(255,255,255,0.02); border:1px solid rgba(255,255,255,0.04);
  border-radius:12px; padding:16px; text-align:center; transition:var(--transition);
}
.firma-stat:hover { background:rgba(255,255,255,0.04); transform:scale(1.02); }
.firma-stat-val{ font-size:24px; font-weight:700; color:var(--text); margin-bottom:4px;}
.firma-stat-label{ font-size:12px; color:var(--text2); font-weight:500;}

.alert{ background:rgba(239,68,68,.1); border:1px solid rgba(239,68,68,.3); border-radius:12px; padding:16px 20px; margin:24px; color:#fca5a5; font-size:14px; box-shadow: 0 4px 12px rgba(239,68,68,0.1);}

.progress-bar-outer{ background:rgba(255,255,255,0.1); border-radius:10px; height:6px; flex:1; min-width:60px; overflow:hidden;}
.progress-bar-inner{ 
  height:100%; border-radius:10px; 
  background:linear-gradient(90deg, var(--accent), var(--accent2)); 
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.3);
  width: 0;
  animation: fillBar 1.2s cubic-bezier(0.1, 0.7, 0.1, 1) forwards;
}
@keyframes fillBar {
  from { width: 0; }
  to { width: var(--w); }
}

/* Chart List Overlays */
.chart-list { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.chart-list-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.02); font-size: 14px; }
.chart-list-item:last-child { border-bottom: none; }
.chart-list-val { font-weight: 600; color: var(--text); }
.chart-list-label { color: var(--text2); }

/* --- RESPONSIVE MOBILE LAYOUT --- */
@media(max-width: 1024px) {
  .charts-grid-2 { grid-template-columns: 1fr; margin: 0; gap: 0; }
}

/* ═══ MOBILE BOTTOM NAV ═══ */
.mobile-bottom-nav {
  display: none;
}
@media(max-width: 768px) {
  .mobile-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
    background: rgba(26, 26, 40, 0.94); border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px 20px 0 0;
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    height: calc(72px + env(safe-area-inset-bottom));
    align-items: center;
    justify-content: space-around;
  }
  .mob-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 6px 12px; cursor: pointer; border: none; background: none;
    color: rgba(148, 163, 184, 0.6); font-family: inherit; font-size: 11px; font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }
  .mob-nav-item.active { color: #818cf8; }
  .mob-nav-item svg { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 24px; height: 24px; stroke-width: 2; }
  .mob-nav-item.active svg { transform: translateY(-2px); stroke-width: 2.2; }
  
  /* Small glow bar active indicator */
  .mob-nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    width: 12px;
    height: 3px;
    background-color: #818cf8;
    border-radius: 99px;
    opacity: 0;
    transform: scaleX(0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .mob-nav-item.active::after {
    opacity: 1;
    transform: scaleX(1);
  }
  
  .mob-nav-dot { display: none !important; }
}

@media(max-width: 768px) {
  /* ── Header ── */
  .header-inner {
    height: 56px; padding: 0 16px;
    flex-wrap: nowrap;
  }
  .header-left { gap: 12px; flex: 1; }
  .header-right { gap: 8px; flex-shrink: 0; }
  /* Hide nav-tabs in header on mobile (bottom nav used instead) */
  .header-inner .nav-tabs { display: none !important; }
  .logo img { height: 28px !important; }

  /* Icon-only action buttons */
  .header-action-btn { padding: 8px; min-width: 36px; height: 36px; justify-content: center; }
  .header-action-btn span,
  .header-action-btn > *:not(svg) { display: none; }

  /* Main content bottom padding for nav + safe area */
  #mainContent { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  /* ── KPI Cards ── */
  .kpi-row {
    grid-template-columns: 1fr 1fr;
    padding: 12px 12px 0; gap: 10px;
  }
  .kpi-card {
    padding: 12px 14px; gap: 8px; border-radius: 12px;
    flex-direction: row; align-items: center; justify-content: space-between;
  }
  .kpi-card-info { width: auto; flex: 1; min-width: 0; }
  .kpi-card-value { font-size: 15px; margin-top: 2px; }
  .kpi-card-label { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .kpi-card svg.kpi-donut { width: 44px; height: 44px; align-self: center; margin-top: 0; flex-shrink: 0; }

  /* ── Filter Section ── */
  .filter-section { margin: 10px 12px 12px; padding: 0 12px; }
  .filter-section-inner { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 0 10px; }

  /* Top row: 3 dropdowns side by side */
  .filter-left {
    display: grid !important; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    margin-bottom: 8px;
  }
  /* Advanced filter button goes below the 3 dropdowns, full width */
  .filter-adv-btn {
    grid-column: 1 / -1; width: 100%; justify-content: center;
    margin-top: 4px;
  }
  /* Search row */
  .filter-right {
    display: grid !important; grid-template-columns: 1fr auto auto; gap: 8px;
    align-items: center;
  }
  .filter-search-wrap { width: 100%; }
  .filter-search-input { width: 100%; min-width: 0; }
  .filter-adv-row { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .filter-adv-row .filter-group { flex: 1 1 calc(50% - 4px); }
  .filter-adv-row .multi-select { width: 100%; }
  .multi-select { width: 100%; }
  .ms-header { font-size: 12px; padding: 7px 10px; }

  /* ── Charts ── */
  .chart-card { margin: 0 12px 12px !important; padding: 16px; border-radius: 14px; }
  .ilce-doughnut-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ilce-donut-item { padding: 10px 6px; border-radius: 10px; }
  .ilce-donut-item canvas { max-width: 90px; }
  .ilce-donut-name { font-size: 11px; }
  .ilce-donut-stat { font-size: 10px; }

  /* Custom Legends on Mobile */
  .custom-legend { gap: 6px; grid-template-columns: 1fr 1fr 1fr; }
  .legend-item { flex-direction: column; padding: 8px 6px; gap: 4px; text-align: center; align-items: center; }
  .legend-label-wrap { flex-direction: column; gap: 3px; align-items: center; }
  .legend-pct { align-self: center; }

  /* Dashboard charts 2 col */
  .charts-grid-2 { padding: 0 12px 12px; gap: 12px; }

  /* ── Footer compact on mobile ── */
  .site-footer { padding: 16px 16px calc(16px + 74px + env(safe-area-inset-bottom)); margin-top: 16px; }
}

/* ═══ MOBILE İCMAL TABLE - Card Layout ═══ */
@media(max-width: 768px) {
  .icmal-table-wrap { margin: 10px 12px 12px; border-radius: 14px; }

  /* Hide desktop column headers */
  .icmal-thead { display: none !important; }

  /* İlçe row becomes a full card */
  .icmal-ilce-row { border-bottom: none; margin-bottom: 0; }
  .icmal-ilce-header {
    display: flex !important; flex-wrap: nowrap; gap: 0;
    padding: 16px 14px;
    align-items: center;
    border-bottom: 1px solid var(--border);
  }

  /* Expand icon */
  .icmal-expand-icon { flex-shrink: 0; margin-right: 10px; }

  /* Left: name + subtitle (köy count) */
  .icmal-ilce-name {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
    padding: 0;
  }
  .icmal-ilce-name-text { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.2; }
  .icmal-ilce-koycount { font-size: 12px; color: var(--text2); font-weight: 400; }

  /* Middle: 3 values stacked */
  .icmal-ilce-vals {
    display: flex; gap: 10px; flex-shrink: 0; margin-right: 12px;
  }
  .icmal-ilce-val-group {
    display: flex; flex-direction: column; gap: 1px; text-align: right; min-width: 54px;
  }
  .icmal-ilce-val-num { font-size: 13px; font-weight: 700; line-height: 1.2; }
  .icmal-ilce-val-lbl { font-size: 10px; color: var(--text2); font-weight: 400; }

  /* Right: durum badge + chevron */
  .icmal-ilce-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
  .icmal-ilce-chevron { color: var(--text2); font-size: 14px; }

  /* Progress + oran below the header row */
  .icmal-ilce-progress-row {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    padding: 0 14px 12px 14px;
    border-bottom: 1px solid var(--border);
  }
  .icmal-ilce-progress-bar { width: 100px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-bottom: 0; }
  .icmal-ilce-progress-fill { height: 100%; border-radius: 2px; }
  .icmal-ilce-oran-text { font-size: 11px; color: var(--text2); font-weight: 600; text-align: right; }

  /* Hide desktop-only cells */
  .icmal-ilce-header > .icmal-cell,
  .icmal-ilce-header > .icmal-oran-wrap,
  .icmal-ilce-header > .icmal-durum { display: none !important; }

  /* Köy rows in accordion */
  .icmal-koy-section { background: rgba(0,0,0,0.2); }
  .icmal-koy-header {
    display: flex !important; gap: 0; flex-wrap: nowrap;
    padding: 12px 14px 12px 28px; align-items: center;
  }
  .icmal-koy-name { flex: 1; font-size: 13px; padding: 0; margin-right: 8px; }

  /* Hide desktop koy cells */
  .icmal-koy-header > .icmal-cell,
  .icmal-koy-header > .icmal-oran-wrap,
  .icmal-koy-header > .icmal-durum,
  .icmal-koy-header > .icmal-expand-icon { display: none !important; }
  .icmal-koy-header .icmal-koy-expand { display: flex !important; }

  /* Mobile köy data values - force visible */
  .mob-koy-vals { display: flex !important; }
  .mob-koy-progress { display: flex !important; }

  /* Detail rows - mobile: card style, no grid, no horizontal scroll */
  .icmal-detail-thead { display: none !important; }
  .icmal-detail-row {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px 14px !important;
    gap: 4px;
    overflow-x: hidden !important;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(0,0,0,0.15);
  }
  .icmal-detail-row .idc {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 11px;
    padding: 0 !important;
  }
  .icmal-row-actions {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end;
    padding: 4px 0 0 0;
    border-top: 1px solid rgba(255,255,255,0.04);
    margin-top: 4px;
    gap: 8px;
  }

  /* Mobile detail card */
  .mob-detail-card {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    padding: 0;
  }
  .mob-dc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mob-dc-mevkii {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mob-dc-mid {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    font-size: 11px;
    color: var(--text);
  }
  .mob-dc-label {
    color: var(--text2);
    font-size: 10px;
  }

  /* Hide desktop-only elements on mobile */
  .desk-only { display: none !important; }
  .mob-only { display: block !important; }
}


/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Footer on Login Mode */
body.login-mode { overflow: hidden; }
body.login-mode .site-footer {
  position: absolute; bottom: 0; left: 0; width: 100%; z-index: 10;
  background: transparent;
  border-top: 1px solid rgba(255,255,255,0.05); margin-top: 0; padding: 12px 24px;
}
body.login-mode .footer-top { margin-bottom: 12px; }
body.login-mode .footer-bottom { padding-top: 12px; }

/* Footer */
.site-footer { background: transparent; border-top: 1px solid rgba(255,255,255,0.05); padding: 24px 24px 16px; margin-top: 40px; }
.footer-inner { width: 100%; margin: 0 auto; }
.footer-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 24px; }
.footer-left { flex: 1; max-width: 800px; }
.footer-brand { font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; display: inline-block; margin-bottom: 8px; transition: var(--transition); }
.footer-brand:hover { color: var(--blue); }
.footer-disclaimer { font-size: 11px; color: var(--text2); line-height: 1.4; }
.footer-right { display: flex; align-items: center; }
.social-links { display: flex; gap: 12px; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.05); color: var(--text2); border: 1px solid var(--border); transition: var(--transition); }
.social-links a:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: var(--border-hover); transform: translateY(-2px); }
.footer-bottom { text-align: center; font-size: 11px; color: rgba(255,255,255,0.3); padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-bottom a:hover { color: #fff !important; }

@media(min-width: 769px) {
  .footer-disclaimer { white-space: nowrap; }
}

@media(max-width: 768px) {
  .footer-top { flex-direction: column; align-items: center; gap: 12px; text-align: center; }
  .footer-left { max-width: 100%; }
  .footer-right { width: 100%; justify-content: center; }
  .footer-brand { font-size: 13px; margin-bottom: 3px; }
  .footer-disclaimer { font-size: 10px; }
  .social-links { margin: 0 auto; gap: 8px; }
  .social-links a { width: 30px; height: 30px; }
  .footer-bottom { font-size: 10px; padding-top: 10px; }
  .hero-title { font-size: 40px; letter-spacing: -1px; }
  .hero-subtitle { font-size: 16px; }
  .login-card { padding: 32px 20px; }
}

/* ─── Responsive utility classes ─── */
.mob-only { display: none; }
@media(max-width:768px) {
  .mob-only { display: block; }
  .desk-only { display: none !important; }
}

/* İcmal ilçe header - mobile inner elements (hidden on desktop) */
.icmal-ilce-name { flex-direction: row; align-items: center; gap: 8px; }
.icmal-ilce-name-text { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icmal-ilce-koycount { display: none; font-size: 12px; color: var(--text2); }
.icmal-ilce-vals { display: none; }
.icmal-ilce-right { display: none; }
.icmal-ilce-chevron { display: none; }
.icmal-ilce-progress-row { display: none; }

@media(max-width:768px) {
  .icmal-ilce-koycount { display: block; }
  .icmal-ilce-vals { display: flex; }
  .icmal-ilce-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .icmal-ilce-chevron { display: flex; align-items: center; color: var(--text2); }
  .icmal-ilce-progress-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

  /* Desktop cells hidden on mobile */
  .icmal-ilce-header > .icmal-cell { display: none !important; }
  .icmal-ilce-header > .icmal-oran-wrap { display: none !important; }
  .icmal-ilce-header > .icmal-durum { display: none !important; }
  /* Hide left expand icon on mobile for ilçe (right chevron used instead) */
  .icmal-ilce-header > .icmal-expand-icon { display: none !important; }

  /* Restructure name column */
  .icmal-ilce-name {
    flex-direction: column !important; align-items: flex-start !important; flex-wrap: nowrap !important; gap: 2px !important;
    flex: 1 !important; min-width: 0 !important; padding: 12px 0 !important;
  }
  .icmal-ilce-name-text { font-size: 15px; font-weight: 700; }
  .icmal-ilce-koycount { margin: 0; font-size: 12px; color: var(--text2); }

  /* Mobile ilçe header layout: name | vals | right(badge+chevron) */
  .icmal-ilce-header {
    display: flex !important;
    padding: 0 14px 0 14px !important;
    gap: 8px;
    align-items: center;
  }

  /* Koy header desktop cells hidden */
  .icmal-koy-header > .icmal-cell { display: none !important; }
  .icmal-koy-header > .icmal-oran-wrap { display: none !important; }
  .icmal-koy-header > .icmal-durum { display: none !important; }
  .icmal-koy-header > .icmal-expand-icon { display: none !important; }

  /* Koy header mobile: full card layout */
  .icmal-koy-header {
    display: flex !important;
    flex-direction: column !important;
    padding: 10px 14px 10px 20px !important;
    gap: 6px;
    cursor: pointer;
  }
  .icmal-koy-name {
    flex: unset !important; padding: 0 !important; width: 100%;
    display: flex !important; align-items: center !important; justify-content: space-between !important;
    gap: 8px !important; font-size: 13px !important; font-weight: 600 !important; color: var(--text) !important;
  }
  /* Mobile köy: show talep/gercek/kalan values */
  .mob-koy-vals {
    display: flex !important;
    gap: 0;
    width: 100%;
  }
  .mob-koy-val-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .mob-koy-val-num { font-size: 12px; font-weight: 700; line-height: 1.2; }
  .mob-koy-val-lbl { font-size: 10px; color: var(--text2); font-weight: 400; }
  /* Mobile köy progress row */
  .mob-koy-progress {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .mob-koy-progress-bar { flex: 1; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
  .mob-koy-progress-fill { height: 100%; border-radius: 2px; }
  .mob-koy-oran-text { font-size: 11px; color: var(--text2); font-weight: 600; white-space: nowrap; }
}

@media(min-width:769px) {
  /* On desktop, hide the mobile-specific structure elements */
  .icmal-ilce-vals { display: none !important; }
  .icmal-ilce-right { display: none !important; }
  .icmal-ilce-progress-row { display: none !important; }
  .icmal-ilce-koycount { display: none !important; }
  /* Desktop name: dot + text in a row */
  .icmal-ilce-name { flex-direction: row !important; align-items: center !important; gap: 8px !important; }
  .icmal-ilce-name-text { font-size: 14px; font-weight: 600; }
}




/* İcmal Table */
.icmal-table-wrap {
  margin: 16px 24px 24px; border-radius: 14px;
  border: 1px solid var(--border); overflow: hidden;
}
/* Shared grid: expand | name | talep | gercek | kalan | oran+bar | sayi | durum */
.icmal-grid-cols { grid-template-columns: 36px minmax(180px,2fr) repeat(3,minmax(90px,1fr)) minmax(120px,1.2fr) 90px 110px; }
.icmal-thead {
  display: grid;
  background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border);
  padding: 0 8px;
}
.icmal-thead, .icmal-ilce-header, .icmal-koy-header {
  grid-template-columns: 36px minmax(180px,2fr) repeat(3,minmax(90px,1fr)) minmax(120px,1.2fr) 90px 110px;
}
.ith {
  padding: 12px 10px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--text2);
}
.ith-exp { display: flex; align-items: center; justify-content: center; }
.ith-num { text-align: right; }
.ith-durum { text-align: center; }
.ith-sortable { cursor: pointer; user-select: none; transition: color 0.2s; display: flex; align-items: center; gap: 4px; }
.ith-sortable:hover { color: var(--text); }
.ith-sortable.sort-active { color: #a5b4fc; }
.sort-arrow { font-size: 10px; opacity: 0.4; transition: opacity 0.2s; }
.ith-sortable.sort-active .sort-arrow { opacity: 1; }
.ith-name.ith-sortable { justify-content: flex-start; }
.ith-num.ith-sortable { justify-content: flex-end; }
.ith-durum.ith-sortable { justify-content: center; }

/* Firma page */
.firma-page-wrap { max-width: 1600px; margin: 0 auto; padding: 0 24px 24px; }

/* İlçe Row */
.icmal-ilce-row { animation: fadeIn 0.3s ease-out; border-bottom: 1px solid var(--border); }
.icmal-ilce-header {
  display: grid;
  padding: 0 8px; cursor: pointer; transition: background 0.15s;
  align-items: center;
}
.icmal-ilce-header:hover { background: rgba(255,255,255,0.03); }
.icmal-expand-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: transform 0.25s ease; font-size: 10px;
}
.icmal-expand-icon.open { transform: rotate(90deg); }
.icmal-ilce-name { font-size: 14px; font-weight: 600; padding: 14px 10px; display: flex; align-items: center; gap: 8px; }
.icmal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.icmal-cell { padding: 14px 10px; font-size: 13px; text-align: right; }
.icmal-cell-green { color: var(--green); }
.icmal-cell-yellow { color: var(--yellow); }
.icmal-actions-cell { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; }

/* Progress bar in oran column */
.icmal-oran-wrap { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 14px 10px; }
.icmal-oran-val { font-size: 13px; }
.icmal-progress { width: 60px; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.icmal-progress-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* Durum badge */
.icmal-durum { display: flex; align-items: center; justify-content: center; padding: 14px 10px; }
.idb { padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.idb-green { background: rgba(74,222,128,0.15); color: #4ade80; }
.idb-yellow { background: rgba(251,191,36,0.15); color: #fbbf24; }
.idb-red { background: rgba(248,113,113,0.15); color: #f87171; }

/* Accordion content - smooth Apple-like animation */
.icmal-accordion { overflow: hidden; max-height: 0; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.icmal-accordion.open { max-height: 5000px; transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* Köy rows */
.icmal-koy-section { background: rgba(0,0,0,0.15); }
.icmal-koy-row { border-top: 1px solid rgba(255,255,255,0.04); }
.icmal-koy-header {
  display: grid;
  padding: 0 8px 0 16px; cursor: pointer; transition: background 0.15s; align-items: center;
}
.icmal-koy-header:hover { background: rgba(255,255,255,0.04); }
.icmal-koy-name { font-size: 13px; font-weight: 500; padding: 12px 10px; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.icmal-koy-name svg { flex-shrink: 0; }

/* Detail rows - sub-table inside koy */
.icmal-detail-section { background: rgba(0,0,0,0.2); }
.icmal-detail-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.7fr 0.8fr 1fr 1fr 0.9fr 0.9fr 110px;
  padding: 10px 52px 10px 52px; border-top: 1px solid rgba(255,255,255,0.04);
  font-size: 12px; align-items: center;
  transition: background 0.15s;
}
.icmal-detail-row:hover { background: rgba(255,255,255,0.02); }
.icmal-detail-row.gizli { opacity: 0.45; }
.icmal-detail-thead {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.7fr 0.8fr 1fr 1fr 0.9fr 0.9fr 110px;
  padding: 8px 52px; border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
.idt-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: rgba(161,161,170,0.7); text-align: left; }
.idt-label.sortable { cursor: pointer; user-select: none; }
.idc { padding: 0 6px; color: var(--text); text-align: left; }
.idc-muted { color: var(--text2); }
.icmal-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 8px; position: relative; }

/* Action icon buttons */
.icmal-icon-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 7px; border: none; background: transparent; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
}
.icmal-icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* Three-dot dropdown */
.icmal-menu-wrap { position: relative; }
.icmal-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 9999;
  background: #2a2a35; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; min-width: 160px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4); display: none;
}
.icmal-dropdown.open { display: block; }
.icmal-dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; font-size: 13px; color: var(--text2);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.icmal-dd-item:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.icmal-dd-item.danger:hover { background: rgba(248,113,113,0.1); color: var(--red); }
.icmal-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* Responsive */
@media(max-width:900px) {
  .icmal-thead, .icmal-ilce-header, .icmal-koy-header {
    grid-template-columns: 32px 1fr 90px 90px 80px 60px 80px 90px 90px;
  }
}
@media(max-width:768px) {
  .icmal-table-wrap { margin: 10px 12px; }
}

/* ── Modal form dark style ── */
.form-label { display: block; font-size: 12px; color: #a1a1aa; margin-bottom: 6px; font-weight: 500; }
.form-input {
  width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: #f4f4f5; border-radius: 8px; padding: 9px 12px;
  font-size: 13px; outline: none; font-family: inherit;
}
.form-input:focus { border-color: rgba(99,102,241,0.5); background: rgba(255,255,255,0.08); }
.form-input option, .form-input optgroup { background: #252530; color: #f4f4f5; }
select.form-input { cursor: pointer; }
select.form-input[size] { max-height: 200px; overflow-y: auto; padding: 4px; }
select.form-input[size] option { padding: 6px 8px; border-radius: 5px; cursor: pointer; }
select.form-input[size] option:hover { background: rgba(99,102,241,0.3); }
textarea.form-input { resize: vertical; min-height: 70px; }
.form-toggle-wrap { display: flex; align-items: center; cursor: pointer; }
.btn-modal-cancel {
  padding: 9px 18px; border-radius: 9px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05); color: #a1a1aa;
  cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.btn-modal-cancel:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-modal-save {
  padding: 9px 22px; border-radius: 9px; border: none;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35); transition: all 0.2s;
}
.btn-modal-save:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(99,102,241,0.45); }
.btn-modal-save:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

/* Responsive Form Row Grids & Mobile Modal Compacting */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.form-row-checkbox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

@media(max-width: 580px) {
  #kayitModal > div {
    max-height: calc(100dvh - 16px) !important;
    margin: 8px !important;
    border-radius: 12px !important;
  }
  #kayitModal .modal-body {
    padding: 10px 14px !important;
  }
  .form-row-2 {
    grid-template-columns: 1fr 1fr; /* Keep side-by-side on mobile but compact */
    gap: 8px;
    margin-bottom: 8px;
  }
  .form-row-3 {
    grid-template-columns: 1fr; /* Stack on mobile to prevent squishing */
    gap: 8px;
    margin-bottom: 8px;
  }
  .form-row-checkbox {
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 8px;
  }
  .form-label {
    font-size: 11px !important;
    margin-bottom: 4px !important;
  }
  .form-input {
    padding: 7px 10px !important;
    font-size: 12px !important;
    border-radius: 6px !important;
  }
  .form-toggle-wrap {
    padding-bottom: 6px !important;
  }
  textarea.form-input {
    min-height: 40px !important;
  }
}

/* ═══ DATE RANGE FILTER DROPDOWN ═══ */
.date-filter-container {
  position: relative;
  display: inline-block;
}

.date-filter-trigger {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--border) !important;
  color: var(--text2) !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: inherit;
  transition: all 0.2s;
  white-space: nowrap;
}

.date-filter-trigger:hover, .date-filter-trigger.active {
  border-color: rgba(99, 102, 241, 0.5) !important;
  color: #a5b4fc !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.date-filter-trigger .arrow-icon {
  transition: transform 0.2s;
}

.date-filter-trigger.active .arrow-icon {
  transform: rotate(180deg);
}

.date-filter-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  background: #1a1a24;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  overflow: hidden;
  animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 440px;
}

/* Left panel: Presets */
.df-presets {
  width: 200px;
  padding: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.df-preset-item {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.df-preset-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.df-preset-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

/* Right panel: Custom date inputs */
.df-custom {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 240px;
  background: rgba(255, 255, 255, 0.01);
}

.df-custom-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.df-custom-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.df-field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.df-date-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
  width: 100%;
}

.df-date-input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(0, 0, 0, 0.3);
}

.df-btn-apply {
  background: #6366f1;
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
  margin-top: 8px;
}

.df-btn-apply:hover {
  background: #4f46e5;
}

/* Responsive Overrides */
@media(max-width: 768px) {
  .date-filter-container {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
  }
  .date-filter-trigger {
    width: 100%;
    justify-content: space-between;
  }
  .date-filter-dropdown {
    width: 100%;
    min-width: unset;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 6px);
  }
  .df-presets {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 8px;
  }
  .df-custom {
    width: 100%;
  }
}

