/* =============================================
   HIRARC 2008 — Global Stylesheet
   Theme: Dark Professional
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =============================================
   CSS Variables / Design Tokens
   ============================================= */
:root {
  /* Colors (Emerald & Slate HSE Safety Theme) */
  --primary: #059669;
  --primary-light: #34D399;
  --primary-dark: #065F46;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #06B6D4;

  /* Risk Level Colors */
  --risk-low: #10B981;
  --risk-medium: #F59E0B;
  --risk-high: #F97316;
  --risk-extreme: #EF4444;

  /* Dark Theme */
  --bg-dark: #0F172A;
  --bg-sidebar: #090D16;
  --bg-card: #1E293B;
  --bg-card-hover: #253347;
  --bg-input: #0F172A;
  --border: #334155;
  --border-light: #1E293B;

  /* Text - High Contrast Readability Fix */
  --text-primary: #F8FAFC;
  --text-secondary: #E2E8F0;
  --text-muted: #94A3B8;
  --text-dark: #0F172A;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 20px rgba(30,64,175,0.3);

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* =============================================
   Reset & Base
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent);
}

img { max-width: 100%; }
ul { list-style: none; }

/* =============================================
   Layout — Sidebar + Main
   ============================================= */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo-text h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.sidebar-logo-text span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }

.nav-section {
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  margin-bottom: 2px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(59,130,246,0.1);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(30,64,175,0.5), rgba(59,130,246,0.2));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.3);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  line-height: 1.6;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
}

.user-card:hover {
  background: var(--bg-card-hover);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; overflow: hidden; }
.user-info strong {
  display: block;
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Header --- */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-title {
  flex: 1;
}

.header-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-title .breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.header-title .breadcrumb a {
  color: var(--text-muted);
}
.header-title .breadcrumb a:hover {
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-btn {
  width: 38px; height: 38px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--bg-dark);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

/* --- Page Content --- */
.page-content {
  padding: 24px;
  flex: 1;
}

/* =============================================
   Cards
   ============================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(59,130,246,0.3);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

/* Stat Cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 3px;
  background: var(--stat-color, var(--primary));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--stat-color, var(--primary));
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--stat-bg, rgba(59, 130, 246, 0.1)) !important;
  border: 1px solid var(--stat-border, rgba(59, 130, 246, 0.2)) !important;
  color: var(--stat-color, var(--primary-light)) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover .stat-icon {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 0 20px var(--stat-glow, rgba(59, 130, 246, 0.45));
}

.stat-info { flex: 1; }
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.stat-change {
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* =============================================
   Buttons
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 2px 8px rgba(30,64,175,0.4);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(30,64,175,0.5);
  color: white;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-accent:hover { color: white; }

.btn-success {
  background: linear-gradient(135deg, #059669, var(--success));
  color: white;
}
.btn-success:hover { color: white; }

.btn-danger {
  background: linear-gradient(135deg, #DC2626, var(--danger));
  color: white;
}
.btn-danger:hover { color: white; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 15px;
}

.btn-icon {
  padding: 9px;
  width: 36px; height: 36px;
  justify-content: center;
}

/* =============================================
   Forms
   ============================================= */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 11.5px;
  color: var(--danger);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* =============================================
   Badges / Status
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-low       { background: rgba(16,185,129,0.15); color: #10B981; border: 1px solid rgba(16,185,129,0.3); }
.badge-medium    { background: rgba(245,158,11,0.15); color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); }
.badge-high      { background: rgba(249,115,22,0.15); color: #F97316; border: 1px solid rgba(249,115,22,0.3); }
.badge-extreme   { background: rgba(239,68,68,0.15);  color: #EF4444; border: 1px solid rgba(239,68,68,0.3); }
.badge-secondary { background: rgba(100,116,139,0.15); color: #94A3B8; border: 1px solid rgba(100,116,139,0.3); }

.status-draft     { background: rgba(100,116,139,0.15); color: #94A3B8; border: 1px solid rgba(100,116,139,0.3); padding: 3px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.status-submitted { background: rgba(6,182,212,0.15);  color: #06B6D4; border: 1px solid rgba(6,182,212,0.3);  padding: 3px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.status-reviewed  { background: rgba(245,158,11,0.15); color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); padding: 3px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.status-approved  { background: rgba(16,185,129,0.15); color: #10B981; border: 1px solid rgba(16,185,129,0.3); padding: 3px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.status-rejected  { background: rgba(239,68,68,0.15);  color: #EF4444; border: 1px solid rgba(239,68,68,0.3);  padding: 3px 10px; border-radius: var(--radius-full); font-size: 11.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* =============================================
   Tables
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover {
  background: rgba(59,130,246,0.05);
}

tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-primary);
  vertical-align: middle;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =============================================
   Risk Matrix
   ============================================= */
.risk-matrix {
  display: grid;
  grid-template-columns: 40px repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr) 40px;
  gap: 4px;
  width: 100%;
  max-width: 400px;
}

.risk-cell {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: var(--transition);
}

.risk-cell:hover {
  transform: scale(1.05);
  z-index: 1;
}

.risk-label-side {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

/* =============================================
   Alerts / Flash
   ============================================= */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #34D399; }
.alert-danger   { background: rgba(239,68,68,0.1);  border: 1px solid rgba(239,68,68,0.3);  color: #F87171; }
.alert-warning  { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: #FCD34D; }
.alert-info     { background: rgba(6,182,212,0.1);  border: 1px solid rgba(6,182,212,0.3);  color: #67E8F9; }

/* =============================================
   Progress Bars
   ============================================= */
.progress-bar-wrap {
  background: var(--bg-dark);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   Modals
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-lg { max-width: 900px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: var(--bg-dark);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.modal-close:hover { background: var(--danger); color: white; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* =============================================
   Tabs
   ============================================= */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-dark);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* =============================================
   Chart containers
   ============================================= */
.chart-container {
  position: relative;
  width: 100%;
}

/* =============================================
   Empty state
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13.5px;
  margin-bottom: 20px;
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}

.page-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  text-decoration: none;
}

.page-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* =============================================
   Utility Classes
   ============================================= */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }
.text-right { text-align: right; }
.w-full { width: 100%; }

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* =============================================
   Login Page
   ============================================= */
/* =============================================
   Login Page (Split-screen Premium Redesign)
   ============================================= */
.login-split-container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  background: var(--bg-dark);
  font-family: 'Inter', sans-serif;
  color: var(--text-primary);
}

/* --- Left Side: Showcase --- */
.login-showcase {
  background: #090d16;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px;
  border-right: 1px solid var(--border);
}

.showcase-glow-1 {
  position: absolute;
  top: -10%; left: -10%;
  width: 50%; height: 50%;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.15) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

.showcase-glow-2 {
  position: absolute;
  bottom: -10%; right: -10%;
  width: 60%; height: 60%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

.showcase-content {
  position: relative;
  z-index: 2;
  max-width: 540px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid rgba(5, 150, 105, 0.3);
  color: var(--primary-light);
  font-weight: 700;
  font-size: 12.5px;
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.brand-badge i {
  font-size: 14px;
}

.showcase-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 60%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.showcase-desc {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
}

.showcase-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.metric-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(8px);
}

.metric-icon {
  width: 44px; height: 44px;
  background: rgba(5, 150, 105, 0.1);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-light);
  font-size: 18px;
}

.metric-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-val {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-lbl {
  font-size: 11.5px;
  color: var(--text-muted);
}

.showcase-footer {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.8;
  margin-top: 20px;
}

/* --- Right Side: Form Area --- */
.login-form-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  background-image: 
    radial-gradient(at 0% 0%, rgba(30, 41, 59, 0.5) 0, transparent 50%),
    radial-gradient(at 50% 0%, rgba(5, 150, 105, 0.05) 0, transparent 50%);
}

.login-card-premium {
  width: 100%;
  max-width: 450px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeInUp 0.4s ease;
}

.login-logo-premium {
  text-align: center;
  margin-bottom: 28px;
}

.logo-icon-wrap {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-lg);
  display: inline-flex; align-items: center; justify-content: center;
  color: white;
  font-size: 24px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(5, 150, 105, 0.3);
}

.login-logo-premium h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.login-logo-premium p {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* --- Input Fields --- */
.form-group-premium {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group-premium label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-wrapper-premium {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-premium {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  transition: var(--transition-fast);
}

.input-wrapper-premium input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 14px;
  padding: 12px 14px 12px 42px;
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition-fast);
}

.input-wrapper-premium input:focus {
  border-color: var(--primary-light);
  background: rgba(15, 23, 42, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

.input-wrapper-premium input:focus + .input-icon-premium,
.input-wrapper-premium input:focus ~ .input-icon-premium {
  color: var(--primary-light);
}

.pw-toggle-btn-premium {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
  z-index: 10;
}

.pw-toggle-btn-premium:hover {
  color: var(--text-primary);
}

/* --- Submit Button --- */
.btn-premium-login {
  width: 100%;
  margin-top: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.btn-premium-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.4);
}

.btn-premium-login:active {
  transform: translateY(1px);
}

.btn-premium-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.public-report-link-premium {
  text-align: center;
  margin-top: 20px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.public-report-link-premium a {
  color: var(--primary-light);
  font-weight: 700;
}

.public-report-link-premium a:hover {
  color: var(--accent);
}

/* --- Demo accounts --- */
.demo-premium-section {
  margin-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.demo-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.demo-grid-premium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.demo-card-premium {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.demo-card-premium i {
  font-size: 16px;
}

.demo-card-premium .demo-name {
  font-size: 11px;
  font-weight: 700;
}

/* Hover effects with colored glow shadow */
.demo-card-premium.admin-glow {
  color: #60A5FA;
}
.demo-card-premium.admin-glow:hover {
  background: rgba(96, 165, 250, 0.08);
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.25);
  transform: translateY(-2px);
}

.demo-card-premium.staff-glow {
  color: #34D399;
}
.demo-card-premium.staff-glow:hover {
  background: rgba(52, 211, 153, 0.08);
  border-color: #34D399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
  transform: translateY(-2px);
}

.demo-card-premium.reviewer-glow {
  color: #FCD34D;
}
.demo-card-premium.reviewer-glow:hover {
  background: rgba(252, 211, 77, 0.08);
  border-color: #FCD34D;
  box-shadow: 0 0 12px rgba(252, 211, 77, 0.25);
  transform: translateY(-2px);
}

/* --- Media Queries --- */
@media (max-width: 1024px) {
  .login-split-container {
    grid-template-columns: 1fr;
  }
  .login-showcase {
    display: none;
  }
  .login-form-area {
    padding: 24px;
    min-height: 100vh;
  }
}

@media (max-width: 480px) {
  .login-form-area {
    padding: 16px;
  }
  .login-card-premium {
    padding: 24px 16px;
  }
}

/* =============================================
   Animations
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.fade-in { animation: fadeInUp 0.4s ease; }
.spin { animation: spin 1s linear infinite; }

/* =============================================
   Scrollbar
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =============================================
   Responsive — Tablet (≤1024px)
   ============================================= */
@media (max-width: 1024px) {
  /* Sidebar: slide-in overlay */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.5);
  }
  .main-content {
    margin-left: 0;
  }

  /* Forms */
  .form-row   { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }

  /* Dashboard 2-col grids → 1-col */
  .dashboard-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

/* =============================================
   Responsive — Mobile (≤768px)
   ============================================= */
@media (max-width: 768px) {

  /* Page padding */
  .page-content { padding: 12px; }

  /* Top header */
  .top-header {
    padding: 0 12px;
    gap: 10px;
  }
  .header-title h1 {
    font-size: 15px;
  }
  .header-title .breadcrumb {
    display: none;
  }

  /* Stat cards: 2 columns */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }

  /* Form rows stack */
  .form-row   { grid-template-columns: 1fr; gap: 0; }
  .form-row-3 { grid-template-columns: 1fr; gap: 0; }

  /* All inline grids used in dashboard/reports become single column */
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns: repeat(4,1fr)"],
  [style*="grid-template-columns:repeat(auto-fill"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables: allow full horizontal scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table {
    min-width: 600px;
  }

  /* Cards */
  .card-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }
  .card-body { padding: 14px; }

  /* Modal full width */
  .modal-overlay { padding: 12px; }
  .modal, .modal.modal-lg { max-width: 100%; width: 100%; }

  /* Tabs: scrollable row */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    padding: 4px;
  }
  .tab-btn { font-size: 12px; padding: 7px 12px; flex-shrink: 0; }

  /* Buttons: touch-friendly min height */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }

  /* Login card */
  .login-card { padding: 24px 20px; }

  /* Toolbar / action rows */
  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .page-toolbar > * { width: 100%; }

  /* Filter form: wrap cleanly */
  .filter-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .filter-form > * { width: 100% !important; min-width: 0 !important; }

  /* Remove side-by-side user card label */
  .user-info span { display: none; }

  /* Risk matrix: shrink cells */
  .risk-cell { font-size: 11px; }

  /* Hazard items on create page */
  .hazard-item { padding: 14px !important; }

  /* Pagination: compact */
  .pagination { flex-wrap: wrap; }
  .page-btn { width: 32px; height: 32px; font-size: 12px; }
}

/* =============================================
   Responsive — Small Mobile (≤480px)
   ============================================= */
@media (max-width: 480px) {

  /* Stat cards: single column */
  .stat-grid { grid-template-columns: 1fr; }

  /* Header: hide secondary actions */
  .header-actions .header-btn:not(:first-child) { display: none; }

  /* Top header: tighter */
  .top-header { height: 54px; padding: 0 10px; }

  /* Stat cards compact */
  .stat-card { padding: 14px; }
  .stat-icon  { width: 40px; height: 40px; font-size: 17px; }
  .stat-value { font-size: 20px; }

  /* Login page */
  .login-card { padding: 20px 16px; margin: 8px; }
  .login-logo-icon { width: 52px; height: 52px; font-size: 22px; }
  .login-logo h1 { font-size: 18px; }

  /* Table cells: smaller text */
  tbody td { font-size: 12.5px; padding: 10px 12px; }
  thead th  { font-size: 10.5px; padding: 10px 12px; }

  /* Nav badges */
  .nav-badge { display: none; }

  /* Buttons in toolbar: full width stack */
  .page-content > div:first-child .btn {
    width: 100%;
    justify-content: center;
  }
}

/* =============================================
   Tooltip
   ============================================= */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E293B;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
  z-index: 999;
}
[data-tooltip]:hover::after {
  opacity: 1;
}

/* =============================================
   Risk Number Input
   ============================================= */
.risk-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.risk-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--border);
  outline: none;
}
.risk-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--primary-light);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.risk-value-display {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: white;
  background: var(--primary);
  flex-shrink: 0;
}

/* =============================================
   Risk Rating Cell colors in table
   ============================================= */
.rating-low     { color: var(--risk-low);     font-weight: 700; }
.rating-medium  { color: var(--risk-medium);  font-weight: 700; }
.rating-high    { color: var(--risk-high);    font-weight: 700; }
.rating-extreme { color: var(--risk-extreme); font-weight: 700; }

/* =============================================
   Hierarchy Control Cards (hc-*)
   ============================================= */
.hc-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  transition: var(--transition);
}

.hc-card.hc-active {
  border-color: var(--hc-color, var(--primary));
  box-shadow: 0 0 0 1px var(--hc-color, var(--primary)),
              0 4px 12px rgba(0,0,0,0.15);
}

.hc-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: var(--transition-fast);
  border-left: 3px solid transparent;
}

.hc-btn:hover {
  background: var(--bg-card-hover);
  border-left-color: var(--hc-color, var(--primary));
}

.hc-card.hc-active .hc-btn {
  background: color-mix(in srgb, var(--hc-color, var(--primary)) 10%, var(--bg-card));
  border-left-color: var(--hc-color, var(--primary));
}

.hc-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.hc-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hc-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.hc-card.hc-active .hc-label {
  color: var(--hc-color, var(--primary-light));
}

.hc-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
}

.hc-toggle-icon {
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.hc-card.hc-active .hc-toggle-icon {
  color: var(--hc-color, var(--primary-light));
}

.hc-body {
  padding: 14px;
  background: color-mix(in srgb, var(--hc-color, var(--primary)) 4%, var(--bg-dark));
  border-top: 1px solid color-mix(in srgb, var(--hc-color, var(--primary)) 20%, transparent);
  animation: fadeInDown 0.2s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hc-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border-left: 2px solid color-mix(in srgb, var(--hc-color, var(--primary)) 50%, transparent);
  line-height: 1.5;
}

/* Compact form rows inside hc-body */
.hc-body .form-row {
  gap: 8px;
  margin-top: 8px;
}

.hc-body .form-control {
  font-size: 13px;
}


/* =============================================
   Mobile Bottom Navigation Bar
   ============================================= */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: rgba(15, 22, 41, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 90;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  }

  /* Push page content up so it doesn't hide behind bottom nav */
  .main-content {
    padding-bottom: 70px;
  }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 4px;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  min-height: 48px;
  font-family: inherit;
}

.mobile-nav-item i {
  font-size: 18px;
  margin-bottom: 1px;
  transition: var(--transition-fast);
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--primary-light);
}

.mobile-nav-item.active i {
  color: var(--primary-light);
  filter: drop-shadow(0 0 6px rgba(59,130,246,0.6));
}

/* Active underline indicator */
.mobile-nav-item.active {
  position: relative;
}
.mobile-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--primary-light);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

/* =============================================
   Sistem Responsif & Mesra Mudah Alih (Responsive Styling)
   ============================================= */

/* Paparan Desktop (min-width: 1025px) */
@media (min-width: 1025px) {
  #sidebarToggle {
    display: none !important;
  }
}

/* Paparan Tablet & Mudah Alih (max-width: 1024px) */
@media (max-width: 1024px) {
  /* Sidebar bertindak sebagai slide-in drawer */
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  
  /* Rapatkan kandungan ke kiri sepenuhnya */
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  /* Header atas dikecilkan sedikit */
  .top-header {
    padding: 0 16px !important;
  }
  
  .page-content {
    padding: 16px !important;
  }
  
  #sidebarToggle {
    display: flex !important;
  }
}

/* Paparan Telefon Mudah Alih (max-width: 768px) */
@media (max-width: 768px) {
  /* Semua grid columns (seperti stats-grid, 3-column rows, 2-column rows) dijadikan 1-kolum menegak */
  div[style*="display:grid"], 
  div[style*="display: grid"],
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  
  /* Bentuk Flexbox bertukar menjadi menegak */
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 16px !important;
  }
  .page-header > div,
  .page-header .no-print {
    width: 100% !important;
  }
  .page-header .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  
  /* Filter form menjadi satu kolum penuh */
  .card-body form,
  form[style*="display:flex"],
  form[style*="display: flex"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .card-body form > div,
  form[style*="display:flex"] > div,
  form[style*="display: flex"] > div {
    width: 100% !important;
  }
  .card-body form button,
  .card-body form a {
    width: 100% !important;
    justify-content: center !important;
  }
  
  /* Sediakan scrollbar mendatar untuk jadual panjang */
  .table-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }
}

/* =============================================
   Mod Gelap / Mod Cerah (Light Theme Overrides)
   ============================================= */
body.light-theme {
  --bg-dark: #F8FAFC;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --bg-input: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text-primary: #000000;
  --text-secondary: #0A0F1D;
  --text-muted: #1E293B;
  --text-dark: #FFFFFF;
}

body.light-theme .main-content a:not(.btn) {
  color: var(--primary) !important;
}

body.light-theme .main-content a:not(.btn):hover {
  color: var(--primary-dark) !important;
}

body.light-theme .top-header {
  background: #FFFFFF !important;
  border-bottom: 1px solid #E2E8F0;
}

body.light-theme .card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03) !important;
}

body.light-theme .card-header {
  background: #F8FAFC !important;
  border-bottom: 1px solid #E2E8F0 !important;
}

body.light-theme .stat-card {
  background: #FFFFFF !important;
  border-color: #E2E8F0 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}

body.light-theme .form-control {
  background: #FFFFFF !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
}

body.light-theme .form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15) !important;
}

body.light-theme table th {
  background: #F8FAFC !important;
  color: #334155 !important;
  border-bottom: 2px solid #E2E8F0 !important;
}

body.light-theme table td {
  border-bottom: 1px solid #E2E8F0 !important;
  color: #334155 !important;
}

body.light-theme table tr:hover {
  background: #F8FAFC !important;
}

body.light-theme .btn-ghost {
  border-color: #CBD5E1 !important;
  color: #334155 !important;
}

body.light-theme .btn-ghost:hover {
  background: #F1F5F9 !important;
}

body.light-theme .nav-section-label {
  color: #64748B !important;
}

body.light-theme .sidebar-logo-text h2 {
  color: #000000 !important;
}

body.light-theme .nav-item {
  color: #334155 !important;
}

body.light-theme .nav-item i {
  color: #64748B !important;
}

body.light-theme .nav-item:hover {
  background: #F1F5F9 !important;
  color: #000000 !important;
}

body.light-theme .nav-item:hover i {
  color: #000000 !important;
}

body.light-theme .nav-item.active {
  background: linear-gradient(135deg, #059669, #34D399) !important;
  color: #FFFFFF !important;
  box-shadow: none !important;
}

body.light-theme .nav-item.active i {
  color: #FFFFFF !important;
}

/* --- Shake Animation for Error --- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

.shake-effect {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}



