:root {
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --teal: #0ea5a4;
  --teal-dark: #0b8382;
  --blue: #2563eb;
  --amber: #f59e0b;
  --red: #dc2626;
  --green: #059669;
  --purple: #7c3aed;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f4f6fa;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

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

.sidebar {
  width: 264px;
  flex: 0 0 264px;
  background: linear-gradient(180deg, #0f172a 0%, #111f38 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  overflow-y: auto;
  scrollbar-width: thin;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: linear-gradient(135deg, var(--teal), #0284c7);
  color: #fff; font-weight: 800; font-size: 12.5px;
  display: grid; place-items: center; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 16px; }
.brand-text span { font-size: 10.5px; color: #8fa3bd; letter-spacing: .02em; }

.nav { padding: 12px 10px 20px; flex: 1; }
.nav-group-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #6b7f99; padding: 14px 12px 6px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; color: #c7d2e0;
  font-size: 13.6px; font-weight: 500; margin-bottom: 2px;
  transition: background .15s, color .15s;
}
.nav-item i { width: 18px; text-align: center; font-size: 13.5px; opacity: .85; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: linear-gradient(90deg, rgba(14, 165, 164, .22), rgba(14, 165, 164, .06)); color: #fff; box-shadow: inset 3px 0 0 var(--teal); }
.nav-item.active i { color: var(--teal); opacity: 1; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.cash-chip {
  background: rgba(255, 255, 255, .06);
  border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column;
}
.cash-chip span { font-size: 11px; color: #8fa3bd; text-transform: uppercase; letter-spacing: .06em; }
.cash-chip strong { color: #5eead4; font-size: 15px; font-variant-numeric: tabular-nums; }

.backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 55;
}

.main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-title h1 { font-size: 19px; }
.topbar-title p { margin: 2px 0 0; font-size: 12.6px; color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.menu-btn { display: none !important; }

.view { padding: 22px 26px 60px; max-width: 1560px; width: 100%; }
.fade-in { animation: fade .28s ease; }
@keyframes fade { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px;
  padding: 9px 14px; font-size: 13.4px; font-weight: 600;
  cursor: pointer; background: #fff; color: var(--ink-2);
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
  font-family: inherit; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 1px 2px rgba(14, 165, 164, .3); }
.btn-primary:hover:not(:disabled) { background: var(--teal-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: #f8fafc; border-color: #cbd5e1; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: 6.5px 11px; font-size: 12.6px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); cursor: pointer;
  display: inline-grid; place-items: center; font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: #f1f5f9; }
.icon-btn.sm { width: 29px; height: 29px; font-size: 11.5px; }
.icon-btn.danger:hover { background: #fef2f2; color: var(--red); border-color: #fecaca; }

.bell-count {
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  border-radius: 999px; padding: 1px 6px; margin-left: 2px;
}

.link { font-size: 12.6px; font-weight: 600; white-space: nowrap; }
.link i { font-size: 10px; }

/* ---------- cards & grids ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 18px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 14.6px; }
.card-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 16px 18px; }

.kpi-grid {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow); border-left: 3px solid var(--line);
}
.kpi-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  display: grid; place-items: center; font-size: 13.5px;
  background: #f1f5f9; color: var(--ink-2);
}
.kpi-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kpi-label { font-size: 11.8px; color: var(--muted); font-weight: 600; text-transform: none; }
.kpi-value { font-size: 17.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-hint { font-size: 11.5px; color: var(--muted); }
.kpi.small { padding: 11px 14px; }
.kpi.small .kpi-value { font-size: 15.5px; }

.tone-blue { border-left-color: var(--blue); }
.tone-blue .kpi-icon { background: #eff6ff; color: var(--blue); }
.tone-teal, .tone-green { border-left-color: var(--teal); }
.tone-teal .kpi-icon, .tone-green .kpi-icon { background: #ecfdf5; color: var(--teal); }
.tone-amber { border-left-color: var(--amber); }
.tone-amber .kpi-icon { background: #fffbeb; color: var(--amber); }
.tone-red { border-left-color: var(--red); }
.tone-red .kpi-icon { background: #fef2f2; color: var(--red); }
.tone-purple { border-left-color: var(--purple); }
.tone-purple .kpi-icon { background: #f5f3ff; color: var(--purple); }

.grid-2 { display: grid; gap: 18px; grid-template-columns: 1fr; }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 300px; }

/* ---------- toolbar & filters ---------- */
.toolbar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 18px; background: #fbfcfe; border-bottom: 1px solid var(--line);
}
.toolbar.standalone {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: var(--shadow); align-items: center;
}
.toolbar-note { font-size: 12.4px; color: var(--muted); display: flex; gap: 7px; align-items: center; margin-left: auto; }

.search-box { position: relative; flex: 1 1 240px; min-width: 190px; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; }
.search-box .input { padding-left: 33px; }

.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 140px; flex: 0 1 auto; }
.filter-field label { font-size: 11.4px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

.input {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 165, 164, .13); }
textarea.input { resize: vertical; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
.data-table th {
  text-align: left; padding: 10px 14px; background: #f8fafc;
  font-size: 11.4px; text-transform: uppercase; letter-spacing: .045em;
  color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td { padding: 10px 14px; background: #f8fafc; font-weight: 700; border-top: 1px solid var(--line); }
.data-table .right, .data-table th.right, .data-table td.right { text-align: right; }

.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.truncate { display: inline-block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.table-foot { margin: 10px 18px 14px; font-size: 12.8px; color: var(--ink-2); }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.usage-cell { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.usage-cell span { font-size: 11.6px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- badges ---------- */
.badge {
  display: inline-block; padding: 2.5px 9px; border-radius: 999px;
  font-size: 11.4px; font-weight: 650; white-space: nowrap; line-height: 1.6;
}
.badge-green { background: #ecfdf5; color: #047857; }
.badge-red { background: #fef2f2; color: #b91c1c; }
.badge-amber { background: #fffbeb; color: #b45309; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-teal { background: #ecfeff; color: #0e7490; }
.badge-purple { background: #f5f3ff; color: #6d28d9; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* ---------- progress ---------- */
.progress { height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; flex: 1; min-width: 50px; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--teal); transition: width .3s; }
.progress-bar.amber { background: var(--amber); }
.progress-bar.red { background: var(--red); }
.progress-bar.teal { background: var(--teal); }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.pager-info { font-size: 12.4px; color: var(--muted); }
.pager-btns { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pager-page { font-size: 12.4px; color: var(--ink-2); font-weight: 600; }

/* ---------- states ---------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 42px 20px; color: var(--muted); text-align: center;
}
.empty-state i { font-size: 26px; color: #cbd5e1; }
.empty-state p { margin: 0; font-size: 13.4px; }
.empty-state.small { padding: 20px 12px; }

.loading-block {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 44px 20px; color: var(--muted); font-size: 13.4px;
}
.loading-block i { color: var(--teal); font-size: 16px; }

.error-block {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 34px 20px; color: var(--red); text-align: center;
  background: #fff; border: 1px solid #fecaca; border-radius: var(--radius);
}
.error-block p { margin: 0; color: var(--ink-2); font-size: 13.4px; }

.skeleton-stack { display: flex; flex-direction: column; gap: 14px; }
.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 50%, #eef2f7 75%);
  background-size: 300% 100%; animation: shimmer 1.3s infinite; border-radius: 12px;
}
.skeleton.sk-lg { height: 92px; }
.skeleton.sk-md { height: 220px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- alerts ---------- */
.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: #fff;
}
.alert-item > i { font-size: 15px; width: 18px; text-align: center; }
.alert-item.high { border-color: #fecaca; background: #fffafa; }
.alert-item.high > i { color: var(--red); }
.alert-item.warn { border-color: #fde68a; background: #fffdf5; }
.alert-item.warn > i { color: var(--amber); }
.alert-item.info { border-color: #dbeafe; background: #f8fbff; }
.alert-item.info > i { color: var(--blue); }
.alert-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.alert-body strong { font-size: 13.4px; }
.alert-body span { font-size: 12.4px; color: var(--muted); }
.alert-group { font-size: 10.6px !important; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: #94a3b8 !important; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13.3px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.tab:hover { border-color: #cbd5e1; }
.tab.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab.active i { color: var(--teal); }

.terms-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 14px; }
.term-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px;
  display: flex; flex-direction: column; gap: 3px; background: #fbfcfe;
}
.term-days { font-size: 22px; font-weight: 750; color: var(--teal); line-height: 1.1; }
.term-label { font-size: 13px; font-weight: 650; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 100;
  animation: fade .16s ease;
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 520px;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -18px rgba(15, 23, 42, .5); animation: pop .18s ease;
}
.modal-wide { max-width: 720px; }
@keyframes pop { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 15.6px; flex: 1; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 18px; border-top: 1px solid var(--line); background: #fbfcfe;
}
.confirm-text { margin: 0; font-size: 13.6px; color: var(--ink-2); }

.form-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field label { font-size: 12.3px; font-weight: 650; color: var(--ink-2); }
.field .req { color: var(--red); }
.field .help { font-size: 11.4px; color: var(--muted); }
.check-field { display: flex; align-items: center; gap: 9px; font-size: 13.4px; }
.check-field.span-2 { grid-column: span 2; }
.form-error {
  margin-top: 14px; padding: 10px 12px; border-radius: 9px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 12.8px;
}

/* ---------- import công nợ ---------- */
.import-status { margin-top: 14px; }
.import-status .chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.import-status .help { display: block; margin-top: 6px; }
.import-preview {
  margin-top: 4px; max-height: 330px; overflow: auto;
  border: 1px solid var(--line); border-radius: 11px; background: var(--card);
}
.import-preview .data-table { font-size: 12.6px; }
.import-errors { margin: 7px 0 0; padding-left: 18px; color: var(--red); font-size: 12.4px; line-height: 1.55; }
#import-file { padding: 9px 10px; }

/* ---------- toast ---------- */
#toast-root {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px; max-width: min(360px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border-radius: 11px; background: #0f172a; color: #fff;
  font-size: 13.2px; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(15, 23, 42, .6);
  animation: slideIn .22s ease; transition: opacity .25s, transform .25s;
}
.toast i { font-size: 14px; }
.toast-success i { color: #34d399; }
.toast-error i { color: #f87171; }
.toast-warn i { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateX(20px); }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */
@media (min-width: 900px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1023px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid !important; }
  .topbar { padding: 12px 16px; }
  .topbar-title h1 { font-size: 16.5px; }
  .topbar-title p { display: none; }
  .view { padding: 16px 16px 56px; }
  .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
  .kpi { padding: 11px 12px; gap: 9px; }
  .kpi-icon { width: 29px; height: 29px; flex-basis: 29px; font-size: 12px; }
  .kpi-value { font-size: 15px; }
  .card-head { padding: 12px 14px; }
  .card-body { padding: 13px 14px; }
  .toolbar { padding: 12px 14px; }
  .data-table { font-size: 12.6px; }
  .data-table th, .data-table td { padding: 9px 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: span 1; }
  .btn-label { display: none; }
  .btn-sm .btn-label { display: none; }
  .truncate { max-width: 170px; }
  .chart-box { height: 220px; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 13.6px; }
  .kpi-label { font-size: 10.8px; }
  .kpi-hint { display: none; }
  .tabs { gap: 5px; }
  .tab { padding: 7px 11px; font-size: 12.3px; }
  .tab span { display: none; }
  .tab i { font-size: 14px; }
  .alert-item { flex-wrap: wrap; }
  .modal { max-width: none; }
  .view { padding: 12px 12px 56px; }
}


/* ================= KDN bổ sung ================= */
[hidden] { display: none !important; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 2px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; color: #8fa3bd; flex: 0 0 32px; }
.user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-info strong { color: #fff; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info span { font-size: 11.5px; color: #8fa3bd; }
.user-info a { color: #8fa3bd; }
.user-info a:hover { color: #5eead4; }

.ro-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); background: #eef2f7; border-radius: 999px; padding: 5px 11px; }

/* Chế độ chỉ xem: ẩn mọi nút ghi dữ liệu */
body.ro #btn-create, body.ro #btn-import, body.ro [data-act="edit"], body.ro [data-act="del"],
body.ro [data-act="settle"], body.ro [data-act="pay"], body.ro [data-plan], body.ro .write-only { display: none !important; }
body:not(.is-admin) .admin-only { display: none !important; }

.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.perm-table td.c, .perm-table th.c { text-align: center; width: 70px; }
.perm-table input { width: 16px; height: 16px; accent-color: var(--teal); }
.perm-pill { display: inline-block; font-size: 11.5px; border-radius: 6px; padding: 2px 7px; margin: 1px 2px 1px 0; background: #eef2f7; color: var(--ink-2); }
.perm-pill.w { background: #ccfbf1; color: #0f766e; }
.temp-pw { font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700; background: #f1f5f9; border-radius: 8px; padding: 10px 14px; display: inline-block; letter-spacing: .5px; user-select: all; }

/* Trang đăng nhập */
.auth-page { min-height: 100vh; background: linear-gradient(160deg, #0f172a 0%, #12304a 55%, #0e5e63 100%); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 28px 28px 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.auth-card h1 { font-size: 20px; margin: 18px 0 14px; }
.auth-card .field { margin-bottom: 13px; }
.auth-card .form-error { margin-bottom: 12px; }
.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand strong { display: block; font-size: 15.5px; }
.auth-brand span { font-size: 12px; color: var(--muted); }
.auth-links { margin: 16px 0 0; font-size: 13px; text-align: center; }
.auth-foot { color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; text-align: center; }
.btn-block { width: 100%; justify-content: center; margin-top: 4px; }
.input[type="text"].upper { text-transform: uppercase; }

/* Logo KDN */
.brand-logo { flex-direction: column; align-items: stretch; gap: 8px; padding: 16px 16px 14px; text-decoration: none; }
.brand-logo-tile { background: #fff; border-radius: 12px; padding: 8px 14px; display: flex; justify-content: center; box-shadow: 0 6px 16px -8px rgba(0,0,0,.5); }
.brand-logo-tile img { display: block; width: 100%; max-width: 160px; height: auto; }
.brand-logo-sub { font-size: 10.5px; color: #8fa3bd; text-align: center; letter-spacing: .14em; font-weight: 700; }
.auth-brand { flex-direction: column; text-align: center; gap: 4px; }
.auth-brand img { width: 220px; max-width: 80%; height: auto; margin: 0 auto 6px; display: block; }
