/* Oga Tailor Admin - Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #0c0e14;
  --bg-elevated: #14171f;
  --bg-card: #1a1e28;
  --bg-hover: rgba(255,255,255,0.04);
  --bg-stripe: rgba(255,255,255,0.02);
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --text: #f0f2f5;
  --text-muted: #8b92a3;
  --text-dim: #5c6370;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-muted: rgba(16,185,129,0.15);
  --accent-glow: rgba(16,185,129,0.25);
  --accent-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --danger: #ef4444;
  --danger-muted: rgba(239,68,68,0.15);
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.15);
  --shadow-card-hover: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.2);
  --shadow-subtle: 0 1px 3px rgba(0,0,0,0.12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --spacing-page: 32px;
  --transition: 0.2s ease;
  --section-gap: 28px;
}

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

body {
  font-family: var(--font);
  background: linear-gradient(165deg, var(--bg) 0%, #0d0f14 35%, #0f1218 70%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Login */
body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #0c0e14 0%, #1a1e28 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(22,26,35,0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 52px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.02) inset;
}

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

.login-header .logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.login-header h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.login-header p { color: var(--text-muted); font-size: 15px; }

.login-form .field { margin-bottom: 20px; }
.login-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-form .error,
.login-form .login-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-form .login-success {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-form .login-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
}
.login-form .login-footer a { color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  width: 100%;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(16,185,129,0.4);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-1px);
}

.btn-sm { padding: 10px 18px; font-size: 13px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* App layout */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--bg-elevated) 0%, rgba(16,19,26,0.98) 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 4px 0 32px rgba(0,0,0,0.25);
}

.sidebar-brand {
  padding: 32px 28px;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, transparent 0%, rgba(16,185,129,0.03) 100%);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 4px;
}

.nav-item:hover { color: var(--text); background: var(--bg-hover); }
.nav-item.active {
  color: var(--accent);
  background: var(--accent-muted);
  border-left: 3px solid var(--accent);
  margin-left: -3px;
  padding-left: 21px;
}

.nav-item .icon { font-size: 18px; opacity: 0.8; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.admin-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(22,26,35,0.9) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
}

.admin-avatar img { width: 100%; height: 100%; object-fit: cover; }

.admin-info { flex: 1; min-width: 0; }
.admin-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-logout {
  display: block;
  width: 100%;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-logout:hover { color: var(--danger); border-color: var(--danger); }

.main-content {
  flex: 1;
  padding: var(--spacing-page);
  overflow-y: auto;
  min-width: 0;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards */
.card {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(22,26,35,0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: var(--section-gap);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.02) inset;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-card-hover), 0 0 0 1px rgba(255,255,255,0.03) inset;
  border-color: var(--border-strong);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
}

.card-title::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.6;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(22,27,36,0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,0.02) inset;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at top right, var(--accent-muted), transparent);
  opacity: 0.4;
  border-radius: 50%;
}

.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover), 0 0 0 1px rgba(255,255,255,0.03) inset;
}

.stats-grid-icons .stat-card { display: flex; flex-direction: column; position: relative; padding-left: 56px; }
.stats-grid-icons .stat-icon {
  position: absolute;
  left: 20px;
  top: 24px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stats-grid-icons .stat-icon svg { width: 20px; height: 20px; }
.stat-icon-users { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.stat-icon-customers { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.stat-icon-orders { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.stat-icon-invoices { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-icon-revenue { background: rgba(16, 185, 129, 0.15); color: var(--accent); }

.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; }
.stat-delta { font-size: 12px; font-weight: 600; display: block; margin-top: 6px; }
.stat-delta.positive { color: var(--accent); }
.stat-delta.negative { color: var(--danger); }

/* Dashboard hero */
.dashboard-hero { margin-bottom: 28px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}
.hero-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.hero-value { font-size: 32px; font-weight: 700; display: block; margin-bottom: 6px; }
.hero-label { font-size: 13px; color: var(--text-muted); }

/* Activity chart */
.activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  margin-bottom: 12px;
}
.activity-bar {
  flex: 1;
  min-width: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}
.activity-fill {
  display: block;
  width: 100%;
  min-height: 4px;
  background: linear-gradient(180deg, var(--accent), #34d399);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.2s;
}
.activity-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

/* Forms */
.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:hover {
  border-color: var(--border-strong);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-row { display: flex; gap: 24px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* Form sections */
.form-section {
  margin-bottom: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
}

.form-section:first-child {
  border-top: none;
  padding-top: 0;
}

/* Tables */
/* Measurement fields - premium layout */
.measurements-section { max-width: 860px; }

/* Measurement tabs - per-gender view */
.measurement-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.measurement-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.measurement-tab:hover { color: var(--text); background: var(--bg-hover); }
.measurement-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.measurement-tab-panel { margin-top: 8px; }
.measurement-tab-hint {
  font-size: 13px;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.measurement-field-card-tab {
  display: flex;
  align-items: center;
  gap: 12px;
}
.measurement-position {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.measurement-label-display {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}
.measurement-key-badge {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--bg);
  border-radius: 6px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}
.measurement-scope-badge {
  font-size: 11px;
  padding: 4px 8px;
  background: var(--accent-muted);
  color: var(--accent);
  border-radius: 6px;
}
.measurement-edit-all summary::-webkit-details-marker { display: none; }
.measurement-edit-all summary::marker { content: none; }

/* Empty state when no fields for a gender */
.measurement-empty-state {
  padding: 24px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
}
.measurement-empty-state p { margin-bottom: 8px; }
.measurement-empty-state p:last-child { margin-bottom: 0; }
.measurement-empty-state strong { color: var(--text); }

/* Drag feedback */
.measurement-field-card-tab[draggable="true"] { cursor: grab; }
.measurement-field-card-tab[draggable="true"]:active { cursor: grabbing; }
.measurement-field-card-tab.measurement-dragging {
  opacity: 0.6;
  cursor: grabbing;
}
.measurement-field-card-tab.measurement-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-muted);
}
.measurements-header {
  margin-bottom: 28px;
}
.measurements-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.measurements-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}
.measurements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.measurement-field-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.measurement-field-card:hover { border-color: var(--border-strong); }
.measurement-field-card:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-muted); }
.measurement-field-card:has(.measurement-toggle-input:not(:checked)) { opacity: 0.65; }
.measurement-field-card:has(.measurement-toggle-input:not(:checked)) .measurement-fields-row input,
.measurement-field-card:has(.measurement-toggle-input:not(:checked)) .measurement-fields-row select { opacity: 0.8; }
.measurement-drag {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: grab;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.measurement-drag:hover { color: var(--text-muted); background: var(--bg-hover); }
.measurement-drag:active { cursor: grabbing; }
.measurement-drag svg { width: 18px; height: 18px; opacity: 0.8; }
.measurement-fields-row {
  flex: 1;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}
.measurement-field-key {
  flex: 0 0 160px;
  min-width: 140px;
}
.measurement-field-key .form-control {
  font-family: ui-monospace, monospace;
  font-size: 13px;
}
.measurement-field-label { flex: 1; min-width: 180px; }
.measurement-field-gender { flex: 0 0 120px; }
.measurement-field-gender .form-control {
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}
.measurement-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.measurement-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.measurement-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  display: block;
}
.measurement-toggle-input:checked + .measurement-toggle { background: var(--accent-muted); border-color: var(--accent); }
.measurement-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.measurement-toggle-input:checked + .measurement-toggle::after {
  transform: translateX(20px);
  background: var(--accent);
}
.measurement-toggle-input { display: none; }
.measurement-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}
.measurement-btn-up, .measurement-btn-down {
  background: transparent;
  color: var(--text-muted);
}
.measurement-btn-up:hover, .measurement-btn-down:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.measurement-btn-delete {
  background: transparent;
  color: var(--text-dim);
}
.measurement-btn-delete:hover { background: var(--danger-muted); color: var(--danger); }
.measurements-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.measurements-footer .btn-add-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.measurements-footer .btn-add-field:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-muted);
}
.measurements-footer .btn-save {
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
}
@media (max-width: 768px) {
  .measurement-field-card { flex-wrap: wrap; }
  .measurement-fields-row { flex-direction: column; align-items: stretch; }
  .measurement-field-key, .measurement-field-label, .measurement-field-gender { flex: 1 1 100%; }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

.data-table th, .data-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table thead {
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
}

.data-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 20px;
}

.data-table tbody tr:nth-child(even) {
  background: var(--bg-stripe);
}

.data-table tbody tr:hover td {
  background: var(--bg-hover);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Messages */
.alert {
  padding: 16px 22px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  border: 1px solid transparent;
  font-weight: 500;
  line-height: 1.5;
}

.alert-success {
  background: linear-gradient(135deg, var(--accent-muted) 0%, rgba(16,185,129,0.08) 100%);
  color: var(--accent);
  border-color: rgba(16,185,129,0.2);
}

.alert-error {
  background: linear-gradient(135deg, var(--danger-muted) 0%, rgba(239,68,68,0.08) 100%);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.alert-info {
  background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.06) 100%);
  color: var(--info);
  border-color: rgba(59,130,246,0.2);
}

/* Bars */
.bar {
  display: grid;
  grid-template-columns: 120px 1fr 40px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}

.bar span:first-child { color: var(--text-muted); }
.bar span:last-child { color: var(--text-muted); font-weight: 500; }

.bar-fill-wrap {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  border-radius: 999px;
  transition: width 0.3s;
}

/* Pills */
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pill-success {
  background: linear-gradient(135deg, var(--accent-muted) 0%, rgba(16,185,129,0.08) 100%);
  color: var(--accent);
  border: 1px solid rgba(16,185,129,0.2);
}

.pill-warning {
  background: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(245,158,11,0.08) 100%);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,0.2);
}

.pill-muted {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* Avatar upload */
.avatar-upload {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.avatar-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--bg-elevated);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
}

.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

.avatar-actions { display: flex; flex-direction: column; gap: 8px; }

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -5px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255,255,255,0.03);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(16,185,129,0.08);
}

/* Report cards */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.report-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

/* Reports page */
.reports-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.reports-filters { margin-bottom: 24px; }
.reports-filter-form .filter-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.reports-filter-form .filter-group { min-width: 140px; }
.reports-filter-form .filter-search { flex: 1; min-width: 180px; }
.reports-filter-form .filter-submit { flex-shrink: 0; }

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.analytics-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(26,30,40,0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  display: flex;
  align-items: center;
  gap: 22px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
}
.analytics-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}
.analytics-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.analytics-icon svg { width: 24px; height: 24px; }
.analytics-icon-users { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.analytics-icon-customers { background: rgba(16, 185, 129, 0.15); color: var(--accent); }
.analytics-icon-orders { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.analytics-icon-revenue { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.analytics-content { min-width: 0; }
.analytics-value { font-size: 26px; font-weight: 700; display: block; line-height: 1.2; }
.analytics-label { font-size: 13px; color: var(--text-muted); }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 24px 0 0;
  margin-top: 24px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.pagination-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-links a,
.pagination-links span {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}

.pagination-links a:hover {
  background: var(--bg-hover);
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 12px;
  }
  .sidebar-brand { border: none; padding: 0; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
  .nav-section { display: none; }
  .sidebar-footer { margin-left: auto; border: none; padding: 0; flex-direction: row; align-items: center; gap: 12px; }
  .admin-profile { margin: 0; }
  .main-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.muted { color: var(--text-muted); font-size: 13px; }

/* Checkbox/switch */
.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.inline-form select {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color var(--transition);
}

.inline-form select:hover {
  border-color: var(--border-strong);
}

.inline-form select:focus {
  outline: none;
  border-color: var(--accent);
}

.upcoming-list {
  list-style: none;
}

.upcoming-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background 0.15s;
}

.upcoming-list li:hover {
  background: var(--bg-hover);
  margin: 0 -28px;
  padding-left: 28px;
  padding-right: 28px;
}

.upcoming-list li:last-child {
  border-bottom: none;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-content {
  position: relative;
  background: linear-gradient(145deg, var(--bg-card) 0%, rgba(22,26,35,0.98) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.02) inset;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 6px; margin-bottom: 4px; }
.actions-cell .inline-form { display: inline; }

/* Breadcrumbs */
.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.breadcrumbs a { color: var(--accent); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs span { color: var(--text-dim); }

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 16px;
}

.detail-grid dt {
  color: var(--text-muted);
  font-size: 13px;
}

.detail-grid dd {
  min-width: 0;
  word-break: break-word;
}

.detail-grid code {
  display: inline-block;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Loading */
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
