/* ============================================================
   admin/assets/admin.css — Stylesheet Dashboard Admin
   ============================================================ */

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

:root {
  --sidebar-w:   240px;
  --brand:       #2563eb;
  --brand-dark:  #1e40af;
  --danger:      #dc2626;
  --success:     #16a34a;
  --warning:     #d97706;
  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --muted:       #64748b;
  --radius:      8px;
  --shadow:      0 1px 6px rgba(0,0,0,.08);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w); background: var(--text);
  color: #cbd5e1; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; z-index: 50;
}
.sidebar-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 1.25rem 1rem; border-bottom: 1px solid #334155;
}
.sidebar-brand span { font-size: 1.5rem; }
.sidebar-brand strong { display: block; color: #fff; font-size: .95rem; }
.sidebar-brand small { color: #94a3b8; font-size: .75rem; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.nav-item {
  display: block; padding: .7rem 1.25rem;
  color: #94a3b8; font-size: .9rem;
  transition: .15s;
}
.nav-item:hover { background: #1e293b; color: #fff; text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar-footer {
  padding: 1rem; border-top: 1px solid #334155;
  display: flex; align-items: center; justify-content: space-between;
  font-size: .8rem;
}
.btn-logout {
  color: #f87171; font-size: .8rem; padding: .3rem .7rem;
  border: 1px solid #f87171; border-radius: 5px;
}
.btn-logout:hover { background: #f87171; color: #fff; text-decoration: none; }

/* --- Main wrap --- */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* --- Page header --- */
.page-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.page-header h1 { font-size: 1.2rem; }
.page-content { padding: 1.5rem; flex: 1; }

/* --- Flash --- */
.flash {
  margin: 1rem 1.5rem 0;
  padding: .85rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
}
.flash-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.flash-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* --- Stats cards (dashboard) --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.25rem; border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
}
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat-card .stat-label { font-size: .85rem; color: var(--muted); margin-top: .2rem; }

/* --- Table --- */
.table-wrap { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th { background: var(--bg); padding: .75rem 1rem; text-align: left; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); }
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.badge-on  { background: #dcfce7; color: #166534; }
.badge-off { background: #fee2e2; color: #991b1b; }

/* --- Buttons --- */
.btn { display: inline-block; padding: .5rem 1.1rem; border-radius: var(--radius); font-size: .875rem; font-weight: 600; cursor: pointer; border: none; transition: .15s; text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-edit   { background: #fef3c7; color: #92400e; }
.btn-edit:hover { background: #fde68a; text-decoration: none; }
.btn-delete { background: #fee2e2; color: var(--danger); }
.btn-delete:hover { background: #fca5a5; text-decoration: none; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #cbd5e1; text-decoration: none; }

/* --- Form --- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; max-width: 720px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .6rem .85rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; font-family: inherit;
  transition: border-color .15s;
}
.form-control:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* --- Login page --- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); margin-left: 0 !important; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2.5rem; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-box h1 { font-size: 1.4rem; margin-bottom: .25rem; }
.login-box p { color: var(--muted); font-size: .875rem; margin-bottom: 1.75rem; }
.login-box .btn { width: 100%; text-align: center; padding: .7rem; margin-top: .5rem; }

/* --- Section title in page --- */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.section-header h2 { font-size: 1rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
