/* Web-specific layout — admin dashboard */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}

.sidebar-logo {
  padding: 20px 20px 18px;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.sidebar-logo span { color: var(--accent); }

.nav-section-label {
  padding: 14px 20px 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  margin: 1px 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  background: none;
  width: calc(100% - 16px);
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.05);
}
.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 60px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

/* ── Page content ────────────────────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px 32px;
  max-width: 1400px;
}

/* ── KPI stat cards ──────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-1px); }
.stat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-blue   { background: rgba(59,130,246,0.12); color: #3B82F6; }
.stat-icon-green  { background: rgba(34,197,94,0.12);  color: #22C55E; }
.stat-icon-purple { background: rgba(168,85,247,0.12); color: #A855F7; }
.stat-icon-orange { background: rgba(249,115,22,0.12); color: #F97316; }
.stat-icon-teal   { background: rgba(20,184,166,0.12); color: #14B8A6; }
.stat-icon-accent { background: var(--accent-glow); color: var(--accent); }
.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: 14px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(0,0,0,0.02); }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}
.badge-active, .badge-available, .badge-online  { background: rgba(34,197,94,0.12);  color: #16A34A; }
.badge-suspended, .badge-offline, .badge-error  { background: rgba(239,68,68,0.12);  color: #DC2626; }
.badge-busy, .badge-charging                    { background: var(--accent-glow);     color: var(--accent); }
.badge-maintenance, .badge-pending              { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-completed                                { background: rgba(156,163,175,0.12); color: #6B7280; }
.badge-success                                  { background: rgba(34,197,94,0.12);  color: #16A34A; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover:not(:disabled) { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary  { background: var(--accent); color: #fff; box-shadow: 0 2px 8px var(--accent-glow); }
.btn-sm       { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn-danger   { background: rgba(239,68,68,0.1); color: #DC2626; }
.btn-success  { background: rgba(34,197,94,0.1); color: #16A34A; }
.btn-ghost    { background: rgba(0,0,0,0.05); color: var(--text-secondary); }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; align-items: center; }
.search-input, .filter-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus, .filter-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.25rem; align-items: center; }
.page-btn {
  padding: 6px 14px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--bg-secondary); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── States ──────────────────────────────────────────────────────────────── */
.loading-state { text-align: center; padding: 4rem; color: var(--text-secondary); }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 3rem; color: var(--text-secondary); font-size: 14px; }
.error-banner  { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); color: #DC2626; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 1rem; }
.success-banner { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.25); color: #16A34A; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 1rem; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.page-title { font-size: 1.4rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.3px; }

/* ── Responsive sidebar collapse ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-item span, .nav-section-label { display: none; }
  .nav-item { justify-content: center; padding: 11px; margin: 1px 4px; width: calc(100% - 8px); }
  .sidebar-logo { justify-content: center; padding: 16px 0 16px; }
  .page-content { padding: 20px 16px; }
}


/* ── RTL layout for admin sidebar ─────────────────────────────────────────── */
[dir="rtl"] .app-shell { flex-direction: row-reverse; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); box-shadow: -2px 0 12px rgba(0,0,0,0.04); }
[dir="rtl"] .main-content { direction: rtl; }
[dir="rtl"] .nav-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .sidebar-logo { flex-direction: row-reverse; }
