/* =====================================================
   PALETA — SEGUROS MORGAN COTA Y ASOCIADOS
   ===================================================== */
:root {
  --azul-profundo: #1B3A57;
  --terracota: #D97D54;
  --blanco-hueso: #FAF7F2;
  --gris-carbon: #3A3A3A;
  --gris-medio: #6B6B6B;
  --gris-suave: #D8D2C5;
  --gris-fondo: #EFEAE0;
  --rojo-error: #B23A3A;
  --verde-vigente: #2D6A4F;
  --naranja-lapso: #B8860B;
}

/* Reset y base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--blanco-hueso);
  color: var(--gris-carbon);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

/* =====================================================
   WORDMARK COMPLETO (Login)
   ===================================================== */
.wordmark-full {
  text-align: center;
  margin-bottom: 32px;
}

.wm-seguros {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 6px;
  color: var(--azul-profundo);
  margin-bottom: 16px;
}

.wm-apellidos {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 44px;
  font-weight: 500;
  font-style: italic;
  color: var(--azul-profundo);
  line-height: 1;
  margin-bottom: 14px;
}

.wm-line {
  width: 80px;
  height: 1px;
  background: var(--terracota);
  margin: 0 auto 14px;
}

.wm-asociados {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 5px;
  color: var(--azul-profundo);
  margin-bottom: 18px;
}

.wm-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: 1px;
  color: var(--terracota);
}

/* =====================================================
   WORDMARK COMPACTO (Header)
   ===================================================== */
.wordmark-compact {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  justify-content: center;
}

.wmc-seguros {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--azul-profundo);
}

.wmc-apellidos {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  color: var(--azul-profundo);
}

.wmc-asociados {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--azul-profundo);
}

/* =====================================================
   LOGIN
   ===================================================== */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: white;
  padding: 48px 40px;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(27, 58, 87, 0.08);
  width: 100%;
  max-width: 440px;
  border-top: 3px solid var(--terracota);
}

.subtitle {
  text-align: center;
  color: var(--gris-medio);
  margin-bottom: 24px;
  font-size: 14px;
}

/* =====================================================
   INPUTS Y BOTONES
   ===================================================== */
input, textarea, select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gris-suave);
  border-radius: 4px;
  font-size: 15px;
  margin-bottom: 12px;
  font-family: inherit;
  background: white;
  color: var(--gris-carbon);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--azul-profundo);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

.input-label {
  display: block;
  font-size: 12px;
  color: var(--gris-medio);
  margin-bottom: 4px;
  margin-top: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

input[type="file"] {
  padding: 8px;
}

button {
  width: 100%;
  padding: 12px 16px;
  background: var(--azul-profundo);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
  letter-spacing: 0.3px;
}

button:hover {
  background: #14304A;
}

button:disabled {
  background: var(--gris-medio);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--azul-profundo);
  border: 1px solid var(--gris-suave);
}

.btn-secondary:hover {
  background: var(--gris-fondo);
  border-color: var(--azul-profundo);
}

.btn-small {
  width: auto;
  padding: 8px 14px;
  font-size: 13px;
  background: var(--terracota);
}

.btn-small:hover {
  background: #C46640;
}

.btn-danger {
  background: var(--rojo-error);
}

.btn-danger:hover {
  background: #951F1F;
}

/* =====================================================
   ERRORES
   ===================================================== */
.error {
  color: var(--rojo-error);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* =====================================================
   HEADER
   ===================================================== */
header {
  background: white;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--gris-suave);
  gap: 16px;
}

header h1 {
  font-size: 22px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--azul-profundo);
  flex: 1;
  text-align: center;
}

header button {
  width: auto;
  padding: 8px 16px;
  font-size: 13px;
  flex-shrink: 0;
}

/* =====================================================
   TOOLBAR
   ===================================================== */
.toolbar {
  padding: 32px 32px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.toolbar h2 {
  font-family: 'Playfair Display', serif;
  font-size: 30px;
  font-weight: 500;
  color: var(--azul-profundo);
}

.toolbar button {
  width: auto;
  padding: 10px 20px;
}

/* =====================================================
   LISTA DE CLIENTES
   ===================================================== */
.clients-list {
  padding: 0 32px 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.client-card {
  background: white;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--gris-suave);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.client-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 58, 87, 0.1);
  border-color: var(--azul-profundo);
}

.client-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--azul-profundo);
  margin-bottom: 10px;
}

.client-card p {
  color: var(--gris-medio);
  font-size: 13px;
  margin-bottom: 4px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gris-medio);
  grid-column: 1 / -1;
}

/* =====================================================
   VISTA DETALLE DEL CLIENTE
   ===================================================== */
.client-info-section {
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.client-info-grid {
  background: white;
  padding: 28px;
  border-radius: 4px;
  border: 1px solid var(--gris-suave);
  border-top: 3px solid var(--terracota);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

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

.info-label {
  font-size: 11px;
  color: var(--gris-medio);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.info-value {
  font-size: 15px;
  color: var(--gris-carbon);
}

/* =====================================================
   DOCUMENTOS
   ===================================================== */
.documents-section {
  padding: 0 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.documents-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--azul-profundo);
}

.documents-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.document-item {
  background: white;
  padding: 14px 16px;
  border-radius: 4px;
  border: 1px solid var(--gris-suave);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-tipo {
  font-size: 10px;
  color: var(--terracota);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  margin-bottom: 2px;
}

.document-descripcion {
  font-size: 14px;
  color: var(--gris-carbon);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.document-actions button {
  width: auto;
  padding: 6px 10px;
  font-size: 12px;
}

.documents-empty {
  color: var(--gris-medio);
  font-size: 14px;
  font-style: italic;
  padding: 12px 0;
}

.modal-documents-section {
  margin: 16px 0;
  padding: 16px;
  background: var(--gris-fondo);
  border-radius: 4px;
}

.modal-documents-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--azul-profundo);
}

.modal-documents-section .documents-list {
  grid-template-columns: 1fr;
  margin-top: 10px;
}

/* =====================================================
   PÓLIZAS
   ===================================================== */
.policies-list {
  padding: 0 32px 32px;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.policy-card {
  background: white;
  padding: 20px;
  border-radius: 4px;
  border: 1px solid var(--gris-suave);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--azul-profundo);
}

.policy-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 58, 87, 0.1);
}

.policy-card.ramo-vida { border-left-color: var(--verde-vigente); }
.policy-card.ramo-autos { border-left-color: var(--terracota); }
.policy-card.ramo-gmm { border-left-color: var(--azul-profundo); }

.policy-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.policy-ramo {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gris-medio);
}

.policy-estatus {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.estatus-vigente {
  background: rgba(45, 106, 79, 0.12);
  color: var(--verde-vigente);
}

.estatus-cancelada {
  background: rgba(178, 58, 58, 0.12);
  color: var(--rojo-error);
}

.estatus-lapso {
  background: rgba(184, 134, 11, 0.12);
  color: var(--naranja-lapso);
}

.policy-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--azul-profundo);
  margin-bottom: 8px;
}

.policy-card p {
  color: var(--gris-medio);
  font-size: 13px;
  margin-bottom: 4px;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 87, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 4px;
  border-top: 3px solid var(--terracota);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--azul-profundo);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-actions button {
  flex: 1;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 600px) {
  header {
    flex-wrap: wrap;
    padding: 16px;
  }
  
  .wordmark-compact {
    order: -1;
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 8px;
  }
  
  .wmc-apellidos {
    font-size: 18px;
  }
  
  .toolbar {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    padding: 24px 16px 12px;
  }
  
  .toolbar button {
    width: 100%;
  }
  
  .clients-list, .policies-list, .documents-section, .client-info-section {
    padding-left: 16px;
    padding-right: 16px;
  }
}