/* ==========================================================================
   iSafedrive Admin Command Center — Styles
   ========================================================================== */

/* ---- Layout ---- */
body { overflow: hidden; color: #1c1c1e; background: #f2f2f7; }
body .splash-screen { position: fixed; inset: 0; z-index: 9999; }

/* Global text visibility fix — nothing should be invisible */
*, *::before, *::after { color: inherit; }
.admin-content, .admin-content * { color: inherit; }
body, body * { color: #1c1c1e; }

/* All card/panel text must be visible */
.kpi-card, .entity-card, .admin-table-wrap, .pricing-card, .admin-chart, .zone-card, .admin-modal, .card-grid, .detail-grid, .detail-item, .pricing-row, .section-header { color: #1c1c1e !important; }
.kpi-card *, .entity-card *, .pricing-card *, .zone-card *, .admin-chart * { color: inherit; }
.kpi-card .kpi-value, .kpi-card .kpi-label { color: inherit !important; }
.kpi-card .kpi-value { color: #1c1c1e !important; }
.kpi-card .kpi-label { color: #6b7280 !important; }
.kpi-card.accent .kpi-value { color: #fff !important; }
.kpi-card.accent .kpi-label { color: rgba(255,255,255,0.85) !important; }
.kpi-card.accent .kpi-change { color: rgba(255,255,255,0.9) !important; background: rgba(255,255,255,0.2) !important; }

/* Tables */
.admin-table th, .admin-table td, .admin-table * { color: inherit !important; }
.admin-table th { color: #6b7280 !important; }
.admin-table td { color: #1c1c1e !important; }

/* Badges — always readable */
.badge, .badge * { color: inherit; }
.badge-green { color: #166534 !important; background: #dcfce7 !important; }
.badge-red { color: #991b1b !important; background: #fee2e2 !important; }
.badge-yellow { color: #92400e !important; background: #fef3c7 !important; }
.badge-blue { color: #1e40af !important; background: #dbeafe !important; }
.badge-gray { color: #374151 !important; background: #f3f4f6 !important; }
.badge-purple { color: #6d28d9 !important; background: #ede9fe !important; }

/* Entity cards */
.entity-card .name, .entity-card .meta, .entity-row .label, .entity-row .val { color: inherit !important; }
.entity-card .name { color: #1c1c1e !important; }
.entity-card .meta { color: #6b7280 !important; }
.entity-row .label { color: #6b7280 !important; }
.entity-row .val { color: #1c1c1e !important; }

/* Pricing */
.pricing-row .pr-label, .pricing-row .pr-value, .pricing-row .pr-value * { color: inherit !important; }
.pricing-row .pr-label { color: #1c1c1e !important; }
.pricing-row .pr-value { color: #1c1c1e !important; }
.pricing-row input { color: #1c1c1e !important; }

/* Section titles */
.section-title, .section-subtitle { color: inherit !important; }
.section-title { color: #1c1c1e !important; }
.section-subtitle { color: #6b7280 !important; }

/* Detail modals */
.detail-item .d-label, .detail-item .d-value, .detail-item * { color: inherit !important; }
.detail-item .d-label { color: #6b7280 !important; }
.detail-item .d-value { color: #1c1c1e !important; }

/* Charts */
.chart-lbl { color: #6b7280 !important; }
.chart-val { color: #1c1c1e !important; }
.chart-fill { color: transparent !important; }

/* Modal */
.admin-modal, .admin-modal * { color: inherit; }
.admin-modal { color: #1c1c1e !important; }
.admin-modal-title { color: #1c1c1e !important; }
.admin-form-label { color: #6b7280 !important; }
.admin-form-input { color: #1c1c1e !important; }
.admin-form-input::placeholder { color: #9ca3af !important; }
.admin-form-select { color: #1c1c1e !important; }
.admin-form-textarea { color: #1c1c1e !important; }
.admin-btn { color: inherit !important; }
.admin-btn-primary { color: #fff !important; }
.admin-btn-ghost { color: #1c1c1e !important; }

/* Zones */
.zone-name { color: #1c1c1e !important; }
.zone-meta { color: #6b7280 !important; }
.zone-tag { color: #374151 !important; background: #f3f4f6 !important; }

/* Audit */
.audit-entry .a-action, .audit-entry .a-meta { color: inherit !important; }
.audit-entry .a-action { color: #1c1c1e !important; }
.audit-entry .a-meta { color: #6b7280 !important; }

/* Search */
.search-result-item, .search-result-item * { color: inherit !important; }
.search-result-item .sr-text { color: #1c1c1e !important; }
.search-result-item .sr-label { color: #6b7280 !important; }

/* Empty state */
.empty-state, .empty-state * { color: inherit !important; }
.empty-state { color: #6b7280 !important; }
.empty-state .empty-title { color: #1c1c1e !important; }

/* Topbar pills — must be clickable */
.topbar-pill, .topbar-pill span { color: #1c1c1e !important; }
.topbar-pill { z-index: 150; position: relative; }
.badge-gray { color: #374151 !important; background: #f3f4f6 !important; }
.badge-purple { color: #6d28d9 !important; }
.kpi-card.accent .kpi-value { color: #ffffff !important; }
.kpi-card.accent .kpi-label { color: rgba(255,255,255,0.85) !important; }
.kpi-card.accent .kpi-change { color: rgba(255,255,255,0.9) !important; background: rgba(255,255,255,0.2) !important; }

/* Sidebar */
.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: #0f172a;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-section { padding: 4px 0; }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}

.sidebar-item.active {
  color: #fff;
  background: rgba(20,99,255,0.2);
  border-left-color: #1463ff;
  font-weight: 600;
}

.sidebar-item .icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* Mobile toggle */
.admin-menu-toggle {
  display: none;
  position: fixed;
  top: 12px; left: 12px;
  z-index: 1200;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}

/* Main area */
.admin-main {
  margin-left: 240px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.admin-topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 1px solid rgba(60,60,67,0.1);
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left { flex-shrink: 0; }
.brand-mobile { display: none; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; color: var(--text); }

.topbar-search {
  flex: 1;
  max-width: 500px;
  position: relative;
  display: flex;
  align-items: center;
  background: #f2f2f7;
  border-radius: 12px;
  padding: 0 12px;
  height: 38px;
  gap: 8px;
}

.search-icon { font-size: 14px; color: var(--muted); }

.topbar-search input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}

.topbar-search input::placeholder { color: var(--faint); }

.search-results {
  position: absolute;
  top: 44px; left: 0; right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  border: 1px solid var(--line);
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-size: 13px;
}

.search-result-item:hover { background: #f2f2f7; }
.search-result-item .sr-icon { font-size: 18px; }
.search-result-item .sr-text { flex: 1; }
.search-result-item .sr-label { font-size: 11px; color: var(--muted); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: #f2f2f7;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.topbar-pill:hover { background: #e5e5ea; }

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.alert-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.admin-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Content */
.admin-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f2f2f7;
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid rgba(60,60,67,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.kpi-card .kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-top: 2px;
}

.kpi-card .kpi-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
}

.kpi-card .kpi-change.up { background: #dcfce7; color: #166534; }
.kpi-card .kpi-change.down { background: #fee2e2; color: #991b1b; }

.kpi-card.accent {
  background: linear-gradient(135deg, #1463ff, #0a3fd3);
  color: #fff;
}

.kpi-card.accent .kpi-value { color: #fff; }
.kpi-card.accent .kpi-label { color: rgba(255,255,255,0.7); }
.kpi-card.accent .kpi-change { background: rgba(255,255,255,0.2); color: #fff; }

/* ---- Section ---- */
.admin-section { margin-bottom: 24px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.section-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---- Tables ---- */
.admin-table-wrap {
  background: #fff;
  border-radius: 14px;
  border: 1px solid rgba(60,60,67,0.08);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid rgba(60,60,67,0.06);
}

.admin-table th {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f9f9fb;
  position: sticky;
  top: 0;
}

.admin-table tr:hover td { background: #f9f9fb; }
.admin-table tr:last-child td { border-bottom: none; }

.admin-table .avatar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-table .avatar-sm {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ---- Buttons ---- */
.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.admin-btn-primary { background: var(--accent); color: #fff; }
.admin-btn-primary:hover { background: #0a3fd3; }
.admin-btn-ghost { background: #f2f2f7; color: var(--text); border: 1px solid rgba(60,60,67,0.12); }
.admin-btn-ghost:hover { background: #e5e5ea; }
.admin-btn-danger { background: #fff; color: #ef4444; border: 1px solid #ef4444; }
.admin-btn-success { background: #22c55e; color: #fff; }
.admin-btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }

/* ---- Segmented controls ---- */
.admin-seg {
  display: inline-flex;
  background: #f2f2f7;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.admin-seg button {
  border: none;
  background: none;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.admin-seg button.on {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ---- Chart ---- */
.admin-chart {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(60,60,67,0.08);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 160px;
  padding-top: 10px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.5s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
}

.chart-fill.blue { background: #1463ff; }
.chart-fill.green { background: #22c55e; }
.chart-fill.red { background: #ef4444; }
.chart-fill.purple { background: #7c5cff; }

.chart-lbl { font-size: 9px; color: var(--muted); font-weight: 600; }
.chart-val { font-size: 10px; font-weight: 700; }

/* ---- Map ---- */
.admin-map {
  width: 100%;
  height: 500px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(60,60,67,0.08);
}

/* ---- Grid cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.entity-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(60,60,67,0.08);
  cursor: pointer;
  transition: all 0.15s;
}

.entity-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.entity-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.entity-card .name { font-weight: 600; font-size: 15px; }
.entity-card .meta { font-size: 12px; color: var(--muted); }

.entity-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entity-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.entity-row .label { color: var(--muted); }
.entity-row .val { font-weight: 600; }

/* ---- Modal ---- */
.admin-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.admin-modal {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  animation: modalSlideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-modal-title {
  font-size: 20px;
  font-weight: 700;
}

.admin-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: #f2f2f7;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Form ---- */
.admin-form-group {
  margin-bottom: 14px;
}

.admin-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-form-input {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.admin-form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(20,99,255,0.1); }

.admin-form-select {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.admin-form-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  font-family: inherit;
  resize: vertical;
}

/* ---- Tabs ---- */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f2f2f7;
  margin-bottom: 16px;
}

.admin-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---- Detail panel ---- */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.detail-item .d-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.detail-item .d-value {
  font-size: 15px;
  font-weight: 600;
  margin-top: 2px;
}

/* ---- Pricing cards ---- */
.pricing-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(60,60,67,0.08);
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(60,60,67,0.06);
}

.pricing-row:last-child { border-bottom: none; }

.pricing-row .pr-label {
  font-size: 14px;
  color: var(--text);
}

.pricing-row .pr-value {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-row input {
  width: 120px;
  height: 36px;
  border: 1px solid rgba(60,60,67,0.12);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  outline: none;
}

.pricing-row input:focus { border-color: var(--accent); }

/* ---- Two-col layout ---- */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.admin-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* ---- Geofence zone ---- */
.zone-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(60,60,67,0.08);
  border-left: 4px solid var(--accent);
}

.zone-card .zone-name {
  font-weight: 600;
  font-size: 15px;
}

.zone-card .zone-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.zone-card .zone-props {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.zone-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f2f2f7;
  color: var(--text2);
}

/* ---- Timeline ---- */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.audit-entry {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(60,60,67,0.06);
}

.audit-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
}

.audit-entry .a-action { font-weight: 600; font-size: 14px; }
.audit-entry .a-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- Notification form ---- */
.notif-target-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.notif-target-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1.5px solid rgba(60,60,67,0.12);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}

.notif-target-chip.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-size: 17px; font-weight: 600; color: var(--text); }
.empty-state .empty-desc { font-size: 13px; margin-top: 4px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .admin-menu-toggle { display: flex; }
  .brand-mobile { display: flex; }
  .admin-grid-2, .admin-grid-3 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .admin-content { padding: 16px; padding-top: 60px; }
  .admin-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 900; }
}

@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: linear-gradient(135deg, #f2f2f7 0%, #e8f0fe 50%, #dbeafe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1);
  border: 1px solid rgba(60,60,67,0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header svg {
  margin-bottom: 12px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  color: #1c1c1e;
  letter-spacing: -0.02em;
}

.login-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

.login-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  height: 48px;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  color: #1c1c1e;
  background: #f9fafb;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}

.login-field input:focus {
  border-color: #1463ff;
  box-shadow: 0 0 0 3px rgba(20,99,255,0.1);
  background: #fff;
}

.login-field input::placeholder {
  color: #9ca3af;
}

.login-btn {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 12px;
  background: #1463ff;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}

.login-btn:hover {
  background: #0a3fd3;
}

.login-btn:active {
  transform: scale(0.98);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: #9ca3af;
}
