/* ==========================================
   E-COS Global — Styling System (Vanilla CSS)
   ========================================== */

/* 1. Core Token & Colors */
:root {
  /* Default Theme: Midnight Dark */
  --bg-app: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: linear-gradient(180deg, #1e293b, #0f172a);
  --border-color: #334155;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  
  --primary: #3b82f6; /* Electric Blue */
  --primary-hover: #2563eb;
  --primary-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
  
  --success: #10b981; /* Emerald Green */
  --success-light: #d1fae5;
  --success-text: #065f46;
  
  --warning: #f59e0b; /* Amber Gold */
  --warning-light: #fef3c7;
  --warning-text: #92400e;
  
  --danger: #ef4444; /* Rose Red */
  --danger-light: #fee2e2;
  --danger-text: #991b1b;
  
  --font-display: 'Outfit', 'Inter', Arial, sans-serif;
  --font-body: 'Inter', Arial, Helvetica, sans-serif;
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
  --box-shadow-premium: 0 10px 30px rgba(0, 0, 0, 0.25);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Theme overrides: Emerald Green */
body.theme-emerald {
  --bg-app: #f0fdf4;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #10b981, #064e3b);
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-gradient: linear-gradient(135deg, #10b981, #065f46);
  
  --box-shadow-premium: 0 10px 30px rgba(16, 185, 129, 0.08);
}

/* Theme overrides: Classic Blue */
body.theme-classic {
  --bg-app: #f1f5f9;
  --bg-card: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #1e3a8a, #0f172a);
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --primary: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
  
  --box-shadow-premium: 0 10px 30px rgba(59, 130, 246, 0.08);
}

/* 2. Global Resets & Scrollbars */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  transition: var(--transition-smooth);
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  outline: none;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* 3. Helper Classes */
.hidden {
  display: none !important;
}

.sidebar-backdrop {
  display: none;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.dpp {
  background: #dbeafe;
  color: #1e40af;
}

.badge.puk {
  background: #ecfdf5;
  color: #065f46;
}

/* Status Badges */
.status-badge {
  font-weight: 800;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
}

.status-pending {
  background: var(--warning-light);
  color: var(--warning-text);
}

.status-approved {
  background: var(--success-light);
  color: var(--success-text);
}

.status-approved_with_gap {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px dashed #0284c7;
}

.status-rejected {
  background: var(--danger-light);
  color: var(--danger-text);
}

/* 4. Login Page Layout */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85)), url('assets/login-background.png') center/cover no-repeat;
  padding: 24px;
}

.login-card {
  position: relative;
  width: min(450px, 94vw);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 26px;
  padding: 34px;
  box-shadow: 0 28px 90px rgba(0,0,0,0.4);
  z-index: 5;
}

body.theme-emerald .login-card, body.theme-classic .login-card {
  background: #ffffff;
  box-shadow: 0 20px 50px rgba(0,0,0,0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.app-logo-mark {
  font-size: 48px;
  margin-bottom: 10px;
}

.login-header h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 30px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.login-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: rgba(0,0,0,0.15);
  color: var(--text-main);
  transition: var(--transition-smooth);
}

body.theme-emerald .form-group input, body.theme-classic .form-group input,
body.theme-emerald .form-group select, body.theme-classic .form-group select {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

.btn-primary {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: var(--border-radius-md);
  background: var(--primary-gradient);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-danger {
  padding: 10px 16px;
  border: 0;
  border-radius: var(--border-radius-sm);
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.btn-danger:hover {
  filter: brightness(1.08);
}

.btn-secondary {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
}

body.theme-emerald .btn-secondary, body.theme-classic .btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
}

.select-role-wrap {
  border-top: 1px dashed var(--border-color);
  padding-top: 14px;
  margin-top: 18px;
}

.login-help {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.login-identity {
  position: absolute;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0,0,0,0.5);
  font-family: var(--font-display);
}

.login-identity b {
  font-size: 16px;
  font-weight: 800;
}

.login-identity span {
  font-size: 11px;
  opacity: 0.8;
}

.login-copyright {
  position: absolute;
  right: 24px;
  bottom: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 5. Main Application Shell */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  color: #fff;
  z-index: 10;
}

.sidebar-close {
  display: none;
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 18px;
}

.brand-icon {
  font-size: 32px;
}

.brand-text strong {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
}

.brand-text small {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  font-weight: 700;
  text-transform: uppercase;
}

.user-role-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  border-radius: var(--border-radius-md);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.theme-emerald .user-role-card, body.theme-classic .user-role-card {
  background: rgba(0,0,0,0.15);
  border-color: rgba(255, 255, 255, 0.15);
}

.profile-photo-container {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  cursor: pointer;
  border-radius: 50%;
  align-self: center;
}

.profile-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}

.profile-photo-container:hover .profile-photo {
  border-color: var(--primary);
  transform: scale(1.05);
}

.online-indicator-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  background-color: var(--success);
  transition: var(--transition-smooth);
}

body.theme-emerald .online-indicator-dot {
  border-color: #064e3b;
}

body.theme-classic .online-indicator-dot {
  border-color: #0f172a;
}

.online-indicator-dot.pulse {
  animation: status-pulse 2s infinite;
}

.online-indicator-dot.offline {
  background-color: var(--danger) !important;
}

@keyframes status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.sidebar-identity-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
}

.user-role-card b {
  font-size: 14px;
  color: #fff;
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user-role-card span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  word-break: break-all;
}

.user-role-card .badge {
  align-self: flex-start;
  margin-top: 4px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.sidebar-nav button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: var(--border-radius-sm);
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.sidebar-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logout-btn {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  color: #fff;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  background: var(--danger);
  border-color: var(--danger);
}

.sidebar-copyright {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin-top: 10px;
}

/* Content Area */
.content {
  padding: 30px;
  height: 100vh;
  overflow-y: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
}

.topbar h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

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

.topbar-select {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
}

.topbar-btn {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 700;
  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--border-color);
}

/* 6. Dashboard Elements & Grid */
.dash-hero {
  background: var(--primary-gradient);
  color: #fff;
  border-radius: var(--border-radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.2);
}

.dash-hero h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
}

.dash-hero p {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 4px;
}

.dash-hero .badge {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.stats {
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.stat.success-stat {
  border-left-color: var(--success);
}

.stat.warning-stat {
  border-left-color: var(--warning);
}

.stat.danger-stat {
  border-left-color: var(--danger);
}

.stat small {
  color: var(--text-muted);
  font-weight: 800;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.stat b {
  display: block;
  font-size: 32px;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--text-main);
  margin-top: 6px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text-main);
}

/* 7. Tables, Forms, Fields */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--bg-card);
}

th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

th {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-muted);
  font-weight: 800;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

body.theme-emerald tr:hover td, body.theme-classic tr:hover td {
  background: #f8fafc;
}

.btn-icon {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  margin: 0 4px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  border-radius: var(--border-radius-sm);
  border: 0;
  cursor: pointer;
  background: var(--primary-gradient);
  color: #fff;
}

.btn-small:hover {
  filter: brightness(1.08);
}

.btn-small.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-small.danger {
  background: linear-gradient(135deg, var(--danger), #dc2626);
}

/* Fields & Layout */
.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
}

.field input, .field select, .field textarea {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 11px 13px;
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

body.theme-emerald .field input, body.theme-classic .field input,
body.theme-emerald .field select, body.theme-classic .field select,
body.theme-emerald .field textarea, body.theme-classic .field textarea {
  background: #ffffff;
  border-color: #cbd5e1;
}

.field select {
  cursor: pointer;
}

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

/* File indicator status */
.file-status-indicator {
  margin-top: 4px;
  font-size: 12px;
}

/* Discrepancy box */
.discrepancy-card {
  background: rgba(239, 68, 68, 0.05);
  border: 1px dashed rgba(239, 68, 68, 0.25);
  border-radius: var(--border-radius-md);
  padding: 14px;
  margin-top: 14px;
}

.discrepancy-card h4 {
  font-size: 13px;
  color: var(--danger);
  font-weight: 800;
  margin-bottom: 6px;
}

/* 8. Modern Visual Charts */
.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-item {
  display: grid;
  grid-template-columns: 100px 1fr 40px;
  gap: 10px;
  align-items: center;
  font-size: 12px;
}

.bar-label {
  color: var(--text-main);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  height: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.bar-track span {
  display: block;
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 99px;
  transition: width 0.6s ease;
}

.bar-value {
  font-weight: 800;
  color: var(--text-main);
  text-align: right;
}

/* Simple Compliance Ring Chart */
.compliance-summary-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.compliance-ring {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--bg-card) 79%, transparent 80% 100%), conic-gradient(var(--success) var(--percentage, 0%), var(--border-color) 0);
  display: grid;
  place-items: center;
}

.compliance-ring b {
  font-size: 20px;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--text-main);
}

/* 9. Modals Overlay & Responsive */
.modal-shell {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-emerald .modal-card, body.theme-classic .modal-card {
  background: #ffffff;
  box-shadow: 0 15px 45px rgba(0,0,0,0.1);
}

@keyframes slideUp {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dialog-card {
  width: min(450px, 94vw);
  padding: 24px;
}

.dialog-card h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.dialog-card p {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
}

.preview-card {
  width: min(650px, 94vw);
  padding: 20px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
}

.modal-close {
  background: transparent;
  border: 0;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 6px;
}

.modal-close:hover {
  color: var(--text-main);
}

.preview-body {
  max-height: 70vh;
  overflow-y: auto;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.1);
}

.preview-body img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* 10. Responsive Viewports & Media Queries */
@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    transition: var(--transition-smooth);
    box-shadow: none;
  }
  
  .app.sidebar-open .sidebar {
    left: 0;
    box-shadow: 10px 0 50px rgba(0,0,0,0.5);
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 8;
  }
  
  .app.sidebar-open .sidebar-backdrop {
    display: block;
  }
  
  .sidebar-close {
    display: block;
    position: absolute;
    right: 14px;
    top: 14px;
    font-size: 26px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .grid.two {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .content {
    padding: 16px;
  }
}

/* ==========================================
   Phase 2 Enhancements
   ========================================== */

/* Readability overrides for select option tags across all themes */
select option {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
}

/* Brand Logos */
.login-logo {
  max-height: 90px;
  width: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}
.brand-logo {
  max-height: 38px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Notification Bell & Panel */
.notif-wrapper {
  position: relative;
  display: inline-block;
}
.notif-bell-btn {
  position: relative;
  font-size: 16px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 8px var(--danger);
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--box-shadow-premium);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.2s ease;
}
.notif-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
}
.notif-header h4 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}
.btn-clear-notif {
  background: transparent;
  border: 0;
  font-size: 10.5px;
  color: var(--primary);
  cursor: pointer;
  font-weight: 700;
}
.btn-clear-notif:hover {
  text-decoration: underline;
}
.notif-list {
  overflow-y: auto;
  max-height: 340px;
  display: flex;
  flex-direction: column;
}
.notif-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.notif-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
body.theme-emerald .notif-item:hover, body.theme-classic .notif-item:hover {
  background: rgba(0, 0, 0, 0.03);
}
.notif-item.unread {
  border-left: 3px solid var(--primary);
  background: rgba(59, 130, 246, 0.05);
}
body.theme-emerald .notif-item.unread {
  border-left-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}
.notif-item-msg {
  color: var(--text-main);
  font-weight: 500;
}
.notif-item.unread .notif-item-msg {
  font-weight: 700;
}
.notif-item-time {
  font-size: 9.5px;
  color: var(--text-muted);
}
.notif-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* Professional Print & PDF Layout Styling */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12px !important;
  }
  .sidebar,
  .topbar-actions,
  .menu-toggle,
  .logout-btn,
  .sidebar-backdrop,
  .modal-shell,
  .topbar h2,
  .report-control,
  .modal-actions,
  button,
  input[type="file"],
  .file-upload-wrapper {
    display: none !important;
  }
  .app {
    display: block !important;
  }
  .content {
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .card {
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 30px !important;
    background: transparent !important;
    page-break-inside: avoid;
  }
  .card h3 {
    color: #000 !important;
    border-bottom: 2px solid #000 !important;
    padding-bottom: 4px !important;
    margin-bottom: 10px !important;
    font-size: 16px !important;
  }
  table {
    border: 1px solid #cbd5e1 !important;
    width: 100% !important;
    border-collapse: collapse !important;
  }
  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 8px !important;
    color: #000 !important;
    background: transparent !important;
  }
  th {
    background: #f1f5f9 !important;
    font-weight: bold !important;
  }
  .table-wrap {
    overflow: visible !important;
    border: 0 !important;
  }
  .badge, .status-badge {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: transparent !important;
    text-shadow: none !important;
    padding: 2px 6px !important;
  }
}
