:root {
  --bg: #eef3f9;
  --panel: rgba(255, 255, 255, 0.96);
  --line: rgba(34, 58, 94, 0.1);
  --text: #18324b;
  --muted: #6c7c90;
  --accent: #1d8ff2;
  --accent-2: #ff4f9a;
  --danger: #df4f5f;
  --shadow: 0 24px 60px rgba(36, 62, 99, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 143, 242, 0.18), transparent 24%),
    radial-gradient(circle at bottom right, rgba(255, 79, 154, 0.12), transparent 18%),
    linear-gradient(180deg, #f6f9fd 0%, #eef3f9 100%);
}
button, input, select { font: inherit; }
.hidden { display: none !important; }
.app-frame { min-height: 100vh; padding: 24px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.login-screen.simple-login { min-height: calc(100vh - 48px); display: flex; align-items: center; justify-content: center; }
.login-panel.narrow { width: min(100%, 460px); padding: 28px; }
.eyebrow { margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.75rem; color: var(--accent); font-weight: 700; }
h1, h2 { margin: 0; }
label { display: grid; gap: 8px; }
label span, small, th, td, .profile-chip p { color: var(--muted); }
.stack-form { display: grid; gap: 16px; }
input, select { width: 100%; border: 1px solid rgba(34, 58, 94, 0.14); background: #fff; border-radius: 16px; padding: 14px 16px; }
button { border: none; border-radius: 16px; padding: 14px 18px; cursor: pointer; font-weight: 700; background: linear-gradient(135deg, var(--accent), #58b6ff); color: #fff; }
button.secondary { background: #eef4fb; color: var(--text); border: 1px solid rgba(34, 58, 94, 0.1); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.form-error { margin: 14px 0 0; color: var(--danger); font-size: 0.94rem; }
.dashboard-shell { width: min(1500px, 100%); margin: 0 auto; display: grid; grid-template-columns: 290px 1fr; gap: 24px; }
.sidebar { padding: 24px; display: flex; flex-direction: column; gap: 22px; min-height: calc(100vh - 48px); position: sticky; top: 24px; }
.sidebar-title { font-size: 1.7rem; line-height: 1.15; }
.profile-chip { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 20px; background: linear-gradient(135deg, rgba(29, 143, 242, 0.12), rgba(255, 79, 154, 0.08)); }
.profile-avatar { width: 52px; height: 52px; border-radius: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.2rem; }
.nav-list { display: grid; gap: 10px; }
.nav-item { text-align: left; background: transparent; color: var(--text); border: 1px solid rgba(34, 58, 94, 0.08); }
.nav-item.active { background: linear-gradient(135deg, rgba(29, 143, 242, 0.14), rgba(29, 143, 242, 0.08)); color: var(--accent); border-color: rgba(29, 143, 242, 0.18); }
.logout-btn { margin-top: auto; }
.workspace { display: grid; gap: 18px; }
.workspace-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 4px 2px; }
.workspace-header h1 { font-size: clamp(2rem, 3vw, 3rem); }
.screen-panel { display: grid; gap: 18px; }
.kpi-grid { display: grid; gap: 16px; }
.kpi-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compact-gap { gap: 14px; }
.kpi { padding: 22px; min-width: 0; overflow: hidden; }
.kpi strong { display: block; margin: 12px 0 8px; font-size: clamp(1.6rem, 2.2vw, 2.5rem); line-height: 1.1; overflow-wrap: anywhere; word-break: break-word; }
.content-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; }
.content-grid.wide-left { grid-template-columns: 1.45fr 0.85fr; }
.section-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 16px; }
.section-head.compact { margin-bottom: 14px; }
.filters, .report-tabs-panel, .panel { padding: 22px; }
.report-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.report-tab { background: #f7fbff; color: var(--text); border: 1px solid rgba(34, 58, 94, 0.08); }
.report-tab.active { background: linear-gradient(135deg, rgba(29, 143, 242, 0.14), rgba(29, 143, 242, 0.04)); color: var(--accent); }
.filter-grid { display: grid; gap: 14px; }
.summary-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.detail-filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #313840; color: #fff; padding: 14px 12px; text-align: left; font-size: 0.92rem; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid rgba(34, 58, 94, 0.08); white-space: nowrap; }
tbody tr:nth-child(even) { background: rgba(239, 244, 250, 0.7); }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }
.badge.register { background: rgba(55, 179, 107, 0.14); color: #1f8e51; }
.badge.other, .badge.role { background: rgba(111, 127, 146, 0.14); color: #556274; }
.table-action { padding: 8px 12px; border-radius: 12px; background: #f3f7fd; color: var(--text); border: 1px solid rgba(34, 58, 94, 0.08); }
.table-head-wrap { align-items: center; }
.table-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.page-info { padding: 8px 12px; border-radius: 999px; background: rgba(29, 143, 242, 0.08); color: var(--accent); font-weight: 700; }
.pagination-bar { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.pagination-btn { min-width: 130px; }
@media (max-width: 1280px) {
  .summary-filter-grid, .detail-filter-grid, .kpi-grid.five, .kpi-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .dashboard-shell, .content-grid, .content-grid.wide-left { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; position: static; }
}
@media (max-width: 720px) {
  .app-frame { padding: 16px; }
  .summary-filter-grid, .detail-filter-grid, .kpi-grid.five, .kpi-grid.four { grid-template-columns: 1fr; }
  .workspace-header, .section-head { flex-direction: column; align-items: stretch; }
  .table-meta, .pagination-bar { justify-content: flex-start; }
}
