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

/* ==========================================================================
   HorariosApp 2.0 — Executive Cyber-Dashboard Theme System
   ========================================================================== */
:root {
  /* Core Dark Palette */
  --bg-app: #07070E;
  --bg-sidebar: #0C0D17;
  --bg-card: rgba(18, 20, 36, 0.7);
  --bg-card-hover: rgba(28, 31, 56, 0.85);
  --bg-glass: rgba(15, 17, 30, 0.75);
  --bg-input: rgba(24, 27, 48, 0.85);
  
  /* Cyber Accents */
  --accent-primary: #6366F1;   /* Electric Indigo */
  --accent-secondary: #06B6D4; /* Cyber Cyan */
  --accent-pink: #EC4899;      /* Neon Magenta */
  --accent-purple: #8B5CF6;    /* Deep Purple */
  --accent-emerald: #10B981;   /* Neon Emerald */
  --accent-amber: #F59E0B;     /* Vivid Amber */

  /* Status Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #F43F5E;
  --info: #3B82F6;

  /* Linear & Radial Gradients */
  --gradient-main: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
  --gradient-cyber: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%);
  --gradient-card: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
  --gradient-glow: linear-gradient(90deg, transparent 0%, #6366F1 30%, #EC4899 70%, transparent 100%);

  /* Text System */
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-highlight: #FFFFFF;

  /* Glassmorphism & Borders */
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  --border-active: rgba(6, 182, 212, 0.5);
  --glass-blur: blur(20px);

  /* Shadows & Glow Effects */
  --shadow-app: 0 20px 50px rgba(0, 0, 0, 0.6);
  --glow-primary: 0 0 25px rgba(99, 102, 241, 0.35);
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --glow-pink: 0 0 25px rgba(236, 72, 153, 0.35);

  /* Typography & Radii */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;

  /* Location Theme Badges */
  --loc-guardia-bg: rgba(59, 130, 246, 0.15);
  --loc-guardia-color: #60A5FA;
  --loc-guardia-border: rgba(59, 130, 246, 0.3);

  --loc-valle-bg: rgba(16, 185, 129, 0.15);
  --loc-valle-color: #34D399;
  --loc-valle-border: rgba(16, 185, 129, 0.3);

  --loc-mitras-bg: rgba(245, 158, 11, 0.15);
  --loc-mitras-color: #FBBF24;
  --loc-mitras-border: rgba(245, 158, 11, 0.3);

  --loc-descanso-bg: rgba(100, 116, 139, 0.15);
  --loc-descanso-color: #94A3B8;
  --loc-descanso-border: rgba(100, 116, 139, 0.3);

  --loc-vacation-bg: rgba(139, 92, 246, 0.15);
  --loc-vacation-color: #C084FC;
  --loc-vacation-border: rgba(139, 92, 246, 0.3);

  /* Location Name Color Utilities */
  .name-loc-guardia { color: var(--loc-guardia-color) !important; font-weight: 700; }
  .name-loc-valle { color: var(--loc-valle-color) !important; font-weight: 700; }
  .name-loc-mitras { color: var(--loc-mitras-color) !important; font-weight: 700; }
  .name-loc-descanso { color: var(--loc-descanso-color) !important; font-weight: 700; }
  .name-loc-vacation { color: var(--loc-vacation-color) !important; font-weight: 700; }

  /* Backwards Compatibility Aliases */
  --primary: var(--accent-primary);
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-dark: #4F46E5;
  --bg-body: var(--bg-app);
  --border: var(--border-glass);
}

/* ==========================================================================
   Day / Night Theme System
   Default body = Dark Mode (Night Theme)
   body.light-mode = Light Mode (Day Theme)
   ========================================================================== */
body.light-mode {
  --bg-app: #F1F5F9;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-glass: rgba(255, 255, 255, 0.95);
  --bg-input: #F8FAFC;
  
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-highlight: #020617;
  
  --border-glass: rgba(0, 0, 0, 0.1);
  --border-glow: rgba(99, 102, 241, 0.3);
  --shadow-app: 0 10px 30px rgba(0, 0, 0, 0.06);

  --bg-body: #F1F5F9;
  --border: rgba(0, 0, 0, 0.1);
}

body.light-mode .app-sidebar {
  background: #FFFFFF;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.05);
}

body.light-mode .top-header,
body.light-mode .controls-bar,
body.light-mode .metric-card,
body.light-mode .location-card,
body.light-mode .person-selector-container,
body.light-mode .day-card,
body.light-mode .table-container {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

body.light-mode .schedule-table th {
  background: #F8FAFC;
  color: #475569;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .schedule-table td {
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .schedule-table tr:hover td {
  background: rgba(99, 102, 241, 0.04);
}

body.light-mode .modal-content {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.light-mode .modal-header,
body.light-mode .modal-footer {
  background: #F8FAFC;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode input[type="text"],
body.light-mode input[type="password"],
body.light-mode input[type="date"],
body.light-mode input[type="time"],
body.light-mode input[type="email"],
body.light-mode input[type="tel"],
body.light-mode select,
body.light-mode textarea {
  background: #F1F5F9;
  border-color: rgba(0, 0, 0, 0.12);
  color: #0F172A;
}

body.light-mode .tab-button.active,
body.light-mode .tab-button.active span {
  color: #7C3AED !important;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

body.light-mode .tab-button.active svg {
  color: #7C3AED !important;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
  background-attachment: fixed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* ==========================================================================
   Main App Dashboard Layout (Sidebar + Main Viewport)
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Left Sidebar */
.app-sidebar {
  width: 270px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  backdrop-filter: var(--glass-blur);
}

/* Brand Section */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 1.5rem;
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary);
  flex-shrink: 0;
}

.brand-icon-box svg {
  width: 24px;
  height: 24px;
  color: #FFFFFF;
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar Navigation Tabs */
.tabs-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s);
  text-align: left;
  width: 100%;
}

.tab-button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  transform: translateX(4px);
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #FFFFFF;
  box-shadow: var(--glow-primary);
}

.tab-button.active svg {
  color: var(--accent-secondary);
  transform: scale(1.1);
}

/* Sidebar Footer Quick Widget */
.sidebar-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-glass);
}

.sidebar-status-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-dot-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulseDot 2s infinite;
}

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

.status-info-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.status-info-text strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.825rem;
}

/* Main Viewport Content */
.main-viewport {
  flex: 1;
  margin-left: 270px;
  padding: 2rem 2.5rem;
  max-width: 1550px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Top Dashboard Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  position: relative;
}

.header-title-area h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.header-title-area p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Circular Control Icon Buttons */
.theme-toggle, .header-action-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: var(--glass-blur);
}

.theme-toggle:hover, .header-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
  transform: translateY(-2px);
}

.theme-toggle svg, .header-action-btn svg {
  width: 20px;
  height: 20px;
}

/* Weather Widget Capsule */
.weather-widget {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  backdrop-filter: var(--glass-blur);
}

.weather-icon-large {
  font-size: 1.6rem;
  line-height: 1;
}

.weather-info {
  display: flex;
  flex-direction: column;
}

.weather-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.weather-temp-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-secondary);
  font-family: var(--font-mono);
}

.weather-details {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.weather-city-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.weather-desc-text {
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.weather-extra {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.weather-rain-badge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-secondary);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* Metric Stats Cards Row */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: var(--glass-blur);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
}

.metric-card.cyan::before { background: var(--accent-secondary); }
.metric-card.pink::before { background: var(--accent-pink); }
.metric-card.amber::before { background: var(--accent-amber); }

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-app);
}

.metric-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.metric-body h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-body .metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

/* Glowing Divider */
.glow-divider {
  height: 2px;
  width: 100%;
  background: var(--gradient-glow);
  opacity: 0.6;
  margin: 0.5rem 0;
}

/* ==========================================================================
   Tab Content Containers
   ========================================================================== */
.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  flex-direction: column;
  gap: 1.75rem;
}

.tab-content.active {
  display: flex;
  opacity: 1;
  animation: viewFadeIn 0.35s ease-out forwards;
}

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

/* Controls Bar & Week Nav Segmented Pill */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
}

.week-navigation {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
  transform: scale(1.08);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

.week-info {
  text-align: center;
}

.week-info h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.week-info span {
  font-size: 0.78rem;
  color: var(--accent-secondary);
  font-family: var(--font-mono);
  font-weight: 500;
}

.config-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Button UI Components */
.btn-primary, .btn-secondary, .btn-danger, .today-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  outline: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--gradient-main);
  color: #FFFFFF;
  box-shadow: var(--glow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #F43F5E 0%, #E11D48 100%);
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244, 63, 94, 0.5);
}

.today-btn {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-secondary);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.today-btn:hover {
  background: var(--accent-secondary);
  color: #FFFFFF;
  box-shadow: var(--glow-cyan);
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Tables Redesign (Cyber Glass Schedule Grid)
   ========================================================================== */
.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-app);
}

.schedule-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.schedule-table th {
  padding: 1.1rem 1rem;
  background: rgba(12, 13, 23, 0.9);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-glass);
}

.schedule-table th:first-child {
  border-top-left-radius: var(--radius-lg);
}
.schedule-table th:last-child {
  border-top-right-radius: var(--radius-lg);
}

.schedule-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.875rem;
  vertical-align: middle;
  transition: background 0.2s;
}

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

.schedule-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.person-cell {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 160px;
}

.person-cell strong {
  color: var(--accent-secondary);
  font-size: 0.95rem;
}

/* Schedule Cell Inner Content */
.schedule-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Location Badges Pill System */
.location-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

.location-badge.guardia {
  background: var(--loc-guardia-bg);
  color: var(--loc-guardia-color);
  border: 1px solid var(--loc-guardia-border);
}

.location-badge.valle {
  background: var(--loc-valle-bg);
  color: var(--loc-valle-color);
  border: 1px solid var(--loc-valle-border);
}

.location-badge.mitras {
  background: var(--loc-mitras-bg);
  color: var(--loc-mitras-color);
  border: 1px solid var(--loc-mitras-border);
}

.location-badge.descanso {
  background: var(--loc-descanso-bg);
  color: var(--loc-descanso-color);
  border: 1px solid var(--loc-descanso-border);
}

.location-badge.vacation {
  background: var(--loc-vacation-bg);
  color: var(--loc-vacation-color);
  border: 1px solid var(--loc-vacation-border);
}

/* Special Table Cell Indicators */
.vacation-cell {
  background: rgba(139, 92, 246, 0.06) !important;
}

.location-change-cell {
  background: rgba(6, 182, 212, 0.06) !important;
}

.location-change-indicator {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-secondary);
  display: inline-block;
}

.vacation-badge-small {
  font-size: 0.7rem;
  color: var(--accent-purple);
  font-weight: 600;
  display: block;
}

.swap-comment {
  font-size: 0.75rem;
  color: var(--accent-pink);
  font-style: italic;
  display: block;
}

/* ==========================================================================
   Individual View (Day Cards Grid)
   ========================================================================== */
.individual-view {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.person-selector-container {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  padding: 1.25rem 1.75rem;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 1rem;
  backdrop-filter: var(--glass-blur);
}

.person-selector-container label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
}

.person-selector-container select {
  flex: 1;
  max-width: 320px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

.person-selector-container select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}

/* Day Cards Grid */
.individual-days-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  min-height: 170px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  backdrop-filter: var(--glass-blur);
}

.day-card:hover {
  transform: translateY(-5px);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--glow-primary);
}

.day-card.today {
  border: 2px solid var(--accent-primary);
  box-shadow: var(--glow-primary);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(18, 20, 36, 0.7) 100%);
}

.day-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;

}

.badge-today {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: var(--glow-primary);
}

.badge-vacation {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-purple);
  color: #FFFFFF;
}

.badge-location-change {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--accent-secondary);
  color: #FFFFFF;
}

.day-schedule {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.day-schedule .time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   General View Location Cards Grid
   ========================================================================== */
.general-view {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.locations-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.locations-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.locations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.location-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  transition: transform 0.2s ease;
}

.location-card:hover {
  transform: translateY(-3px);
}

.location-header {
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-glass);
}

.location-card.guardia .location-header {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.1) 100%);
  color: #60A5FA;
}

.location-card.valle .location-header {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.1) 100%);
  color: #34D399;
}

.location-card.mitras .location-header {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3) 0%, rgba(217, 119, 6, 0.1) 100%);
  color: #FBBF24;
}

.location-content {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 380px;
  overflow-y: auto;
}

.location-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.location-item strong {
  font-size: 0.925rem;
  color: var(--text-primary);
  display: block;
}

.comment-text {
  font-size: 0.72rem;
  color: var(--accent-pink);
  font-style: italic;
  display: block;
}

/* ==========================================================================
   Modals & Glass Dialogs
   ========================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.active {
  display: flex;
  animation: modalPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  background: #0D0F1D;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-app), var(--glow-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.close-modal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.close-modal:hover {
  background: var(--danger);
  color: #FFFFFF;
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms UI */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--glow-primary);
}

/* Danger Zone */
.danger-zone {
  margin-top: 2rem;
  padding: 1.25rem;
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.danger-title {
  color: var(--danger);
  font-size: 1rem;
  font-weight: 800;
}

.danger-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .app-sidebar {
    width: 80px;
    padding: 1.25rem 0.65rem;
  }
  .brand-info, .brand-badge, .tab-button span, .sidebar-footer {
    display: none;
  }
  .tab-button {
    justify-content: center;
    padding: 0.85rem;
  }
  .main-viewport {
    margin-left: 80px;
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 0.85rem 1.25rem;
  }
  .brand-wrapper {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
  }
  .brand-info, .brand-badge {
    display: block;
  }
  .tabs-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .tab-button span {
    display: block;
  }
  .main-viewport {
    margin-left: 0;
    padding: 1rem;
  }
  .top-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Tablet / Medium Screen Agent Adjustment */
  #schedule-agent-widget {
    bottom: 1rem;
    right: 1rem;
  }

  .agent-drawer {
    right: 1rem;
    bottom: 4.5rem;
    width: calc(100vw - 2rem);
    max-width: 420px;
    max-height: calc(100vh - 6rem);
    max-height: calc(100dvh - 6rem);
  }
}

/* Mobile Screens (Phones <= 600px) Full-Screen Agent Modal */
@media (max-width: 600px) {
  #schedule-agent-widget {
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
  }

  .agent-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    z-index: 10005;
    box-shadow: none;
  }

  .agent-header {
    padding: 0.85rem 1rem;
  }

  .agent-messages {
    padding: 0.75rem;
  }

  .agent-msg {
    max-width: 95%;
  }

  .agent-input-box {
    padding: 0.65rem 0.75rem;
  }

  .agent-input-box input {
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Schedule Assistant Agent Widget (Cyber-Agent Chat)
   ========================================================================== */
#schedule-agent-widget {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  font-family: var(--font-sans);
}

.agent-fab-btn {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--gradient-main);
  color: #FFFFFF;
  border: none;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--glow-primary), 0 10px 25px rgba(0,0,0,0.4);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.agent-fab-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.6);
}

.agent-fab-icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* Chat Drawer Container */
.agent-drawer {
  display: none;
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 400px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 7rem);
  background: #0C0E1C;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-app), var(--glow-primary);
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: var(--glass-blur);
  animation: agentPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-sizing: border-box;
}

@keyframes agentPop {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.agent-drawer.active {
  display: flex;
}

.agent-header {
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.agent-title-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-cyber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--glow-cyan);
}

.agent-title-info h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.agent-status-text {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

.agent-key-btn {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  border-radius: 9999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.agent-key-btn:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: var(--accent-violet);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

.agent-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.agent-clear-btn:hover {
  color: #ef4444;
  transform: scale(1.15);
}

.agent-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  display: inline-block;
  animation: typingDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.agent-close:hover {
  color: var(--danger);
}

/* Suggestion Chips */
.agent-chips-bar {
  padding: 0.65rem 1rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-glass);
}

.agent-chip {
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.agent-chip:hover {
  background: var(--accent-primary);
  color: #FFFFFF;
  border-color: var(--accent-primary);
}

/* Messages Area */
.agent-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.agent-msg {
  display: flex;
  max-width: 90%;
}

.agent-msg.bot {
  align-self: flex-start;
}

.agent-msg.user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
}

.agent-msg.bot .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-top-left-radius: 4px;
}

.agent-msg.user .msg-bubble {
  background: var(--gradient-main);
  color: #FFFFFF;
  border-top-right-radius: 4px;
  box-shadow: var(--glow-primary);
}

/* Input Box */
.agent-input-box {
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.agent-input-box input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

.agent-input-box input:focus {
  border-color: var(--accent-primary);
}

.agent-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-main);
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.agent-send-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--glow-primary);
}

body.light-mode .agent-drawer {
  background: #FFFFFF;
  border-color: rgba(0,0,0,0.12);
}

body.light-mode .agent-msg.bot .msg-bubble {
  background: #F1F5F9;
  color: #0F172A;
  border-color: rgba(0,0,0,0.08);
}