/* ==========================================================================
   TOYOTA CHIAPAS & TOYOTA FARRERA PONIENTE
   Diseño Identico Corporate Executive Theme (Toyota Chiapas UI) - Sin Sidebar
   ========================================================================== */

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

:root {
  /* Toyota Corporate Brand Palette */
  --toyota-red: #d32f2f;
  --toyota-red-bright: #eb0a1e;
  --toyota-red-gradient: linear-gradient(135deg, #e52e2e 0%, #c62828 100%);
  --toyota-red-bg-light: #fef2f2;
  
  --bg-page: #f1f4f9;
  --bg-card: #ffffff;
  --border-card: #e2e8f0;
  --border-accent: #f1f5f9;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-label: #64748b;
  --text-light: #ffffff;
  
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-card-hover: 0 10px 30px rgba(0, 0, 0, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  --font-title: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Forzar la eliminación absoluta de la barra lateral en todos los dispositivos */
.sidebar-corporate, .sidebar-nav, .sidebar-watermark, .sidebar-brand {
  display: none !important;
}

/* App Master Layout */
.app-master-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  justify-content: center;
}

.main-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  background-color: var(--bg-page);
}

/* --------------------------------------------------------------------------
   HEADER & CABECERA CON PORTADA OFICIAL (Fondo DO.png)
   -------------------------------------------------------------------------- */
.header-dealership-banner {
  position: relative;
  height: 220px;
  width: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.55) 100%),
              url('../assets/fondo-do.png') center/cover no-repeat;
  padding: 1.2rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.header-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  z-index: 2;
  width: 100%;
}

.agencies-logo-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.agency-logo-img {
  height: 34px;
  width: auto;
  object-fit: contain;
}

.btn-header-pill-red {
  background: linear-gradient(135deg, #e52e2e 0%, #c62828 100%);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(229, 46, 46, 0.4);
  white-space: nowrap;
}

.btn-header-pill-white {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-decoration: none;
  white-space: nowrap;
}

/* Insignia Flotante de Perfil (Glass Card) */
.header-profile-floating-badge {
  position: absolute;
  bottom: -45px;
  left: 2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  z-index: 5;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.8rem 0.9rem 1rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
  max-width: calc(100% - 4rem);
}

.profile-avatar-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e52e2e 0%, #991b1b 100%);
  border: 4px solid #ffffff;
  box-shadow: 0 6px 16px rgba(229, 46, 46, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 900;
  flex-shrink: 0;
}

.profile-badge-text-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-badge-text-box h2 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.profile-badge-text-box p {
  font-size: 0.88rem;
  color: #475569;
  font-weight: 700;
  margin-top: 3px;
}

.profile-tag-red {
  display: inline-block;
  background-color: #d32f2f;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-top: 6px;
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   CUERPO Y TARJETAS DE INFORMACIÓN (17 CAMPOS)
   -------------------------------------------------------------------------- */
.body-container {
  padding: 5rem 2rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 900;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon-right {
  color: #94a3b8;
  width: 20px;
  height: 20px;
}

/* Grids Responsivos */
.cards-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
}

.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
}

.grid-2-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.subcards-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.field-card {
  background-color: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  width: 100%;
}

.field-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: #cbd5e1;
}

.field-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--toyota-red-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toyota-red);
  flex-shrink: 0;
}

.field-icon-wrapper svg {
  width: 18px;
  height: 18px;
}

.field-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.field-num-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  white-space: nowrap;
}

.field-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

#val_domicilio, #val_correo {
  white-space: normal !important;
  word-break: break-word;
  overflow: visible;
  text-overflow: clip;
}

.field-value.highlight-red {
  color: var(--toyota-red);
}

/* Alert Boxes */
.alert-box {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
}
.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fee2e2;
  color: #b91c1c;
}

/* --------------------------------------------------------------------------
   MODAL REPORTE DE DATO INCORRECTO
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-report-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.2rem 2.5rem;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-title-banner {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.modal-icon-badge {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background-color: var(--toyota-red-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toyota-red);
  flex-shrink: 0;
}

.modal-title-text h2 {
  font-family: var(--font-title);
  font-size: 1.7rem;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.2;
}

.modal-title-text h2 span { color: var(--toyota-red); }

.modal-title-text p {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.4;
}

.form-field-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.form-field-row.align-top { align-items: flex-start; }

.form-label-col {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 240px;
  flex-shrink: 0;
}

.form-label-col.align-top {
  align-items: flex-start;
  padding-top: 0.5rem;
}

.form-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background-color: var(--toyota-red-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toyota-red);
  flex-shrink: 0;
}

.form-row-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.form-row-label span.req { color: var(--toyota-red); }

.form-input-col { flex: 1; }

.form-control-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  outline: none;
}

.form-control-input.readonly {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

.modal-notice-banner {
  background-color: var(--toyota-red-bg-light);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.5rem;
  margin-bottom: 1.8rem;
}

.modal-notice-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(211, 47, 47, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--toyota-red);
  flex-shrink: 0;
}

.modal-notice-text {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.4;
}

.modal-footer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.btn-modal-cancel {
  padding: 0.85rem 2rem;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-modal-submit {
  padding: 0.85rem 2.2rem;
  background: var(--toyota-red-gradient);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 6px 20px rgba(229, 46, 46, 0.35);
}

.footer-master {
  text-align: center;
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 600;
  padding: 1.5rem 0 2rem 0;
}

/* ==========================================================================
   ADAPTACIÓN RESPONSIVA MULTIDISPOSITIVO
   ========================================================================== */

/* 1. TABLETS Y PANTALLAS MEDIANAS (768px - 1080px) */
@media (max-width: 1080px) {
  .cards-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2-columns { grid-template-columns: 1fr; }
  .subcards-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* 2. DISPOSITIVOS MÓVILES (SMARTPHONES < 768px) */
@media (max-width: 768px) {
  .sidebar-corporate, .sidebar-nav, .sidebar-watermark, .sidebar-brand {
    display: none !important;
  }

  .header-dealership-banner {
    height: auto;
    min-height: 240px;
    padding: 1rem 1.2rem 4rem 1.2rem;
  }

  .header-top-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  /* Alineación de los logos 100% a la izquierda */
  .agencies-logo-row {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100%;
  }

  .agency-logo-img {
    height: 32px;
  }

  .header-profile-floating-badge {
    position: relative;
    bottom: -30px;
    left: 0;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    flex-direction: column;
    text-align: center;
    padding: 1.2rem;
    gap: 0.8rem;
  }

  .profile-avatar-circle {
    width: 72px;
    height: 72px;
    font-size: 1.8rem;
  }

  .profile-badge-text-box {
    align-items: center;
  }

  .profile-badge-text-box h2 {
    font-size: 1.25rem;
  }

  .profile-tag-red {
    align-self: center;
  }

  .body-container {
    padding: 3.5rem 1rem 1.5rem 1rem;
    gap: 1.5rem;
  }

  /* Todas las grillas pasan a 1 columna completa en celular */
  .cards-grid-4, 
  .cards-grid-3, 
  .grid-2-columns, 
  .subcards-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .field-card {
    padding: 0.85rem;
  }

  .field-num-label {
    font-size: 0.65rem;
    white-space: normal !important;
    line-height: 1.2;
  }

  .field-value {
    font-size: 0.85rem;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }

  .modal-overlay {
    padding: 0.8rem;
  }

  .modal-report-card {
    padding: 1.4rem 1.2rem;
  }

  .form-field-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-label-col {
    width: 100%;
  }

  .modal-footer-row {
    flex-direction: column-reverse;
    gap: 0.8rem;
  }

  .btn-modal-cancel, .btn-modal-submit {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .header-profile-floating-badge {
    padding: 1rem 0.8rem;
  }
  .profile-badge-text-box h2 {
    font-size: 1.1rem;
  }
  .btn-header-pill-red, .btn-header-pill-white {
    font-size: 0.78rem;
    padding: 0.55rem 1rem;
  }
}
