: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 Megafonías TsSAEx --- */
.brand-name {
  color: var(--md-sys-color-primary);
  text-transform: none !important;
  font-variant: normal !important;
  letter-spacing: -0.5px;
}

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

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

.splash-logo {
  width: 100%;
  max-width: 250px;
  height: auto;
  margin-bottom: 30px;
  animation: pulse 2s infinite ease-in-out;
}

.loading-title {
  font-size: 2rem;
  margin-bottom: 24px;
  text-align: center;
}

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

/* --- LAYOUT GRID --- */
#app {
  display: none; /* Controlado por JS */
  flex-direction: column;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 24px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  align-items: start;
}

.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);
}

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

.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;
}
.radio-container label { display: flex; align-items: center; gap: 12px; cursor: pointer; }

/* --- ESTILOS REGULACIÓN --- */
#container-regulacion {
  /* display: none; El JS lo cambia a flex */
  background: rgba(109, 94, 0, 0.08); /* Uso del color primary con baja opacidad */
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px dashed var(--md-sys-color-primary);
  animation: slideIn 0.3s ease-out;
}

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

/* --- BOTONES Y ESPECIALES --- */
.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); }

/* --- EDITOR Y DIALOG --- */
.editor-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.parada-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr 40px; 
  gap: 8px; 
  margin-top: 10px; 
  align-items: center; 
}
.editor-actions { display: flex; gap: 10px; margin-top: 10px; }

.dialog-layout { display: flex; flex-direction: column; gap: 16px; min-width: 300px; padding-top: 12px; }

.json-preview {
  background: #1e1e1e; color: #c5e1a5; padding: 15px; border-radius: 12px;
  font-size: 0.8rem; overflow-x: auto; display: none;
}

/* Responsividad extra */
@media (min-width: 1100px) {
  .editor-card { grid-column: span 2; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .editor-controls { grid-template-columns: 1fr; }
  .parada-row { grid-template-columns: 1fr 1fr; }
  .top-app-bar h1 { font-size: 1.8rem; }
}