/* ===== DESIGN TOKENS — Corporativo Azul Oscuro (Dark Premium) ===== */
:root, [data-theme="dark"] {
  --navy:        #111827;
  --navy-light:  #1a2332;
  --navy-mid:    #1f2937;
  --navy-hover:  #273548;
  --surface:     #1a2332;
  --surface-2:   #1f2937;
  --surface-3:   #273548;

  --blue:        #3b82f6;
  --blue-hover:  #2563eb;
  --blue-glow:   rgba(59, 130, 246, 0.25);
  --blue-soft:   rgba(59, 130, 246, 0.1);
  --primary:     #3b82f6;
  --primary-rgb: 59, 130, 246;
  --cyan:        #06b6d4;
  --cyan-glow:   rgba(6, 182, 212, 0.2);
  --green:       #10b981;
  --green-dark:  #059669;
  --green-soft:  rgba(16, 185, 129, 0.15);

  --bg:          #0f1623;
  --card-bg:     #1a2332;
  --card-border: rgba(255, 255, 255, 0.08);

  --text:        #e2e8f0;
  --text-bright: #f8fafc;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --heading:     #ffffff;

  --border:      rgba(255, 255, 255, 0.1);
  --border-hover:rgba(255, 255, 255, 0.2);

  --red:         #ef4444;
  --red-hover:   #dc2626;
  --red-soft:    rgba(239, 68, 68, 0.15);
  --red-dark:    #fca5a5;
  --amber:       #f59e0b;
  --amber-soft:  rgba(245, 158, 11, 0.15);

  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --shadow:      0 4px 20px rgba(0, 0, 0, 0.25);
  --shadow-lg:   0 12px 40px rgba(0, 0, 0, 0.35);
  --transition:  all 0.2s ease;

  --login-bg:    radial-gradient(ellipse at top, #1a2332 0%, #0f1623 70%);
  --logo-filter: brightness(1.15);
  --sidebar-logo-bg: transparent;
  --row-hover:   rgba(255, 255, 255, 0.03);
  --inactive-bg: rgba(239, 68, 68, 0.06);
  --inactive-info-bg: rgba(239, 68, 68, 0.08);
  --inactive-info-border: rgba(239, 68, 68, 0.15);
  --input-bg:    var(--surface);
}

/* ===== "LIGHT MODE" OVERRIDES (AJISA CORPORATE THEME) ===== */
[data-theme="light"] {
  /* Fondo y Paneles - Blanco y Gris Claro */
  --bg:          #f3f1fc; /* Fondo general */
  --navy:        #082360; /* Azul Marino AJISA - Sidebar */
  --card-bg:     #ffffff; /* Blanco puro para paneles y tarjetas */
  --surface:     #f9fcff; /* Inputs/Hover */
  --surface-2:   #e2e8f0;
  --surface-3:   #cbd5e1;
  
  --navy-light:  #10225c;
  --navy-mid:    #082360;
  --navy-hover:  #0095eb; /* Hover en sidebar */

  /* Texto - Oscuro para legibilidad */
  --text:        #334155; /* Gris oscuro */
  --text-bright: #082360; /* Azul marino para textos destacados */
  --text-muted:  #64748b; /* Gris medio */
  --text-dim:    #94a3b8; /* Gris claro */
  --heading:     #082360; /* Azul marino para encabezados */

  /* Bordes */
  --border:      rgba(8, 35, 96, 0.1);
  --border-hover:rgba(8, 35, 96, 0.2);
  --card-border: rgba(8, 35, 96, 0.08);

  /* Acentos AJISA */
  --blue:        #0095eb; /* Celeste AJISA */
  --blue-hover:  #007cc3;
  --primary:     #0095eb;
  --cyan:        #06b6d4;
  --green:       #10b981;
  --green-dark:  #059669;
  --red:         #ef4444;
  --orange:      #f97316;

  --red-soft:    rgba(239, 68, 68, 0.1);
  --red-dark:    #dc2626;
  --green-soft:  rgba(16, 185, 129, 0.1);
  --blue-soft:   rgba(0, 149, 235, 0.1);
  --blue-glow:   rgba(0, 149, 235, 0.2);
  --cyan-glow:   rgba(6, 182, 212, 0.2);
  --amber-soft:  rgba(245, 158, 11, 0.1);
  
  --row-hover:   rgba(0, 149, 235, 0.05);
  --inactive-bg: rgba(239, 68, 68, 0.05);
  --inactive-info-bg: rgba(239, 68, 68, 0.05);
  --inactive-info-border: rgba(239, 68, 68, 0.15);
  --login-bg:    #f3f1fc;

  --shadow:      0 4px 15px rgba(8, 35, 96, 0.08);
  --shadow-lg:   0 10px 30px rgba(8, 35, 96, 0.12);
}

[data-theme="light"] .content::before {
  opacity: 0.01; /* Almost invisible circuit pattern to avoid noise */
}

[data-theme="light"] .panel,
[data-theme="light"] .card,
[data-theme="light"] .sidebar {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Removed hardcoded dark sidebar in light mode */

/* Light mode: show sun icon in dark, moon in light */
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Light mode login */
[data-theme="light"] .login-main { background: var(--login-bg); }
[data-theme="light"] .login-card {
  background: var(--card-bg);
  border-color: var(--card-border);
  box-shadow: var(--shadow-lg);
}
[data-theme="light"] .login-card h1 { color: var(--heading); }
[data-theme="light"] .login-card p { color: var(--text-dim); }

/* Light mode alerts */
[data-theme="light"] .alert.success { background: var(--green-soft); color: var(--green-dark); border-color: var(--green); }
[data-theme="light"] .alert.danger { background: var(--red-soft); color: var(--red-dark); border-color: var(--red); }

/* Light mode badges */
[data-theme="light"] .badge-active { background: var(--green-soft); color: var(--green); }
[data-theme="light"] .badge-inactive { background: var(--red-soft); color: var(--red); }

/* Light mode inputs */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder { color: var(--text-muted); }
[data-theme="light"] select option { background: var(--surface); color: var(--text); }

/* Light mode card gradients */
[data-theme="light"] .card span { color: var(--text-dim); }
[data-theme="light"] .cards .card strong { color: var(--heading); }




/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.layout { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width, 260px);
  min-width: var(--sidebar-width, 260px);
  background: var(--navy);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--navy-hover) transparent;
  transition: width 0.1s, min-width 0.1s;
}

.sidebar-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 100;
  background-color: transparent;
  transition: background-color 0.2s;
}
.sidebar-resizer:hover, .sidebar-resizer.active {
  background-color: var(--primary);
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 15px var(--blue-glow);
}

.brand-icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 12px 18px;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  border-bottom: none;
  flex: 1;
}

.user-avatar {
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}


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

.nav-section {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffffff; /* Fuerte y definido */
  padding: 18px 18px 8px;
  font-weight: 800;
  margin-top: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.85); /* Letras más fuertes */
  text-decoration: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600; /* Letras bien marcadas */
  transition: var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.nav-link svg {
  color: #ffffff; /* Íconos blancos fuertes y exactos */
  transition: var(--transition);
}

.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover svg {
  color: var(--blue); /* Highlight icon on hover */
}

.nav-link.active {
  color: #ffffff;
  background: var(--blue-soft);
  border-left-color: var(--blue);
  font-weight: 600;
}

.nav-link.active svg {
  color: var(--blue); /* Active icon is blue */
}

.logout-link {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 13px 18px;
  color: var(--text-dim);
}

.logout-link:hover {
  color: var(--red);
  background: var(--red-soft);
}

/* ===== MAIN CONTENT ===== */
.content {
  flex: 1;
  padding: 30px 34px;
  max-width: 100%;
  overflow-x: auto;
  position: relative;
  z-index: 1;
}

.content h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 22px;
  letter-spacing: -0.5px;
}

.content h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-bright);
  margin: 0 0 10px;
}

/* ===== LOGIN ===== */
.login-main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--login-bg);
}

.login-card {
  width: 420px;
  max-width: 92vw;
  padding: 36px 40px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
}

/* Login logo */
.login-logo {
  width: 160px;
  height: 160px;
  object-fit: contain;
  margin: 0 auto 15px;
  display: block;
  border-radius: 20px;
  background: #ffffff;
  padding: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 4px;
}

.login-card p {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 14px;
}

.login-footer {
  color: var(--text-dim);
  font-size: 12px;
  margin: 20px 0 0;
  letter-spacing: 0.3px;
}

.login-card label { text-align: left; color: var(--text-muted); }

.login-card button {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  box-shadow: 0 6px 20px var(--blue-glow);
}

.login-card button:hover {
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.4);
}

/* ===== FORMS ===== */
label {
  display: block;
  margin-top: 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-top: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-bright);
  background: var(--surface);
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}

input[type="checkbox"], input[type="radio"] {
  width: auto;
  margin-top: 0;
  padding: 0;
  cursor: pointer;
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }

select { cursor: pointer; }
select option { background: var(--surface); color: var(--text); }

textarea { min-height: 90px; resize: vertical; }

/* ===== BUTTONS ===== */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  background: var(--blue);
  color: white;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 16px;
  min-height: 36px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

button:hover, .button:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--blue-glow);
}

button:active, .button:active { transform: translateY(0); }

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 6px;
  padding: 8px 16px;
  min-height: 36px;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
  transition: var(--transition);
}

.danger-btn:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* ===== CARDS (Dashboard) ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 14px;
  margin: 0 0 26px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  opacity: 0.6;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.card:hover::before { opacity: 1; }

.card span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cards .card strong {
  display: block;
  font-size: 30px;
  font-weight: 700;
  margin-top: 6px;
  color: var(--heading);
  letter-spacing: -1px;
}

/* ===== PANELS ===== */
.panel {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  padding: 22px;
  margin-bottom: 18px;
}

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; margin-top: 6px; }

th {
  text-align: left;
  padding: 9px 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
}

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

td a { color: var(--blue); text-decoration: none; font-weight: 500; }
td a:hover { text-decoration: underline; color: var(--cyan); }

/* ===== GRID LAYOUTS ===== */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-items: end;
}

.wide { grid-column: 1 / -1; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
}

.alert.success {
  background: var(--green-soft);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert.danger {
  background: var(--red-soft);
  color: var(--red-dark);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== MISC LAYOUT ===== */
.item-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.title-row { display: flex; align-items: center; justify-content: space-between; }

/* ===== PAYROLL ===== */
.quick-rates {
  margin: 15px 0;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.quick-rates button {
  margin: 5px 4px;
  background: var(--green);
  font-size: 12px;
  padding: 7px 12px;
}

.quick-rates button:hover {
  background: var(--green-dark);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.payroll-row {
  display: grid;
  grid-template-columns: 150px 2fr 120px 110px 120px 1.5fr;
  gap: 10px;
  margin-bottom: 10px;
}

td input[type="number"] { min-width: 90px; padding: 7px; }

small { color: var(--text-dim); font-size: 12px; }

.action-cell { display: flex; align-items: center; gap: 8px; }
.action-cell form, td form { margin: 0; }

/* ===== DAYS GRID ===== */
.days-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0 15px;
}

.days-grid label {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin: 0;
  font-weight: normal;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.days-grid label:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.days-grid input { width: auto; margin-right: 6px; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-active { background: var(--green-soft); color: #6ee7b7; }
.badge-inactive { background: var(--red-soft); color: var(--red-dark); }

/* ===== INACTIVE ROWS ===== */
.row-inactive td { opacity: 0.5; background: rgba(239, 68, 68, 0.04); }
.row-inactive td .badge { opacity: 1; }

.row-inactive-detail td {
  background: rgba(239, 68, 68, 0.04);
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(239, 68, 68, 0.15);
}

.termination-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.12);
}

.termination-info .wide { width: 100%; }
.termination-info .badge { font-size: 10px; padding: 2px 8px; vertical-align: middle; }

.reactivate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  background: var(--green-soft);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius);
  padding: 8px 16px;
  min-height: 36px;
  box-sizing: border-box;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
  transition: var(--transition);
}

.reactivate-btn:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px;
  width: 480px;
  max-width: 92vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.25s ease-out;
}

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

.modal-card h2 { margin-top: 0; color: var(--red-dark); font-size: 18px; }
.modal-card label { margin-top: 14px; font-weight: 600; font-size: 13px; }
.required { color: var(--red); }

.radio-group { display: flex; gap: 20px; margin-top: 8px; }
.radio-label {
  display: flex; align-items: center; gap: 6px;
  font-weight: normal; margin-top: 0; cursor: pointer; color: var(--text);
}
.radio-label input[type="radio"] { width: auto; margin: 0; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  min-height: 36px;
  box-sizing: border-box;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  line-height: 1;
  transition: var(--transition);
}

.cancel-btn:hover { background: var(--navy-hover); border-color: var(--border-hover); }
.modal-actions .danger-btn { margin-top: 0; padding: 10px 18px; }

/* ===== RESPONSIVE & NOTIFICATIONS ===== */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 90;
}
.mobile-brand { font-weight: 700; font-size: 16px; color: var(--heading); }
.hamburger-btn, .notif-btn {
  background: transparent; border: none; color: var(--text);
  cursor: pointer; padding: 5px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.hamburger-btn:hover, .notif-btn:hover { color: var(--blue); }

.sidebar .notif-btn { color: rgba(255, 255, 255, 0.7); }
.sidebar .notif-btn:hover { color: #ffffff; }

.notif-badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--red); color: white;
  font-size: 10px; font-weight: bold;
  padding: 2px 5px; border-radius: 10px;
}

.notif-panel {
  position: absolute; top: 60px; right: 20px;
  width: 320px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 99; overflow: hidden;
}
[data-theme="light"] .notif-panel { box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.notif-header { padding: 12px 15px; background: var(--bg); border-bottom: 1px solid var(--border); font-weight: 600; color: var(--heading); font-size: 13px; }
.notif-list { max-height: 350px; overflow-y: auto; }
.notif-item { padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--border); }
.notif-item strong { display: block; font-size: 13px; color: var(--heading); margin-bottom: 4px; }
.notif-item p { margin: 0; font-size: 12px; color: var(--text-dim); }
.notif-time { display: block; margin-top: 6px; font-size: 10px; color: var(--text-dim); text-align: right; }
.notif-empty { padding: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }

.sidebar-overlay {
  display: none; position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 95;
  backdrop-filter: blur(2px);
}

@media (max-width: 1100px) { .payroll-row { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .mobile-header { display: flex; }
  .desktop-notif { display: none !important; }
  .layout { flex-direction: column; }
  
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 280px; z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  
  .content { padding: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .grid2, .form-grid { grid-template-columns: 1fr !important; }
  .table { min-width: 700px; } /* Ensures tables scroll on mobile */
  
  /* Fix hardcoded inline grids for mobile */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 2fr 1.2fr"],
  div[style*="grid-template-columns: 1fr 320px"],
  div[style*="grid-template-columns: 1fr 2fr"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .days-grid { grid-template-columns: 1fr; }
}

/* ===== HEADER ACTIONS ===== */
.header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}
.header-actions h1 { margin-top: 0; margin-bottom: 5px; }
.header-actions p { margin: 0; }

form button[type="submit"]:not(.danger-btn):not(.cancel-btn):not(.reactivate-btn) {
  margin-top: 15px;
}

.modal-actions button[type="submit"] {
  margin-top: 0 !important;
}

/* Modal / Dialog Styles */
dialog {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-width: 500px;
  width: 90%;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.cancel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  min-height: 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.cancel-btn:hover {
  background: var(--surface);
  border-color: var(--text-muted);
}
