/* ==========================================================================
   Gestione Servizio Civile - Croce Rossa Italiana (Comitato di Carmagnola & Pancalieri)
   Design System: Dark Slate & CRI Red Operational Glassmorphism UI
   ========================================================================== */

:root, [data-theme="dark"] {
  --cri-red: #dc2626;
  --cri-red-hover: #b91c1c;
  --cri-red-dark: #991b1b;
  --cri-red-light: rgba(220, 38, 38, 0.15);

  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.92);
  --bg-card-hover: rgba(51, 65, 85, 0.95);
  --bg-card-solid: #1e293b;
  --glass-border: rgba(255, 255, 255, 0.1);

  --primary: var(--cri-red);
  --primary-hover: var(--cri-red-hover);
  --primary-light: var(--cri-red-light);
  
  --accent: #10b981;
  --accent-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-light: rgba(59, 130, 246, 0.15);
  --purple: #8b5cf6;
  --purple-light: rgba(139, 92, 246, 0.15);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --header-title: #ffffff;

  --header-bg: rgba(15, 23, 42, 0.98);
  --nav-bg: rgba(30, 41, 59, 0.6);
  --input-bg: rgba(15, 23, 42, 0.9);
  --modal-bg: #1e293b;
  --modal-backdrop: rgba(15, 23, 42, 0.8);
  --modal-footer-bg: rgba(15, 23, 42, 0.5);
  --table-header-bg: rgba(15, 23, 42, 0.95);
  --cell-bg: rgba(15, 23, 42, 0.6);
  --cell-has-shift: rgba(30, 41, 59, 0.9);

  --header-height: 76px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-solid: #ffffff;
  --glass-border: #e2e8f0;

  --primary: var(--cri-red);
  --primary-hover: var(--cri-red-hover);
  --primary-light: rgba(220, 38, 38, 0.1);
  
  --accent: #059669;
  --accent-light: rgba(16, 185, 129, 0.1);
  --warning: #d97706;
  --warning-light: rgba(245, 158, 11, 0.1);
  --danger: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.1);
  --info: #2563eb;
  --info-light: rgba(59, 130, 246, 0.1);
  --purple: #7c3aed;
  --purple-light: rgba(139, 92, 246, 0.1);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --header-title: #0f172a;

  --header-bg: rgba(255, 255, 255, 0.98);
  --nav-bg: #ffffff;
  --input-bg: #f8fafc;
  --modal-bg: #ffffff;
  --modal-backdrop: rgba(15, 23, 42, 0.5);
  --modal-footer-bg: #f8fafc;
  --table-header-bg: #f1f5f9;
  --cell-bg: #f8fafc;
  --cell-has-shift: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

/* Header Application Bar */
.app-header {
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--cri-red);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

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

.cri-logo-badge {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.cri-cross-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.brand-text h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--header-title);
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-text h1 .badge-service {
  background: var(--cri-red);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-text p {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Settimana Selector Widget */
.week-selector-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.week-nav-btn {
  background: var(--cell-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.week-nav-btn:hover {
  background: var(--cri-red);
  color: white;
  border-color: var(--cri-red);
}

.week-select-dropdown {
  background: var(--input-bg);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.week-select-dropdown:focus {
  border-color: var(--cri-red);
}

.week-dates-badge {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Header Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--cri-red);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}
.btn-primary:hover {
  background: var(--cri-red-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--cell-bg);
  color: var(--text-main);
  border-color: var(--glass-border);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-accent {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.btn-accent:hover {
  background: #10b981;
  color: white;
}

.btn-pdf {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}
.btn-pdf:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-drive {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.btn-drive:hover {
  background: #2563eb;
  color: white;
}

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

/* Main Navigation Tabs */
.app-tabs-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 28px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn {
  padding: 14px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.tab-btn i {
  font-size: 1rem;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--primary-light);
}

.tab-btn.active {
  color: var(--header-title);
  border-bottom-color: var(--cri-red);
  background: var(--primary-light);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
}

.tab-btn.active .tab-badge {
  background: var(--cri-red);
  color: white;
}

/* Application Body Content */
.app-content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1700px;
  width: 100%;
  margin: 0 auto;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* Projects Banner Summary Cards */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--cri-red);
}

.project-card.pancalieri::before {
  background: #3b82f6;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

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

.project-location-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--header-title);
  margin-top: 4px;
}

.project-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--glass-border);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Section Controls Bar */
.section-toolbar {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-title h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

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

.filter-select, .search-input {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  outline: none;
}

.filter-select:focus, .search-input:focus {
  border-color: var(--cri-red);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
}

.search-input-wrapper input {
  padding-left: 36px;
  width: 240px;
}

/* Grid Settimanale Turni Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.shifts-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 1050px;
}

.shifts-table th {
  background: var(--table-header-bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  border-bottom: 2px solid var(--glass-border);
}

.shifts-table th.day-col {
  text-align: center;
  width: 11%;
}

.shifts-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
  vertical-align: middle;
}

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

/* Civilista Cell */
.civilista-info-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.civilista-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cri-red) 0%, #7f1d1d 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.civilista-meta {
  display: flex;
  flex-direction: column;
}

.civilista-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.civilista-project {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Day Cell & Shift Card Slot */
.shift-cell {
  text-align: center;
  position: relative;
}

.shift-slot {
  min-height: 48px;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.shift-slot:hover {
  border-color: var(--cri-red);
  background: rgba(220, 38, 38, 0.1);
}

.shift-slot.has-shift {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Badges Tipologie Turno e Assenze */
.shift-badge {
  width: 100%;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.shift-badge.preset-7 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.shift-badge.preset-11 { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.shift-badge.preset-15 { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.shift-badge.preset-19 { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.4); }
.shift-badge.custom-shift { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }

/* Assenze */
.shift-badge.permesso-ord { background: rgba(245, 158, 11, 0.25); color: #fcd34d; border: 1px solid #f59e0b; }
.shift-badge.permesso-straord { background: rgba(139, 92, 246, 0.25); color: #c4b5fd; border: 1px solid #8b5cf6; }
.shift-badge.malattia-ret { background: rgba(239, 68, 68, 0.25); color: #fca5a5; border: 1px solid #ef4444; }
.shift-badge.malattia-non-ret { background: rgba(156, 163, 175, 0.25); color: #e5e7eb; border: 1px solid #9ca3af; }
.shift-badge.riposo { background: rgba(100, 116, 139, 0.2); color: #94a3b8; border: 1px solid rgba(100, 116, 139, 0.3); }

.shift-time {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.shift-hours {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.85;
}

/* Tabella Totali Ore */
.hours-total-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 6px 12px;
  border-radius: 20px;
  display: inline-block;
}

/* Civilisti Anagrafica & Cards Layout */
.civilisti-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.civilista-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  transition: var(--transition-normal);
}

.civilista-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.civilista-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.civilista-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cri-red) 0%, #b91c1c 100%);
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.civilista-card-details h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--header-title);
}

.civilista-card-details .project-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* Leave Balances Display in Civilista Card */
.leave-balances-container {
  background: var(--cell-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.balance-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.balance-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.balance-counts {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.balance-remaining {
  font-size: 1.15rem;
  font-weight: 800;
}

.balance-remaining.po { color: #f59e0b; }
.balance-remaining.ps { color: #8b5cf6; }
.balance-remaining.mr { color: #ef4444; }
.balance-remaining.mnr { color: #9ca3af; }

.balance-total {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.balance-bar-bg {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.balance-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.balance-bar-fill.po { background: #f59e0b; }
.balance-bar-fill.ps { background: #8b5cf6; }
.balance-bar-fill.mr { background: #ef4444; }
.balance-bar-fill.mnr { background: #9ca3af; }

.civilista-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.hours-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hours-summary strong {
  color: #10b981;
  font-size: 1rem;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--modal-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--header-title);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--cri-red);
}

.modal-body {
  padding: 24px;
}

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

/* Forms & Inputs */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-main);
  font-size: 0.9rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--cri-red);
  box-shadow: 0 0 0 2px var(--cri-red-light);
}

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

/* Turni Quick Preset Selector */
.shift-presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.preset-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
  color: var(--text-main);
  cursor: pointer;
  text-align: center;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--cri-red);
  background: rgba(220, 38, 38, 0.15);
}

.preset-btn.selected {
  border-color: var(--cri-red);
  background: var(--cri-red);
  color: white;
}

.preset-time {
  font-size: 0.95rem;
  font-weight: 800;
  display: block;
}

.preset-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.preset-btn.selected .preset-label {
  color: rgba(255, 255, 255, 0.85);
}

/* Google Drive Dropzone Component */
.drive-dropzone {
  border: 2px dashed rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.05);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
  margin-bottom: 24px;
}

.drive-dropzone:hover, .drive-dropzone.dragover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.drive-icon {
  font-size: 2.8rem;
  color: #60a5fa;
  margin-bottom: 12px;
}

/* Table Drive Files */
.files-list-table {
  width: 100%;
  border-collapse: collapse;
}

.files-list-table th, .files-list-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-border);
}

/* Print / PDF Specific Template (Hidden on web UI, rendered during PDF export) */
#pdfPrintContainer {
  display: none;
  background: #ffffff;
  color: #1e293b;
  padding: 30px;
  font-family: Arial, sans-serif;
}

.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid #dc2626;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.pdf-logo {
  height: 60px;
}

.pdf-title h1 {
  font-size: 18pt;
  color: #dc2626;
  margin-bottom: 4px;
}

.pdf-title p {
  font-size: 10pt;
  color: #64748b;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 9pt;
}

.pdf-table th {
  background: #f1f5f9;
  color: #0f172a;
  padding: 8px;
  border: 1px solid #cbd5e1;
  text-align: center;
}

.pdf-table td {
  padding: 8px;
  border: 1px solid #cbd5e1;
  text-align: center;
}

.pdf-table td.name-col {
  text-align: left;
  font-weight: bold;
}

.pdf-footer {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  font-size: 10pt;
}

.pdf-signature-box {
  width: 220px;
  border-top: 1px solid #000;
  padding-top: 5px;
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-header {
    flex-direction: column;
    height: auto;
    padding: 16px;
    gap: 14px;
  }

  .header-controls {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .shifts-table th.day-col {
    min-width: 110px;
  }
}

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

.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--cri-red);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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