/* styles.css - Essaca Consulting Phase I ESA Dashboard — Premium Light Theme */

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

/* --- Theme Variables --- */
:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Light Background System */
  --bg-body: #f0f4f8;
  --bg-card: #ffffff;
  --bg-card-hover: #fafcff;
  --bg-subtle: #f7f9fc;
  --bg-input: #f4f6fa;

  /* Vibrant Color Palette */
  --primary: #0ea57a;
  --primary-light: #d1fae5;
  --primary-dark: #065f46;
  --primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);

  --accent: #6366f1;        /* Indigo */
  --accent-light: #e0e7ff;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --info: #0891b2;          /* Teal */
  --info-light: #cffafe;
  --info-gradient: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);

  --warning: #d97706;       /* Amber */
  --warning-light: #fef3c7;
  --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);

  --danger: #dc2626;        /* Red */
  --danger-light: #fee2e2;
  --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  --success: #16a34a;
  --success-light: #dcfce7;

  /* Text Hierarchy */
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --text-white: #ffffff;

  /* Borders */
  --border-light: #e5e7eb;
  --border-medium: #d1d5db;

  /* Elevation System */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
  --shadow-colored: 0 4px 14px -2px;

  --border-radius: 16px;
  --border-radius-sm: 10px;
  --border-radius-xs: 6px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  padding: 24px 28px;
}

/* --- Custom Scrollbar (Light) --- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Animated Background Blobs (Ambient) --- */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  z-index: -1;
  animation: blobFloat 18s ease-in-out infinite alternate;
}

body::before {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #a7f3d0 0%, #6ee7b7 100%);
  top: -100px;
  right: -100px;
}

body::after {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
  bottom: -80px;
  left: -80px;
  animation-delay: -9s;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -20px) scale(1.05); }
  100% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ============================================================
   GLASS PANEL — Premium White Card
   ============================================================ */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
  position: relative;
  overflow: hidden;
}

.glass-panel:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

/* ============================================================
   HEADER — 3-Column Grid Layout
   ============================================================ */
header.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding: 14px 24px;
  /* background/border/shadow from .glass-panel */
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 30px;
  padding: 4px;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 22px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.nav-tab svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
}

.nav-tab:hover {
  background: rgba(16, 185, 129, 0.08);
  color: var(--primary);
}

.nav-tab.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
  animation: btnPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-tab-admin.active {
  background: var(--warning-gradient);
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.header-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.header-action-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.header-action-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.header-divider {
  width: 1px;
  height: 28px;
  background: var(--border-light);
  flex-shrink: 0;
}

.header-logout-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.header-logout-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.header-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  height: 46px;
  width: auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.04);
}

.logo-text span {
  font-size: 11px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

.controls-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================
   SEGMENTED VIEW SWITCHER
   ============================================================ */
.view-switcher {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 30px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.switch-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.switch-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.switch-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  color: var(--primary);
}

.switch-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  animation: btnPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes btnPop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Employee Selector */
.employee-select-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: 22px;
  transition: all 0.3s ease;
}

.employee-select-wrapper:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.employee-select-wrapper label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.custom-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

.custom-select option {
  background: #fff;
  color: var(--text-primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Shimmer animation on buttons */
.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}

.btn:hover::after {
  left: 100%;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-colored) rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

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

.btn-secondary:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-danger {
  background: var(--danger-light);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--danger);
}

.btn-danger:hover {
  background: #fff;
  border-color: var(--danger);
  box-shadow: var(--shadow-colored) rgba(220, 38, 38, 0.15);
  transform: translateY(-1px);
}

/* ============================================================
   KPI DASHBOARD ROW
   ============================================================ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: slideUp 0.5s ease-out both;
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.12s; }
.kpi-card:nth-child(3) { animation-delay: 0.19s; }
.kpi-card:nth-child(4) { animation-delay: 0.26s; }

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

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Colored top accent bar */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.kpi-card.kpi-active::before  { background: var(--info-gradient); }
.kpi-card.kpi-delay::before   { background: var(--danger-gradient); }
.kpi-card.kpi-review::before  { background: var(--warning-gradient); }
.kpi-card.kpi-completed::before { background: var(--primary-gradient); }

/* Decorative gradient circle in corner */
.kpi-card::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  top: -30px;
  right: -30px;
  opacity: 0.06;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.kpi-card:hover::after {
  opacity: 0.1;
  transform: scale(1.15);
}

.kpi-card.kpi-active::after  { background: var(--info); }
.kpi-card.kpi-delay::after   { background: var(--danger); }
.kpi-card.kpi-review::after  { background: var(--warning); }
.kpi-card.kpi-completed::after { background: var(--primary); }

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

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

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-card.kpi-active .kpi-icon  { background: var(--info-light); color: var(--info); }
.kpi-card.kpi-delay .kpi-icon   { background: var(--danger-light); color: var(--danger); }
.kpi-card.kpi-review .kpi-icon  { background: var(--warning-light); color: var(--warning); }
.kpi-card.kpi-completed .kpi-icon { background: var(--success-light); color: var(--success); }

.kpi-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.kpi-value {
  font-size: 36px;
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.kpi-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============================================================
   VIEW PANELS
   ============================================================ */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: viewFadeIn 0.5s ease-out forwards;
}

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

/* ============================================================
   DASHBOARD GRID LAYOUT
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 340px 1fr;
  }
}

.sidebar-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.main-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ============================================================
   PANEL SECTION HEADERS
   ============================================================ */
.panel-title-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-subtle);
}

.panel-title {
  font-size: 16px;
  font-family: var(--font-heading);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.panel-title svg {
  width: 20px;
  height: 20px;
  fill: var(--primary);
}

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

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

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1.5px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  outline: none;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

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

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

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

/* ============================================================
   DELAY QUEUE
   ============================================================ */
.delay-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.delay-item {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-left: 4px solid var(--danger);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.25s ease;
  animation: slideIn 0.3s ease-out both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.delay-item:hover {
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.delay-icon {
  color: var(--danger);
  flex-shrink: 0;
  margin-top: 2px;
  animation: pulseIcon 2s ease-in-out infinite;
}

@keyframes pulseIcon {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.delay-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.delay-info { flex-grow: 1; }

.delay-project {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.delay-reason {
  font-size: 12px;
  color: var(--danger);
  margin-top: 3px;
  font-weight: 500;
}

.delay-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  gap: 14px;
}

.delay-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

.delay-empty svg {
  width: 40px;
  height: 40px;
  fill: #d1d5db;
  margin-bottom: 10px;
}

/* ============================================================
   TEAM WORKLOAD
   ============================================================ */
.workload-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 310px;
  overflow-y: auto;
}

.workload-item {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 14px 16px;
  transition: all 0.3s ease;
  animation: slideUp 0.4s ease-out both;
}

.workload-item:hover {
  background: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.workload-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.workload-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.workload-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.workload-stats {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  background: var(--bg-input);
  padding: 2px 10px;
  border-radius: 12px;
}

.workload-bar-bg {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.workload-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Animated shine on workload bars */
.workload-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: barShine 2.5s ease-in-out infinite;
}

@keyframes barShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.load-low  { background: var(--primary-gradient); }
.load-med  { background: var(--warning-gradient); }
.load-high { background: var(--danger-gradient); }

/* ============================================================
   TABLE TOOLBAR
   ============================================================ */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.search-filter-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
  max-width: 500px;
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 40px;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 16px;
}

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

th {
  background: var(--bg-subtle);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-secondary);
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-light);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-primary);
  vertical-align: middle;
}

tr {
  transition: background 0.2s ease;
}

tr:hover td {
  background: #f8fafc;
}

.project-cell-name {
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  font-size: 14px;
}

.project-cell-number {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-low {
  background: var(--info-light);
  color: var(--info);
}

.badge-medium {
  background: var(--success-light);
  color: var(--success);
}

.badge-high {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-critical {
  background: var(--danger-light);
  color: var(--danger);
  animation: criticalPulse 2s ease-in-out infinite;
}

@keyframes criticalPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.2); }
  50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

/* ============================================================
   STATUS DROPDOWN (TABLE)
   ============================================================ */
.status-dropdown {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ============================================================
   TABLE ACTION BUTTONS
   ============================================================ */
.actions-cell {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-icon:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: scale(1.08);
}

.btn-icon-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-light);
}

.btn-icon svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* ============================================================
   CALENDAR
   ============================================================ */
.calendar-widget {
  margin-top: 16px;
}

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

.calendar-month-year {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
}

.calendar-weekday {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 8px 0;
  letter-spacing: 0.06em;
}

.calendar-day {
  aspect-ratio: 1;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  padding: 4px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 58px;
  transition: all 0.25s ease;
  cursor: pointer;
}

.calendar-day:hover {
  background: #fff;
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
  transform: scale(1.03);
}

.calendar-day.empty {
  opacity: 0.25;
  cursor: default;
}

.calendar-day.empty:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.calendar-day-num {
  font-size: 11px;
  font-weight: 600;
  align-self: flex-end;
  color: var(--text-secondary);
}

.calendar-day.today {
  border: 2px solid var(--primary);
  background: rgba(16, 185, 129, 0.04);
}

.calendar-day.today .calendar-day-num {
  background: var(--primary-gradient);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.calendar-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.calendar-event-dot {
  font-size: 7px;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.calendar-event-dot:hover {
  transform: scale(1.05);
}

.cal-draft {
  background: var(--warning-light);
  color: var(--warning);
}

.cal-review {
  background: var(--info-light);
  color: var(--info);
}

.cal-final {
  background: var(--success-light);
  color: var(--success);
}

/* ============================================================
   EMPLOYEE VIEW
   ============================================================ */
.employee-header-card {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 50%, #eff6ff 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.2) !important;
  margin-bottom: 28px;
}

.employee-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.employee-welcome h2 {
  font-size: 22px;
  color: var(--text-primary);
  font-weight: 800;
}

.employee-welcome p {
  color: var(--text-secondary);
  font-size: 13px;
}

.employee-role-badge {
  background: var(--primary-gradient);
  color: #fff;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-colored) rgba(16, 185, 129, 0.2);
  border: none;
}

/* ============================================================
   CHECKLIST CARDS (EMPLOYEE VIEW)
   ============================================================ */
.checklist-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.checklist-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.35s ease;
  animation: cardSlideUp 0.4s ease-out both;
}

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

.checklist-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.checklist-title-box h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.checklist-badges {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checklist-dates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  background: var(--bg-subtle);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  border: 1px solid var(--border-light);
}

.date-block {
  display: flex;
  flex-direction: column;
}

.date-block-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.date-block-val {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

.date-block-val.overdue {
  color: var(--danger);
  font-weight: 700;
}

.checklist-roles {
  display: flex;
  gap: 24px;
  font-size: 13px;
}

.role-tag {
  color: var(--text-secondary);
}

.role-tag strong {
  color: var(--text-primary);
}

.checklist-notes-section h4 {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.checklist-notes-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 44px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.7;
}

/* ============================================================
   PROGRESS FLOW (PROCESS STEPS)
   ============================================================ */
.checklist-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--bg-subtle);
  padding-top: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.progress-flow {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.progress-step-btn {
  background: var(--bg-subtle);
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.progress-step-btn:hover {
  background: #fff;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.progress-step-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: btnPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notes-editor-wrapper {
  display: flex;
  gap: 8px;
  width: 100%;
}

.notes-editor-wrapper input {
  flex-grow: 1;
}

.employee-checklist-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.employee-checklist-empty svg {
  width: 60px;
  height: 60px;
  fill: #d1d5db;
  margin-bottom: 16px;
}

/* ============================================================
   REMINDERS
   ============================================================ */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminder-item {
  padding: 14px;
  border-radius: var(--border-radius-sm);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13px;
  transition: all 0.25s ease;
  animation: slideIn 0.3s ease-out both;
}

.reminder-item:hover {
  transform: translateX(4px);
}

.reminder-item.reminder-alert {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  border: 1px solid rgba(220, 38, 38, 0.15);
  border-left: 4px solid var(--danger);
  color: var(--danger);
}

.reminder-item.reminder-alert svg {
  color: var(--danger);
  fill: currentColor;
  flex-shrink: 0;
}

.reminder-item.reminder-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid rgba(217, 119, 6, 0.15);
  border-left: 4px solid var(--warning);
  color: var(--warning);
}

.reminder-item.reminder-warning svg {
  color: var(--warning);
  fill: currentColor;
  flex-shrink: 0;
}

.reminder-item svg {
  width: 18px;
  height: 18px;
}

.reminder-project {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-center { text-align: center; }
.mb-12 { margin-bottom: 12px; }
.mt-12 { margin-top: 12px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* Tooltip */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 5px 10px;
  font-size: 11px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Overdue text color in table */
.overdue {
  color: var(--danger) !important;
  font-weight: 700;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  body { padding: 12px; }
  header { padding: 12px 16px; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .progress-flow { gap: 3px; }
  .progress-step-btn { font-size: 10px; padding: 5px 10px; }
}

/* ============================================================
   AUTH — LOGIN OVERLAY
   ============================================================ */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f5f1 0%, #f0f4f8 50%, #eef2ff 100%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 36px;
  text-align: center;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.login-logo-wrap { margin-bottom: 20px; }
.login-logo { height: 52px; object-fit: contain; }

.login-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
  text-align: left;
}

/* ============================================================
   AUTH — USER BADGE IN HEADER
   ============================================================ */

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

.user-badge-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.user-badge-sep {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1;
}

.user-badge-email {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.role-admin    { background: #fef3c7; color: #92400e; }
.role-manager  { background: var(--primary-light); color: var(--primary-dark); }
.role-employee { background: var(--accent-light); color: #3730a3; }

.btn-sm { padding: 5px 10px !important; font-size: 11px !important; }

/* ============================================================
   EMPLOYEE EMPTY STATE
   ============================================================ */

.employee-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 32px;
  gap: 12px;
}

.employee-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.employee-empty-icon svg {
  width: 28px;
  height: 28px;
  fill: var(--text-muted);
}

.employee-empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.employee-empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 380px;
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   USER MANAGEMENT PANEL
   ============================================================ */

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.user-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}

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

.user-list-email {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   ADMIN ACCESS MANAGEMENT PANEL
   ============================================================ */

#adminViewPanel {
  display: none;
  flex-direction: column;
  gap: 20px;
}

#adminViewPanel.active {
  display: flex;
  animation: viewFadeIn 0.5s ease-out forwards;
}

.admin-hero {
  background: linear-gradient(135deg, #f0fdf4 0%, #f0f9ff 60%, #f5f3ff 100%) !important;
  border: 1px solid rgba(16, 185, 129, 0.15) !important;
}

.admin-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-hero-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-hero-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.admin-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.admin-stat-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.25s ease;
}

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

.admin-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-stat-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.admin-stat-card.stat-total .admin-stat-icon  { background: var(--bg-subtle); color: var(--text-secondary); }
.admin-stat-card.stat-admin .admin-stat-icon   { background: #fef3c7; color: #92400e; }
.admin-stat-card.stat-manager .admin-stat-icon { background: var(--primary-light); color: var(--primary-dark); }
.admin-stat-card.stat-employee .admin-stat-icon { background: var(--accent-light); color: #3730a3; }

.admin-stat-val {
  font-size: 26px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.admin-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  margin-top: 4px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pill.active  { background: var(--success-light); color: var(--success); }
.status-pill.active::before  { background: var(--success); }
.status-pill.inactive { background: #f3f4f6; color: var(--text-muted); }
.status-pill.inactive::before { background: var(--text-muted); }


/* ============================================================
   RESPONSIVE — Header
   ============================================================ */
@media (max-width: 900px) {
  header.app-header {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
  }
  .header-nav { justify-content: center; }
  .header-right { justify-content: center; flex-wrap: wrap; }
  .header-brand { justify-content: center; }
}
