/* ============================================================
   E-Learning DMPT — Design System & Styles
   Duta Marine HSSE Theme: Plus Jakarta Sans & Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@600;700&display=swap');

/* ── CSS Custom Properties (Three-Layer Design Tokens) ───── */
:root {
  /* ── 1. PRIMITIVES ─────────────────────────────────────── */
  /* Skala Biru Maritim Duta Marine */
  --color-brand-900: #003366;
  --color-brand-800: #004080;
  --color-brand-700: #004d80;
  --color-brand-600: #005999;
  --color-brand-500: #0066b2;
  --color-brand-400: #0077cc;
  --color-brand-300: #38bdf8;
  --color-brand-200: #bae6fd;
  --color-brand-100: #e0f2fe;
  --color-brand-50:  #f0f7ff;

  /* Status Primitives */
  --color-success: #059669;
  --color-danger:  #dc2626;
  --color-warning: #d97706;

  /* Typography Primitives */
  --font-display: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* ── 2. SEMANTIC TOKENS (LIGHT MODE) ───────────────────── */
  /* Surfaces */
  --surface-ground: #f0f7ff;
  --surface-card:   #ffffff;
  --surface-card-subtle: #f8fafc;
  --surface-border: rgba(0, 80, 160, 0.12);

  /* Text */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #64748b;
  --text-inverse:   #ffffff;

  /* Status Semantics */
  --success:        var(--color-success);
  --success-bg:     rgba(5, 150, 105, 0.1);
  --warning:        var(--color-warning);
  --warning-bg:     rgba(217, 119, 6, 0.1);
  --danger:         var(--color-danger);
  --danger-bg:      rgba(220, 38, 38, 0.08);

  /* Accents & Brand */
  --accent-blue:     var(--color-brand-500);
  --accent-gradient: linear-gradient(135deg, var(--color-brand-700), var(--color-brand-500));

  /* ── 3. COMPONENT ALIASES (BACKWARDS COMPATIBILITY) ─────── */
  --bg-primary:    var(--surface-ground);
  --bg-secondary:  var(--color-brand-100);
  --bg-card:       var(--surface-card);
  --bg-card-hover: var(--surface-card);
  --bg-sidebar:    #f8fafc;
  --bg-input:      #ffffff;
  --bg-overlay:    rgba(0, 30, 60, 0.4);

  --border:        var(--surface-border);
  --border-focus:  var(--color-brand-500);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Shadow — Structured & Soft Layering */
  --shadow-card:  0 1px 3px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(0, 80, 160, 0.08);
  --shadow-hover: 0 4px 6px rgba(15, 23, 42, 0.04), 0 10px 24px rgba(0, 80, 160, 0.12);
  --shadow-glow:  0 0 24px rgba(0, 102, 178, 0.15);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Layout */
  --nav-height: 64px;
  --sidebar-width: 260px;
  --max-width: 1200px;

  /* Transition & Tactile Motion */
  --ease-tactile: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark Mode ─────────────────────────────────────────── */
[data-theme="dark"] {
  /* Semantic Surfaces */
  --surface-ground: #0b1329;
  --surface-card:   #152238;
  --surface-card-subtle: #1c2c47;
  --surface-border: rgba(255, 255, 255, 0.12);

  /* Semantic Text (WCAG AA > 5.8:1 verified against #152238) */
  --text-primary:   #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-inverse:   #0b1329;

  /* Status Semantics */
  --color-success:  #10b981;
  --color-danger:   #ef4444;
  --color-warning:  #f59e0b;
  --success:        #10b981;
  --success-bg:     rgba(16, 185, 129, 0.15);
  --warning:        #f59e0b;
  --warning-bg:     rgba(245, 158, 11, 0.15);
  --danger:         #ef4444;
  --danger-bg:      rgba(239, 68, 68, 0.15);

  /* Component Aliases */
  --bg-primary:    var(--surface-ground);
  --bg-secondary:  #1a2845;
  --bg-card:       var(--surface-card);
  --bg-card-hover: #1b2d4b;
  --bg-sidebar:    #101b30;
  --bg-input:      #101b30;
  --bg-overlay:    rgba(0, 0, 0, 0.6);

  --accent-blue:     #38bdf8;
  --accent-gradient: linear-gradient(135deg, var(--color-brand-500), #38bdf8);

  --border:        var(--surface-border);
  --border-focus:  rgba(56, 189, 248, 0.6);

  --shadow-card:  0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow:  0 0 24px rgba(56, 189, 248, 0.15);
}

[data-theme="dark"] .navbar {
  background: rgba(11, 19, 41, 0.95);
  border-bottom-color: var(--surface-border);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] .form-control {
  background: var(--surface-card);
  border-color: var(--surface-border);
  color: var(--text-primary);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-control:focus {
  background: var(--surface-card-subtle);
}

[data-theme="dark"] .login-card {
  background: var(--surface-card);
}

[data-theme="dark"] .btn--secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

[data-theme="dark"] .btn--google {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--surface-border);
}

[data-theme="dark"] .toast {
  background: var(--surface-card);
  border-color: var(--surface-border);
}

[data-theme="dark"] a:hover {
  color: var(--color-brand-300);
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  transform: none;
}

/* ── Reset & Base ──────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--surface-ground);
}

body {
  font-family: var(--font-body);
  background-color: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Maritime Offshore Platform Background (bg_platform.jpg) ── */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(240, 247, 255, 0.82), rgba(240, 247, 255, 0.88)),
    url('../images/bg_platform.jpg');
  background-size: cover;
  background-position: center 20%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: -1;
  transition: background var(--transition-base), opacity var(--transition-base);
}

[data-theme="dark"] body::before {
  background-image: 
    linear-gradient(rgba(11, 19, 41, 0.82), rgba(11, 19, 41, 0.90)),
    url('../images/bg_platform.jpg');
  filter: brightness(0.95) contrast(1.1);
}

/* ── Typography Pairing ────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.hero__title,
.page-header__title,
.card__title,
.modal__header,
.modal__title,
.login-card__title,
.navbar__brand-gradient {
  font-family: var(--font-display);
  letter-spacing: -0.015em;
}

body, p, input, select, textarea, label, table, .admin-table, .form-input, .form-control {
  font-family: var(--font-body);
}

/* ── OpenType Tabular Figures (Anti Layout Shift) ──────── */
.stat__value,
.tabular-nums,
table td,
table th,
.admin-table td,
.admin-table th,
.compliance-metric-row__val,
.score-badge,
.badge-status-tag,
.score-value,
.timestamp,
.kpi-card__value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brand-700);
}

img {
  max-width: 100%;
  display: block;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ── Navbar ────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-xl);
  z-index: 1000;
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
}

.navbar__brand svg {
  width: 28px;
  height: 28px;
}

.navbar__brand-gradient {
  color: var(--accent-blue);
  font-weight: 700;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.navbar__link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.navbar__link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.navbar__link.active {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
}

.navbar__link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  background: none;
  border: none;
}

.navbar__hamburger span {
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
}

/* ── Main Content ──────────────────────────────────────── */
.main {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

/* ── Hero Section (Editorial Split Layout) ──────────────── */
.hero {
  padding: var(--space-2xl) 0 var(--space-xl);
  position: relative;
}

.hero__split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero__partner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-brand-700);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-card);
}

[data-theme="dark"] .hero__partner-badge {
  color: var(--color-brand-300);
  background: var(--surface-card);
}

.hero__title {
  font-size: 2.3rem;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.hero__title span {
  color: var(--color-brand-500);
}

.hero__subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: var(--space-lg);
  max-width: 580px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Compliance Summary Card (High-Density Solid Card) */
.compliance-summary-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: var(--space-xl);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  transition: border-color var(--transition-fast);
}

.compliance-summary-card:hover {
  border-color: var(--color-brand-500);
}

.compliance-summary-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: var(--space-md);
}

.compliance-summary-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.compliance-metrics {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compliance-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.compliance-metric-row__label {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.compliance-metric-row__val {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.compliance-progress-track {
  height: 6px;
  background: var(--surface-ground);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}

.compliance-progress-fill {
  height: 100%;
  background: var(--color-brand-500);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Retain .hero__stats for secondary stats / fallback views */
.hero__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
}

.stat {
  text-align: center;
}

.stat__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-blue);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: var(--space-xs);
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-header__title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.page-header__subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ── Solid Surface Card ────────────────────────────────── */
.card {
  background-color: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 8px; /* Turunkan dari radius berlebih 20px menjadi 8px terukur */
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background-color: var(--surface-card);
  border-color: var(--color-brand-500);
  box-shadow: var(--shadow-card);
  transform: none; /* Hilangkan translateY(-4px) melayang */
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
}

.card__icon--red {
  background: var(--danger-bg);
}

.card__icon--blue {
  background: rgba(59, 130, 246, 0.1);
}

.card__icon--yellow {
  background: var(--warning-bg);
}

.card__icon--green {
  background: var(--success-bg);
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.card__desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

/* ── Badge ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge--info {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.badge--success {
  background: var(--success-bg);
  color: #16a34a;
}

.badge--warning {
  background: var(--warning-bg);
  color: #d97706;
}

.badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

/* ── Score Badge (Dashboard Cards) ─────────────────────── */
.score-badge {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.score-badge--pass {
  background: var(--success-bg);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.score-badge--fail {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.score-badge--fail small {
  font-weight: 400;
  font-size: 0.75rem;
  display: block;
  margin-top: 4px;
}

.badge-status-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-right: 6px;
}

.score-badge--pass .badge-status-tag {
  background: #16a34a;
  color: #ffffff;
}

.score-badge--fail .badge-status-tag {
  background: #dc2626;
  color: #ffffff;
}

.icon-svg {
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

/* ── Card Grid ─────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

/* ── Accordion ─────────────────────────────────────────── */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.accordion__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  user-select: none;
}

.accordion__header:hover {
  background: var(--bg-card-hover);
}

.accordion__header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.accordion__header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.accordion__header-title {
  font-weight: 600;
  font-size: 1rem;
}

.accordion__header-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  margin-left: var(--space-sm);
}

.accordion__chevron {
  transition: transform var(--transition-base);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.accordion__item.open .accordion__chevron {
  transform: rotate(180deg);
}

.accordion__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion__item.open .accordion__body {
  max-height: 800px;
  padding: 0 var(--space-lg) var(--space-lg);
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-tactile), background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.975);
}

.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 119, 204, 0.2);
}

.btn--primary:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.btn--secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 80, 160, 0.15);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #dc2626;
}

.btn--success {
  background: var(--success);
  color: #fff;
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn--full {
  width: 100%;
}

.btn--icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn--icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn--icon.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.3);
}

/* ── Form Inputs ───────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: #ffffff;
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* ── Upload Zone ───────────────────────────────────────── */
.upload-card {
  background-color: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  padding: var(--space-lg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.upload-card:hover {
  border-color: var(--color-brand-500);
}

.upload-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-md);
  font-size: 1.5rem;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
  transition: all var(--transition-base);
}

.upload-card.uploaded .upload-card__icon {
  background: var(--success-bg);
  color: var(--success);
}

.upload-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.upload-zone {
  width: 100%;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-xl) var(--space-md);
  cursor: pointer;
  transition: all var(--transition-base);
  margin: var(--space-md) 0;
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-blue);
  background: rgba(0, 119, 204, 0.04);
}

.upload-zone__text {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.upload-zone__text strong {
  color: var(--accent-blue);
}

.upload-zone input[type="file"] {
  display: none;
}

.upload-card__formats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.upload-card__status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
  width: 100%;
  justify-content: center;
}

.upload-card__status--success {
  background: var(--success-bg);
  color: var(--success);
}

.upload-card__status--error {
  background: var(--danger-bg);
  color: var(--danger);
}

.upload-card__status--uploading {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

/* Upload progress shimmer */
.upload-progress {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg-input);
  margin-top: var(--space-sm);
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 2px;
  animation: shimmer 1.5s infinite;
  width: 60%;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(200%);
  }
}

/* Success checkmark bounce */
@keyframes bounceIn {
  0% {
    transform: scale(0);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.upload-card.uploaded .upload-card__icon {
  animation: bounceIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Admin Layout ──────────────────────────────────────── */
.admin-layout,
#admin-container {
  display: flex;
  min-height: calc(100vh - var(--nav-height));
  background-color: var(--surface-ground);
  width: 100%;
}

.admin-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: var(--space-lg) 0;
  flex-shrink: 0;
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

.admin-sidebar__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 0 var(--space-lg);
  margin-bottom: var(--space-md);
}

.admin-sidebar__nav {
  list-style: none;
  flex: 1;
}

.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.admin-sidebar__link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.admin-sidebar__link.active {
  color: var(--accent-blue);
  background: rgba(0, 119, 204, 0.06);
  border-left-color: var(--accent-blue);
}

.admin-sidebar__link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-sidebar__logout {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.admin-content {
  flex: 1;
  padding: var(--space-xl);
  overflow-y: auto;
}

/* ── Admin Tables ──────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th {
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: var(--bg-card);
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-control--sm {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.scores-filter-row th {
  padding: 4px 8px !important;
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border) !important;
}

.scores-filter-row .form-control,
.scores-filter-row .form-control--sm {
  width: 100%;
  min-width: 60px;
}

/* ── Link Item in Admin ────────────────────────────────── */
.link-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.link-item .form-input {
  flex: 1;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* ── Login Card ────────────────────────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: var(--space-xl);
}

.login-card {
  background-color: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.02);
  padding: var(--space-2xl);
  width: 100%;
  max-width: 400px;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.login-card__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-sm);
}

.login-card__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-xl);
}

.login-card__icon {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: var(--space-lg);
}

.login-error {
  background: var(--danger-bg);
  color: var(--danger);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  display: none;
  text-align: center;
}

.login-error.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ── Divider "atau" ───────────────────────────────────── */
.divider-or {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-lg) 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Google Sign-In Button ────────────────────────────── */
.google-btn-wrapper {
  display: flex;
  justify-content: center;
}

.btn--google {
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  gap: var(--space-sm);
  transition: all var(--transition-fast);
}

.btn--google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn--google svg {
  flex-shrink: 0;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-md));
  right: var(--space-md);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.3s ease forwards;
  min-width: 300px;
  max-width: 420px;
}

.toast--success {
  border-left: 3px solid var(--success);
}

.toast--error {
  border-left: 3px solid var(--danger);
}

.toast--info {
  border-left: 3px solid var(--accent-blue);
}

.toast--warning {
  border-left: 3px solid var(--warning);
}

.toast__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast__message {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
}

.toast__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast.removing {
  animation: slideOutRight 0.3s ease forwards;
}

/* ── Status Badge ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge--success {
  background: var(--success-bg);
  color: var(--success);
}

.badge--warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge--danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge--info {
  background: rgba(0, 119, 204, 0.08);
  color: var(--accent-blue);
}

/* ── Skeleton Loading Component ────────────────────────── */
.skeleton-box {
  display: block;
  height: 1rem;
  background: linear-gradient(90deg, var(--surface-ground) 25%, var(--surface-border) 50%, var(--surface-ground) 75%);
  background-size: 200% 100%;
  animation: skeletonWave 1.6s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes skeletonWave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── UI Ball Spinners (Minimal Pure CSS Loaders) ────────── */
.uiball-spinner {
  --uib-size: 18px;
  --uib-color: currentColor;
  --uib-speed: 0.9s;
  --uib-stroke: 2px;
  position: relative;
  display: inline-block;
  height: var(--uib-size);
  width: var(--uib-size);
  vertical-align: middle;
  flex-shrink: 0;
}

.uiball-ring {
  border: var(--uib-stroke) solid rgba(0, 102, 178, 0.18);
  border-top-color: var(--uib-color);
  border-radius: 50%;
  animation: uiballRingRotate var(--uib-speed) linear infinite;
}

[data-theme="dark"] .uiball-ring {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: var(--uib-color);
}

@keyframes uiballRingRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Modal Dialogs ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.modal-dialog {
  background-color: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalEnter 0.25s var(--ease-tactile);
}

@keyframes modalEnter {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal__header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-display);
}

.modal__body {
  padding: var(--space-lg);
  overflow-y: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal__body h4 {
  color: var(--text-primary);
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-size: 1rem;
}

.modal__body ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.modal__body li {
  margin-bottom: 6px;
}

.modal__footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--surface-border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  background: var(--surface-card-subtle);
}

/* ── Section Divider ───────────────────────────────────── */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-xl) 0;
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state__text {
  font-size: 0.95rem;
}

/* ── Footer ────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2xl);
}

/* ── Monitoring log table ──────────────────────────────── */
.log-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.log-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.log-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.log-table tr:hover td {
  background: var(--bg-card);
}

/* ── Module Management ─────────────────────────────────── */
.module-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.module-item {
  transition: all var(--transition-fast);
}

.btn--pass {
  background: transparent;
  border: 1px solid var(--success);
  color: var(--success);
  padding: 0px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn--pass:hover {
  opacity: 1;
  background: var(--success-bg);
  transform: scale(1.1);
}

.module-item:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

.module-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .module-item__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Module Form ───────────────────────────────────────── */
.module-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .module-form__grid {
    grid-template-columns: 1fr;
  }

  .module-form__grid .form-group[style*="grid-column"] {
    grid-column: auto !important;
  }
}

/* ── Emoji Picker ──────────────────────────────────────── */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--space-sm);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-width: 320px;
}

.emoji-picker__item {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.emoji-picker__item:hover {
  transform: scale(1.15);
  background: var(--bg-card-hover);
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(0, 119, 204, 0.15);
}

.emoji-picker__item.selected {
  border-color: var(--accent-blue);
  background: rgba(0, 119, 204, 0.1);
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1023px) {
  .admin-sidebar {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .navbar__links {
    position: fixed;
    top: var(--nav-height);
    right: -100%;
    width: 260px;
    height: calc(100vh - var(--nav-height));
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    flex-direction: column;
    padding: var(--space-lg);
    gap: var(--space-sm);
    transition: right var(--transition-base);
    z-index: 999;
  }

  .navbar__links.open {
    right: 0;
  }

  .navbar__hamburger {
    display: flex;
  }

  .navbar__hamburger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .navbar__hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .navbar__hamburger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero__title {
    font-size: 1.8rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding: var(--space-lg) var(--space-md);
  }

  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) 0;
  }

  .admin-sidebar__nav {
    display: flex;
    overflow-x: auto;
    padding: 0 var(--space-md);
    gap: var(--space-xs);
  }

  .admin-sidebar__link {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
  }

  .admin-sidebar__link.active {
    border-left: none;
    border-bottom-color: var(--accent-blue);
  }

  .admin-sidebar__logout {
    border-top: none;
    padding: var(--space-sm) var(--space-md);
  }

  .admin-content {
    padding: var(--space-md);
  }

  .login-card {
    padding: var(--space-lg);
  }

  /* Page header — smaller on mobile */
  .page-header__title {
    font-size: 1.3rem;
  }

  .page-header__subtitle {
    font-size: 0.85rem;
  }

  /* Hero section */
  .hero__subtitle {
    font-size: 0.9rem;
  }

  .hero__stats {
    gap: var(--space-lg);
  }

  /* Score tables — horizontal scroll */
  .admin-table {
    font-size: 0.8rem;
  }

  .admin-table th,
  .admin-table td {
    padding: var(--space-sm);
    white-space: nowrap;
  }

  /* Score badges on module cards */
  .score-badge {
    font-size: 0.8rem;
    padding: var(--space-sm) var(--space-md);
  }

  /* KPI grid — 2 columns on tablet */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-card {
    padding: var(--space-md);
  }

  .kpi-card__value {
    font-size: 1.4rem;
  }

  /* Module form grid — single column */
  .module-form__grid {
    grid-template-columns: 1fr;
  }

  /* User area in mobile nav */
  #user-area {
    border-left: none !important;
    border-top: 1px solid var(--border);
    margin-left: 0 !important;
    padding-left: 0 !important;
    padding-top: var(--space-sm);
    flex-wrap: wrap;
  }

  /* Buttons — larger touch targets */
  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .btn--sm {
    padding: 8px 14px;
  }

  /* Profile page */
  .container[style*="max-width:600px"] {
    max-width: 100% !important;
  }

  /* Scores filter row — hide on mobile (use global search) */
  .scores-filter-row {
    display: none;
  }

  /* Card hover — no transform float on mobile (avoids jank) */
  .card:hover {
    transform: none;
  }

  /* Tables — ensure they scroll horizontally */
  .card[style*="overflow-x"] {
    -webkit-overflow-scrolling: touch;
  }

  /* Scores page — attempt table */
  .scores-module-card table th,
  .scores-module-card table td {
    padding: var(--space-sm);
    font-size: 0.8rem;
  }

  /* Footer */
  .footer {
    padding: var(--space-lg);
    font-size: 0.75rem;
  }

  /* Admin sidebar title — hide on mobile for space */
  .admin-sidebar__title {
    display: none;
  }

  /* Admin sidebar link text — icons only on small screens */
  .admin-sidebar__link svg {
    width: 16px;
    height: 16px;
  }

  .admin-sidebar__link {
    font-size: 0.8rem;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm);
  }
}

/* ── KPI Cards (Admin Dashboard) ──────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-md);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-card);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.kpi-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin: 0 auto var(--space-md);
}

.kpi-card__value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.kpi-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Bar Chart (inline CSS chart) ─────────────────────── */
.bar-chart {
  position: relative;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  height: 24px;
  overflow: hidden;
}

.bar-chart__fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.bar-chart__fill--success {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.bar-chart__fill--warning {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.bar-chart__fill--danger {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.bar-chart__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Donut Chart (CSS only) ───────────────────────────── */
.donut-chart {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  background: conic-gradient(
    #22c55e 0deg, #22c55e var(--pass-deg),
    #ef4444 var(--pass-deg), #ef4444 360deg
  );
  position: relative;
  flex-shrink: 0;
}

.donut-chart__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Progress Ring (CSS only) ─────────────────────────── */
.progress-ring {
  width: 140px;
  height: 140px;
  border-radius: var(--radius-full);
  background: conic-gradient(
    #3b82f6 0deg,
    #3b82f6 calc(var(--progress) * 3.6deg),
    var(--bg-secondary) calc(var(--progress) * 3.6deg),
    var(--bg-secondary) 360deg
  );
  position: relative;
  display: inline-block;
}

.progress-ring__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Histogram (vertical bar chart) ───────────────────── */
.histogram {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-md);
  height: 180px;
  padding: var(--space-md) 0;
}

.histogram__bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 80px;
  height: 100%;
  justify-content: flex-end;
}

.histogram__count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.histogram__bar {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 4px;
}

.histogram__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
}

/* Dashboard row responsive */
@media (max-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr !important;
  }
}


@media (max-width: 480px) {
  .hero__title {
    font-size: 1.3rem;
  }

  .hero__subtitle {
    font-size: 0.8rem;
  }

  .hero__stats {
    gap: var(--space-md);
  }

  .stat__value {
    font-size: 1.2rem;
  }

  .stat__label {
    font-size: 0.7rem;
  }

  .navbar {
    padding: 0 var(--space-sm);
  }

  /* Hide brand text on tiny screens, keep logos */
  .navbar__brand-gradient {
    display: none;
  }

  .toast {
    min-width: unset;
    max-width: calc(100vw - 24px);
    font-size: 0.8rem;
  }

  .toast__message {
    font-size: 0.8rem;
  }

  /* KPI — single column on small phones */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
  }

  .kpi-card {
    padding: var(--space-sm) var(--space-md);
  }

  .kpi-card__icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-bottom: var(--space-sm);
  }

  .kpi-card__value {
    font-size: 1.2rem;
  }

  .kpi-card__label {
    font-size: 0.65rem;
  }

  /* Page header */
  .page-header__title {
    font-size: 1.1rem;
  }

  .page-header {
    margin-bottom: var(--space-md);
  }

  /* Login */
  .login-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .login-card__title {
    font-size: 1.2rem;
  }

  .login-card__icon {
    font-size: 2rem;
    margin-bottom: var(--space-md);
  }

  /* Cards */
  .card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
  }

  .card__title {
    font-size: 0.95rem;
  }

  .card__desc {
    font-size: 0.8rem;
  }

  /* Admin table compact */
  .admin-table th,
  .admin-table td {
    padding: 6px;
    font-size: 0.75rem;
  }

  /* Sync buttons */
  .btn {
    padding: 10px 16px;
    font-size: 0.85rem;
  }

  /* Container minimal padding */
  .container {
    padding: var(--space-md) var(--space-sm);
  }

  /* Section divider less margin */
  .section-divider {
    margin: var(--space-lg) 0;
  }

  /* Bar chart smaller */
  .bar-chart {
    height: 20px;
  }

  .bar-chart__label {
    font-size: 0.6rem;
  }

  /* Score module cards on user page */
  .score-badge {
    font-size: 0.75rem;
    padding: 6px var(--space-sm);
  }

  /* Theme toggle smaller */
  .theme-toggle {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

/* ── Commitment Statement Page ─────────────────────────── */
.commitment-card {
  padding: 0;
  overflow: visible;
}

.commitment-card:hover {
  transform: none;
}

.commitment-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(0, 119, 204, 0.08), rgba(0, 170, 238, 0.05));
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.commitment-info__icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 119, 204, 0.1);
  border-radius: var(--radius-md);
}

.commitment-info strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.commitment-pdf-container {
  position: relative;
  background: #f5f5f5;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

[data-theme="dark"] .commitment-pdf-container {
  background: #1a1a2e;
}

.commitment-pdf-image {
  width: 100%;
  max-width: 900px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.commitment-scroll-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(217, 119, 6, 0.08));
  border-bottom: 1px solid var(--border);
  color: #d97706;
  font-size: 0.85rem;
  font-weight: 500;
  animation: pulseHint 2s ease-in-out infinite;
}

@keyframes pulseHint {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.commitment-scroll-hint__arrow {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.commitment-accept {
  padding: var(--space-lg);
  background: rgba(0, 119, 204, 0.03);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.commitment-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  margin-bottom: var(--space-md);
  user-select: none;
}

.commitment-check:hover:not(.commitment-check--disabled) {
  border-color: var(--accent-blue);
  background: rgba(0, 119, 204, 0.04);
  box-shadow: 0 0 0 3px rgba(0, 119, 204, 0.08);
}

.commitment-check--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.commitment-check input[type="checkbox"] {
  display: none;
}

.commitment-check__box {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-top: 2px;
  background: var(--bg-input);
  position: relative;
}

.commitment-check input:checked + .commitment-check__box {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}

.commitment-check input:checked + .commitment-check__box::after {
  content: '✓';
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.commitment-check__text {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
  flex: 1;
}

.commitment-submit {
  margin-top: var(--space-sm);
  padding: 14px var(--space-lg);
  font-size: 1rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.commitment-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.commitment-submit:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 119, 204, 0.3);
}

/* Dark mode adjustments */
[data-theme="dark"] .commitment-info {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(34, 211, 238, 0.05));
}

[data-theme="dark"] .commitment-accept {
  background: rgba(56, 189, 248, 0.03);
}

[data-theme="dark"] .commitment-scroll-hint {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(217, 119, 6, 0.08));
}

/* ── Responsive: Commitment Statement ──────────────────── */
@media (max-width: 768px) {
  .commitment-info {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .commitment-accept {
    padding: var(--space-md);
  }

  .commitment-check {
    padding: var(--space-sm) var(--space-md);
  }

  .commitment-check__text {
    font-size: 0.82rem;
  }

  .commitment-submit {
    font-size: 0.9rem;
    padding: 12px var(--space-md);
  }
}

/* ── Login & Auth Portal Layout ───────────────────────── */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height) - 40px);
  padding: var(--space-xl) var(--space-md);
}

.login-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: var(--space-2xl) var(--space-xl);
  width: 100%;
  max-width: 440px;
  position: relative;
  box-shadow: var(--shadow-md);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-brand-500);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.login-card__title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
  font-family: var(--font-display);
}

.login-card__subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.login-card__icon {
  text-align: center;
  color: var(--color-brand-500);
  margin-bottom: var(--space-md);
}

.login-error {
  display: none;
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(220, 38, 38, 0.2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

/* ============================================================
   Print Styles (Ctrl+P to PDF)
   ============================================================ */
@media print {
  /* Sembunyikan elemen UI yang tidak diperlukan saat print */
  .navbar,
  .btn,
  .theme-toggle,
  .navbar__hamburger,
  #toast-container,
  .footer {
    display: none !important;
  }

  /* Reset margin/padding dan background untuk print */
  body, .main {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body::before {
    display: none !important; /* Hilangkan background image */
  }

  .container {
    padding: 20px !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Tipografi untuk print */
  .hero__title {
    font-size: 24pt !important;
    color: #000 !important;
  }
  
  .hero__title span {
    color: #000 !important;
  }

  .stat__value {
    color: #000 !important;
  }

  /* Pastikan elemen hero terlihat rapi */
  .hero {
    padding: 20px 0 !important;
  }

  /* Layout Card */
  .card-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 15px !important;
  }

  .card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    page-break-inside: avoid !important;
    padding: 15px !important;
  }

  /* Pastikan warna background (seperti badge) tetap tercetak */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}

/* ============================================================
   Modul Upload Kualifikasi — Cloud Storage In-Memory (Tahap 5)
   ============================================================ */

.upload-dropzone:hover {
  border-color: var(--color-brand-500) !important;
  background-color: var(--surface-card) !important;
}

.category-card:hover {
  border-color: var(--color-brand-400) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.category-card.active {
  box-shadow: 0 0 0 1px var(--color-brand-500), var(--shadow-card);
}

[data-theme="dark"] .upload-security-banner {
  background: var(--surface-card) !important;
  border-color: var(--surface-border) !important;
}

[data-theme="dark"] .category-card {
  background: var(--surface-card) !important;
  border-color: var(--surface-border) !important;
}

[data-theme="dark"] .category-card.active {
  background: var(--surface-card-subtle) !important;
  border-color: var(--color-brand-400) !important;
}

[data-theme="dark"] .upload-dropzone {
  background: var(--surface-card-subtle) !important;
  border-color: var(--surface-border) !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============================================================
   Admin Panel HSSE Architecture
   Otoritas: Administrator Herdiansyah Hadikusumah
   ============================================================ */

.admin-command-banner {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-left: 4px solid #1a237e;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.matrix-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.matrix-grid-table th {
  background: var(--surface-card-subtle);
  color: var(--text-primary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 12px 14px;
  border-bottom: 2px solid var(--surface-border);
  text-align: left;
}

.matrix-grid-table td {
  padding: 14px;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: middle;
}

.matrix-grid-table tr:hover td {
  background-color: rgba(26, 35, 126, 0.02);
}

.matrix-cell-box {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
  transition: border-color var(--transition-fast);
}

.matrix-cell-box:hover {
  border-color: #1a237e;
}

.matrix-cell-box.modified {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.03);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.toggle-chip input[type="checkbox"] {
  cursor: pointer;
  accent-color: #1a237e;
  width: 15px;
  height: 15px;
}

.threshold-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.threshold-card:hover {
  border-color: #1a237e;
  box-shadow: var(--shadow-sm);
}

.threshold-slider-control {
  width: 100%;
  accent-color: #1a237e;
  height: 6px;
  border-radius: 3px;
  cursor: pointer;
  margin: 10px 0;
}

.preset-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-chip-btn:hover {
  background: #1a237e;
  color: #ffffff;
  border-color: #1a237e;
}

.audit-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.audit-status-badge--fit {
  background: rgba(22, 163, 74, 0.12);
  color: #15803d;
  border: 1px solid #16a34a;
}

.audit-status-badge--unauth {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  border: 1px solid #dc2626;
}

.audit-status-badge--pending {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border: 1px solid #d97706;
}

.doc-audit-stamp {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 4px;
}

/* ── Container Layout & Visibility Guarantees ───────────────── */
#app,
#main-content,
.main,
.container,
.dashboard-wrapper,
.card,
.login-card {
  visibility: visible;
  opacity: 1;
}

.admin-layout,
#admin-container {
  display: flex;
  background-color: var(--surface-ground);
  width: 100%;
  min-height: calc(100vh - var(--nav-height));
  visibility: visible;
  opacity: 1;
}

.login-wrapper {
  display: flex;
  visibility: visible;
  opacity: 1;
}
