/* ============================================================
   BİN ABİ (BA) - SUPERADMIN WEB DASHBOARD STYLES
   Desktop Full-Screen / Wide Web Layout
   Tasarım: index.html Teması (Açık Gri Zemin, Beyaz Lüks Kartlar,
   Koyu Füme Vurgular, Canlı Fıstık Yeşili & Zümrüt)
   ============================================================ */

:root {
  --admin-bg: #f3f4f8;
  --admin-sidebar-bg: #ffffff;
  --admin-card-bg: #ffffff;
  --admin-card-inner: #f8fafc;
  
  --primary-green: #6ebd14;
  --primary-green-dark: #589b0d;
  --primary-green-light: #74c816;
  --primary-green-soft: #eef8ce;
  --primary-green-text: #4d7c0f;
  
  --tag-green: #74c816;
  --tag-green-glow: rgba(116, 200, 22, 0.25);
  
  --blue: #0284c7;
  --purple: #0f172a;
  --gold: #f59e0b;
  --red: #ef4444;
  --accent-teal: #008779;
  
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --border: #f0f2f5;
  --border-light: #e5e7eb;
  --border-active: #d9f99d;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 25px rgba(15, 23, 42, 0.05);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

body.admin-web-body {
  background: var(--admin-bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
}

/* ADMIN WEB LAYOUT */
.admin-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR */
.admin-sidebar {
  width: 270px;
  background: var(--admin-sidebar-bg);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  flex-shrink: 0;
  box-shadow: 2px 0 20px rgba(15, 23, 42, 0.02);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-brand img {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
}

.role-tag {
  font-size: 10px;
  background: var(--primary-green-soft);
  color: var(--primary-green-text);
  border: 1px solid #d9f1a0;
  padding: 3px 8px;
  border-radius: 9999px;
  font-weight: 800;
  margin-left: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-link {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 16px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: #f8fafc;
  color: var(--text-primary);
  border-color: var(--border-light);
}

.nav-link.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.15);
}

.nav-link.active i {
  color: var(--tag-green);
}

.nav-counter {
  margin-left: auto;
  font-size: 11px;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 9999px;
  color: var(--text-muted);
  font-weight: 700;
}

.nav-counter.green {
  background: var(--primary-green-soft);
  color: var(--primary-green-text);
}

.nav-link.active .nav-counter {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-user-info i {
  font-size: 20px;
  color: var(--primary-green);
}

.admin-user-info strong {
  font-size: 12.5px;
  display: block;
  color: var(--text-primary);
}

.admin-user-info span {
  font-size: 10.5px;
  color: var(--text-muted);
}

.btn-logout {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fee2e2;
  padding: 9px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--red);
  color: #ffffff;
  border-color: var(--red);
}

/* MAIN CONTENT */
.admin-main-content {
  flex: 1;
  padding: 28px 34px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* SECTION VIEWS (TAB SWITCHING) */
.admin-section-view {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.admin-section-view.active {
  display: flex;
  animation: fadeIn 0.2s ease-in;
}

/* TOPBAR */
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.topbar-left p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.live-pill-beacon {
  background: var(--primary-green-soft);
  color: var(--primary-green-text);
  border: 1px solid #d9f1a0;
  font-size: 11.5px;
  font-weight: 800;
  padding: 7px 14px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tag-green);
  box-shadow: 0 0 8px var(--tag-green);
  animation: pulseGreen 1.5s infinite;
}

.btn-refresh {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.btn-refresh:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.kpi-icon.blue { background: #e0f2fe; color: #0284c7; }
.kpi-icon.purple { background: #f1f5f9; color: #0f172a; }
.kpi-icon.green { background: var(--primary-green-soft); color: var(--primary-green-text); }
.kpi-icon.gold { background: #fef3c7; color: #d97706; }

.kpi-data .label {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.kpi-data .number {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  display: block;
  margin: 2px 0;
}

.kpi-data .trend {
  font-size: 11.5px;
  font-weight: 700;
}

.kpi-data .trend.pos { color: var(--primary-green-text); }

/* SECTIONS */
.admin-card-section {
  background: var(--admin-card-bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-head h3 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-sub {
  font-size: 11.5px;
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 9999px;
  color: var(--text-muted);
  font-weight: 700;
}

.btn-sub-action {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sub-action:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.table-search-box {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 280px;
}

.table-search-box i {
  color: var(--text-dim);
  font-size: 13px;
}

.table-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  font-family: var(--font-body);
}

/* GAUGES */
.efficiency-gauges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.gauge-card {
  background: var(--admin-card-inner);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.g-title {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
}

.g-val {
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 800;
  color: var(--text-primary);
}

.text-success { color: var(--primary-green-text); }
.text-blue { color: #0284c7; }
.text-accent { color: var(--primary-green-dark); }

.g-bar {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 4px 0;
}

.g-bar .fill {
  height: 100%;
  background: var(--primary-green);
  border-radius: 9999px;
}

.g-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* DATA TABLE */
.table-container {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.data-table th {
  padding: 12px 14px;
  color: var(--text-muted);
  border-bottom: 1.5px solid var(--border-light);
  font-weight: 700;
  white-space: nowrap;
}

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  white-space: nowrap;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.status-badge {
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
}

.status-badge.active { background: #e0f2fe; color: #0284c7; }
.status-badge.completed { background: var(--primary-green-soft); color: var(--primary-green-text); }
.status-badge.online { background: var(--primary-green-soft); color: var(--primary-green-text); }
.status-badge.offline { background: #fef2f2; color: var(--red); }

.pref-pill {
  font-size: 11px;
  background: #f1f5f9;
  padding: 3px 8px;
  border-radius: 9999px;
  color: #475569;
  font-weight: 600;
}

/* SETTINGS FORM GRID */
.settings-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--admin-card-inner);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 16px;
}

.setting-field label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.setting-field label i {
  color: var(--primary-green);
}

.setting-field input {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.setting-field input:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(110, 189, 20, 0.15);
}

.setting-field small {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-save-params {
  background: var(--primary-green);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 13px 24px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(110, 189, 20, 0.3);
  transition: all 0.2s ease;
}

.btn-save-params:hover {
  background: var(--primary-green-dark);
}

/* ANIMATIONS */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(116, 200, 22, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(116, 200, 22, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(116, 200, 22, 0); }
}

@media (max-width: 1100px) {
  .kpi-grid, .efficiency-gauges-grid, .settings-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   FLEET LOSS ALERT & MODAL STYLES
   ============================================================ */
.fleet-loss-alert-banner {
  background: #fef2f2;
  border: 1px solid #fee2e2;
  border-left: 4px solid var(--red);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #991b1b;
  font-size: 13px;
}
.fleet-loss-alert-banner i {
  font-size: 20px;
  color: var(--red);
}
.fleet-loss-alert-banner strong {
  color: #7f1d1d;
  margin-right: 6px;
}

.row-loss-warning {
  background: #fef2f2 !important;
}
.row-loss-warning:hover td {
  background: #fee2e2 !important;
}

.badge-loss-alert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fee2e2;
  color: var(--red);
  border: 1px solid #fecaca;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* ADMIN DETAIL MODAL */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.admin-modal-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 24px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
}
.admin-modal-header {
  padding: 20px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.admin-modal-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-green-soft);
  color: var(--primary-green-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.admin-modal-icon-badge.driver {
  background: #e0f2fe;
  color: #0284c7;
}
.admin-modal-icon-badge.loss {
  background: #fee2e2;
  color: var(--red);
}
.admin-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.admin-modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.profile-meta-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-meta-card .lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}
.profile-meta-card .val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}
.profile-detail-section {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 18px;
}
.profile-detail-section h4 {
  margin: 0 0 10px 0;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.profile-info-row:last-child {
  border-bottom: none;
}
.profile-info-row .k {
  color: var(--text-muted);
}
.profile-info-row .v {
  color: var(--text-primary);
  font-weight: 700;
}
