/* ============================================================
   Zepey — base styles
   ============================================================ */

:root {
  --dark: #2c2c2c;
  --accent: #6370a4;
  --ah: #545f8e;
  --bg: #f0f1f6;
  --card: #fff;
  --bdr: #d5d9e5;
  --muted: #7a7f8e;
  --text: #2c2c2c;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --r: 12px;
  --input-bg: #ebeeff;
  --topbar-bg: #6370a4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, button, textarea, select { font: inherit; color: inherit; }
::selection { background: #6c91ff; color: #fff; }

.admin-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Top nav ─────────────────────────────────────────────── */
.topnav {
  background: var(--topbar-bg);
  height: 56px;
  display: flex; align-items: center;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.topnav-brand {
  font-size: 18px; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 8px;
  margin-right: 32px; flex-shrink: 0;
  letter-spacing: -0.5px;
}
.topnav-links { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-link {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.7);
  border-radius: 6px;
  white-space: nowrap;
  transition: all .15s;
}
.topnav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.topnav-link.active { color: #fff; background: rgba(255,255,255,.15); }
.topnav-link i { font-size: 14px; }

.topnav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.topnav-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; background: rgba(255,255,255,.08); border-radius: 999px; }
.topnav-avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--accent); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.topnav-user-name { color: #fff; font-size: 13px; font-weight: 600; }
.topnav-logout { color: rgba(255,255,255,.7); padding: 4px 6px; border-radius: 6px; }
.topnav-logout:hover { color: #fff; background: rgba(255,255,255,.1); }

/* ── Page topbar ─────────────────────────────────────────── */
.topbar {
  background: var(--card);
  padding: 0 28px;
  min-height: 50px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--bdr);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-title { font-size: 15px; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.topbar-title i { color: var(--accent); }

/* ── Content area ────────────────────────────────────────── */
.content { padding: 18px 24px; flex: 1; min-height: 0; }

/* ── Cards / table / forms ───────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--bdr); border-radius: var(--r); overflow: hidden; }
.card-hdr { padding: 14px 18px; border-bottom: 1px solid var(--bdr); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--accent); }
.card-body { padding: 18px; }

.btn-p { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.btn-p:hover { background: var(--ah); color: #fff; }
.btn-o { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--card); color: var(--muted); border: 1px solid var(--bdr); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; }
.btn-o:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border: none; }
.btn-danger:hover { background: #dc2626; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--bdr); background: var(--bg); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--bdr); vertical-align: middle; color: var(--text); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg); }

.form-input, input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], textarea, select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--bdr); border-radius: 8px; font-size: 13px; background: var(--input-bg); color: var(--text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,112,164,.15); }
textarea { resize: vertical; min-height: 70px; }
label.l { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-ok { background: #d1fae5; color: #065f46; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #f1f5f9; color: var(--muted); }

/* ── Auth pages (login) ──────────────────────────────────── */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #5b6692 0%, #6370a4 100%);
  padding: 24px;
}
.auth-card {
  background: #fff; border-radius: 14px; padding: 36px 32px;
  box-shadow: 0 16px 50px rgba(0,0,0,.18);
  width: 100%; max-width: 400px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; color: var(--dark); }
.auth-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.auth-card .row { margin-bottom: 14px; }
.auth-card .err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 9px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 14px; }
.auth-card button { width: 100%; padding: 11px; border-radius: 8px; border: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; }
.auth-card button:hover { background: var(--ah); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .topnav { padding: 0 12px; }
  .topnav-brand { margin-right: 12px; font-size: 16px; }
  .topnav-link { padding: 6px 10px; font-size: 12px; }
  .topnav-link span { display: none; }
  .content { padding: 12px; }
}
