/* ==========================================================================
   DERIN CORP - PAYROLL & ATTENDANCE MANAGEMENT SYSTEM
   Modern, Responsive & Interactive Professional Dashboard CSS
   ========================================================================== */

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

:root {
  /* Color Palette - Executive Dark Theme (Default) */
  --bg-body: #0b0f19;
  --bg-sidebar: #0f172a;
  --bg-surface: #131c2e;
  --bg-surface-elevated: #1a243a;
  --bg-input: #0e1524;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-active: #10b981;

  /* Accent Colors */
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-600: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.2);

  --indigo-500: #6366f1;
  --indigo-400: #818cf8;
  --indigo-glow: rgba(99, 102, 241, 0.2);

  --cyan-500: #06b6d4;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --rose-500: #f43f5e;
  --rose-400: #fb7185;

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0b0f19;

  /* Gradients & Shadows */
  --grad-primary: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-indigo: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-card: linear-gradient(180deg, rgba(26, 36, 58, 0.6) 0%, rgba(19, 28, 46, 0.8) 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);

  /* Layout dimensions */
  --sidebar-width: 270px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --grad-card: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.1);
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

code, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--emerald-500);
}

/* ==========================================================================
   Layout Architecture
   ========================================================================== */
#app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

.role-badge-pill {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.role-badge-pill.admin { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.4); }
.role-badge-pill.moderator { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.role-badge-pill.karyawan { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
}

.brand-info h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-info p {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* User Profile Badge in Sidebar */
.sidebar-user {
  margin: 16px;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-meta .name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta .role-text {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Navigation Menu */
.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald-400);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--emerald-500);
  border-radius: 0 4px 4px 0;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose-400);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: var(--rose-400);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}
.logout-btn:hover {
  background: var(--rose-500);
  color: white;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-body);
}

/* App Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
}

.header-title-box h2 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-title-box p {
  font-size: 12px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-datetime-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.live-datetime-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-500);
  box-shadow: 0 0 10px var(--emerald-500);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.theme-toggle-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.theme-toggle-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Content Container */
.content-body {
  padding: 28px;
  flex: 1;
}

/* Page View Container with smooth tab switching */
.page-view {
  display: none;
  animation: fadeIn 0.25s ease-out forwards;
}

.page-view.active {
  display: block;
}

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

/* ==========================================================================
   Dashboard Metrics & Cards
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

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

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.stat-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--emerald-400); }
.stat-icon.indigo { background: rgba(99, 102, 241, 0.15); color: var(--indigo-400); }
.stat-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--amber-400); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--cyan-500); }
.stat-icon.rose { background: rgba(244, 63, 94, 0.15); color: var(--rose-400); }

.stat-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-card-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.stat-card-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Payday Alert Card / Timeline Banner */
.payday-reminder-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.payday-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.payday-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.payday-card:hover {
  border-color: var(--emerald-500);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.12);
}

.payday-card.urgent {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, var(--bg-surface-elevated) 100%);
}

.payday-card.today {
  border-color: var(--emerald-500);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12) 0%, var(--bg-surface-elevated) 100%);
}

.payday-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.countdown-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.countdown-badge.today { background: rgba(16, 185, 129, 0.2); color: var(--emerald-400); border: 1px solid rgba(16, 185, 129, 0.4); }
.countdown-badge.urgent { background: rgba(245, 158, 11, 0.2); color: var(--amber-400); border: 1px solid rgba(245, 158, 11, 0.4); }
.countdown-badge.normal { background: rgba(99, 102, 241, 0.15); color: var(--indigo-400); }

/* ==========================================================================
   Data Tables & Controls
   ========================================================================== */
.table-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.panel-toolbar {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Inputs & Form Elements */
.search-box {
  position: relative;
  min-width: 240px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.custom-select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.custom-select:focus {
  border-color: var(--emerald-500);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  user-select: none;
}

.btn-primary {
  background: var(--emerald-500);
  color: #ffffff;
}
.btn-primary:hover {
  background: var(--emerald-600);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-indigo {
  background: var(--indigo-500);
  color: #ffffff;
}
.btn-indigo:hover {
  background: #4f46e5;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--rose-400);
}
.btn-danger:hover {
  background: var(--rose-500);
  color: white;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* Modern Data Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.modern-table th {
  background: var(--bg-surface-elevated);
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.modern-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  vertical-align: middle;
}

/* Sticky Action Column so Edit & Hapus are ALWAYS visible */
.modern-table th.col-aksi {
  position: sticky;
  right: 0;
  background: var(--bg-surface-elevated) !important;
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.35);
  z-index: 10;
  text-align: center;
  min-width: 145px;
}

.modern-table td.col-aksi {
  position: sticky;
  right: 0;
  background: var(--bg-surface);
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.35);
  z-index: 8;
  text-align: center;
  min-width: 145px;
}

[data-theme="light"] .modern-table th.col-aksi {
  background: #f1f5f9 !important;
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .modern-table td.col-aksi {
  background: #ffffff;
  box-shadow: -6px 0 14px rgba(0, 0, 0, 0.08);
}

.modern-table tbody tr:hover td.col-aksi {
  background: var(--bg-surface-elevated);
}

[data-theme="light"] .modern-table tbody tr:hover td.col-aksi {
  background: #f8fafc;
}

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

.modern-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

[data-theme="light"] .modern-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-cell-meta .title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}

.user-cell-meta .sub {
  font-size: 11px;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-cycle {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.badge-quota {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-payday-today {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: pulse-glow 2s infinite;
}

/* ==========================================================================
   Input Absensi & Kalender View
   ========================================================================== */
.attendance-header-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.date-navigator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-navigator input[type="date"] {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.date-display-badge {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 14px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

/* Attendance Status Segmented Radios */
.status-pill-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
}

.status-pill {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-pill:hover {
  color: var(--text-primary);
}

.status-pill.active-masuk {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-400);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-pill.active-libur {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.status-pill.active-izin {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose-400);
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.mini-input-number {
  width: 100px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

.mini-input-number:focus {
  outline: none;
  border-color: var(--emerald-500);
}

/* ==========================================================================
   Slip Gaji Saya (Personal Payslip View)
   ========================================================================== */
.payslip-hero-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.08) 50%, var(--bg-surface) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  box-shadow: var(--shadow-md);
}

.payslip-hero-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.thp-highlight-box {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 18px 24px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.1);
}

.thp-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 700;
}

.thp-amount {
  font-size: 32px;
  font-weight: 800;
  color: var(--emerald-400);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
}

.thp-terbilang {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Rolling Leave Quota Meter */
.leave-quota-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.quota-meter-bar {
  flex: 1;
  min-width: 180px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.quota-meter-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-dialog.wide {
  max-width: 820px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--bg-surface-elevated);
}

/* Forms in Modal */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--emerald-500);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

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

/* Live Preview Box in Add/Edit User */
.live-calc-box {
  background: var(--bg-surface-elevated);
  border: 1px dashed rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 12px;
}

.live-calc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--emerald-400);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.live-calc-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.live-calc-item .lbl { color: var(--text-muted); }
.live-calc-item .val { font-weight: 700; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; }

/* ==========================================================================
   Professional Printable Slip Gaji Format
   ========================================================================== */
#printable-slip {
  background: #ffffff;
  color: #111827;
  padding: 32px;
  border-radius: var(--radius-md);
  font-family: 'Plus Jakarta Sans', sans-serif;
  box-shadow: var(--shadow-lg);
  max-width: 720px;
  margin: 0 auto;
}

.slip-kop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.slip-company-info h2 {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.5px;
}

.slip-company-info p {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.slip-doc-badge {
  text-align: right;
}

.slip-doc-badge h3 {
  font-size: 16px;
  font-weight: 800;
  color: #059669;
  letter-spacing: 0.5px;
}

.slip-doc-badge p {
  font-size: 11px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
}

.slip-employee-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #f8fafc;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 20px;
  font-size: 12px;
}

.slip-meta-row {
  display: flex;
  justify-content: space-between;
}
.slip-meta-row .label { color: #64748b; }
.slip-meta-row .value { font-weight: 700; color: #0f172a; }

.slip-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.slip-column-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.slip-column-header {
  background: #f1f5f9;
  padding: 8px 14px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #e2e8f0;
}
.slip-column-header.income { color: #059669; }
.slip-column-header.deduction { color: #dc2626; }

.slip-item-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
}
.slip-item-row:last-child {
  border-bottom: none;
}
.slip-item-row .val {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.slip-total-thp-card {
  background: #ecfdf5;
  border: 2px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.slip-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
}

.signature-line {
  margin-top: 60px;
  border-top: 1px dashed #94a3b8;
  padding-top: 6px;
  font-weight: 700;
}

/* Print CSS */
@media print {
  body * {
    visibility: hidden;
  }
  #printable-slip, #printable-slip * {
    visibility: visible;
  }
  #printable-slip {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 20px;
    box-shadow: none;
    border: none;
  }
  .modal-overlay, .modal-footer, .sidebar, .app-header {
    display: none !important;
  }
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease-out forwards;
}

.toast.success { border-left: 4px solid var(--emerald-500); }
.toast.info { border-left: 4px solid var(--indigo-500); }
.toast.warning { border-left: 4px solid var(--amber-500); }
.toast.error { border-left: 4px solid var(--rose-500); }

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

/* ==========================================================================
   Login Screen Dedicated Styles
   ========================================================================== */
.login-view-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.15), transparent 40%),
              radial-gradient(circle at bottom left, rgba(99, 102, 241, 0.15), transparent 40%),
              var(--bg-body);
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

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

.login-brand-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background: var(--grad-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.7);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

@media (max-width: 640px) {
  .content-body {
    padding: 16px;
  }
  .app-header {
    padding: 0 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row-2, .slip-breakdown-grid, .slip-employee-meta {
    grid-template-columns: 1fr;
  }
}
