/* =============================================
   ZWET RIDE — ADMIN DASHBOARD STYLES
   Premium desktop-first admin panel
   ============================================= */

/* Login */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1A1A2E, #0A0A10);
  padding: 20px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-2xl);
  padding: 40px; box-shadow: var(--shadow-xl);
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-header h1 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; margin-top: 16px; color: var(--text); }
.login-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 6px; }
.form-group { margin-bottom: 16px; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }
.input-wrap {
  display: flex; align-items: center; background: var(--bg-secondary);
  border: 2px solid var(--border); border-radius: var(--radius-md); padding: 0 14px;
  transition: border-color 0.3s;
}
.input-wrap:focus-within { border-color: #8B5CF6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.input-wrap i { color: var(--text-muted); font-size: 0.9rem; width: 18px; }
.input-wrap input { flex: 1; padding: 14px 10px; background: transparent; color: var(--text); font-size: 0.95rem; border: none; outline: none; }
.btn-admin-primary {
  width: 100%; padding: 14px; background: #8B5CF6; color: white; border: none;
  border-radius: var(--radius-md); font-weight: 700; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s; margin-top: 8px;
}
.btn-admin-primary:hover { background: #7C3AED; transform: translateY(-2px); box-shadow: 0 4px 20px rgba(139,92,246,0.3); }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; width: auto; }

/* Dashboard Shell */
.dashboard-shell { display: flex; min-height: 100vh; background: var(--bg); }

/* Sidebar */
.sidebar {
  width: 260px; background: var(--bg-card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 200; transition: transform 0.3s;
}
.sidebar-logo {
  padding: 20px 24px; display: flex; align-items: center; gap: 10px;
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.sidebar-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--radius-md); color: var(--text-muted); font-weight: 600;
  font-size: 0.9rem; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.sidebar-item:hover { background: var(--bg-secondary); color: var(--text); }
.sidebar-item.active { background: rgba(139,92,246,0.1); color: #8B5CF6; }
.sidebar-item i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.su-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: rgba(139,92,246,0.1);
  color: #8B5CF6; display: flex; align-items: center; justify-content: center;
}
.su-name { font-weight: 700; font-size: 0.85rem; }
.su-role { font-size: 0.7rem; color: var(--text-muted); }
.btn-logout {
  width: 36px; height: 36px; border-radius: var(--radius-md); border: none;
  background: var(--bg-secondary); color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.btn-logout:hover { background: rgba(239,68,68,0.1); color: #EF4444; }

/* Main Content */
.main-content {
  flex: 1; margin-left: 260px; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* Topbar */
.topbar {
  height: 64px; background: var(--bg-glass-strong); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light); display: flex; align-items: center;
  padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100;
}
.menu-toggle {
  display: none; width: 40px; height: 40px; border: none; background: none;
  color: var(--text); font-size: 1.2rem; cursor: pointer;
}
.page-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 800; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-bar-admin {
  display: flex; align-items: center; gap: 8px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 0 14px;
}
.search-bar-admin input { padding: 10px 8px; background: transparent; color: var(--text); font-size: 0.85rem; border: none; outline: none; width: 200px; }
.search-bar-admin i { color: var(--text-muted); font-size: 0.85rem; }
.topbar-btn {
  width: 40px; height: 40px; border-radius: var(--radius-md); border: none;
  background: var(--bg-secondary); color: var(--text); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s; position: relative;
}
.topbar-btn:hover { background: var(--bg-tertiary); }
.notif-badge {
  position: absolute; top: -2px; right: -2px; width: 18px; height: 18px;
  background: #EF4444; color: white; border-radius: 50%; font-size: 0.65rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Pages */
.page { display: none; padding: 24px; animation: fadeIn 0.3s ease-out; }
.page.active-page { display: block; }
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h3 { font-size: 1.1rem; font-weight: 800; }

/* KPI Grid */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px;
  display: flex; align-items: center; gap: 14px;
  transition: all 0.3s; position: relative;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0;
}
.kpi-value { font-size: 1.5rem; font-weight: 900; }
.kpi-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.kpi-trend {
  position: absolute; top: 12px; right: 16px; font-size: 0.7rem; font-weight: 700;
  padding: 3px 8px; border-radius: var(--radius-full);
}
.kpi-trend.up { background: rgba(16,185,129,0.1); color: #10B981; }
.kpi-trend.down { background: rgba(239,68,68,0.1); color: #EF4444; }
.kpi-badge { position: absolute; top: 12px; right: 16px; font-size: 0.7rem; color: var(--text-muted); }

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px;
}
.chart-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 16px; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; border-radius: 6px 6px 0 0; min-height: 4px;
  transition: height 1s ease; position: relative; overflow: hidden;
}
.bar-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.bar-value { font-size: 0.6rem; font-weight: 700; }

/* Vehicle Distribution */
.dist-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.dist-label { width: 70px; font-size: 0.8rem; font-weight: 600; }
.dist-bar-bg {
  flex: 1; height: 10px; background: var(--bg-tertiary); border-radius: 10px; overflow: hidden;
}
.dist-bar-fill { height: 100%; border-radius: 10px; transition: width 1s ease; }
.dist-pct { font-size: 0.75rem; font-weight: 700; width: 35px; text-align: right; }

/* Activity Feed */
.activity-feed { max-height: 280px; overflow-y: auto; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: 0.85rem;
}
.activity-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0;
}
.activity-msg { flex: 1; line-height: 1.4; }
.activity-time { font-size: 0.7rem; color: var(--text-muted); white-space: nowrap; }

/* Data Tables */
.data-table-wrap { overflow-x: auto; }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
  background: var(--bg-card); border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border);
}
.data-table thead { background: var(--bg-secondary); }
.data-table th {
  padding: 14px 16px; text-align: left; font-weight: 700;
  color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap;
}
.data-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.data-table tr:hover td { background: var(--bg-secondary); }
.table-search {
  padding: 10px 16px; background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 0.85rem; outline: none; width: 240px;
}
.table-search:focus { border-color: #8B5CF6; }

.status-badge {
  font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-full);
  display: inline-block;
}
.badge-active, .badge-online, .badge-completed, .badge-verified { background: rgba(16,185,129,0.1); color: #10B981; }
.badge-blocked, .badge-offline, .badge-cancelled { background: rgba(239,68,68,0.1); color: #EF4444; }
.badge-ongoing, .badge-pending, .badge-monitoring { background: rgba(245,158,11,0.1); color: #F59E0B; }
.badge-expired, .badge-resolved { background: rgba(107,114,128,0.1); color: #6B7280; }

.action-btn {
  padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; margin-right: 4px;
}
.action-btn:hover { border-color: #8B5CF6; color: #8B5CF6; }

/* Filter Pills */
.filter-pills { display: flex; gap: 8px; }
.pill {
  padding: 8px 16px; border-radius: var(--radius-full); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.pill:hover, .pill.active { background: rgba(139,92,246,0.1); color: #8B5CF6; border-color: #8B5CF6; }

/* Pricing Grid */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 20px;
}
.pricing-card h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; font-size: 1rem; }
.pricing-row {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: 0.85rem;
}
.pricing-row:last-child { border-bottom: none; }
.pricing-val { font-weight: 700; }

/* Analytics */
.analytics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.analytics-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
}
.analytics-card h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.analytics-value { font-size: 2rem; font-weight: 900; }
.analytics-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Safety */
.safety-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.safety-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px; text-align: center;
}
.ss-value { font-size: 2rem; font-weight: 900; margin: 10px 0 4px; }
.ss-label { font-size: 0.8rem; color: var(--text-muted); }

/* Helpers */
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 32px; }
.mb-md { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .charts-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .search-bar-admin { display: none; }
}

@media (max-width: 640px) {
  .page { padding: 16px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 1.2rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}

/* Note: Shared button classes (.btn-site, .btn-site-primary, .btn-site-outline) are defined in shared/site.css */

/* ── Traffic Analytics ── */
.traffic-container { padding: 0 0 24px 0; }
.traffic-kpis .kpi-card { padding: 16px; }
.traffic-chart { overflow-x: auto; }
.traffic-bar { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; min-width:20px; }
.traffic-bar-inner { width:100%; border-radius:4px 4px 0 0; min-height:2px; transition:height 0.3s; position:relative; cursor:pointer; }
.traffic-bar-label { font-size:0.6rem; color:var(--text-muted); white-space:nowrap; transform:rotate(-45deg); margin-top:4px; }
.traffic-bar:hover .traffic-bar-inner { opacity:0.8; }
.traffic-breakdown { padding:4px 0; }
.traffic-breakdown-item { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--border); font-size:0.85rem; }
.traffic-breakdown-item:last-child { border-bottom:none; }
.traffic-breakdown-item .label { color:var(--text); font-weight:500; }
.traffic-breakdown-item .count { color:var(--text-muted); font-weight:600; }
.traffic-breakdown-item .bar-bg { flex:1; height:6px; background:var(--bg-secondary); border-radius:3px; margin:0 12px; overflow:hidden; }
.traffic-breakdown-item .bar-fill { height:100%; border-radius:3px; transition:width 0.5s; }
@media (max-width:768px) {
  .traffic-kpis .kpi-card { padding:12px; }
  .traffic-kpis .kpi-value { font-size:1.2rem; }
}

/* ── Settings ── */
.settings-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px;
}
.settings-card .card-header {
  font-size: 1rem; font-weight: 800; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--primary);
}
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.setting-item { display: flex; flex-direction: column; gap: 4px; }
.setting-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.setting-desc { font-size: 0.7rem; color: var(--text-muted); min-height: 1em; }
.setting-input {
  padding: 10px 12px; background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 0.9rem; outline: none; width: 100%;
  box-sizing: border-box; transition: border-color 0.2s;
}
.setting-input:focus { border-color: var(--primary); }
.setting-textarea {
  padding: 10px 12px; background: var(--bg-secondary); border: 2px solid var(--border);
  border-radius: var(--radius-md); color: var(--text); font-size: 0.85rem; outline: none; width: 100%;
  box-sizing: border-box; min-height: 60px; resize: vertical; font-family: inherit;
}
.setting-textarea:focus { border-color: var(--primary); }
.toggle-wrap { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-wrap input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 24px; transition: 0.3s;
}
.toggle-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 2px; bottom: 2px;
  background: white; border-radius: 50%; transition: 0.3s;
}
.toggle-wrap input:checked + .toggle-slider { background: var(--primary); border-color: var(--primary); }
.toggle-wrap input:checked + .toggle-slider::before { transform: translateX(20px); }
