:root {
  --md-sys-color-primary: #6d5e00;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-surface: #fefcf3;
  --md-sys-color-surface-container: #f5f4e8;
  --md-sys-color-surface-container-high: #ecebe0;
  --md-sys-color-secondary-container: #e8e2d0;
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-error-container: #ffdad6;
  --md-sys-color-on-error-container: #410002;
  font-family: 'Roboto', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background-color: var(--md-sys-color-surface);
  color: #1c1c16;
  overflow-x: hidden;
}

md-icon { font-family: 'Material Symbols Outlined' !important; }

/* --- MARCA --- */
.brand-name {
  color: var(--md-sys-color-primary);
  letter-spacing: -0.5px;
}

/* --- SPLASH SCREEN --- */
#loading-screen {
  position: fixed;
  inset: 0;
  background-color: var(--md-sys-color-surface);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 90%;
}

.splash-logo { width: 200px; height: auto; margin-bottom: 30px; animation: pulse 2s infinite ease-in-out; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* --- LAYOUT PRINCIPAL (DASHBOARD) --- */
#app {
  display: none; 
  flex-direction: column;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  gap: 24px;
}

.top-app-bar h1 { font-size: 2.2rem; font-weight: 400; margin: 0; }

.dashboard-grid {
  display: grid;
  /* 400px para botones, 1fr para el mapa */
  grid-template-columns: 400px 1fr;
  grid-template-areas: 
    "interior mapa"
    "exterior mapa"
    "especiales mapa"
    "volumen mapa";
  gap: 20px;
  align-items: start;
}

/* --- TARJETAS --- */
.m3-card {
  background-color: var(--md-sys-color-surface-container);
  border-radius: 28px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Asignación de áreas */
.m3-card:nth-child(1) { grid-area: interior; }
.m3-card:nth-child(2) { grid-area: exterior; }
.m3-card:nth-child(3) { grid-area: especiales; }
.m3-card:nth-child(4) { grid-area: volumen; }

.m3-card.secondary { background-color: var(--md-sys-color-secondary-container); }
.m3-card.specials-card { background-color: #fceee9; }

/* --- ESTILO ESPECÍFICO DEL MAPA --- */
.map-card { 
  grid-area: mapa; 
  padding: 0; /* Para que el mapa llegue al borde */
  overflow: hidden;
  height: 800px; /* Altura fija para que luzca en desktop */
  position: sticky;
  top: 24px;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* --- CONTROLES INTERNOS --- */
.vol-header { display: flex; align-items: center; gap: 10px; font-weight: 500; opacity: 0.8; }

.radio-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(0,0,0,0.04);
  padding: 16px;
  border-radius: 20px;
}

.button-grid-specials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.danger-btn { --md-filled-tonal-button-container-color: var(--md-sys-color-error-container); }

/* --- RESPONSIVIDAD --- */
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "mapa"
      "interior"
      "exterior"
      "especiales"
      "volumen";
  }
  .map-card { height: 400px; position: static; }
}

@media (max-width: 480px) {
  .top-app-bar h1 { font-size: 1.6rem; }
  .m3-card { padding: 16px; border-radius: 20px; }
}