/* ═══════════════════════════════════════════════════
   TERRANOVA GESTIONE FERIE
   Architectural Glassmorphism Design System
   ═══════════════════════════════════════════════════ */

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

:root {
  --primary: #1A1A2E;
  --primary-light: #2a2a4a;
  --accent: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3498db;
  --text: #1A1A2E;
  --text-secondary: #5a5a7a;
  --text-muted: #8a8aa0;
  --surface: rgba(255, 255, 255, 0.12);
  --surface-hover: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.2);
  --border-solid: rgba(26, 26, 46, 0.08);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --blur: 20px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 16px 48px rgba(26, 26, 46, 0.12);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-height: 64px;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: #f0f0f8;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ── ATMOSPHERIC BACKGROUND ──────────────────────── */
.bg-atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e8f0 0%, #f5f0f0 30%, #f0f5f0 60%, #e8e8f0 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.3), transparent 70%);
  top: -10%;
  right: -5%;
  animation-delay: 0s;
}

.bg-orb--2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.2), transparent 70%);
  bottom: -15%;
  left: -10%;
  animation-delay: -7s;
}

.bg-orb--3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(243, 156, 18, 0.15), transparent 70%);
  top: 40%;
  left: 50%;
  animation-delay: -14s;
}

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

/* ── GLASS CARD ──────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
}

/* ── LAYOUT ──────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen--active {
  display: block;
}

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

.main-content {
  padding-top: calc(var(--nav-height) + 2rem);
  padding-bottom: 3rem;
  min-height: 100vh;
}

/* ── LOGIN SCREEN ────────────────────────────────── */
.login-split {
  display: flex;
  min-height: 100vh;
}

.login-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
}

.login-form-container {
  width: 100%;
  max-width: 380px;
}

.login-brand {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

.login-brand-side {
  flex: 1;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-brand-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(46, 204, 113, 0.15), transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(52, 152, 219, 0.1), transparent 50%);
}

.login-brand-overlay {
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-brand-logo {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
}

.login-brand-text {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.9);
}

.login-brand-tagline {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.12em;
  margin-top: 0.5rem;
}

/* ── FORMS ───────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}

.form-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-input--search {
  padding-left: 2.5rem;
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a5a7a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-row--between {
  justify-content: space-between;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.form-link {
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-link:hover {
  text-decoration: underline;
}

.form-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn--primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.2);
}

.btn--success {
  background: var(--accent);
  color: #fff;
}

.btn--success:hover {
  background: #27ae60;
  transform: translateY(-1px);
}

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

.btn--danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

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

.btn--ghost:hover {
  background: rgba(26, 26, 46, 0.04);
  color: var(--text);
}

.btn--full {
  width: 100%;
}

.btn--sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: rgba(26, 26, 46, 0.06);
  color: var(--text);
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.btn-icon--sm svg {
  width: 16px;
  height: 16px;
}

/* ── NAVBAR ──────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 0.5px solid var(--glass-border);
  z-index: 100;
  box-shadow: 0 1px 12px rgba(26, 26, 46, 0.04);
}

.navbar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.navbar-brand-text {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.nav-link:hover,
.nav-link--active {
  color: var(--text);
  background: rgba(26, 26, 46, 0.05);
}

.nav-link--active {
  font-weight: 600;
}

.nav-icon {
  width: 18px;
  height: 18px;
}

.nav-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.5rem;
  position: relative;
}

.avatar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 0.35rem;
  display: none;
  z-index: 200;
}

.avatar-dropdown--open {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: all 0.1s;
}

.dropdown-item:hover {
  background: rgba(26, 26, 46, 0.05);
  color: var(--text);
}

/* Hamburger */
.navbar-hamburger {
  display: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  width: 28px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
}

.navbar-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.2s;
}

.navbar-hamburger--open span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.navbar-hamburger--open span:nth-child(2) {
  opacity: 0;
}

.navbar-hamburger--open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  z-index: 99;
  flex-direction: column;
  padding: 1.5rem;
  gap: 0.25rem;
}

.mobile-nav--open {
  display: flex;
}

.mobile-nav-link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.mobile-nav-link:hover {
  background: rgba(26, 26, 46, 0.05);
  color: var(--text);
}

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.page-id {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── SUMMARY CARDS ───────────────────────────────── */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}


.summary-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.summary-card-icon svg {
  width: 20px;
  height: 20px;
}

.summary-card-icon--success {
  background: rgba(46, 204, 113, 0.12);
  color: var(--accent);
}

.summary-card-icon--warning {
  background: rgba(243, 156, 18, 0.12);
  color: var(--warning);
}

.summary-card-icon--info {
  background: rgba(52, 152, 219, 0.12);
  color: var(--info);
}

.summary-card-body {
  display: flex;
  flex-direction: column;
}

.summary-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.summary-card-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.summary-card-trend {
  font-size: 0.7rem;
  margin-left: auto;
  align-self: flex-end;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-xs);
}

.summary-card-trend--success { color: var(--accent); background: rgba(46, 204, 113, 0.08); }
.summary-card-trend--warning { color: var(--warning); background: rgba(243, 156, 18, 0.08); }
.summary-card-trend--neutral { color: var(--text-muted); background: rgba(26, 26, 46, 0.04); }

/* ── DASHBOARD GRID ──────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── CALENDAR ────────────────────────────────────── */
.calendar-card {
  overflow: hidden;
}

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

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-month {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 130px;
  text-align: center;
}

.calendar-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filter-toggle {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-solid);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-toggle:hover {
  border-color: var(--primary);
  color: var(--text);
}

.filter-toggle--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.cal-header {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  padding: 0.5rem 0;
}

.cal-day {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
  border: 1px solid rgba(26, 26, 46, 0.05);
  gap: 2px;
}

.cal-day:hover {
  background: rgba(26, 26, 46, 0.04);
}

.cal-day-number {
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text);
  line-height: 1;
  margin-bottom: 1px;
}

.cal-day--empty {
  cursor: default;
  border-color: transparent;
  min-height: 0;
}

.cal-day--empty:hover {
  background: transparent;
}

.cal-day--today {
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.cal-day--today .cal-day-number {
  color: var(--primary);
  font-weight: 700;
}

.cal-day--booked {
  background: rgba(46, 204, 113, 0.12);
}

.cal-day--booked:hover {
  background: rgba(46, 204, 113, 0.2);
}

.cal-day--blocked {
  background: rgba(26, 26, 46, 0.04);
  cursor: not-allowed;
}

.cal-day--blocked .cal-day-number {
  color: var(--text-muted);
  text-decoration: line-through;
}

.cal-day--weekend {
  opacity: 0.5;
}

.cal-booking {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.55rem;
  font-weight: 500;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.3;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-booking-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.calendar-legend {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}


.legend-dot--heatmap-high { background: rgba(46, 204, 113, 0.5); }
.legend-dot--heatmap-med { background: rgba(243, 156, 18, 0.4); }
.legend-dot--heatmap-low { background: rgba(231, 76, 60, 0.35); }

/* ── ACTIVITY FEED ───────────────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-dot--success { background: var(--accent); }
.activity-dot--warning { background: var(--warning); }
.activity-dot--info { background: var(--info); }
.activity-dot--danger { background: var(--danger); }

.activity-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text strong {
  color: var(--text);
  font-weight: 600;
}

.activity-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── DATA TABLE ──────────────────────────────────── */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.data-table th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-solid);
}

.data-table td {
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid rgba(26, 26, 46, 0.04);
  color: var(--text-secondary);
}

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

.data-table tbody tr:hover {
  background: rgba(26, 26, 46, 0.02);
}

.data-table--compact td,
.data-table--compact th {
  padding: 0.5rem 0.6rem;
}

.clickable-row {
  cursor: pointer;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.table-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
}

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

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.badge--success {
  background: rgba(46, 204, 113, 0.12);
  color: #1a8a4a;
}

.badge--warning {
  background: rgba(243, 156, 18, 0.12);
  color: #c87f0a;
}

.badge--danger {
  background: rgba(231, 76, 60, 0.12);
  color: #c0392b;
}

.badge--info {
  background: rgba(52, 152, 219, 0.12);
  color: #2471a3;
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
}

/* ── APPROVAL TIMELINE ───────────────────────────── */
.approval-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 1.5rem 0;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.timeline-step--done .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
}

.timeline-step--done .timeline-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
}

.timeline-step--active .timeline-dot {
  border-color: var(--warning);
  box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.15);
}

.timeline-step--active .timeline-dot::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--warning);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.timeline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.timeline-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.timeline-connector {
  flex: 1;
  height: 2px;
  background: var(--border-solid);
  min-width: 30px;
  margin-bottom: 2.5rem;
}

.timeline-connector--active {
  background: linear-gradient(90deg, var(--accent), var(--warning));
}

/* Vertical timeline */
.approval-timeline--vertical {
  flex-direction: column;
  align-items: flex-start;
  padding: 0.5rem 0;
}

.approval-timeline--vertical .timeline-step {
  flex-direction: row;
  gap: 0.75rem;
}

.approval-timeline--vertical .timeline-content {
  align-items: flex-start;
  text-align: left;
}

.approval-timeline--vertical .timeline-connector {
  width: 2px;
  height: 24px;
  min-width: 2px;
  margin: 0 0 0 13px;
}

/* ── DETAIL LAYOUT ───────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.meta-row {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(26, 26, 46, 0.04);
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 120px;
  flex-shrink: 0;
}

.meta-value {
  font-size: 0.85rem;
  color: var(--text);
}

/* ── DISCUSSION ──────────────────────────────────── */
.discussion-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.comment {
  padding: 1rem;
  background: rgba(26, 26, 46, 0.02);
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
}

.comment:nth-child(odd) {
  border-left-color: var(--info);
}

.comment:nth-child(even) {
  border-left-color: var(--accent);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  flex-shrink: 0;
}

.comment-avatar--manager {
  background: var(--accent);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.comment-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.comment-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.comment-badge--requester {
  background: rgba(52, 152, 219, 0.12);
  color: #2471a3;
}

.comment-badge--leader {
  background: rgba(46, 204, 113, 0.12);
  color: #1a8a4a;
}

.comment-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comment-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(26, 26, 46, 0.06);
}

.comment-input-area .form-textarea {
  flex: 1;
}

/* ── MANAGER ACTIONS ─────────────────────────────── */
.manager-actions {
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.manager-action-btns {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── MEMBER CELL ─────────────────────────────────── */
.member-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.member-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  flex-shrink: 0;
}

.member-avatar--alt1 { background: #8e44ad; }
.member-avatar--alt2 { background: #2980b9; }
.member-avatar--alt3 { background: #e67e22; }
.member-avatar--alt4 { background: #1abc9c; }

.conflict-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.conflict-indicator--warn {
  color: var(--warning);
  font-weight: 500;
}

.conflict-indicator--danger {
  color: var(--danger);
  font-weight: 500;
}

/* ── HEATMAP ─────────────────────────────────────── */
.heatmap {
  display: grid;
  grid-template-columns: 100px repeat(4, 1fr);
  gap: 2px;
  margin: 1rem 0;
  overflow-x: auto;
}

.heatmap-header {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0.4rem 0.5rem;
  text-align: center;
}

.heatmap-name {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.5rem 0.5rem;
  display: flex;
  align-items: center;
}

.heatmap-cell {
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 500;
}

.heatmap-cell--high {
  background: rgba(46, 204, 113, 0.15);
  color: #1a8a4a;
}

.heatmap-cell--med {
  background: rgba(243, 156, 18, 0.15);
  color: #c87f0a;
}

.heatmap-cell--low {
  background: rgba(231, 76, 60, 0.12);
  color: #c0392b;
}

.heatmap-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── ADMIN ───────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--glass-border);
  width: fit-content;
}

.admin-tab {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

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

.admin-tab--active {
  background: var(--primary);
  color: #fff;
}

.admin-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.admin-panel--active {
  display: block;
}

/* ── RULES ───────────────────────────────────────── */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.rule-card {
  padding: 1rem;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.4);
}

.rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rule-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.rule-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rule-detail {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.rule-detail-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.rule-detail-value {
  font-size: 0.82rem;
  color: var(--text);
}

/* ── SIMULATION ──────────────────────────────────── */
.simulation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.simulation-stat {
  text-align: center;
  padding: 1.5rem 1rem;
}

.simulation-stat-value {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
}

.simulation-stat-value--success { color: var(--accent); }
.simulation-stat-value--warning { color: var(--warning); }
.simulation-stat-value--info { color: var(--info); }

.simulation-stat-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.5rem;
}

.simulation-stat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.simulation-bars {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.sim-bar-group {
  display: grid;
  grid-template-columns: 100px 1fr 45px;
  align-items: center;
  gap: 0.75rem;
}

.sim-bar-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
}

.sim-bar-track {
  height: 8px;
  background: rgba(26, 26, 46, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.sim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.sim-bar-fill--success { background: var(--accent); }
.sim-bar-fill--warning { background: var(--warning); }
.sim-bar-fill--danger { background: var(--danger); }

.sim-bar-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* ── SETTINGS ────────────────────────────────────── */
.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(26, 26, 46, 0.04);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(26, 26, 46, 0.15);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

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

.toggle-input:checked + .toggle-switch {
  background: var(--accent);
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

/* ── CARD TITLE ──────────────────────────────────── */
.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

/* ── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    flex-direction: row;
    overflow-x: auto;
  }

  .dashboard-sidebar > * {
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .login-split {
    flex-direction: column;
  }

  .login-brand-side {
    display: none;
  }

  .login-form-side {
    min-height: 100vh;
  }

  .navbar-inner .navbar-left,
  .navbar-inner .navbar-right {
    display: none;
  }

  .navbar-hamburger {
    display: flex;
  }

  .navbar-inner {
    justify-content: center;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .simulation-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .rule-details {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .approval-timeline {
    flex-direction: column;
    align-items: flex-start;
  }

  .approval-timeline .timeline-connector {
    width: 2px;
    height: 20px;
    min-width: 2px;
    margin: 0 0 0 13px;
  }

  .approval-timeline .timeline-step {
    flex-direction: row;
    gap: 0.75rem;
  }

  .approval-timeline .timeline-content {
    align-items: flex-start;
    text-align: left;
  }

  .dashboard-sidebar {
    flex-direction: column;
  }

  .dashboard-sidebar > * {
    min-width: auto;
  }

  .heatmap {
    font-size: 0.65rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .sim-bar-group {
    grid-template-columns: 80px 1fr 40px;
  }

  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .cal-day {
    min-height: 52px;
    padding: 0.2rem 0.25rem;
  }

  .cal-booking {
    font-size: 0.45rem;
  }

  .calendar-filters {
    gap: 0.35rem;
  }

  .filter-toggle {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }

  .comment-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .meta-row {
    flex-direction: column;
    gap: 0.15rem;
  }

  .meta-label {
    width: auto;
  }
}
