:root {
  --navy: #16283f;
  --navy-dark: #0e1c30;
  --navy-light: #1e3555;
  --gold: #b08d4f;
  --gold-light: #d4b877;
  --page-bg: #f3f1ea;
  --header-bg: #faf8f2;
  --card-bg: #ffffff;
  --border: #e6e1d3;
  --text: #1c2b3a;
  --text-soft: #6b7787;
  --sidebar-text: #aebbd0;
  --danger: #c53d6f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 14px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ── App shell ───────────────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 62px 1fr;
  min-height: 100vh;
}

.topbar {
  grid-column: 1 / -1;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; width: 230px; flex-shrink: 0; }
.brand-mark-img { height: 38px; width: auto; flex-shrink: 0; }
.brand-text { font-weight: 700; font-size: 14px; letter-spacing: .04em; line-height: 1.2; }
.brand-text small { display: block; font-weight: 500; color: var(--text-soft); font-size: 10px; letter-spacing: .08em; }

.topbar-search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; color: var(--text-soft);
}
.topbar-search input { border: none; outline: none; flex: 1; font-size: 13px; background: transparent; }
.topbar-search .icon { width: 16px; height: 16px; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  background: var(--navy);
  padding: 18px 12px;
  overflow-y: auto;
}
.sidebar-section-label {
  color: var(--gold-light); font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: 8px 10px 6px;
}
.nav-list { list-style: none; margin: 0 0 18px; padding: 0; }
.nav-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px; margin-bottom: 2px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-link .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }

/* ── Main content ────────────────────────────────────────────── */
.main { padding: 24px 28px; overflow-x: hidden; }
.breadcrumb { color: var(--text-soft); font-size: 12.5px; margin-bottom: 16px; }
.breadcrumb b { color: var(--text); font-weight: 600; }

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 13.5px; color: var(--navy);
}
.card-header .icon { width: 17px; height: 17px; color: var(--gold); }
.card-body { padding: 18px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 780px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  border: 1px solid var(--border); border-radius: 8px; padding: 14px; text-align: center;
  background: #fbfaf6;
}
.stat-tile .num { font-size: 24px; font-weight: 700; color: var(--navy); }
.stat-tile .label { font-size: 11.5px; color: var(--text-soft); margin-top: 2px; }

.module-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 980px) { .module-tiles { grid-template-columns: repeat(2, 1fr); } }
.module-tile {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.module-tile:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(16,24,40,.1); }
.module-tile .icon-wrap {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--gold-light); display: flex; align-items: center; justify-content: center;
}
.module-tile .icon-wrap .icon { width: 19px; height: 19px; }
.module-tile .title { font-weight: 700; font-size: 13.5px; }
.module-tile .desc { color: var(--text-soft); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--navy); color: #fff; border: none; border-radius: 7px;
  padding: 9px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--navy-light); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: var(--gold-light); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge.pink { background: #fbe3ec; color: var(--danger); }
.badge.green { background: #e2f3e6; color: #2f8a4c; }

/* ── Tables & forms (admin console) ─────────────────────────── */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data th { color: var(--text-soft); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: none; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 5px; }
.field input, .field select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }

.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.checkbox-row input { width: auto; flex: 0 0 auto; }
.checkbox-row label { margin: 0; font-weight: 400; color: var(--text); text-transform: none; letter-spacing: normal; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert.error { background: #fbe3ec; color: var(--danger); }
.alert.success { background: #e2f3e6; color: #2f8a4c; }

/* ── Login page ──────────────────────────────────────────────── */
.login-wrap {
  position: relative; overflow: hidden;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top left, var(--navy-light), var(--navy-dark));
  padding: 20px;
}
.hex-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: auto;
}
.hex-cell {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
  transition: stroke .15s ease, stroke-width .15s ease;
}
.login-card { position: relative; z-index: 1; }
.login-card {
  width: 100%; max-width: 860px; min-height: 460px;
  background: var(--card-bg); border-radius: 16px; overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
@media (max-width: 720px) { .login-card { grid-template-columns: 1fr; } }
.login-side {
  background: linear-gradient(160deg, var(--navy), var(--navy-dark));
  color: #fff; padding: 40px; display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.login-logo { width: 170px; height: auto; }
.login-side h1 { font-size: 22px; margin: 0; }
.login-side p { color: var(--sidebar-text); font-size: 13px; line-height: 1.6; margin: 0; }
.login-form { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 4px; font-size: 19px; }
.login-form .sub { color: var(--text-soft); font-size: 13px; margin: 0 0 22px; }
.login-form .btn { width: 100%; justify-content: center; padding: 11px; margin-top: 6px; }

.footer-note { text-align: center; color: var(--text-soft); font-size: 11.5px; padding: 18px; }
