@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,500&display=swap');

:root {
  --navy: #0c2340;
  --navy-2: #12285a;
  --navy-3: #1e3a8a;
  --navy-deep: #0b1b3d;
  --amber: #f59e0b;
  --amber-2: #d97706;
  --amber-soft: #fef3c7;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 4px 16px rgba(15,23,42,.06);
  --shadow-lg: 0 12px 40px rgba(12,35,64,.18);
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: "Times New Roman", Times, serif;
  --tracking: -0.01em;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: var(--tracking);
  background: #f4f6f9;
  color: var(--slate-800);
}
h1,h2,h3,h4,h5 { font-family: var(--font); letter-spacing: -0.02em; font-weight: 700; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
a { color: var(--navy-3); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== LOGIN SPLIT (theo mẫu) ========== */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: #fff;
}
@media (max-width: 900px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand-pane { display: none; }
}
.login-brand-pane {
  background: linear-gradient(160deg, #0a1f3d 0%, #12285a 42%, #1a3a7a 100%);
  color: #fff;
  padding: 36px 44px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.login-brand-pane::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 80%, rgba(245,158,11,.12), transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(59,130,246,.15), transparent 45%);
  pointer-events: none;
}
.login-brand-pane > * { position: relative; z-index: 1; }
.login-brand-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: auto;
}
.login-brand-top .mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--amber); color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 16px rgba(245,158,11,.35);
}
.login-brand-top .titles strong {
  display: block; font-size: 14px; font-weight: 700; color: #fff;
}
.login-brand-top .titles span {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: #fcd34d;
}
.login-brand-body { margin: 48px 0 auto; max-width: 440px; }
.login-brand-body .pill {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12);
  font-size: 12px; font-weight: 600; color: #e2e8f0; margin-bottom: 18px;
}
.login-brand-body h1 {
  margin: 0 0 14px; font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 700; line-height: 1.25; color: #fff;
}
.login-brand-body h1 em {
  font-style: normal; color: #fbbf24; font-weight: 700;
}
.login-brand-body p {
  margin: 0; font-size: 14px; line-height: 1.65; color: #94a3b8; font-weight: 400;
}
.login-stats {
  display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap;
}
.login-stats .stat {
  flex: 1; min-width: 90px;
  padding: 14px 12px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  text-align: center;
}
.login-stats .stat strong {
  display: block; font-size: 20px; font-weight: 700; color: #fbbf24; margin-bottom: 4px;
}
.login-stats .stat span {
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #94a3b8;
}
.login-brand-foot {
  margin-top: 32px; font-size: 11px; color: #64748b;
  display: flex; align-items: center; gap: 6px;
}

.login-form-pane {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px; background: #f8fafc;
}
.login-form-box {
  width: 100%; max-width: 400px;
}
.login-form-box h2 {
  margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--slate-800);
}
.login-form-box .lead {
  margin: 0 0 24px; font-size: 13px; color: var(--slate-500); line-height: 1.5;
}
.login-form-box label {
  display: block; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--slate-600); margin-bottom: 6px;
}
.login-form-box .field { margin-bottom: 16px; }
.login-form-box .form-control {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--slate-200); border-radius: 12px;
  background: #fff; color: var(--slate-800);
  font-size: 14px; font-weight: 500;
  transition: border .15s, box-shadow .15s;
}
.login-form-box .form-control:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.login-form-box .btn-login {
  width: 100%; padding: 13px 16px; margin-top: 8px;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--navy-2); color: #fff;
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .05s;
}
.login-form-box .btn-login:hover { background: var(--navy); }
.login-form-box .btn-login:active { transform: translateY(1px); }
.login-hint {
  margin-top: 12px; font-size: 12px; color: var(--slate-500);
  display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
.login-samples {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--slate-200);
}
.login-samples h4 {
  margin: 0 0 10px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--slate-500);
}
.sample-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sample-card {
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--slate-200); background: #fff;
  cursor: pointer; transition: border .15s, box-shadow .15s;
  text-align: left;
}
.sample-card:hover { border-color: #93c5fd; box-shadow: 0 2px 8px rgba(30,58,138,.08); }
.sample-card strong { display: block; font-size: 12.5px; font-weight: 600; color: var(--slate-800); }
.sample-card span { font-size: 11px; color: var(--slate-500); }
.sample-card code { font-size: 10px; color: var(--navy-3); font-weight: 600; }
.login-preview-box {
  margin: 12px 0 16px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--slate-200); border-radius: 12px;
}
.login-preview-box .n { font-weight: 700; color: var(--navy); font-size: 14px; }
.login-note {
  margin-top: 20px; padding: 12px 14px; border-radius: 12px;
  background: #eef2ff; border: 1px solid #c7d2fe;
  font-size: 12px; color: #3730a3; line-height: 1.5;
}

/* ========== APP SHELL ========== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, #0e2448 0%, #0a1a33 100%);
  color: #e2e8f0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.05);
}
.sidebar-brand {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; gap: 11px; align-items: center;
}
.sidebar-brand .mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--amber); color: var(--navy);
  font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(245,158,11,.3);
}
.sidebar-brand h1 { margin: 0; font-size: 13px; font-weight: 700; color: #fff; }
.sidebar-brand p {
  margin: 2px 0 0; font-size: 9.5px; color: #fcd34d;
  font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: #64748b;
  padding: 12px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; margin-bottom: 2px;
  border: none; border-radius: 10px; background: transparent;
  color: #cbd5e1; font-size: 13px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(245,158,11,.18), rgba(245,158,11,.04));
  color: #fbbf24; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--amber);
}
.nav-item .ico { width: 18px; text-align: center; opacity: .9; font-size: 14px; }
.nav-item .badge-admin {
  margin-left: auto; font-size: 9px; font-weight: 700;
  background: var(--amber); color: var(--navy);
  padding: 2px 6px; border-radius: 6px; letter-spacing: .02em;
}
.sidebar-user {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; gap: 10px; align-items: center;
}
.sidebar-user .av {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--amber); color: var(--navy);
  font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user .meta { flex: 1; min-width: 0; }
.sidebar-user .meta strong {
  display: block; color: #fff; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user .meta span { font-size: 11px; color: #94a3b8; }
.sidebar-user button {
  border: none; background: rgba(255,255,255,.08); color: #e2e8f0;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
}
.sidebar-user button:hover { background: rgba(244,63,94,.35); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--slate-200);
  padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 700; color: var(--navy); }
.topbar .sub { margin: 2px 0 0; font-size: 12px; color: var(--slate-500); font-weight: 400; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--slate-100); border: 1px solid var(--slate-200);
  font-size: 12px; font-weight: 600; color: var(--slate-700);
}
.chip.ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.chip.warn { background: var(--amber-soft); border-color: #fcd34d; color: var(--amber-2); }
.content { padding: 18px 22px 36px; flex: 1; }

/* panels */
.panel {
  background: #fff; border: 1px solid var(--slate-200);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel-hd {
  padding: 14px 16px; border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  background: linear-gradient(180deg, #fff, #fafbfc);
}
.panel-hd h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: var(--navy); }
.panel-hd p { margin: 3px 0 0; font-size: 12px; color: var(--slate-500); font-weight: 400; }
.panel-bd { padding: 14px 16px; }

.kpi-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.kpi-card {
  background: #fff; border: 1px solid var(--slate-200);
  border-radius: var(--radius); padding: 14px 15px; box-shadow: var(--shadow);
}
.kpi-card-label {
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--slate-500);
}
.kpi-card-value {
  font-size: 22px; font-weight: 700; color: var(--navy);
  margin-top: 4px; letter-spacing: -0.03em;
}
.kpi-card-sub { font-size: 11.5px; color: var(--slate-500); margin-top: 3px; }
.kpi-card.score { border-color: #bfdbfe; background: linear-gradient(180deg, #f0f7ff, #fff); }
.kpi-card.score .kpi-card-value { color: var(--navy-3); }
.kpi-card.rating { border-color: #fde68a; background: linear-gradient(180deg, #fffbeb, #fff); }
.kpi-card.rating .kpi-card-value { color: var(--amber-2); }
.kpi-card.ok { border-color: #a7f3d0; background: linear-gradient(180deg, #ecfdf5, #fff); }
.kpi-card.ok .kpi-card-value { color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 13px; border-radius: 10px;
  border: 1px solid var(--slate-300); background: #fff; color: var(--slate-700);
  font-weight: 600; font-size: 12.5px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--slate-50); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-primary {
  background: linear-gradient(180deg, #1e3a8a, #12285a);
  border-color: var(--navy); color: #fff;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-success {
  background: linear-gradient(180deg, #10b981, #059669);
  border-color: #047857; color: #fff;
}
.btn-danger { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger:hover { background: #fef2f2; }
.btn-amber {
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  border-color: #d97706; color: var(--navy); font-weight: 700;
}
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px;
}
.toolbar .spacer { flex: 1; }

.table-wrap {
  overflow: auto; border: 1px solid var(--slate-200);
  border-radius: 12px; background: #fff;
}
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
table.data th, table.data td {
  padding: 9px 11px; border-bottom: 1px solid var(--slate-100);
  text-align: left; vertical-align: middle;
}
table.data th {
  background: #f8fafc; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; color: var(--slate-500);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.data tbody tr:hover { background: #f8fafc; }
table.data input, table.data select {
  width: 100%; min-width: 56px; padding: 5px 7px;
  border: 1px solid var(--slate-200); border-radius: 7px; background: #fff;
  font-size: 12.5px;
}
table.data input.num { text-align: center; max-width: 72px; }
table.data input[type=checkbox] { width: auto; min-width: 0; }
.text-center { text-align: center !important; }
.fw-bold { font-weight: 700; }
.muted { color: var(--slate-500); }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px; background: var(--slate-100); padding: 2px 6px;
  border-radius: 6px; color: var(--navy-3); font-weight: 500;
}
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600;
}
.badge-ld { background: #fef3c7; color: #92400e; }
.badge-cm { background: #e0e7ff; color: #3730a3; }
.badge-ok { background: #d1fae5; color: #065f46; }

.alert {
  padding: 11px 13px; border-radius: 11px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  color: #1e3a8a; font-size: 12.5px; margin-bottom: 12px; line-height: 1.5;
}
.alert-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.alert-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.profile-card {
  background: #fff; border: 1px solid var(--slate-200);
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 14px; box-shadow: var(--shadow);
}
.profile-row { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-row .form-group { flex: 1; min-width: 120px; margin-bottom: 0; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--slate-600); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--slate-300); border-radius: 10px;
  background: #fff; color: var(--slate-800);
  transition: border .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
textarea.form-control { resize: vertical; min-height: 64px; }

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fade .22s ease; }
@keyframes fade {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 640px;
  max-height: 85vh; overflow: auto; box-shadow: var(--shadow-lg);
}
.modal-header {
  padding: 14px 16px; border-bottom: 1px solid var(--slate-200);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff;
}
.modal-body { padding: 14px 16px; }
.modal-footer {
  padding: 12px 16px; border-top: 1px solid var(--slate-200);
  display: flex; justify-content: flex-end; gap: 8px;
  position: sticky; bottom: 0; background: #fff;
}
.footer-bar {
  text-align: center; color: var(--slate-400); font-size: 11px;
  padding: 18px 8px 10px; font-weight: 500;
}
.status-draft { color: #64748b; }
.status-submitted { color: #b45309; font-weight: 600; }
.status-approved { color: #047857; font-weight: 600; }
.status-rejected { color: #b91c1c; font-weight: 600; }

/* Dashboard hero */
.dash-hero {
  background: linear-gradient(135deg, #0c2340 0%, #1e3a8a 55%, #12285a 100%);
  border-radius: 16px; color: #fff; padding: 22px 24px;
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
  box-shadow: 0 12px 30px rgba(12,35,64,.22);
  position: relative; overflow: hidden;
}
.dash-hero::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(245,158,11,.12);
}
.dash-hero .hello { font-size: 22px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -0.02em; }
.dash-hero .desc { font-size: 13px; color: #bfdbfe; max-width: 480px; line-height: 1.55; font-weight: 400; }
.dash-hero .pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,.12); margin-right: 6px;
}
.dash-hero .pill.amber { background: rgba(245,158,11,.25); color: #fcd34d; }
.dash-hero .actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.dash-hero .ring {
  width: 110px; height: 110px; border-radius: 50%;
  background: conic-gradient(#f59e0b var(--p, 91%), rgba(255,255,255,.15) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
}
.dash-hero .ring-inner {
  width: 86px; height: 86px; border-radius: 50%; background: #12285a;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dash-hero .ring-inner strong { font-size: 22px; font-weight: 700; color: #fbbf24; letter-spacing: -0.03em; }
.dash-hero .ring-inner span { font-size: 10px; color: #93c5fd; text-transform: uppercase; font-weight: 600; letter-spacing: .04em; }
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 14px; }
@media (max-width: 960px) { .dash-grid { grid-template-columns: 1fr; } }
.progress-list { display: flex; flex-direction: column; gap: 10px; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.progress-row .name { font-weight: 600; font-size: 12.5px; }
.progress-row .meta { font-size: 11px; color: var(--slate-500); }
.progress-bar { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--slate-200); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1e3a8a, #3b82f6); }
.progress-bar > i.ok { background: linear-gradient(90deg, #059669, #34d399); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 8px 4px 0; }
.bar-chart .bar {
  flex: 1; background: #1e3a8a; border-radius: 7px 7px 3px 3px;
  min-height: 4px; position: relative; opacity: .9;
}
.bar-chart .bar.muted { background: #94a3b8; opacity: .5; }
.bar-chart .bar span {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--slate-500); white-space: nowrap; font-weight: 500;
}
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--slate-100);
}
.rank-list li:last-child { border-bottom: none; }
.rank-list .num {
  width: 24px; height: 24px; border-radius: 8px;
  background: var(--slate-100); font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.rank-list .num.top { background: #fef3c7; color: #92400e; }
.rank-list .bar-mini { flex: 1; height: 6px; background: var(--slate-100); border-radius: 99px; overflow: hidden; }
.rank-list .bar-mini i { display: block; height: 100%; background: #1e3a8a; border-radius: 99px; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .nav-section { display: none; }
  .nav-item { width: auto; padding: 8px 10px; }
}

/* ===== Sidebar collapse on/off ===== */
.sidebar {
  transition: width .22s ease, min-width .22s ease;
  width: 248px;
  min-width: 248px;
}
.sidebar-brand .brand-text { min-width: 0; }
.sidebar .nav-item .nav-label { white-space: nowrap; }
.sidebar .nav-section { white-space: nowrap; }

.app-shell.sidebar-collapsed .sidebar {
  width: 72px;
  min-width: 72px;
}
.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding-left: 12px;
  padding-right: 12px;
}
.app-shell.sidebar-collapsed .sidebar-brand .brand-text,
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .nav-item .nav-label,
.app-shell.sidebar-collapsed .nav-item .badge-admin,
.app-shell.sidebar-collapsed .sidebar-user .meta {
  display: none;
}
.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}
.app-shell.sidebar-collapsed .nav-item .ico {
  width: auto;
  font-size: 16px;
}
.app-shell.sidebar-collapsed .sidebar-user {
  justify-content: center;
}
.app-shell.sidebar-collapsed .sidebar-user button.logout-btn {
  display: none;
}
.btn-sidebar-toggle {
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--slate-200);
  background: #fff;
  color: var(--slate-700);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
.btn-sidebar-toggle:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
}
.sidebar-brand .btn-collapse-side {
  margin-left: auto;
  width: 28px; height: 28px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #e2e8f0; cursor: pointer; font-size: 14px;
  display: none; /* desktop uses topbar toggle primarily */
  align-items: center; justify-content: center;
}
@media (max-width: 900px) {
  .app-shell.sidebar-collapsed .sidebar {
    width: 100%;
    min-width: 0;
    max-height: 56px;
    overflow: hidden;
  }
  .app-shell.sidebar-collapsed .sidebar-nav,
  .app-shell.sidebar-collapsed .sidebar-user {
    display: none;
  }
  .btn-sidebar-toggle { display: inline-flex; }
}
/* overlay mode optional for mobile when open */
@media (max-width: 900px) {
  .app-shell:not(.sidebar-collapsed) .sidebar {
    max-height: none;
  }
}

/* Logo mark SVG */
.mark.mark-logo {
  background: transparent !important;
  box-shadow: none !important;
  padding: 0;
  width: 38px;
  height: 38px;
  overflow: hidden;
}
.mark.mark-logo .logo-svg {
  display: block;
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 4px 10px rgba(245,158,11,.35));
}
.login-brand-top .mark.mark-logo {
  width: 42px;
  height: 42px;
}
.login-brand-top .mark.mark-logo .logo-svg {
  width: 42px;
  height: 42px;
}
.app-shell.sidebar-collapsed .mark.mark-logo {
  width: 36px;
  height: 36px;
}
.app-shell.sidebar-collapsed .mark.mark-logo .logo-svg {
  width: 36px;
  height: 36px;
}


/* ===== Báo cáo xem trước (mẫu hành chính) ===== */
.report-filters {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  padding: 12px 14px; margin-bottom: 14px;
  background: #f8fafc; border: 1px solid var(--slate-200); border-radius: 12px;
}
.report-filters .form-group { margin: 0; min-width: 160px; }
.report-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-left: auto; }
.report-badges .chip { font-size: 11.5px; }
.report-preview-wrap {
  border: 1px solid var(--slate-200); border-radius: 12px;
  background: #e8ecf1; padding: 16px; overflow: auto; max-height: 72vh;
}
.report-preview.doc-official {
  background: #fff; max-width: 980px; margin: 0 auto;
  padding: 28px 32px 40px;
  box-shadow: 0 4px 24px rgba(15,23,42,.08);
  font-family: "Times New Roman", Times, serif;
  font-size: 12px; color: #111; line-height: 1.35;
}
.doc-official .doc-hdr {
  display: flex; justify-content: space-between; gap: 16px;
  text-align: center; margin-bottom: 8px;
}
.doc-official .doc-hdr .left, .doc-official .doc-hdr .right { flex: 1; }
.doc-official .doc-hdr .unit { font-weight: 700; text-transform: uppercase; font-size: 12px; }
.doc-official .doc-hdr .sub { font-size: 11px; font-style: italic; }
.doc-official .doc-title {
  text-align: center; font-weight: 700; font-size: 13px;
  text-transform: uppercase; margin: 12px 0 4px;
}
.doc-official .doc-sub { text-align: center; font-size: 11.5px; margin: 0 0 2px; }
.doc-official .doc-meta {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 12px 0 10px; font-size: 12px;
}
.doc-official table.form-table {
  width: 100%; border-collapse: collapse; font-size: 10.5px; margin: 8px 0;
}
.doc-official table.form-table th,
.doc-official table.form-table td {
  border: 1px solid #333; padding: 3px 4px; vertical-align: middle;
}
.doc-official table.form-table th {
  background: #f1f5f9; font-weight: 700; text-align: center;
}
.doc-official .sec-title {
  font-weight: 700; text-transform: uppercase; margin: 14px 0 6px; font-size: 12px;
}
.doc-official .formula { font-size: 11px; margin: 4px 0 10px; }
.doc-official .sign {
  text-align: right; margin-top: 28px; padding-right: 24px;
}
.doc-official .sign .role { font-weight: 700; text-transform: uppercase; }
.doc-official .sign .hint { font-style: italic; font-size: 11px; }
@media print {
  body * { visibility: hidden !important; }
  .report-preview, .report-preview * { visibility: visible !important; }
  .report-preview { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none; max-width: none; }
}

/* Admin submenu */
.nav-admin-group { margin-bottom: 4px; }
.nav-item.nav-parent {
  position: relative;
}
.nav-item .nav-chevron {
  margin-left: auto;
  font-size: 11px;
  opacity: .7;
  transition: transform .2s;
}
.nav-admin-group.open .nav-chevron { transform: rotate(180deg); }
.nav-sub {
  display: none;
  padding: 2px 0 4px 8px;
  margin: 0 0 4px 10px;
  border-left: 2px solid rgba(245,158,11,.35);
}
.nav-admin-group.open .nav-sub { display: block; }
.nav-item.nav-sub-item {
  padding: 8px 10px;
  font-size: 12.5px;
  color: #94a3b8;
}
.nav-item.nav-sub-item.active {
  color: #fbbf24;
  background: rgba(245,158,11,.12);
}
.app-shell.sidebar-collapsed .nav-sub { display: none !important; }
.app-shell.sidebar-collapsed .nav-item .nav-chevron,
.app-shell.sidebar-collapsed .badge-admin { display: none; }


/* ========== Sidebar polish v2 ========== */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: linear-gradient(180deg, #0b1c38 0%, #0a1628 55%, #081320 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,.06);
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.sidebar-brand {
  padding: 16px 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
.sidebar-brand .brand-text h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.sidebar-brand .brand-text p {
  margin: 3px 0 0;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fbbf24;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 10px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.nav-group { margin-bottom: 6px; }
.nav-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #64748b;
  padding: 10px 12px 6px;
  user-select: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 2px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
  position: relative;
}
.nav-item .ico {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: .85;
  flex-shrink: 0;
  color: inherit;
}
.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #f1f5f9;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(245,158,11,.2), rgba(245,158,11,.06));
  color: #fbbf24;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #f59e0b;
}
.nav-item.active .ico { opacity: 1; color: #fbbf24; }

.nav-item .badge-admin {
  margin-left: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  color: #0c2340;
  padding: 2px 6px;
  border-radius: 5px;
  line-height: 1.2;
}
.nav-item .nav-chevron {
  margin-left: 2px;
  font-size: 10px;
  opacity: .65;
  transition: transform .2s ease;
}
.nav-admin-group.open .nav-chevron { transform: rotate(180deg); }

.nav-sub {
  display: none;
  margin: 2px 0 6px 12px;
  padding: 4px 0 4px 8px;
  border-left: 2px solid rgba(245,158,11,.28);
}
.nav-admin-group.open .nav-sub { display: block; }
.nav-item.nav-sub-item {
  padding: 7px 10px;
  font-size: 12.5px;
  color: #7c8aa0;
  border-radius: 8px;
}
.nav-item.nav-sub-item:hover { color: #e2e8f0; }
.nav-item.nav-sub-item.active {
  color: #fbbf24;
  background: rgba(245,158,11,.12);
  box-shadow: none;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 10px;
  background: rgba(0,0,0,.15);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
}
.sidebar-user .av {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0c2340;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.sidebar-user .meta { flex: 1; min-width: 0; }
.sidebar-user .meta strong {
  display: block;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .meta span {
  font-size: 11px;
  color: #94a3b8;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .logout-btn {
  border: none;
  background: rgba(255,255,255,.06);
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sidebar-user .logout-btn:hover {
  background: rgba(239,68,68,.35);
  color: #fff;
}

/* collapsed refinements */
.app-shell.sidebar-collapsed .sidebar {
  width: 76px;
  min-width: 76px;
}
.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 14px 10px;
}
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .badge-admin,
.app-shell.sidebar-collapsed .nav-chevron,
.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .sidebar-user .meta,
.app-shell.sidebar-collapsed .nav-sub {
  display: none !important;
}
.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 11px 0;
}
.app-shell.sidebar-collapsed .nav-item .ico {
  width: auto;
  font-size: 15px;
}
.app-shell.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding: 8px;
}
.app-shell.sidebar-collapsed .logout-btn { display: none; }
.app-shell.sidebar-collapsed .nav-item.active {
  box-shadow: inset 0 0 0 1px rgba(245,158,11,.35);
}

/* Menu nhóm chức năng */
#mainNav .nav-section {
  margin-top: 8px;
  color: #94a3b8;
  font-size: 10px;
  letter-spacing: .1em;
}
#mainNav .nav-sec-leader { color: #fbbf24; }


/* ========== Sidebar polish v3 — chuyên nghiệp ========== */
.sidebar {
  width: 268px;
  min-width: 268px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(245,158,11,.12), transparent 50%),
    linear-gradient(175deg, #0c1f3d 0%, #0a1730 42%, #07101f 100%);
  box-shadow: 6px 0 28px rgba(0,0,0,.18);
}
.sidebar-brand {
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
}
.sidebar-brand .mark {
  width: 40px; height: 40px; border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(245,158,11,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar-brand .brand-text h1 {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sidebar-brand .brand-text p {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: .1em;
  color: #fcd34d;
  opacity: .95;
}

.sidebar-nav {
  padding: 12px 12px 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}

.nav-group {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.nav-group:last-child { border-bottom: none; margin-bottom: 0; }

.nav-section {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #64748b;
  padding: 10px 10px 6px;
}
.nav-sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 16px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  color: #94a3b8;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
}
.nav-sec-leader {
  color: #d97706;
}
.nav-sec-leader .nav-sec-num {
  background: rgba(245,158,11,.18);
  color: #fbbf24;
}

.nav-item {
  gap: 11px;
  padding: 9px 10px;
  margin-bottom: 3px;
  border-radius: 11px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .15s ease, box-shadow .18s ease;
}
.nav-item .ico-wrap {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.nav-item .ico-wrap.sm {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}
.nav-item .ico {
  width: auto;
  height: auto;
  font-size: 12px;
  opacity: 1;
  line-height: 1;
}
.nav-item .ico-wrap.ico-amber {
  background: rgba(245,158,11,.15);
  border-color: rgba(245,158,11,.25);
  color: #fbbf24;
}
.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #f8fafc;
  transform: translateX(2px);
}
.nav-item:hover .ico-wrap {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.12);
}
.nav-item.active {
  background: linear-gradient(105deg, rgba(245,158,11,.22) 0%, rgba(245,158,11,.06) 70%, transparent);
  color: #fde68a;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #f59e0b;
}
.nav-item.active .ico-wrap {
  background: rgba(245,158,11,.2);
  border-color: rgba(245,158,11,.4);
  color: #fbbf24;
  box-shadow: 0 0 0 1px rgba(245,158,11,.15);
}

.nav-item .badge-admin {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: .06em;
  background: linear-gradient(180deg, #fcd34d, #f59e0b);
  color: #0c2340;
  padding: 3px 7px;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nav-item .nav-chevron {
  font-size: 10px;
  opacity: .55;
  transition: transform .25s ease;
}
.nav-admin-group.open .nav-chevron { transform: rotate(180deg); opacity: .9; }

.nav-sub {
  margin: 2px 0 6px 12px;
  padding: 4px 0 4px 8px;
  border-left: 2px solid rgba(245,158,11,.28);
  border-radius: 0 8px 8px 0;
  background: rgba(0,0,0,.12);
}
.nav-item.nav-sub-item {
  padding: 7px 10px;
  font-size: 12.5px;
  color: #94a3b8;
  border-radius: 8px;
}
.nav-item.nav-sub-item:hover { color: #e2e8f0; }
.nav-item.nav-sub-item.active {
  color: #fbbf24;
  background: rgba(245,158,11,.12);
  box-shadow: none;
}

.sidebar-user {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  background: linear-gradient(0deg, rgba(0,0,0,.25), transparent);
  gap: 11px;
}
.sidebar-user .av {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #fbbf24, #d97706);
  color: #0c2340;
  font-weight: 800;
  font-size: 11px;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.sidebar-user .meta strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user .meta span {
  font-size: 10.5px;
  color: #94a3b8;
}
.sidebar-user .logout-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.sidebar-user .logout-btn:hover {
  background: rgba(244,63,94,.2);
  border-color: rgba(244,63,94,.35);
  color: #fda4af;
}
.logout-ico { font-size: 14px; font-weight: 700; }

/* Collapsed */
.app-shell.sidebar-collapsed .sidebar {
  width: 72px;
  min-width: 72px;
}
.app-shell.sidebar-collapsed .nav-section,
.app-shell.sidebar-collapsed .nav-sec-num,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .badge-admin,
.app-shell.sidebar-collapsed .nav-chevron {
  display: none !important;
}
.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}
.app-shell.sidebar-collapsed .nav-item:hover { transform: none; }
.app-shell.sidebar-collapsed .nav-group { border-bottom: none; padding-bottom: 2px; }

@media (max-width: 900px) {
  .nav-item:hover { transform: none; }
}


/* nav icons emoji v4 — giống mẫu */
.nav-item .nav-ico {
  width: 22px;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  filter: grayscale(0.15);
  opacity: .92;
}
.nav-item:hover .nav-ico,
.nav-item.active .nav-ico {
  filter: none;
  opacity: 1;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(245,158,11,.2), rgba(245,158,11,.05));
  color: #fbbf24;
  box-shadow: inset 3px 0 0 #f59e0b;
  border-radius: 12px;
}
.nav-section {
  letter-spacing: .12em;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 14px 12px 6px;
}
.nav-item {
  padding: 10px 12px;
  gap: 12px;
  color: #94a3b8;
}
.nav-item:hover {
  color: #e2e8f0;
  background: rgba(255,255,255,.06);
  transform: none;
}
/* Ẩn ico-wrap cũ nếu còn */
.nav-item .ico-wrap { display: none; }
.app-shell.sidebar-collapsed .nav-item .nav-ico {
  font-size: 17px;
}
