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

:root {
  /* Colors */
  --bg: #f8fafc;
  --sidebar-bg: #ffffff;
  --sidebar-text: #475569;
  --sidebar-hover: #f1f5f9;
  --sidebar-hover-text: #0f172a;
  --sidebar-active: #fef2f2;
  --sidebar-active-text: #dc2626;
  --sidebar-active-border: #dc2626;
  --sidebar-border: #e2e8f0;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  
  --primary: #dc2626;
  --primary-hover: #b91c1c;
  --primary-light: #fee2e2;
  
  --success: #10b981;
  --success-light: #e6fbf3;
  --success-text: #047857;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #b45309;
  
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #b91c1c;

  --info: #06b6d4;
  --info-light: #ecfeff;
  --info-text: #0e7490;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.04), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  --shadow-premium: 0 20px 40px -15px rgba(220, 38, 38, 0.08);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Font Families */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Transition */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── DARK THEME VARIABLES ── */
html[data-theme="dark"] {
  /* Colors */
  --bg: #090d16;                 /* very deep dark space background */
  --sidebar-bg: #0d1527;         /* dark slate sidebar background */
  --sidebar-text: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.04);
  --sidebar-hover-text: #ffffff;
  --sidebar-active: rgba(239, 68, 68, 0.12);
  --sidebar-active-text: #fca5a5;
  --sidebar-active-border: #f87171;
  --sidebar-border: #1e293b;
  --card: #131c31;               /* rich slate card background */
  --text: #f1f5f9;               /* light slate text */
  --text-muted: #64748b;         /* muted text */
  --border: #1e293b;             /* dark border slate */
  
  --primary: #ef4444;            /* red */
  --primary-hover: #dc2626;
  --primary-light: rgba(239, 68, 68, 0.12);
  
  --success: #34d399;            /* emerald-400 */
  --success-light: rgba(52, 211, 153, 0.1);
  --success-text: #34d399;
  
  --warning: #fbbf24;            /* amber-400 */
  --warning-light: rgba(251, 191, 36, 0.1);
  --warning-text: #fbbf24;
  
  --danger: #f87171;             /* rose-400 */
  --danger-light: rgba(248, 113, 113, 0.1);
  --danger-text: #f87171;

  --info: #22d3ee;               /* cyan-400 */
  --info-light: rgba(34, 211, 238, 0.1);
  --info-text: #22d3ee;
}

/* Specific elements dark theme overrides */
html[data-theme="dark"] .profile-chip {
  background: #1e293b;
  color: #cbd5e1;
}

html[data-theme="dark"] input:focus, 
html[data-theme="dark"] select:focus, 
html[data-theme="dark"] textarea:focus {
  background: #1e293b;
}

html[data-theme="dark"] input:disabled, 
html[data-theme="dark"] select:disabled, 
html[data-theme="dark"] textarea:disabled {
  background: #0f172a;
  color: #475569;
}

html[data-theme="dark"] .accordion-header {
  background: #0d1527;
}

html[data-theme="dark"] table th {
  background: #0d1527;
  color: #cbd5e1;
}

html[data-theme="dark"] table td {
  color: #e2e8f0;
}

html[data-theme="dark"] table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

html[data-theme="dark"] .modal-info-item {
  background: #0d1527 !important;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
  color: var(--text);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  background: var(--border);
  transform: translateY(-2px);
}


/* ── BASE STYLES ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hidden {
  display: none !important;
}

/* ── LOGIN SCREEN ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, rgba(238, 235, 255, 0.8) 0%, rgba(243, 244, 249, 1) 90%);
}

.login-card {
  width: 100%;
  max-width: 1000px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 30px 60px -15px rgba(0,0,0,0.1);
  border: 1px solid var(--border);
}

.login-left {
  padding: 48px;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #1e1e38 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  top: -50px;
  right: -50px;
  pointer-events: none;
}

.login-left::after {
  content: '';
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  bottom: -50px;
  left: -50px;
  pointer-events: none;
}

.login-left h1 {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 800;
  margin: 24px 0 12px;
}

.login-left p {
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.6;
}

.feature-list {
  display: grid;
  gap: 12px;
  margin-top: 32px;
  z-index: 1;
}

.feature-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e2e8f0;
}

.feature-item::before {
  content: '✓';
  color: #818cf8;
  font-weight: bold;
}

.login-footer {
  font-size: 12px;
  color: #64748b;
  margin-top: 24px;
}

.login-right {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
  letter-spacing: 0.01em;
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  outline: none;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

input:disabled, select:disabled, textarea:disabled {
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.85;
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  gap: 8px;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-light {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.btn-light:hover {
  background: #e2e8f0;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-warning {
  background: var(--warning);
  color: white;
}

.btn-warning:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

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

.demo-box {
  margin-top: 24px;
  padding: 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

.demo-box strong {
  color: var(--text);
}

/* ── APP LAYOUT ── */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--sidebar-border);
}

.brand {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.brand small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.role-badge {
  margin: 14px 20px 0;
  padding: 6px 10px;
  background: var(--primary-light);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  text-align: center;
}

.menu-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 20px 20px 8px;
}

.menu {
  padding: 0 10px;
  flex: 1;
}

.menu button {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  padding: 10px 14px;
  margin-bottom: 4px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
}

.menu button:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-hover-text, #0f172a);
}

.menu button.active {
  background: var(--sidebar-active);
  color: var(--sidebar-active-text, #dc2626);
  border-left: 3px solid var(--sidebar-active-border);
  padding-left: 11px;
  font-weight: 600;
}

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

.logout-btn {
  width: 100%;
  text-align: left;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.logout-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

html[data-theme="dark"] .brand {
  color: #ffffff;
}

html[data-theme="dark"] .role-badge {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

html[data-theme="dark"] .logout-btn {
  background: rgba(239, 68, 68, 0.08);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

html[data-theme="dark"] .logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ffffff;
}

/* ── MAIN WORKSPACE ── */
.main {
  padding: 32px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.topbar {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.topbar h2 {
  font-size: 22px;
  color: var(--text);
  margin-bottom: 2px;
}

.topbar p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.profile-chip {
  padding: 8px 16px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

/* ── STATS CARDS ── */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.booking-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.booking-financial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-info-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.modal-refund-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  line-height: 1.4;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  right: -15px;
  bottom: -15px;
  opacity: 0.08;
  pointer-events: none;
}

.stat-card.primary::after { background: var(--primary); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.info::after { background: var(--info); }

.stat-card .muted {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card .stat {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  margin: 6px 0;
  line-height: 1.1;
}

.stat-card .card-footer-text {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── EMPLOYEE PORTAL DASHBOARD ── */
.employee-portal-hero-card {
  margin-bottom: 18px;
  padding: 10px;
  overflow: hidden;
}

.employee-portal-hero {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(280px, auto);
  align-items: center;
  gap: 18px;
  padding: 22px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary) 0%, #0f766e 58%, #0b5c59 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
}

.employee-portal-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,.92);
  box-shadow: 0 5px 16px rgba(0,0,0,.2);
}

.employee-portal-initials {
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
}

.employee-portal-eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .76;
}

.employee-portal-identity h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 2.5vw, 29px);
}

.employee-portal-role { margin-top: 5px; font-weight: 700; opacity: .94; }
.employee-portal-login { margin-top: 4px; font-size: 12px; opacity: .76; }

.employee-portal-profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 8px;
}

.employee-portal-profile-details span {
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background: rgba(255,255,255,.1);
}

.employee-portal-profile-details small,
.employee-portal-profile-details strong { display: block; }
.employee-portal-profile-details small { margin-bottom: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; opacity: .72; }
.employee-portal-profile-details strong { overflow-wrap: anywhere; font-size: 12px; }

.employee-dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.employee-dashboard-stat { min-width: 0; padding: 15px; border-top: 3px solid rgba(11,116,111,.7); }
.employee-dashboard-stat .muted { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.employee-dashboard-stat-value { margin-top: 6px; color: var(--primary); font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }
.employee-dashboard-stat-note { margin-top: 4px; color: var(--text-muted); font-size: 11px; }

.employee-dashboard-actions-card { margin-bottom: 18px; }
.employee-dashboard-actions-card .section-title { margin-bottom: 12px; }
.employee-dashboard-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.employee-dashboard-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: #f8fafc;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.employee-dashboard-action:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-1px); }
.employee-dashboard-action-icon,
.employee-dashboard-panel-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0f766e);
  font-size: 13px;
  font-weight: 900;
}
.employee-dashboard-action strong,
.employee-dashboard-action small { display: block; }
.employee-dashboard-action strong { font-size: 13px; }
.employee-dashboard-action small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }

.employee-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.employee-dashboard-panel { min-width: 0; padding: 20px; }
.employee-dashboard-panel-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.employee-dashboard-panel-title > div { min-width: 0; flex: 1; }
.employee-dashboard-panel-title h3 { margin: 0; font-size: 16px; }
.employee-dashboard-panel-title small { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }

.employee-dashboard-highlight {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  padding: 14px 10px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ecfdf5, #eff6ff);
  text-align: center;
}
.employee-dashboard-highlight strong,
.employee-dashboard-highlight span { display: block; }
.employee-dashboard-highlight strong { grid-row: 1; color: var(--primary); font-size: 18px; }
.employee-dashboard-highlight span { grid-row: 2; color: var(--text-muted); font-size: 10px; text-transform: uppercase; }

.employee-dashboard-detail {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.employee-dashboard-detail:last-child { border-bottom: 0; padding-bottom: 0; }
.employee-dashboard-detail span { color: var(--text-muted); }
.employee-dashboard-detail strong { max-width: 58%; text-align: right; overflow-wrap: anywhere; }
.employee-dashboard-money { color: var(--primary); font-size: 27px; font-weight: 900; }
.employee-dashboard-money-label { margin: 1px 0 10px; color: var(--text-muted); font-size: 11px; }

.employee-dashboard-balance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.employee-dashboard-balance-grid span { padding: 11px 6px; border-radius: 10px; background: #f0fdfa; text-align: center; }
.employee-dashboard-balance-grid strong,
.employee-dashboard-balance-grid small { display: block; }
.employee-dashboard-balance-grid strong { color: var(--primary); font-size: 20px; }
.employee-dashboard-balance-grid small { margin-top: 2px; color: var(--text-muted); font-size: 10px; }

.employee-dashboard-activity { display: grid; gap: 8px; }
.employee-dashboard-activity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.employee-dashboard-activity-row > div { min-width: 0; }
.employee-dashboard-activity-row strong,
.employee-dashboard-activity-row small { display: block; }
.employee-dashboard-activity-row strong { font-size: 12px; }
.employee-dashboard-activity-row small { margin-top: 3px; color: var(--text-muted); font-size: 10px; overflow-wrap: anywhere; }
.employee-dashboard-empty { padding: 18px; border-radius: 10px; color: var(--text-muted); background: #f8fafc; font-size: 12px; text-align: center; }
.employee-dashboard-security-card { margin-bottom: 0; }

@media (max-width: 1100px) {
  .employee-portal-hero { grid-template-columns: auto 1fr; }
  .employee-portal-profile-details { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .employee-dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-dashboard-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .employee-portal-hero { grid-template-columns: auto 1fr; padding: 16px; }
  .employee-portal-profile-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .employee-dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .employee-portal-hero-card { padding: 6px; }
  .employee-portal-hero { grid-template-columns: 1fr; gap: 12px; text-align: center; }
  .employee-portal-avatar { width: 66px; height: 66px; margin: 0 auto; }
  .employee-portal-profile-details { grid-template-columns: 1fr 1fr; text-align: left; }
  .employee-dashboard-stats,
  .employee-dashboard-actions { grid-template-columns: 1fr; }
  .employee-dashboard-action { min-height: 58px; }
  .employee-dashboard-panel { padding: 15px; }
  .employee-dashboard-panel-title { align-items: flex-start; }
  .employee-dashboard-highlight strong { font-size: 16px; }
}

/* ── VISUAL CHARTS CARD ── */
.charts-card {
  padding: 24px;
}

.chart-container {
  position: relative;
  height: 220px;
  margin-top: 14px;
}

/* ── FORMS & FILTERS ── */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 14px;
  align-items: flex-end;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.full-span {
  grid-column: 1 / -1;
}

/* ── TABLES ── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  margin-top: 14px;
}

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

table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #475569;
  text-align: left;
  border-bottom: 1.5px solid var(--border);
}

table td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: #334155;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

table tbody tr {
  transition: var(--transition);
}

table tbody tr:hover {
  background: #f8fafc;
}

/* ── BADGES ── */
.status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.status.confirmed, .status.paid, .status.donelead {
  background: var(--success-light);
  color: var(--success-text);
}

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

.status.cancelled, .status.notconfirm {
  background: var(--danger-light);
  color: var(--danger-text);
}

.status.openlead {
  background: var(--info-light);
  color: var(--info-text);
}

.status.closed {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.status.rescheduled {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}

/* New badge classes for loans and listings */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

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

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

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

.badge-info {
  background: var(--info-light);
  color: var(--info-text);
}

/* ── DETAILS PANEL ── */
.detail-box {
  background: #fafafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 20px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.detail-box h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.detail-grid div {
  padding: 4px 0;
}

.detail-grid strong {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.detail-grid span {
  font-weight: 600;
  color: var(--text);
}

/* ── SUCCESS MESSAGE BOX ── */
.success-box {
  margin-top: 14px;
  background: var(--success-light);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

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

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state::before {
  content: '📁';
  display: block;
  font-size: 32px;
  margin-bottom: 12px;
}

/* ── HAMBURGER TOGGLE (Mobile) ── */
.hamburger-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  flex-direction: column;
  gap: 5px;
  transition: var(--transition);
}

.hamburger-btn span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: currentColor;
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger-btn:hover {
  background: #f1f5f9;
}

/* Sidebar Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
}

.sidebar-overlay.active {
  display: block;
}

/* ── RESPONSIVE BREAKPOINTS ── */

/* Large tablets: 1200px */
@media (max-width: 1200px) {
  .app {
    grid-template-columns: 220px 1fr;
  }
  .sidebar {
    width: 220px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablets: 1024px — sidebar becomes overlay */
@media (max-width: 1024px) {
  .hamburger-btn {
    display: flex;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 260px;
    z-index: 999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
  }

  .main {
    padding: 20px;
  }

  .topbar {
    padding: 14px 20px;
    margin-bottom: 20px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

/* Small tablets / large phones: 768px */
@media (max-width: 768px) {
  .main {
    padding: 14px;
  }

  .topbar {
    padding: 12px 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar h2 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 12px;
  }

  .profile-chip {
    font-size: 11.5px;
    padding: 6px 12px;
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
  }

  .booking-detail-grid,
  .booking-financial-grid,
  .modal-info-grid-3,
  .modal-refund-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .profile-prefix {
    display: none !important;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    padding: 16px;
  }

  .stat-card .stat {
    font-size: 24px;
  }

  /* Login page */
  .login-card {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .login-left {
    display: none;
  }

  .login-right {
    padding: 32px 24px;
  }

  /* Table — enable horizontal scroll */
  .table-responsive {
    border-radius: var(--radius-sm);
  }

  table th, table td {
    padding: 10px 12px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  /* HR tabs — scrollable */
  .hr-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .hr-tabs::-webkit-scrollbar {
    display: none;
  }

  /* Finance sub-tab flex sidebar inline wrap */
  #financeView > div,
  #financeView > div > div:not(.internal-nav-menu),
  .finance-sub-tab-view {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    overflow-x: hidden;
  }

  .finance-sub-tab-view .card,
  .finance-sub-tab-view .section-title,
  .finance-sub-tab-view .section-title > div {
    max-width: 100%;
    min-width: 0;
  }

  .finance-sub-tab-view .section-title > div {
    width: 100%;
  }

  .finance-sub-tab-view .section-title .muted {
    display: block;
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  /* Accordion bodies */
  .accordion-body {
    padding: 16px;
  }

  /* Buttons row on mobile */
  .btn-row-mobile {
    flex-wrap: wrap;
  }

  /* Section title responsive */
  .section-title {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-container {
    margin: 16px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }
}

/* Mobile phones: 480px */
@media (max-width: 480px) {
  .main {
    padding: 10px;
  }

  .topbar {
    padding: 10px 12px;
    border-radius: var(--radius-md);
  }

  .grid-4, .grid-3, .grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  #pageSub {
    display: none !important;
  }

  .card {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .stat-card .stat {
    font-size: 20px;
  }

  .stat-card .muted {
    font-size: 11px;
  }

  table th, table td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .btn {
    font-size: 13px;
    padding: 9px 14px;
  }

  .btn-sm {
    font-size: 11.5px;
    padding: 5px 10px;
  }

  .section-title h3 {
    font-size: 15px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .profile-header-block {
    flex-direction: column;
    text-align: center;
  }

  .login-right {
    padding: 24px 16px;
  }

  /* Finance internal nav — make it scrollable row on phones */
  div[style*="width: 260px"] {
    width: 100% !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    padding: 10px !important;
    gap: 4px !important;
    border-radius: var(--radius-md) !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  div[style*="width: 260px"]::-webkit-scrollbar {
    display: none;
  }

  div[style*="width: 260px"] button {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
    font-size: 12px !important;
    padding: 6px 10px !important;
  }

  /* Finance main layout — stack vertically */
  div[style*="display: flex; gap: 24px"] {
    flex-direction: column !important;
  }
}


/* ── MODAL SYSTEM ── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
  box-sizing: border-box;
  /* Allow scroll on overlay if needed */
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  /* Key: prevent modal from exceeding viewport height */
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  padding: 0; /* padding moved inside header/body/footer */
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.18), 0 8px 16px -4px rgba(0, 0, 0, 0.1);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden; /* clip border-radius */
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0; /* never compress header */
}

.modal-header h3, .modal-header .modal-title {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  padding-right: 12px;
}

.modal-close-btn {
  background: #f1f5f9;
  border: none;
  font-size: 1.3rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 8px;
  line-height: 1;
  flex-shrink: 0;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* ★ THIS IS THE KEY CHANGE: body scrolls, header and footer stay fixed ★ */
.modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Custom scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.modal-body::-webkit-scrollbar {
  width: 5px;
}

.modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  flex-shrink: 0; /* never compress footer */
  background: var(--card);
  flex-wrap: wrap;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.modal-info-item {
  font-size: 13px;
}

.modal-info-item strong {
  display: block;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 2px;
}

.modal-info-item span {
  color: #0f172a;
  font-weight: 600;
}

/* ── INLINE GRIDS INSIDE MODAL — responsive collapse ── */
/* 2-column inner grids inside modals */
.modal-body [style*="grid-template-columns: repeat(2, 1fr)"],
.modal-body [style*="grid-template-columns: 1fr 1fr"] {
  grid-template-columns: 1fr 1fr;
}

/* ── MODAL TABLET RESPONSIVE ── */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end; /* slide up from bottom on mobile */
  }

  .modal-container {
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    max-width: 100%;
    transform: translateY(100%);
    /* Drag handle visual hint */
  }

  .modal-container::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 99px;
    margin: 10px auto 0;
    flex-shrink: 0;
  }

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

  .modal-header {
    padding: 8px 18px 14px;
  }

  .modal-body {
    padding: 16px 18px;
  }

  .modal-footer {
    padding: 14px 18px;
    gap: 8px;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    justify-content: center;
  }

  .modal-info-grid {
    grid-template-columns: 1fr;
  }

  /* Collapse all 2+ column grids inside modal body on mobile */
  .modal-body [style*="grid-template-columns: repeat(2, 1fr)"],
  .modal-body [style*="grid-template-columns: 1fr 1fr"],
  .modal-body [style*="grid-template-columns: repeat(3, 1fr)"],
  .modal-body [style*="grid-template-columns: 1fr 1fr 1fr"],
  .modal-body .grid-2,
  .modal-body .grid-3,
  .modal-body .form-grid-2 {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .modal-container {
    max-height: 95vh;
  }

  .modal-header h3, .modal-header .modal-title {
    font-size: 1rem;
  }

  .modal-body {
    padding: 12px 14px;
    font-size: 13px;
  }

  .modal-footer {
    padding: 10px 14px;
  }
}



/* ── STATS ACCENTS ── */
.stat-card.danger::after { background: var(--danger); }
.stat-card.muted-card::after { background: var(--text-muted); }

/* ── HR MANAGEMENT & ACCORDION SYSTEM ── */
.hr-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 8px;
}

.hr-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  font-size: 13.5px;
  flex-shrink: 0;
}

.hr-tab-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.hr-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid rgba(99, 102, 241, 0.2);
}

/* Accordion Layout */
.accordion-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
}

.accordion-item {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.accordion-item.active {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.accordion-header {
  padding: 16px 20px;
  background: var(--bg);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: var(--transition);
}

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

.accordion-header .icon {
  transition: transform 0.25s ease;
  font-size: 18px;
  font-weight: normal;
  color: var(--text-muted);
}

.accordion-item.active .accordion-header .icon {
  transform: rotate(180deg);
  color: var(--primary);
}

.accordion-body {
  padding: 24px;
  display: none;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.accordion-item.active .accordion-body {
  display: block;
}

/* Dynamic Rows for Lists (Education/Experience/Assets) */
.dynamic-list-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.dynamic-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  background: var(--bg);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border);
  margin-bottom: 12px;
}

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

/* Profile Details Styles */
.profile-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1.5px solid var(--border);
}

.profile-header-block {
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.profile-photo-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 3px solid white;
  box-shadow: var(--shadow-md);
  background: #f1f5f9;
}

.profile-title-block h3 {
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 4px;
}

.profile-title-block p {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

.profile-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 4px;
  margin: 22px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.profile-item {
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  padding: 4px 0;
}

.profile-item label {
  color: var(--text-muted);
  font-size: 10.5px;
  margin-bottom: 2px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.profile-item span {
  color: var(--text);
  font-weight: 600;
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.profile-table th, .profile-table td {
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.profile-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
}

/* ── PRINT STYLES (Payslip / Profile Print) ── */
@media print {
  /* Hide everything except the modal content */
  .sidebar,
  .sidebar-overlay,
  .topbar,
  .hamburger-btn,
  .modal-overlay,
  .modal-header,
  .modal-footer,
  .main > *:not(#payslipModal):not(#employeeProfileModal) {
    display: none !important;
  }

  /* Show the modal body fullscreen */
  body {
    background: white !important;
    margin: 0;
    padding: 0;
  }

  .modal-overlay.active {
    position: static !important;
    display: block !important;
    opacity: 1 !important;
    background: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }

  .modal-container {
    border-radius: 0 !important;
    box-shadow: none !important;
    max-height: none !important;
    max-width: 100% !important;
    width: 100% !important;
    transform: none !important;
  }

  .modal-body {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
  }

  #payslipModalBody,
  #employeeProfileModalBody {
    display: block !important;
    width: 100% !important;
  }
}

/* ── MARKETING CAMPAIGN CUSTOM STYLES ── */
.campaign-link-input {
  border-radius: 4px;
  font-weight: 500;
  transition: var(--transition);
}
.campaign-link-input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* ── REPORTS TABS ── */
.reports-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 8px;
}

.reports-tab-btn {
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
  font-size: 13.5px;
  flex-shrink: 0;
}

.reports-tab-btn:hover {
  background: #f1f5f9;
  color: var(--text);
}

.reports-tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border: 1.5px solid rgba(99, 102, 241, 0.2);
}

/* ── INTERNAL NAV MENU (FINANCE / SUB-TABS) ── */
.internal-nav-menu {
  width: 260px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .internal-nav-menu {
    width: 100% !important;
    flex-direction: row !important;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 14px !important;
    gap: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    align-items: center;
  }
  
  .internal-nav-menu::-webkit-scrollbar {
    display: none;
  }

  .internal-nav-menu h3 {
    display: none !important; /* Hide title on mobile horizontal tabs */
  }

  .internal-nav-menu button {
    width: auto !important;
    flex-shrink: 0;
    margin: 0;
  }
  
  .reports-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .reports-tabs::-webkit-scrollbar {
    display: none;
  }
}

/* ── ADDITIONAL REPORTS RESPONSIVENESS FIXES ── */
#fReportPreviewCard {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
  #fReportPreviewCard {
    padding: 16px !important;
  }
  #fReportPreviewCard pre {
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .filters {
    grid-template-columns: 1fr;
  }
  #fReportPreviewCard {
    padding: 10px !important;
  }
  #fReportPreviewCard pre {
    font-size: 9.5px !important;
  }
}

/* ── TOPBAR BUTTON STYLES ── */
.topbar-booking-btn, .topbar-leads-btn {
  border-radius: 30px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  font-family: var(--font-body);
  transition: var(--transition);
}

@media (max-width: 576px) {
  .topbar-booking-btn, .topbar-leads-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
  }
  .topbar-booking-btn > span:not(.badge), .topbar-leads-btn > span:not(.badge) {
    display: none;
  }
  .topbar-booking-btn svg, .topbar-leads-btn svg {
    margin: 0;
  }
}

.demo-readonly-notice {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid #93c5fd;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.demo-readonly-notice.pulse {
  animation: demoReadOnlyPulse .65s ease;
}

@keyframes demoReadOnlyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(59,130,246,.16); }
}

body.demo-read-only #userCreateCard,
body.demo-read-only #topbarBookingBtn {
  display: none !important;
}

.attendance-hub-nav {
  margin-bottom: 18px;
}

@media (max-width: 576px) {
  .topbar-leads-btn #topbarLeadsBadge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    min-height: 19px;
    padding: 2px 5px !important;
    border: 2px solid var(--surface);
  }
  .demo-readonly-notice {
    position: fixed;
    right: 10px;
    bottom: 12px;
    z-index: 1200;
    box-shadow: var(--shadow-md);
  }
  .attendance-hub-nav .hrs-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
  }
  .attendance-hub-nav .hrs-actions .btn {
    width: 100%;
    white-space: normal;
  }
}

/* Active states for topbar buttons acting as tabs */
.topbar-leads-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  font-weight: 700;
}

.topbar-booking-btn.active {
  background: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.25);
  font-weight: 700;
}

/* ── LEADS INBOX STYLES ── */
.inbox-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  height: calc(100vh - 230px);
  min-height: 550px;
  align-items: stretch;
}

.inbox-list {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

/* Inbox Filter Tabs Header */
.inbox-filter-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border);
  background: var(--bg);
  padding: 8px 12px;
  gap: 6px;
}

.inbox-filter-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.inbox-filter-btn:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.02);
}

.inbox-filter-btn.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.inbox-list-scrollable {
  overflow-y: auto;
  flex: 1;
}

/* Avatars & Left Indicators */
.inbox-item {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.inbox-item:hover {
  background: var(--bg);
}

.inbox-item.active {
  background: var(--primary-light);
}

.inbox-item-indicator {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: transparent;
}

.inbox-item.unread .inbox-item-indicator {
  background: var(--primary);
}

.inbox-item.status-done .inbox-item-indicator {
  background: var(--success);
}

.inbox-item.status-archived .inbox-item-indicator {
  background: var(--warning);
}

.lead-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.1);
}

.inbox-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inbox-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.inbox-item-sender {
  color: var(--text);
  font-weight: 600;
}

.inbox-item-date {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.inbox-item-subject {
  font-size: 12.5px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}

.inbox-item-snippet {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* Reading Pane Details */
.inbox-detail {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.empty-inbox-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
}

.email-header-block {
  border-bottom: 1.5px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.email-meta-info {
  flex: 1;
}

.email-meta-sender {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

.email-meta-date {
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.email-body-block {
  flex: 1;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  white-space: pre-wrap;
  border: 1px solid var(--border);
}

.email-actions-block {
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

/* Structured Ticket Layout in details */
.ticket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.ticket-item {
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ticket-item label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.ticket-item span {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Contact Action Chips */
.contact-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.contact-chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

@media (max-width: 992px) {
  .inbox-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .inbox-list {
    max-height: 350px;
  }
}

@media (max-width: 768px) {
  #leadsParserTabContent .grid-2 {
    grid-template-columns: 1fr;
  }
  #leadsParserTabContent .docs-column {
    border-left: none !important;
    padding-left: 0 !important;
    margin-top: 24px;
    border-top: 1px solid var(--border);
    padding-top: 24px;
  }
}

/* ── ANDROID APP IMMERSIVE STATUS BAR PADDING ── */
html.android-app .topbar {
  padding-top: calc(18px + 24px) !important;
}

html.android-app .sidebar-header {
  padding-top: calc(24px + 24px) !important;
}

/* Keep the combined company/package manager fully visible inside narrow app WebViews. */
#branchesView,
#branchesView .grid-2,
#branchesView .grid-2 > .card {
  min-width: 0;
  max-width: 100%;
}

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

#branchesView .table-responsive {
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 900px) {
  #branchesView .grid-2 {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #branchesView .card {
    width: 100%;
    overflow: hidden;
  }
}

@media (max-width: 576px) {
  #branchesView .section-title {
    align-items: flex-start;
  }

  #branchesView .table-responsive table {
    min-width: 540px;
  }
}

@media (max-width: 992px) {
  html.android-app .topbar {
    padding-top: calc(14px + 24px) !important;
  }
}

@media (max-width: 576px) {
  html.android-app .topbar {
    padding-top: calc(10px + 24px) !important;
  }
}

.crm-table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.crm-list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
}

.crm-table-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-table-page-label {
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .crm-table-pagination,
  .crm-table-page-actions {
    width: 100%;
  }

  .crm-table-page-actions {
    justify-content: space-between;
  }
}
