:root {
  --primary: #0E5E3F; --primary-dark: #083B27; --primary-light: #1B8A5A;
  --secondary: #122E55; --accent: #F59E0B;
  --bg: #F1F5F9; --sidebar-bg: #0F172A; --card: #FFFFFF;
  --text: #0F172A; --text-muted: #64748B; --border: #E2E8F0;
  --radius: 10px; --transition: all 0.2s ease;
  --danger: #DC2626; --success: #059669;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* Login page */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #062D1E, #0E5E3F 50%, #122E55); padding: 24px; }
.login-card { background: white; padding: 44px 40px; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,0.25); width: 100%; max-width: 420px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.login-logo .mark { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 1.4rem; }
.login-logo strong { font-size: 1.25rem; color: var(--primary-dark); display: block; }
.login-logo small { font-size: 0.8rem; color: var(--text-muted); }
.login-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
.login-card > p { color: var(--text-muted); margin-bottom: 24px; font-size: 0.95rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 0.9rem; font-weight: 500; }
.field input, .field select, .field textarea { padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 0.95rem; transition: var(--transition); background: white; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,94,63,0.1); }
.field textarea { resize: vertical; min-height: 120px; font-family: inherit; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 0.92rem; transition: var(--transition); justify-content: center; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: #D97706; }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #B91C1C; }
.btn-block { width: 100%; padding: 13px; font-size: 1rem; }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.92rem; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.login-meta { margin-top: 20px; padding: 14px; background: var(--bg); border-radius: 8px; font-size: 0.85rem; color: var(--text-muted); }
.login-meta code { background: white; padding: 2px 6px; border-radius: 4px; color: var(--primary); border: 1px solid var(--border); }

/* Layout */
.admin-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: white; padding: 24px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 0 24px 28px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar-logo .mark { width: 38px; height: 38px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; }
.sidebar-logo strong { font-weight: 700; font-size: 1.05rem; }
.sidebar-logo small { font-size: 0.72rem; opacity: 0.6; display: block; }
.sidebar-nav { padding: 16px; list-style: none; }
.sidebar-nav li { margin-bottom: 4px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 8px; color: rgba(255,255,255,0.7); transition: var(--transition); font-size: 0.95rem; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: white; }
.sidebar-nav a.active { background: var(--primary); color: white; }
.sidebar-nav .icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-section { padding: 12px 18px 8px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.4); font-weight: 700; }
.sidebar-footer { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); background: var(--sidebar-bg); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; background: rgba(255,255,255,0.05); margin-bottom: 8px; }
.sidebar-user .avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--accent), #FCD34D); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; }
.sidebar-user-info strong { display: block; font-size: 0.9rem; }
.sidebar-user-info span { font-size: 0.78rem; opacity: 0.6; }

.main { padding: 28px 36px; }
.main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.main-header h1 { font-size: 1.6rem; font-weight: 700; }
.main-header p { color: var(--text-muted); font-size: 0.92rem; margin-top: 4px; }
.main-actions { display: flex; gap: 8px; }

/* Stat tiles */
.stats-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 20px; margin-bottom: 28px; }
.stat-tile { background: white; padding: 24px; border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.stat-tile .num { font-size: 2rem; font-weight: 800; color: var(--primary-dark); }
.stat-tile .label { color: var(--text-muted); font-size: 0.9rem; margin-top: 2px; }
.stat-tile .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

/* Tables */
.card { background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; margin-bottom: 24px; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.card-header h2 { font-size: 1.05rem; }
.card-body { padding: 22px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 22px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.table th { background: var(--bg); font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 0.78rem; letter-spacing: 0.04em; }
.table tr:hover { background: var(--bg); }
.table .actions { display: flex; gap: 6px; }
.table .actions a, .table .actions button { padding: 6px 12px; font-size: 0.82rem; border-radius: 6px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-blue { background: #DBEAFE; color: #1E40AF; }
.badge-gray { background: #F1F5F9; color: #475569; }

/* Form layouts */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-help { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg); border-radius: 8px; }
.checkbox-row input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); }

/* Settings tabs */
.settings-grid { display: grid; grid-template-columns: 220px 1fr; gap: 28px; }
.settings-tabs { list-style: none; }
.settings-tabs li { margin-bottom: 4px; }
.settings-tabs a { display: block; padding: 11px 16px; border-radius: 8px; color: var(--text); font-size: 0.95rem; transition: var(--transition); }
.settings-tabs a:hover, .settings-tabs a.active { background: var(--primary); color: white; }

.empty-state { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

@media (max-width: 980px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 20px; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
}
