/**
 * HR Onboarding - Digitales Onboarding für Schweizer Organisationen
 * Light Imperial Design - Clean, Organized, Professional
 * Inspired by Monday Board Imperial System
 */

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

/* ===== CSS VARIABLES - Light Imperial ===== */
:root {
  /* Primary: Gold */
  --gold: #D4AF37;
  --gold-dark: #B8960C;
  --gold-light: #F4E4BC;
  --gold-bright: #D4AF37;
  
  /* Accent Colors */
  --accent-red: #E53935;
  --accent-orange: #f59e0b;
  
  /* Secondary: Cool Accent */
  --accent-blue: #3d6a8f;
  --accent-amber: #c9a43d;
  
  /* Imperial-inspired Grays (warm, light) */
  --bg-primary: #fafcfb;
  --bg-secondary: #f5f7f6;
  --bg-panel: #ffffff;
  --bg-elevated: #f0f4f2;
  
  --border-light: #e0e6e3;
  --border-medium: #c5d1cc;
  --border-strong: #9baaa4;
  
  --text-primary: #1a2a24;
  --text-secondary: #4a5a54;
  --text-muted: #7a8a84;
  --text-placeholder: #a0b0a8;
  
  /* Status Colors */
  --status-success: #2d7a4d;
  --status-success-bg: #e8f5ed;
  --status-warning: #b58d2d;
  --status-warning-bg: #fdf6e3;
  --status-error: #a84a4a;
  --status-error-bg: #fdf0f0;
  --status-info: #3d6a8f;
  --status-info-bg: #eef4fc;
  
  /* Typography */
  --font-display: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-mono: 'Rajdhani', 'SF Mono', monospace;
  
  --text-xs: 0.6875rem;   /* 11px - Technical labels */
  --text-sm: 0.8125rem;   /* 13px - Secondary text */
  --text-base: 0.9375rem; /* 15px - Body */
  --text-md: 1rem;        /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.375rem;    /* 22px */
  --text-2xl: 1.75rem;    /* 28px */
  --text-3xl: 2.25rem;    /* 36px - Display */
  
  /* Spacing - Imperial Grid */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* Touch Target */
  --touch: 44px;
  
  /* Border Radius - Technical */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-full: 9999px;
  
  /* Shadows - Subtle depth */
  --shadow-sm: 0 1px 2px rgba(26,42,36,0.04);
  --shadow-md: 0 2px 8px rgba(26,42,36,0.06), 0 1px 2px rgba(26,42,36,0.04);
  --shadow-lg: 0 4px 16px rgba(26,42,36,0.08), 0 2px 4px rgba(26,42,36,0.04);
  --shadow-glow: 0 0 0 3px rgba(45,90,61,0.12);
  
  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 250ms ease;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-display);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

/* Technical Monospace Labels (Imperial Style) */
.label-mono {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-4);
}

.container-narrow {
  max-width: 480px;
}

/* ===== CARDS - Imperial Style ===== */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
  box-shadow: var(--shadow-md);
}

/* Corner Accents (Imperial Inspired) */
.card::before,
.card::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border: 2px solid var(--gold);
}

.card::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
  border-radius: var(--radius-md) 0 0 0;
}

.card::after {
  top: -1px;
  right: -1px;
  border-left: none;
  border-bottom: none;
  border-radius: 0 var(--radius-md) 0 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: var(--space-1);
}

/* ===== PANELS ===== */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-3) var(--space-4);
}

.panel-body {
  padding: var(--space-4);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--gold);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: var(--touch);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-panel);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--shadow-glow);
}

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

.form-select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%234a5a54' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-4) center;
  padding-right: var(--space-8);
  appearance: none;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn:focus {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.btn-primary {
  color: #fff;
  background: var(--gold);
}

.btn-primary:hover {
  background: var(--ps-green-bright);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  color: var(--gold);
  background: var(--gold-light);
  border: 1px solid var(--gold);
}

.btn-secondary:hover {
  background: var(--gold);
  color: #fff;
}

.btn-exit {
  color: var(--status-error);
  background: var(--status-error-bg);
  border: 1px solid var(--status-error);
}

.btn-exit:hover {
  background: var(--status-error);
  color: #fff;
}

.btn-outline {
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.btn-logout {
  background: #f3f4f6;
  color: #374151;
}

.btn-logout:hover {
  background: #e5e7eb;
  color: #111827;
}

.btn-danger {
  color: #fff;
  background: var(--status-error);
}

.btn-danger:hover {
  background: #8a3a3a;
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-md);
}

.btn-block {
  width: 100%;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(45,90,61,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(61,106,143,0.03) 0%, transparent 50%);
  padding: var(--space-4);
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.login-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  position: relative;
}

/* Status Line (Imperial Style) */
.login-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--gold) 20%, 
    var(--gold) 80%, 
    transparent 100%
  );
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #D4AF37;
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 800;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-md);
}

.login-header h1 {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--space-1);
}

.login-header .system-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.login-body {
  padding: var(--space-5);
}

.login-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-light);
  padding: var(--space-4) var(--space-5);
  text-align: center;
}

.login-footer p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: 0;
}

/* Dev Login Section */
.dev-login {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}

.dev-login-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.dev-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.dev-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.dev-btn:hover {
  background: var(--gold-light);
  border-color: var(--gold);
}

.dev-role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.dev-role.role-fl {
  background: var(--status-info-bg);
  color: var(--status-info);
}

.dev-role.role-bl {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.dev-role.role-hr {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.dev-name {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ===== HEADER - Compact Fixed ===== */
.header {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.header-logo {
  width: 36px;
  height: 36px;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border-radius: var(--radius-md);
}

.header-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-user {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.4;
}

.header-user strong {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
}

/* Header Buttons */
.header .btn {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* Inbox Button */
.inbox-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.inbox-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}

.inbox-btn svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.inbox-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--ps-red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inbox-badge.hidden {
  display: none;
}

/* Inbox Modal */
.inbox-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px var(--space-5) var(--space-5);
}

.inbox-modal-overlay.show {
  display: flex;
}

.inbox-modal {
  width: 380px;
  max-height: calc(100vh - 80px);
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.inbox-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
}

.inbox-modal-header h3 {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0;
}

.inbox-modal-close {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.inbox-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.inbox-modal-body {
  max-height: 400px;
  overflow-y: auto;
}

.inbox-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}

.inbox-item {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
}

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

.inbox-item:last-child {
  border-bottom: none;
}

.inbox-item-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.inbox-item-desc {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.inbox-item-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* User Menu Modal */
.user-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 60px var(--space-5) var(--space-5);
}

.user-menu-overlay.show {
  display: flex;
}

.user-menu {
  width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.user-menu-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-menu-avatar {
  width: 40px;
  height: 40px;
  background: var(--gold);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-base);
}

.user-menu-info {
  flex: 1;
}

.user-menu-name {
  font-weight: 600;
  font-size: var(--text-base);
}

.user-menu-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.user-menu-body {
  padding: var(--space-2);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.user-menu-item:hover {
  background: var(--bg-secondary);
}

.user-menu-item-icon {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.user-menu-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-2) 0;
}

/* Password Change Modal */
.password-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.password-modal-overlay.show {
  display: flex;
}

.password-modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.password-modal-header h3 {
  margin: 0;
  font-size: var(--text-lg);
}

.password-modal-close {
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.password-modal-body {
  padding: var(--space-4);
}

.password-field {
  margin-bottom: var(--space-4);
}

.password-field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.password-field input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}

.password-field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--shadow-glow);
}

.password-modal-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* ===== DASHBOARD - Compact Desktop ===== */
.dashboard {
  padding: var(--space-4) var(--space-5);
  max-width: 1600px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.page-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.page-header .label-mono {
  display: block;
  margin-bottom: var(--space-1);
}

/* Stats Grid - More columns on desktop */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  position: relative;
}

.stat-item::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--gold);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-item:nth-child(2)::before { background: var(--accent-blue); }
.stat-item:nth-child(3)::before { background: var(--accent-amber); }
.stat-item:nth-child(4)::before { background: var(--status-success); }

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
  line-height: 1;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== TABLES ===== */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.table tr:hover td {
  background: var(--bg-elevated);
}

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

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-draft {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.badge-active {
  background: var(--status-info-bg);
  color: var(--status-info);
}

.badge-pending {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.badge-approved {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.badge-rejected {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-pending::before { background: var(--status-warning); }
.badge-active::before { background: var(--status-info); }
.badge-approved::before { background: var(--status-success); }
.badge-rejected::before { background: var(--status-error); }
.badge-success::before { background: var(--status-success); }
.badge-draft::before { background: var(--text-muted); }

/* ===== ALERTS ===== */
.alert {
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  border-left: 3px solid;
}

.alert-success {
  background: var(--status-success-bg);
  border-color: var(--status-success);
  color: var(--status-success);
}

.alert-error {
  background: var(--status-error-bg);
  border-color: var(--status-error);
  color: var(--status-error);
}

.alert-warning {
  background: var(--status-warning-bg);
  border-color: var(--status-warning);
  color: var(--status-warning);
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-5);
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition);
}

.tab:hover {
  color: var(--gold);
}

.tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ===== PROGRESS ===== */
.progress-container {
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
  margin: var(--space-2) 0;
}

.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ===== CHECKLIST - Compact Single Row ===== */
.checklist {
  list-style: none;
  padding: 0;
}

.checklist-category {
  margin-bottom: var(--space-4);
}

.checklist-category-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  padding-bottom: var(--space-1);
  border-bottom: 1px solid var(--border-light);
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-light);
}

.checklist-item:last-child {
  border-bottom: none;
}

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

.checklist-item.completed {
  opacity: 0.7;
}

.checklist-item.completed .checklist-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.checklist-content {
  display: flex;
  align-items: center;
  flex: 1;
  gap: var(--space-4);
}

.checklist-title {
  flex: 2;
  min-width: 200px;
}

.checklist-date {
  width: 140px;
  flex-shrink: 0;
}

.checklist-date input {
  width: 100%;
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
}

.checklist-comment {
  flex: 2;
  min-width: 200px;
}

.checklist-comment input {
  width: 100%;
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
}

/* ===== MOBILE FILTER FIX ===== */
@media (max-width: 768px) {
  /* Filter card layout */
  .card .flex.items-center.gap-4,
  .card .flex.gap-4 {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  
  .card .form-group {
    width: 100%;
    min-width: auto;
    margin-bottom: 0;
  }
  
  .card .form-select,
  .card .form-input {
    width: 100%;
  }
  
  .card .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Dashboard actions */
  .dashboard .flex.items-center.justify-between {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  
  .dashboard .flex.items-center.justify-between .label-mono {
    text-align: center;
  }
  
  .dashboard .flex.items-center.justify-between .flex.gap-2 {
    width: 100%;
    flex-direction: column;
  }
  
  .dashboard .flex.items-center.justify-between .btn {
    width: 100%;
  }
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }
.py-6 { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8 { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-10 { padding-top: var(--space-10); padding-bottom: var(--space-10); }
.ml-4 { margin-left: var(--space-4); }

/* Small Form Input */
.form-input-sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

/* Grid gap utilities */
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* Flex utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  :root {
    --text-3xl: 1.75rem;
    --text-2xl: 1.5rem;
  }
  
  .header {
    height: auto;
    min-height: 50px;
    padding: var(--space-2) 0;
  }
  
  .header-container {
    flex-wrap: wrap;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
  }
  
  .header-brand {
    flex-shrink: 0;
  }
  
  .header-title {
    font-size: var(--text-base);
  }
  
  .header-meta {
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  
  .header-user {
    font-size: var(--text-xs);
  }
  
  .header .btn {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
  }
  
  .dashboard {
    padding: var(--space-3);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .card {
    padding: var(--space-4);
  }
  
  .table {
    font-size: var(--text-xs);
  }
  
  .table th,
  .table td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== PRINT ===== */
@media print {
  .header,
  .btn:not(.btn-primary) {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* Collapsible categories in employee details */
.category-details {
  margin-bottom: 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}

.category-summary {
  background: var(--bg-elevated);
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-summary:hover {
  background: var(--bg-hover);
}

.category-summary::after {
  content: '▼';
  font-size: 10px;
  transition: transform 0.2s;
}

.category-details[open] .category-summary::after {
  transition {
  transform: rotate(180deg);
}

.category-content {
  padding: 12px 16px;
}

.category-content .form-group {
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
}

.category-content .form-label {
  font-size: 12px;
  color: var(--text-muted);
  width: 180px;
  flex-shrink: 0;
}

.category-content .form-input {
  font-size: 13px;
  padding: 2px 0;
  flex: 1;
}
.table-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.table-progress-bar {
  width: 80px;
  height: 6px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.table-progress-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
}
.table-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.table-actions {
  display: flex;
  gap: 8px;
}

/* ===== Table Filters ===== */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  align-items: flex-end;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}
.filter-group label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.filter-group input,
.filter-group select {
  border: 1px solid var(--border-light);
  background: #fff;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  min-height: 38px;
}
.filter-group--grow {
  flex: 1 1 220px;
  min-width: 220px;
}
.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.filter-badge {
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.table-empty {
  text-align: center;
  padding: var(--space-4);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
/* Admin Checklists - Task List Styles */
.task-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.task-item {
  display: grid;
  grid-template-columns: 60px 1fr auto auto auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-medium);
  background: var(--bg-card);
  transition: background 0.15s;
}

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

.task-item:nth-child(even) {
  background: var(--bg-primary);
}

.task-item:nth-child(even):hover {
  background: var(--bg-hover);
}

.task-item:last-child {
  border-bottom: none;
}

.task-title input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  background: var(--bg-primary);
  transition: all 0.15s;
}

.task-title input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-hover);
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.stat-pill {
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-medium);
}

.drag-handle .reorder-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.drag-handle .reorder-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.btn-delete,
.task-item .btn-danger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete:hover,
.task-item .btn-danger:hover {
  background: #fee2e2;
  border-color: var(--ps-red);
  color: var(--ps-red);
}

/* Admin Checklists - Filter Styles */
.filters {
  background: var(--bg-card);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  background: var(--bg-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* Admin Checklists - Preview Button */
.preview-btn {
  background: var(--bg-card);
  color: var(--gold);
  padding: 8px 14px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}

.preview-btn:hover {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}

/* Admin Checklists - Add Button */
.btn-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px;
  background: var(--bg-hover);
  border: 2px dashed var(--border-medium);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  border-top: none;
}

.btn-add:hover {
  background: #f0fdf4;
  border-color: var(--gold);
  color: var(--gold);
}

/* Admin Checklists - Toggle Switch */
.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border-medium);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.active {
  background: var(--gold);
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle.active::after {
  transform: translateX(16px);
}

/* Make toggles more visible */
.toggle-group {
  background: var(--bg-hover) !important;
  padding: 8px 12px !important;
}

/* Admin Checklists - Stronger colors (fix for missing bg-hover var) */
.task-item {
  background: #ffffff !important;
  border-bottom: 1px solid #c5d1cc !important;
}

.task-item:nth-child(even) {
  background: #f5f7f6 !important;
}

.task-item:hover {
  background: #e8f0ed !important;
}

.toggle-group {
  background: #e8f0ed !important;
  border: 1px solid #c5d1cc !important;
}

.btn-add {
  background: #ffffff !important;
  border-color: #7a8a84 !important;
}

.btn-add:hover {
  background: #e8f5ed !important;
  border-color: #B8960C !important;
  color: #B8960C !important;
}

.preview-btn {
  background: #ffffff !important;
}

.preview-btn:hover {
  background: #B8960C !important;
}

.filters {
  background: #ffffff !important;
}

.stat-pill {
  background: #ffffff !important;
}

.drag-handle .reorder-btn {
  background: #e8f0ed !important;
  border-color: #c5d1cc !important;
}

.drag-handle .reorder-btn:hover {
  background: #B8960C !important;
  border-color: #B8960C !important;
}

/* Modal close button */
#confirmModal .btn-ghost {
  background: transparent;
  color: #1a2a24;
  border: 1px solid transparent;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
}

#confirmModal .btn-ghost:hover {
  background: #e8f0ed;
  border-color: #9baaa4;
}

/* Modal base styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.modal-overlay.hidden { 
  display: none; 
}

.modal-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 95%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
}

.modal-title { 
  font-size: 1.25rem; 
  font-weight: 600; 
  margin-bottom: 20px; 
  color: #1a2a24; 
}

.modal-message { 
  color: #4a5a54; 
  margin-bottom: 20px; 
  max-height: 60vh; 
  overflow-y: auto; 
}

.modal-actions { 
  display: flex; 
  gap: 12px; 
  justify-content: flex-end; 
}

/* Header meta buttons - same as hr-stats */
.header .btn-ghost {
  background: transparent;
  color: #4a5a54;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s;
}

.header .btn-ghost:hover {
  background: #e8f0ed;
  border-color: #9baaa4;
  color: #1a2a24;
}
