/* ==========================================================================
   Google Fonts Import & Global Custom Properties
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Brand Colors from SmartPark_Color_Palette.pdf */
  --color-royal-blue: #1A3EBF;
  --color-white: #FFFFFF;
  --color-deep-navy: #0A1F6B;
  --color-ice-blue: #E8EEFF;
  --color-amber: #F5A623;
  --color-near-black: #1C1C1E;
  
  /* State Colors (Disponibilidad) */
  --color-state-free: #00C2A8;  /* Verde Teal */
  --color-state-mid: #FF8C00;   /* Naranja */
  --color-state-full: #FF4D4D;  /* Coral Red */

  /* Neutral Dark Colors for UI panels */
  --color-bg-light: #F4F6FC;
  --color-border: #D1DBF7;
  --color-text-muted: #6C7A9C;
  --color-shadow: rgba(10, 31, 107, 0.08);
  
  /* Transition timings */
  --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition-duration: 0.25s;
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--color-bg-light);
  color: var(--color-near-black);
  overflow-x: hidden;
  font-size: 15px; /* Within 14-16px */
  line-height: 1.5;
  /* Stylistic Set ss03 from styling guide */
  font-feature-settings: "ss03" on;
}

/* ==========================================================================
   Typography Rules (Page 1 of branding guide)
   ========================================================================== */
h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: -0.02em;
}

h2 {
  font-size: 20px; /* Adapted for panel title sizes */
  font-weight: 600;
  color: var(--color-deep-navy);
}

h3 {
  font-size: 18px; /* Subtitulos */
  font-weight: 500;
  color: var(--color-deep-navy);
}

p {
  color: var(--color-near-black);
}

.label-badge {
  font-size: 11px; /* 11-13px */
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em; /* ls 0.08em */
}

/* ==========================================================================
   Utility Components (Buttons, Badges)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: all var(--transition-duration) var(--transition-smooth);
}

.btn-primary {
  background-color: var(--color-royal-blue);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-deep-navy);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--color-ice-blue);
  color: var(--color-royal-blue);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-border);
  transform: translateY(-2px);
}

.btn-event {
  background-color: var(--color-white);
  color: var(--color-deep-navy);
  border: 1px solid var(--color-border);
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-event:hover {
  background-color: var(--color-ice-blue);
  border-color: var(--color-royal-blue);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: #FFEAEA;
  color: var(--color-state-full);
  border: 1px solid rgba(255, 77, 77, 0.2);
}

.btn-danger:hover {
  background-color: var(--color-state-full);
  color: var(--color-white);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-accent {
  background-color: var(--color-amber);
  color: var(--color-near-black);
}

/* ==========================================================================
   Routing Display Rules
   ========================================================================== */
.desktop-only { display: block; }
.mobile-only { display: none; }

/* In case of forced mobile preview/embedded mode */
.mobile-mode .desktop-only {
  display: none !important;
}
.mobile-mode .mobile-only {
  display: flex !important;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--color-white);
  overflow: hidden;
}

/* Responsive screen size routing defaults */
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only {
    display: flex !important;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background-color: var(--color-white);
    overflow: hidden;
  }
}

/* ==========================================================================
   DESKTOP VIEW STYLING
   ========================================================================== */
#desktop-dashboard {
  min-height: 100vh;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.desktop-header {
  background-color: var(--color-deep-navy);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 24px var(--color-shadow);
}

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

.brand-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 10px;
}

.brand-info h1 {
  font-size: 24px;
  margin-bottom: 2px;
}

.brand-info p {
  color: var(--color-ice-blue);
  opacity: 0.85;
  font-size: 13px;
}

.status-indicator {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  margin-right: 12px;
  letter-spacing: 0.05em;
}

.status-indicator.live {
  background-color: rgba(0, 194, 168, 0.15);
  color: var(--color-state-free);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

.current-time-display {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 16px;
  border-radius: 10px;
  color: var(--color-white);
  font-weight: 700;
  font-size: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 20px;
  flex: 1;
}

@media (max-width: 1400px) {
  .dashboard-grid {
    grid-template-columns: 1.1fr 1fr;
  }
  .phone-shell-panel {
    display: none !important; /* Hide preview on intermediate screens */
  }
}

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

.dashboard-card {
  background-color: var(--color-white);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: 0 10px 30px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-ice-blue);
  padding-bottom: 12px;
}

/* --- SVG Campus Map Central --- */
.map-panel {
  grid-row: span 2;
}

.map-legend {
  display: flex;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-free { background-color: var(--color-state-free); }
.status-mid { background-color: var(--color-state-mid); }
.status-full { background-color: var(--color-state-full); }

.map-wrapper {
  background-color: var(--color-ice-blue);
  border-radius: 16px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.campus-svg {
  width: 100%;
  height: 100%;
  max-height: 500px;
  display: block;
}

/* SVG Interactive Shapes styling */
.svg-finca-boundary {
  fill: rgba(26, 62, 191, 0.02);
  stroke: rgba(26, 62, 191, 0.15);
  stroke-width: 2;
  stroke-dasharray: 4 4;
  transition: all 0.3s;
}

.svg-finca-label {
  font-size: 10px;
  font-weight: 700;
  fill: var(--color-text-muted);
  letter-spacing: 0.05em;
  pointer-events: none;
}

.svg-parking-polygon {
  fill: var(--color-state-free);
  stroke: var(--color-white);
  stroke-width: 2.5;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(10, 31, 107, 0.1));
  transition: all 0.3s var(--transition-smooth);
}

.svg-parking-polygon:hover {
  filter: drop-shadow(0 8px 12px rgba(10, 31, 107, 0.25));
  stroke-width: 3.5;
  transform: scale(1.02);
  transform-origin: center;
}

.svg-parking-polygon.state-free { fill: var(--color-state-free); }
.svg-parking-polygon.state-mid { fill: var(--color-state-mid); }
.svg-parking-polygon.state-full { fill: var(--color-state-full); }

.svg-parking-label {
  fill: var(--color-near-black);
  font-weight: 700;
  font-size: 11px;
  text-anchor: middle;
  pointer-events: none;
  background-color: var(--color-white);
}

/* --- Stats Panel --- */
.finca-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

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

.finca-stat-card {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-ice-blue);
  border-radius: 12px;
  padding: 14px;
}

.finca-stat-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text-muted);
}

.finca-occupancy-bar {
  background-color: rgba(10, 31, 107, 0.08);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.finca-occupancy-bar .fill {
  background-color: var(--color-royal-blue);
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s var(--transition-smooth);
}

.finca-stat-card[data-finca="1"] .fill { background-color: var(--color-state-full); }
.finca-stat-card[data-finca="2"] .fill { background-color: var(--color-royal-blue); }
.finca-stat-card[data-finca="3"] .fill { background-color: var(--color-state-free); }

.finca-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.finca-numbers .percentage {
  font-weight: 700;
  color: var(--color-deep-navy);
}

/* --- Alerts List --- */
.alerts-subpanel h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

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

.no-alerts {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-ice-blue);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}

.alert-item-card {
  background-color: #FFF3F3;
  border: 1px solid rgba(255, 77, 77, 0.15);
  border-left: 4px solid var(--color-state-full);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideInRight 0.3s var(--transition-smooth);
}

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

.alert-info h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.alert-info p {
  font-size: 11px;
  color: var(--color-text-muted);
}

.alert-value-badge {
  background-color: var(--color-state-full);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
}

/* --- Dynamic SVG Charts --- */
.chart-subpanel h3 {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.chart-container {
  height: 180px;
  background-color: var(--color-bg-light);
  border-radius: 12px;
  border: 1px solid var(--color-ice-blue);
  padding: 12px 10px 5px 10px;
  position: relative;
}

.chart-axis-label {
  font-size: 9px;
  fill: var(--color-text-muted);
  font-weight: 600;
}

.chart-grid-line {
  stroke: rgba(10, 31, 107, 0.05);
  stroke-width: 1;
}

.chart-line-bg {
  fill: none;
  stroke: rgba(26, 62, 191, 0.08);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.chart-line-realtime {
  fill: none;
  stroke: var(--color-royal-blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(26, 62, 191, 0.3));
}

.chart-dot-current {
  fill: var(--color-amber);
  stroke: var(--color-white);
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* --- Control Panel / Sync Box --- */
.sync-box {
  background-color: var(--color-ice-blue);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 18px;
}

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

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

.qr-code-wrapper {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 120px;
  height: 120px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qr-code-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-placeholder {
  position: absolute;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

.sync-instructions {
  flex: 1;
}

.sync-instructions ol {
  padding-left: 16px;
  font-size: 12px;
  color: var(--color-near-black);
  margin-bottom: 10px;
}

.sync-instructions li {
  margin-bottom: 4px;
}

.url-badge {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: monospace;
  font-size: 11px;
  text-align: center;
  color: var(--color-royal-blue);
  font-weight: 600;
}

.demo-controller {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--color-ice-blue);
  padding-top: 14px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--color-royal-blue);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 600;
  padding: 0 4px;
}

.simulation-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simulation-events h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
}

.event-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.auto-sim-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--color-bg-light);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--color-ice-blue);
}

/* Switch styling */
.switch-container {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--color-text-muted);
  transition: .3s;
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--color-white);
  transition: .3s;
  border-radius: 50%;
}

.switch-container input:checked + .switch-slider {
  background-color: var(--color-royal-blue);
}

.switch-container input:checked + .switch-slider:before {
  transform: translateX(20px);
}

.switch-text {
  display: flex;
  flex-direction: column;
}

.switch-text strong {
  font-size: 12px;
  color: var(--color-deep-navy);
}

.switch-text p {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* --- Smartphone Wrapper Frame --- */
.phone-shell-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-light);
}

.phone-shell-wrapper {
  position: relative;
  width: 320px;
  height: 640px;
}

.smartphone {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #111;
  border: 10px solid #222;
  border-radius: 36px;
  box-shadow: 0 20px 40px rgba(10, 31, 107, 0.2), inset 0 0 10px rgba(0,0,0,0.8);
  overflow: hidden;
}

.smartphone .notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 18px;
  background-color: #222;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 1000;
}

.smartphone .screen-content {
  width: 100%;
  height: 100%;
  background: white;
  border: none;
}


/* ==========================================================================
   MOBILE VIEW STYLING
   ========================================================================== */
#mobile-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  max-width: 480px;
  margin: 0 auto;
  background-color: var(--color-white);
  box-shadow: 0 0 20px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
}

/* Mobile Status Bar simulation */
.mobile-status-bar {
  height: 32px;
  padding: 0 16px;
  background-color: var(--color-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-near-black);
  z-index: 100;
  border-bottom: 1px solid var(--color-bg-light);
}

.status-icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-svg {
  width: 12px;
  height: 12px;
  color: var(--color-near-black);
}

/* Toast Notifications (Slide Down from Notch) */
.mobile-toast-notification {
  position: absolute;
  top: -80px; /* Hidden */
  left: 12px;
  right: 12px;
  background: rgba(10, 31, 107, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--color-white);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  z-index: 1000;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-toast-notification.active {
  transform: translateY(120px); /* Position it nicely below header */
}

.toast-icon {
  font-size: 20px;
}

.toast-content h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-amber);
}

.toast-content p {
  font-size: 11px;
  color: var(--color-white);
  opacity: 0.9;
  margin-top: 2px;
}

.toast-close-btn {
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 18px;
  cursor: pointer;
  margin-left: auto;
  opacity: 0.6;
}

.toast-close-btn:hover {
  opacity: 1;
}

/* Mobile Header */
.mobile-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-ice-blue);
  background-color: var(--color-white);
  z-index: 90;
}

.mobile-logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-app-logo {
  height: 32px;
  width: auto;
}

.mobile-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-royal-blue);
  line-height: 1.1;
}

.location-tag {
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.mobile-bell-btn {
  background: var(--color-ice-blue);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--color-royal-blue);
  transition: background 0.2s;
}

.mobile-bell-btn:active {
  background-color: var(--color-border);
}

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

.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--color-state-full);
  color: var(--color-white);
  font-size: 9px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-white);
}

/* Scrollable Main Screens Area */
.mobile-screen-content {
  flex: 1;
  overflow-y: auto;
  background-color: var(--color-bg-light);
  position: relative;
}

/* View switcher display rule */
.app-screen {
  display: none;
  padding: 16px;
  animation: fadeInMobile 0.25s var(--transition-smooth);
}

.app-screen.active {
  display: block;
}

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

/* --- Screen 1: Dashboard Home CSS --- */

/* Smart Suggestion box (Glassmorphism & animated highlight) */
.smart-card {
  background: linear-gradient(135deg, var(--color-deep-navy) 0%, var(--color-royal-blue) 100%);
  border-radius: 18px;
  padding: 18px;
  color: var(--color-white);
  box-shadow: 0 8px 20px rgba(26, 62, 191, 0.2);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.smart-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.smart-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.sparkle-icon {
  font-size: 18px;
}

.smart-card h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-amber);
}

.smart-card p {
  font-size: 14px;
  color: var(--color-white);
  line-height: 1.4;
  opacity: 0.95;
}

.smart-rec-footer {
  margin-top: 14px;
  display: flex;
}

.rec-action-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-title-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.time-stamp-now {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-state-free);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: rgba(0, 194, 168, 0.1);
  padding: 2px 8px;
  border-radius: 50px;
}

/* Finca Pills list */
.finca-cards-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.finca-card-pill {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.finca-card-pill:active {
  transform: scale(0.98);
  background-color: var(--color-bg-light);
}

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

.finca-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.finca-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

.pill-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pill-status .percentage {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-near-black);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator-dot.free { background-color: var(--color-state-free); }
.status-indicator-dot.mid { background-color: var(--color-state-mid); }
.status-indicator-dot.full { background-color: var(--color-state-full); }

/* Dashboard Alerts section */
.dashboard-alerts-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-deep-navy);
  margin-bottom: 12px;
}

.mobile-alerts-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.all-clear {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.check-icon {
  font-size: 18px;
  color: var(--color-state-free);
  background-color: rgba(0, 194, 168, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.all-clear p {
  font-size: 12px;
  color: var(--color-text-muted);
}

.mobile-alert-pill {
  background-color: #FFF6F6;
  border: 1px solid rgba(255, 77, 77, 0.1);
  border-left: 4px solid var(--color-state-full);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-alert-pill h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-near-black);
}

.mobile-alert-pill p {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* --- Screen 2: Mobile Map CSS --- */
#mobile-screen-map {
  padding: 0;
  position: relative;
  height: calc(100vh - 56px - 56px - 32px); /* Subtract Header, Tab bar, status bar */
}

.mobile-map-container {
  width: 100%;
  height: 100%;
  background-color: var(--color-ice-blue);
  overflow: hidden;
  position: relative;
}

.mobile-map-container svg {
  width: 100%;
  height: 100%;
  /* Center crop map elements on mobile */
  transform: scale(1.1);
  transform-origin: center;
}

/* Pull Up drawer */
.mobile-map-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--color-white);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -8px 25px rgba(10, 31, 107, 0.15);
  z-index: 100;
  padding: 12px 18px 24px 18px;
  transform: translateY(100%); /* hidden */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-map-drawer.open {
  transform: translateY(0);
}

.drawer-handle {
  width: 36px;
  height: 5px;
  background-color: var(--color-border);
  border-radius: 10px;
  margin: 0 auto 12px auto;
}

.drawer-placeholder {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  padding: 10px 0;
}

.drawer-details-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-detail-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.drawer-detail-header .finca-badge {
  background-color: var(--color-ice-blue);
  color: var(--color-royal-blue);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 50px;
  font-weight: 600;
}

.drawer-body-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-stat {
  background-color: var(--color-bg-light);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid var(--color-ice-blue);
}

.drawer-stat .label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.drawer-stat .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.drawer-action-row {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 8px;
}

/* --- Screen 3: Parking List CSS --- */
.list-search-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-icon {
  font-size: 14px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--color-near-black);
}

.filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-pill {
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  color: var(--color-text-muted);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-pill.active {
  background-color: var(--color-royal-blue);
  color: var(--color-white);
  border-color: var(--color-royal-blue);
}

.parking-lots-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parking-list-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.parking-list-card:active {
  background-color: var(--color-bg-light);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title-group h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.card-title-group span {
  font-size: 10px;
  color: var(--color-text-muted);
}

.card-status-info {
  text-align: right;
}

.card-status-info .available-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-near-black);
}

.card-status-info .total-capacity {
  font-size: 10px;
  color: var(--color-text-muted);
}

.card-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-progress-bar {
  flex: 1;
  height: 6px;
  background-color: rgba(10, 31, 107, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.card-progress-bar .fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s var(--transition-smooth);
}

.card-progress-bar .fill.free { background-color: var(--color-state-free); }
.card-progress-bar .fill.mid { background-color: var(--color-state-mid); }
.card-progress-bar .fill.full { background-color: var(--color-state-full); }

.card-progress-row .percent-label {
  font-size: 11px;
  font-weight: 700;
  width: 32px;
  text-align: right;
}

/* Modal details */
.mobile-modal {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.mobile-modal.active {
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(10, 31, 107, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-modal.active .modal-backdrop {
  opacity: 1;
}

.modal-wrapper {
  background-color: var(--color-white);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  width: 100%;
  max-width: 480px;
  z-index: 10;
  padding: 20px 20px 32px 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-modal.active .modal-wrapper {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-ice-blue);
  padding-bottom: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-muted);
  cursor: pointer;
}

/* Modal form/simulator elements */
.modal-sim-box {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-ice-blue);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-sim-box h4 {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.modal-counter-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.modal-counter-control .btn-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  color: var(--color-royal-blue);
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(10,31,107,0.05);
}

.modal-counter-control .btn-circle:active {
  background-color: var(--color-ice-blue);
  transform: scale(0.95);
}

.modal-counter-control .counter-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.modal-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert-subscribe-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  border-radius: 12px;
}

.alert-subscribe-toggle span {
  font-size: 13px;
  font-weight: 600;
}

/* --- Screen 4: Historical Analytics CSS --- */
.analytics-header {
  margin-bottom: 16px;
}

.analytics-header p {
  font-size: 12px;
  color: var(--color-text-muted);
}

.day-selectors {
  display: flex;
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.day-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}

.day-btn.active {
  background-color: var(--color-white);
  color: var(--color-royal-blue);
  box-shadow: 0 4px 10px rgba(10, 31, 107, 0.05);
}

.analytics-chart-box {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 16px 12px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-deep-navy);
  margin-bottom: 12px;
}

.analytics-tips-card {
  background-color: var(--color-ice-blue);
  border: 1px dashed var(--color-border);
  border-radius: 16px;
  padding: 14px;
}

.analytics-tips-card h4 {
  font-size: 13px;
  color: var(--color-royal-blue);
  margin-bottom: 6px;
}

.analytics-tips-card p {
  font-size: 12px;
  color: var(--color-near-black);
  line-height: 1.4;
}

/* --- Mobile Bottom Nav Bar --- */
.mobile-tab-bar {
  height: 56px;
  background-color: var(--color-white);
  border-top: 1px solid var(--color-ice-blue);
  display: flex;
  z-index: 90;
}

.tab-item {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s;
}

.tab-icon {
  width: 20px;
  height: 20px;
}

.tab-item span {
  font-size: 10px;
  font-weight: 600;
}

.tab-item.active {
  color: var(--color-royal-blue);
}

.tab-item:active {
  opacity: 0.8;
}

/* ==========================================================================
   Role Segmented Controls (Estudiantes vs Profesores)
   ========================================================================== */
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-role-selector {
  display: flex;
  align-items: center;
}

.role-segmented-control {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 30px;
  padding: 3px;
  display: flex;
  gap: 4px;
}

.role-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-duration) var(--transition-smooth);
}

.role-btn:hover {
  color: var(--color-white);
}

.role-btn.active {
  background-color: var(--color-white);
  color: var(--color-royal-blue);
  box-shadow: 0 4px 12px rgba(10, 31, 107, 0.15);
}

.mobile-role-selector-container {
  width: 100%;
  padding: 10px 16px 14px 16px;
  background-color: var(--color-white);
}

.mobile-role-segmented {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 30px;
  padding: 3px;
  display: flex;
  gap: 4px;
  width: 100%;
}

.mobile-role-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-duration) var(--transition-smooth);
  text-align: center;
}

.mobile-role-btn.active {
  background-color: var(--color-royal-blue);
  color: var(--color-white);
  box-shadow: 0 4px 10px rgba(26, 62, 191, 0.2);
}


/* ==========================================================================
   Rediseño del Layout del Dashboard de Escritorio (Mockup)
   ========================================================================== */

/* Main Container */
.dashboard-layout-container {
  display: flex;
  min-height: calc(100vh - 120px);
  position: relative;
  overflow-x: hidden;
  gap: 20px;
  width: 100%;
}

/* Left Content Area */
.dashboard-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  transition: padding-right var(--transition-duration) var(--transition-smooth);
}

/* Sidebar behavior - by default sidebar is open, padding is 370px */
body:not(.sidebar-collapsed) .dashboard-main-content {
  padding-right: 370px;
}

.sidebar-collapsed .dashboard-main-content {
  padding-right: 0;
}

/* Section Titles */
.section-title-wrapper {
  margin-bottom: 5px;
}
.section-title-wrapper h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-deep-navy);
}
.section-title-wrapper p {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* SECTION 1: Three Finca Columns */
.dashboard-fincas-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .dashboard-fincas-columns {
    grid-template-columns: 1fr;
  }
}

/* Column Cards */
.finca-column-card {
  background-color: var(--color-white);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: 0 10px 30px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0; /* Prevents overflow inside grid */
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-ice-blue);
  padding-bottom: 12px;
}
.column-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.spots-available-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  background-color: rgba(0, 194, 168, 0.1);
  color: var(--color-state-free);
}

/* Progress bar inside columns */
.finca-capacity-numbers {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: -6px;
}
.finca-capacity-numbers .percentage {
  font-weight: 700;
  color: var(--color-deep-navy);
}

/* Parking List Card inside Column */
.parking-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.parking-list-container h3 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.parking-list-scroll {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

/* Custom Scrollbar for list and sidebar */
.parking-list-scroll::-webkit-scrollbar,
.sidebar-scrollable-content::-webkit-scrollbar {
  width: 5px;
}
.parking-list-scroll::-webkit-scrollbar-track,
.sidebar-scrollable-content::-webkit-scrollbar-track {
  background: transparent;
}
.parking-list-scroll::-webkit-scrollbar-thumb,
.sidebar-scrollable-content::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 10px;
}

/* Desktop List Items */
.desktop-list-item {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-ice-blue);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
}
.desktop-list-item:hover {
  border-color: var(--color-royal-blue);
  background-color: var(--color-ice-blue);
  transform: translateY(-2px);
}
.desktop-list-item .item-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.desktop-list-item .item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-deep-navy);
}
.desktop-list-item .item-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.desktop-list-item .item-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.desktop-list-item .item-free {
  font-size: 12px;
  font-weight: 700;
}
.desktop-list-item .item-free.free { color: var(--color-state-free); }
.desktop-list-item .item-free.mid { color: var(--color-state-mid); }
.desktop-list-item .item-free.full { color: var(--color-state-full); }

.desktop-list-item .item-progress {
  width: 60px;
  height: 4px;
  background-color: rgba(10, 31, 107, 0.08);
  border-radius: 5px;
  overflow: hidden;
}
.desktop-list-item .item-progress .fill {
  height: 100%;
  border-radius: 5px;
}
.desktop-list-item .item-progress .fill.free { background-color: var(--color-state-free); }
.desktop-list-item .item-progress .fill.mid { background-color: var(--color-state-mid); }
.desktop-list-item .item-progress .fill.full { background-color: var(--color-state-full); }


/* SECTION 2: Scroll Down (3 Charts Row + Big Map) */
.historical-charts-section,
.map-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.charts-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1200px) {
  .charts-row {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background-color: var(--color-white);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 18px;
  box-shadow: 0 10px 30px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.chart-wrapper {
  height: 150px;
  background-color: var(--color-bg-light);
  border-radius: 12px;
  border: 1px solid var(--color-ice-blue);
  padding: 10px;
  position: relative;
}

.big-map-card {
  background-color: var(--color-white);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 24px;
  box-shadow: 0 10px 30px var(--color-shadow);
  width: 100%;
}
.big-map-card .map-wrapper {
  min-height: 480px;
}


/* Right Sidebar (Collapsible Control Panel) */
.dashboard-sidebar {
  width: 350px;
  background-color: var(--color-white);
  border-left: 1px solid var(--color-border);
  position: fixed;
  top: 108px;
  right: 0;
  bottom: 0;
  z-index: 100;
  box-shadow: -10px 0 30px rgba(10, 31, 107, 0.04);
  transition: transform var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.sidebar-collapsed .dashboard-sidebar {
  transform: translateX(100%);
}

.sidebar-scrollable-content {
  overflow-y: auto;
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-ice-blue);
  padding-bottom: 12px;
}
.sidebar-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
  position: absolute;
  left: -44px;
  top: 20px;
  width: 44px;
  height: 44px;
  border-radius: 12px 0 0 12px;
  background-color: var(--color-deep-navy);
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-right: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: -4px 4px 10px rgba(10, 31, 107, 0.12);
  transition: background-color 0.2s;
}
.sidebar-toggle-btn:hover {
  background-color: var(--color-royal-blue);
}

/* Sidebar Phone simulator container sizing */
.phone-shell-panel-sidebar {
  border-top: 1px solid var(--color-ice-blue);
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-shell-panel-sidebar h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}
.phone-shell-panel-sidebar .phone-shell-wrapper {
  display: flex;
  justify-content: center;
  transform: scale(0.85);
  transform-origin: top center;
  margin-bottom: -60px; /* Offset the scale empty space */
}

/* Dynamic color override for progress bar fill per Finca */
.finca-occupancy-bar[data-finca="1"] .fill { background-color: var(--color-state-full); }
.finca-occupancy-bar[data-finca="2"] .fill { background-color: var(--color-royal-blue); }
.finca-occupancy-bar[data-finca="3"] .fill { background-color: var(--color-state-free); }

/* Header Console Switch styling */
.console-toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 10px;
  color: var(--color-white);
  height: 38px;
  transition: background-color var(--transition-duration) var(--transition-smooth);
}

.console-toggle-control:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.switch-text-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-white);
  user-select: none;
}

/* User status badge in header */
.header-user-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: 10px;
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  height: 38px;
}
.header-user-status .user-icon {
  font-size: 14px;
}
.header-user-status .user-text {
  color: var(--color-ice-blue);
  font-feature-settings: "ss03" on;
}

/* Simulator Role Selector styles inside sidebar */
.sidebar-role-selector-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px var(--color-shadow);
}
.sidebar-role-selector-card h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.sidebar-role-selector-card .role-segmented-control {
  background-color: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 2px;
  display: flex;
  gap: 2px;
  width: 100%;
}
.sidebar-role-selector-card .role-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  padding: 6px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all var(--transition-duration) var(--transition-smooth);
}
.sidebar-role-selector-card .role-btn.active {
  background-color: var(--color-royal-blue);
  color: var(--color-white);
  box-shadow: 0 3px 8px rgba(26, 62, 191, 0.25);
}

/* ==========================================================================
   Reservations View Styling (Reservar)
   ========================================================================== */
.reservations-header {
  padding: 16px 16px 12px 16px;
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-ice-blue);
}

.reservations-header h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-deep-navy);
  margin-bottom: 4px;
}

.reservations-header p {
  font-size: 11.5px;
  color: var(--color-text-muted);
  line-height: 1.3;
}

/* User Credits Summary Card */
.user-credits-card {
  background: linear-gradient(135deg, var(--color-deep-navy) 0%, var(--color-royal-blue) 100%);
  color: var(--color-white);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 16px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 8px 20px rgba(10, 31, 107, 0.2);
}

.credit-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  text-align: center;
}

.credit-metric:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.credit-metric .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
}

.credit-metric .value {
  font-size: 20px;
  font-weight: 800;
  color: var(--color-white);
}

.credit-metric.highlight .value {
  color: var(--color-state-free);
  text-shadow: 0 0 10px rgba(0, 194, 168, 0.4);
}

/* Reservation Flow Form */
.reservation-flow-card {
  background-color: var(--color-white);
  border-radius: 16px;
  border: 1px solid var(--color-border);
  padding: 16px;
  margin: 0 16px 16px 16px;
  box-shadow: 0 4px 15px var(--color-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.flow-row {
  display: flex;
  gap: 8px;
}

.form-select, .form-input {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-light);
  color: var(--color-deep-navy);
  padding: 0 10px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  outline: none;
  transition: all 0.2s;
}

.form-select:focus, .form-input:focus {
  border-color: var(--color-royal-blue);
  background-color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(26, 62, 191, 0.1);
}

/* Hourly Grid timetable */
.res-schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  border: 1px solid var(--color-ice-blue);
  border-radius: 10px;
  padding: 8px;
  background-color: var(--color-bg-light);
}

.res-hour-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.res-hour-row:hover:not(.disabled) {
  border-color: var(--color-royal-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(10, 31, 107, 0.05);
}

.res-hour-row.active {
  border-color: var(--color-royal-blue);
  background-color: var(--color-ice-blue);
  box-shadow: 0 0 0 2px var(--color-royal-blue);
}

.res-hour-row.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--color-bg-light);
}

.res-hour-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-deep-navy);
}

.res-occupancy-mini {
  flex: 1;
  max-width: 65px;
  margin: 0 6px;
}

.res-bar-container {
  height: 6px;
  background-color: var(--color-ice-blue);
  border-radius: 10px;
  overflow: hidden;
}

.res-bar-fill {
  height: 100%;
  border-radius: 10px;
}

.res-bar-label {
  font-size: 8px;
  color: var(--color-text-muted);
  display: block;
  text-align: center;
  margin-top: 2px;
}

.res-quota-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  text-align: center;
  min-width: 60px;
}

.res-quota-badge.available {
  background-color: rgba(0, 194, 168, 0.1);
  color: var(--color-state-free);
  border: 1px solid rgba(0, 194, 168, 0.2);
}

.res-quota-badge.low {
  background-color: rgba(255, 179, 0, 0.1);
  color: var(--color-state-mid);
  border: 1px solid rgba(255, 179, 0, 0.2);
}

.res-quota-badge.full {
  background-color: rgba(255, 77, 77, 0.1);
  color: var(--color-state-full);
  border: 1px solid rgba(255, 77, 77, 0.2);
}

.res-quota-badge.reserved {
  background-color: rgba(26, 62, 191, 0.1);
  color: var(--color-royal-blue);
  border: 1px solid rgba(26, 62, 191, 0.2);
}

/* Confirm reservation panel */
.res-confirm-panel {
  border-top: 1px dashed var(--color-border);
  padding-top: 12px;
  animation: fadeIn 0.3s ease;
}

.selected-summary {
  background-color: var(--color-ice-blue);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-deep-navy);
  margin-bottom: 10px;
}

.selected-summary strong {
  font-weight: 700;
}

/* Add reservation sim slider to sidebar console */
.sidebar-res-sim {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 16px;
  box-shadow: 0 4px 12px var(--color-shadow);
}

.sidebar-res-sim h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.sidebar-res-sim .control-group {
  margin-bottom: 12px;
}

.sidebar-res-sim .res-list {
  max-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px;
  background-color: var(--color-bg-light);
}

.sidebar-res-sim .res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  padding: 4px 6px;
  background-color: var(--color-white);
  border-radius: 4px;
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-royal-blue);
}

.sidebar-res-sim .res-cancel-btn {
  background: none;
  border: none;
  color: var(--color-state-full);
  cursor: pointer;
  font-weight: bold;
  padding: 0 4px;
}

/* Desktop Reservations Styling */
.desktop-reservations-section {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 24px;
  margin: 0 30px 30px 30px;
  box-shadow: 0 4px 15px var(--color-shadow);
}
.desktop-res-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 20px;
}
.desk-res-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.desk-res-left .user-credits-card {
  margin: 0;
}
.desk-res-left .reservation-flow-card {
  margin: 0;
  box-shadow: none;
  border: 1px solid var(--color-border);
}
.desk-res-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.desk-res-right .res-schedule-grid {
  max-height: 250px;
}
.desk-confirmed-res-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Confirmed reservation item styles (both Desktop and Mobile) */
.confirmed-res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  border-left: 4px solid var(--color-state-free);
  box-shadow: 0 2px 6px var(--color-shadow);
  transition: transform 0.2s;
}
.confirmed-res-item:hover {
  transform: translateY(-1px);
}
.confirmed-res-item .res-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.confirmed-res-item .res-info-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-deep-navy);
}
.confirmed-res-item .res-info-time {
  font-size: 10px;
  color: var(--color-text-muted);
}
.confirmed-res-item .btn-cancel {
  background: none;
  border: none;
  color: var(--color-state-full);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.confirmed-res-item .btn-cancel:hover {
  background-color: rgba(255, 77, 77, 0.1);
}


