/* ===== 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 ===== */
[data-theme="light"] {
  --navy:        #cbd5e1;
  --navy-light:  #94a3b8;
  --navy-mid:    #64748b;
  --navy-hover:  #475569;
  
  --surface:     #f8fafc;
  --surface-2:   #f1f5f9;
  --surface-3:   #e2e8f0;

  --bg:          #e2e8f0;
  --card-bg:     #f8fafc;
  --card-border: #cbd5e1;

  --text:        #334155;
  --text-bright: #0f172a;
  --text-muted:  #475569;
  --text-dim:    #64748b;
  --heading:     #0f172a;

  --border:      #cbd5e1;
  --border-hover:#94a3b8;

  --red-soft:    rgba(220, 38, 38, 0.1);
  --red-dark:    #b91c1c;
  --green-soft:  rgba(5, 150, 105, 0.1);
  --blue-soft:   rgba(37, 99, 235, 0.1);
  --blue-glow:   rgba(37, 99, 235, 0.15);
  --cyan-glow:   rgba(8, 145, 178, 0.15);
  --amber-soft:  rgba(217, 119, 6, 0.1);

  --shadow:      0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg:   0 8px 24px rgba(0, 0, 0, 0.08);

  --login-bg:    linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --logo-filter: none;
  --sidebar-logo-bg: transparent;
  --row-hover:   rgba(0, 0, 0, 0.02);
  --inactive-bg: #fee2e2;
  --inactive-info-bg: #fecaca;
  --inactive-info-border: #f87171;
  --input-bg:    #ffffff;
}

/* Light mode sidebar stays dark for contrast */
[data-theme="light"] .sidebar {
  background: #111827;
  border-right-color: rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .sidebar-brand h2 { color: #f1f5f9; }
[data-theme="light"] .brand-sub { color: #475569; }
[data-theme="light"] .sidebar-user { color: #94a3b8; border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="light"] .sidebar-brand { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="light"] .sidebar-user-row { border-bottom-color: rgba(255,255,255,0.06); }
[data-theme="light"] .nav-section { color: #475569; }
[data-theme="light"] .nav-link { color: #94a3b8; }
[data-theme="light"] .nav-link:hover { color: #f1f5f9; background: #1e293b; }
[data-theme="light"] .nav-link.active { color: #3b82f6; background: rgba(59,130,246,0.08); border-left-color: #3b82f6; }
[data-theme="light"] .logout-link { border-top-color: rgba(255,255,255,0.06); color: #475569; }
[data-theme="light"] .logout-link:hover { color: #ef4444; background: rgba(239,68,68,0.08); }
[data-theme="light"] .theme-toggle { border-color: rgba(255,255,255,0.15); color: #94a3b8; }
[data-theme="light"] .theme-toggle:hover { background: rgba(255,255,255,0.08); color: #f1f5f9; }
[data-theme="light"] .desktop-notif { color: #94a3b8; }
[data-theme="light"] .desktop-notif:hover { color: #f1f5f9; }

/* 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: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}
[data-theme="light"] .login-card h1 { color: #0f172a; }
[data-theme="light"] .login-card p { color: #64748b; }

/* Light mode alerts */
[data-theme="light"] .alert.success { background: #dcfce7; color: #166534; border-color: #a7f3d0; }
[data-theme="light"] .alert.danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* Light mode badges */
[data-theme="light"] .badge-active { background: #dcfce7; color: #166534; }
[data-theme="light"] .badge-inactive { background: #fee2e2; color: #991b1b; }

/* Light mode inputs */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: var(--input-bg);
  border-color: #d1d5db;
  color: #1e293b;
}
[data-theme="light"] input::placeholder,
[data-theme="light"] textarea::placeholder { color: #9ca3af; }
[data-theme="light"] select option { background: #ffffff; color: #1e293b; }

/* Light mode card gradient */
[data-theme="light"] .card::before { opacity: 0.8; }
[data-theme="light"] .card span { color: #64748b; }
[data-theme="light"] .cards .card strong { color: #0f172a; }

/* Light mode table */
[data-theme="light"] th { color: #64748b; border-bottom-color: #e2e8f0; }
[data-theme="light"] td { color: #334155; border-bottom-color: #f1f5f9; }
[data-theme="light"] tr:hover td { background: #f8fafc; }

/* Light mode inactive rows */
[data-theme="light"] .row-inactive td { background: #fef2f2; }
[data-theme="light"] .row-inactive-detail td { background: #fef2f2; border-bottom-color: #fca5a5; }
[data-theme="light"] .termination-info { background: #fff5f5; border-color: #fecaca; color: #6b7280; }
[data-theme="light"] .reactivate-btn { background: #dcfce7; color: #166534; border-color: #a7f3d0; }
[data-theme="light"] .reactivate-btn:hover { background: #10b981; color: white; border-color: #10b981; }
[data-theme="light"] .danger-btn { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
[data-theme="light"] .danger-btn:hover { background: #ef4444; color: white; border-color: #ef4444; }

/* Light mode modal */
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.4); }
[data-theme="light"] .modal-card { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 25px 60px rgba(0,0,0,0.15); }
[data-theme="light"] .modal-card h2 { color: #dc2626; }
[data-theme="light"] .cancel-btn { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
[data-theme="light"] .cancel-btn:hover { background: #e2e8f0; }
[data-theme="light"] .radio-label { color: #334155; }

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

body {
  margin: 0;
  font-family: 'Inter', -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: 260px;
  min-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;
}

.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);
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--text-dim);
  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: var(--text-muted);
  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 var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.theme-toggle:hover {
  background: var(--navy-hover);
  color: var(--text-bright);
  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: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 14px 18px 5px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 400;
  transition: var(--transition);
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.nav-link:hover {
  color: var(--text-bright);
  background: var(--navy-hover);
}

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

.nav-link svg { flex-shrink: 0; opacity: 0.5; }
.nav-link.active svg, .nav-link:hover svg { opacity: 1; }

.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::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: -1;
  background-color: var(--text);
  opacity: 0.12;
  mask-image: url("data:image/svg+xml,%3Csvg width='240' height='240' viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%23000' stroke-width='1.5' fill='none'%3E%3Cpath d='M0 40h40l20 20h30'/%3E%3Ccircle cx='93' cy='60' r='3' fill='%23000'/%3E%3Cpath d='M0 120h30l30-30h20'/%3E%3Ccircle cx='83' cy='90' r='3' fill='%23000'/%3E%3Cpath d='M0 200h50l30 30h40'/%3E%3Ccircle cx='123' cy='230' r='3' fill='%23000'/%3E%3Cpath d='M240 80h-40l-20-20h-30'/%3E%3Ccircle cx='147' cy='60' r='3' fill='%23000'/%3E%3Cpath d='M240 160h-50l-30 30h-20'/%3E%3Ccircle cx='137' cy='190' r='3' fill='%23000'/%3E%3Cpath d='M120 0v40l20 20v20'/%3E%3Ccircle cx='140' cy='83' r='3' fill='%23000'/%3E%3Cpath d='M160 240v-40l20-20v-30'/%3E%3Ccircle cx='180' cy='147' r='3' fill='%23000'/%3E%3Cpath d='M80 240v-30l-20-20v-20'/%3E%3Ccircle cx='60' cy='167' r='3' fill='%23000'/%3E%3Cpath d='M40 0v20l20 20h20'/%3E%3Ccircle cx='83' cy='40' r='3' fill='%23000'/%3E%3Cpath d='M200 0v50l-20 20v20'/%3E%3Ccircle cx='180' cy='93' r='3' fill='%23000'/%3E%3Cpath d='M0 160h20l20-20h20'/%3E%3Ccircle cx='63' cy='140' r='3' fill='%23000'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='240' height='240' viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%23000' stroke-width='1.5' fill='none'%3E%3Cpath d='M0 40h40l20 20h30'/%3E%3Ccircle cx='93' cy='60' r='3' fill='%23000'/%3E%3Cpath d='M0 120h30l30-30h20'/%3E%3Ccircle cx='83' cy='90' r='3' fill='%23000'/%3E%3Cpath d='M0 200h50l30 30h40'/%3E%3Ccircle cx='123' cy='230' r='3' fill='%23000'/%3E%3Cpath d='M240 80h-40l-20-20h-30'/%3E%3Ccircle cx='147' cy='60' r='3' fill='%23000'/%3E%3Cpath d='M240 160h-50l-30 30h-20'/%3E%3Ccircle cx='137' cy='190' r='3' fill='%23000'/%3E%3Cpath d='M120 0v40l20 20v20'/%3E%3Ccircle cx='140' cy='83' r='3' fill='%23000'/%3E%3Cpath d='M160 240v-40l20-20v-30'/%3E%3Ccircle cx='180' cy='147' r='3' fill='%23000'/%3E%3Cpath d='M80 240v-30l-20-20v-20'/%3E%3Ccircle cx='60' cy='167' r='3' fill='%23000'/%3E%3Cpath d='M40 0v20l20 20h20'/%3E%3Ccircle cx='83' cy='40' r='3' fill='%23000'/%3E%3Cpath d='M200 0v50l-20 20v20'/%3E%3Ccircle cx='180' cy='93' r='3' fill='%23000'/%3E%3Cpath d='M0 160h20l20-20h20'/%3E%3Ccircle cx='63' cy='140' r='3' fill='%23000'/%3E%3C/g%3E%3C/svg%3E");
  mask-size: 240px;
  -webkit-mask-size: 240px;
}

[data-theme="light"] .content::before {
  opacity: 0.15;
}

.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: var(--radius);
  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: 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);
}

.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: grid;
  place-items: 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: var(--surface-3);
  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); }

.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; }
  .table { min-width: 700px; } /* Ensures tables scroll on mobile */
}

@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;
}
