/* ============================================================
   PAYROLLPRO - Windows 11 Fluent Design System
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES - LIGHT MODE
   ============================================================ */
:root {
  /* Windows 11 Blue Accent Palette */
  --accent: #0067C0;
  --accent-light: #0078D4;
  --accent-lighter: #60CDFF;
  --accent-dark: #004E8C;
  --accent-surface: #EBF3FB;
  --accent-surface2: #D0E8F8;

  /* Neutrals */
  --bg: #F3F3F3;
  --bg-alt: #FAFAFA;
  --surface: #FFFFFF;
  --surface-alt: #F9F9F9;
  --surface-card: rgba(255,255,255,0.85);
  --border: #E5E5E5;
  --border-focus: #0078D4;
  --divider: #EBEBEB;

  /* Typography */
  --text-primary: #1A1A1A;
  --text-secondary: #616161;
  --text-tertiary: #9E9E9E;
  --text-accent: #0067C0;
  --text-inverse: #FFFFFF;

  /* Status Colors */
  --success: #107C41;
  --success-bg: #E8F5E9;
  --warning: #C57B00;
  --warning-bg: #FFF8E1;
  --danger: #C42B1C;
  --danger-bg: #FDEDED;
  --info: #0078D4;
  --info-bg: #EBF3FB;

  /* Sidebar */
  --sidebar-bg: rgba(243,243,243,0.95);
  --sidebar-width: 250px;
  --sidebar-collapsed: 64px;
  --sidebar-item-hover: rgba(0,120,212,0.08);
  --sidebar-item-active-bg: rgba(0,120,212,0.12);
  --sidebar-item-active-border: #0078D4;

  /* Shadows - Windows 11 style */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.14), 0 4px 16px rgba(0,0,0,0.10);
  --shadow-accent: 0 4px 16px rgba(0,120,212,0.25);

  /* Borders & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --topbar-height: 56px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-theme="dark"] {
  --accent: #60CDFF;
  --accent-light: #4CC2FF;
  --accent-dark: #006CBE;
  --accent-surface: rgba(96,205,255,0.08);
  --accent-surface2: rgba(96,205,255,0.14);

  --bg: #202020;
  --bg-alt: #1A1A1A;
  --surface: #2C2C2C;
  --surface-alt: #272727;
  --surface-card: rgba(44,44,44,0.92);
  --border: #3A3A3A;
  --border-focus: #60CDFF;
  --divider: #333333;

  --text-primary: #FFFFFF;
  --text-secondary: #ABABAB;
  --text-tertiary: #6E6E6E;
  --text-accent: #60CDFF;
  --text-inverse: #1A1A1A;

  --success: #6CCB5F;
  --success-bg: rgba(108,203,95,0.12);
  --warning: #FCE100;
  --warning-bg: rgba(252,225,0,0.10);
  --danger: #FF6B6B;
  --danger-bg: rgba(255,107,107,0.12);
  --info: #60CDFF;
  --info-bg: rgba(96,205,255,0.10);

  --sidebar-bg: rgba(32,32,32,0.97);
  --sidebar-item-hover: rgba(255,255,255,0.06);
  --sidebar-item-active-bg: rgba(96,205,255,0.14);
  --sidebar-item-active-border: #60CDFF;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.25);
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  font-weight: 400;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: var(--accent); }

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

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: var(--transition-slow);
  box-shadow: var(--shadow-sm);
}

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

.sidebar-brand .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 18px;
  box-shadow: 0 2px 8px rgba(0,120,212,0.35);
  flex-shrink: 0;
}

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

.sidebar-brand .brand-sub {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

.sidebar-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-tertiary);
  padding: 10px 12px 4px;
}

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

.nav-item:hover {
  background: var(--sidebar-item-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-item-active-bg);
  color: var(--accent-light);
  font-weight: 600;
}

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

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

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
}

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

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--surface-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-slow);
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.topbar-title small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  display: block;
}

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

.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
  position: relative;
}

.topbar-btn:hover {
  background: var(--sidebar-item-hover);
  color: var(--text-primary);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: var(--transition-fast);
}

.user-chip:hover {
  background: var(--accent-surface);
  border-color: var(--accent-light);
}

.user-avatar {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 11px; font-weight: 700;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 10px;
  color: var(--text-tertiary);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  flex: 1;
  padding: 28px;
  min-height: calc(100vh - var(--topbar-height));
  transition: margin-left var(--transition-slow);
}

/* ============================================================
   CARDS & SURFACES
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-glass {
  background: var(--surface-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-glass {
  background: rgba(44,44,44,0.85);
  border-color: rgba(255,255,255,0.08);
}

.card-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.card-body { padding: 20px 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--divider);
  background: var(--surface-alt);
}

/* ============================================================
   STAT CARDS (Dashboard)
   ============================================================ */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-light);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card.green::before { background: var(--success); }
.stat-card.orange::before { background: var(--warning); }
.stat-card.red::before { background: var(--danger); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-icon.blue { background: var(--accent-surface); color: var(--accent-light); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

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

.btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
  opacity: 0.88;
  transition: none;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: var(--accent-light);
  color: white;
  border-color: var(--accent-light);
}
.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--text-tertiary);
}

.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #0D6832; border-color: #0D6832; color: white; }

.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #A3241A; border-color: #A3241A; color: white; }

.btn-warning { background: var(--warning); color: #1A1A1A; border-color: var(--warning); }
.btn-warning:hover { background: #A36600; border-color: #A36600; color: white; }

/* Dark mode: warning is bright yellow — needs dark text */
[data-theme="dark"] .btn-warning { color: #1A1A1A; }
[data-theme="dark"] .btn-warning:hover { background: #D4B800; border-color: #D4B800; color: #1A1A1A; }

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

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 9px 13px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.12);
  background: var(--surface);
}

.form-control.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(196,43,28,0.10);
}

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

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23616161' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

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

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

/* ============================================================
   ATTENDANCE GRID (KEY FEATURE)
   ============================================================ */
.attendance-grid-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.attendance-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
}

.attendance-table thead th {
  background: linear-gradient(180deg, var(--accent-surface) 0%, var(--bg) 100%);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.attendance-table thead th:first-child { padding-left: 16px; border-radius: var(--radius-md) 0 0 0; }
.attendance-table thead th:last-child { padding-right: 16px; border-radius: 0 var(--radius-md) 0 0; }

.attendance-table tbody tr {
  transition: background 0.1s;
}

.attendance-table tbody tr:hover { background: var(--accent-surface); }
.attendance-table tbody tr:nth-child(even) { background: var(--surface-alt); }
.attendance-table tbody tr:nth-child(even):hover { background: var(--accent-surface); }

.attendance-table tbody td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  font-size: 13px;
}

.attendance-table tbody td:first-child { padding-left: 14px; }

/* Fast-entry inputs inside the attendance grid */
.att-input {
  width: 100%;
  padding: 7px 9px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-family: 'Courier New', monospace;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-primary);
  transition: var(--transition-fast);
  text-align: center;
  outline: none;
  min-width: 90px;
}

.att-input:focus {
  background: var(--surface);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,120,212,0.15);
  transform: scale(1.02);
}

.att-input.filled {
  background: var(--accent-surface);
  border-color: var(--accent-surface2);
  color: var(--accent);
}

.att-input.time-out.filled { background: var(--success-bg); border-color: #A5D6A7; color: var(--success); }

.att-emp-id {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-light);
  background: var(--accent-surface);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.att-emp-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
}

.att-emp-pos {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table thead th {
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.data-table thead th:hover { background: var(--accent-surface); color: var(--accent-light); }

.data-table tbody tr {
  transition: background 0.1s;
  cursor: default;
}

.data-table tbody tr:hover { background: var(--accent-surface); }

.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  font-size: 13px;
  color: var(--text-primary);
}

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg); color: var(--text-secondary); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.modal-window {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(12px);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.22s ease;
  opacity: 0;
}

.modal-overlay.show .modal-window {
  transform: scale(1) translateY(0);
  opacity: 1;
}

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

.modal-title {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  color: var(--text-primary);
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition-fast);
}

.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--surface-alt);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header-icon {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-dark));
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 20px;
  box-shadow: var(--shadow-accent);
  flex-shrink: 0;
}

.page-header-title { font-size: 20px; font-weight: 800; color: var(--text-primary); }
.page-header-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 11px;
  color: var(--text-tertiary);
  font-size: 13px;
  pointer-events: none;
}

.search-box input {
  padding-left: 33px;
  padding-right: 13px;
  min-width: 220px;
}

/* ============================================================
   AUTOCOMPLETE DROPDOWN
   ============================================================ */
.autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border-focus);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 999;
  max-height: 240px;
  overflow-y: auto;
  animation: dropIn 0.14s ease;
}

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

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
}

.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--accent-surface); }
.autocomplete-item .emp-code { font-family: monospace; font-size: 11px; color: var(--accent-light); background: var(--accent-surface); padding: 1px 6px; border-radius: 4px; }
.autocomplete-item .emp-name { font-weight: 600; font-size: 13px; }
.autocomplete-item .emp-pos { font-size: 11px; color: var(--text-tertiary); }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  min-width: 280px;
  max-width: 380px;
  animation: slideInRight 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
}

.toast.removing {
  animation: slideOutRight 0.2s ease forwards;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes slideOutRight {
  to { opacity: 0; transform: translateX(30px); }
}

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-content { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; }
.toast-msg { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.toast-close { background: none; border: none; color: var(--text-tertiary); cursor: pointer; font-size: 14px; padding: 0; }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}

.filter-bar label { font-size: 12px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }

/* ============================================================
   PAYSLIP PRINT STYLES
   ============================================================ */
.payslip-box {
  max-width: 680px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.payslip-header {
  background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-light) 100%);
  color: white;
  padding: 24px 28px;
}

.payslip-company { font-size: 18px; font-weight: 800; }
.payslip-title { font-size: 12px; opacity: 0.8; margin-top: 4px; }
.payslip-period { font-size: 13px; font-weight: 600; margin-top: 12px; opacity: 0.9; }

.payslip-body { padding: 24px 28px; }

.payslip-section { margin-bottom: 20px; }
.payslip-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  border-bottom: 2px solid var(--accent-surface2);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.payslip-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px dashed var(--divider);
}

.payslip-row:last-child { border: none; }
.payslip-row .label { color: var(--text-secondary); }
.payslip-row .value { font-weight: 600; }

.payslip-total {
  background: var(--accent-surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

.payslip-total .label { font-size: 14px; font-weight: 700; color: var(--accent); }
.payslip-total .value { font-size: 22px; font-weight: 800; color: var(--accent); }

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-accent { color: var(--accent-light); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.fw-600 { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap { display: flex; gap: 10px; align-items: center; }
.w-100 { width: 100%; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; color: var(--border); }
.empty-state h3 { font-size: 14px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: var(--sidebar-collapsed); }
  .sidebar-brand .brand-text,
  .sidebar-brand .brand-sub,
  .nav-item span,
  .nav-section-label { display: none; }
  .nav-item { justify-content: center; }
  .nav-item i { width: auto; }
  .main-content { padding: 20px 16px; }
}

@media (max-width: 768px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .page-header { flex-wrap: wrap; }
  .page-actions { width: 100%; }
}

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0 !important; padding: 0 !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
