@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0C1B35;
  --navy-2: #0a1730;
  --gold: #C9A84C;
  --gold-light: #DDB96A;
  --surface: #F5F3F0;
  --panel: #FAFBFC;
  --border: #D8DDE3;
  --text: #111111;
  --text-muted: #6b7280;
  --danger: #A33B2E;
  --success: #4f8365;
  --warn: #c99a3f;
  --info: #5C7EA8;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }

.serif { font-family: 'Cormorant Garamond', serif; }

/* ---- App shell ---- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  background:
    radial-gradient(520px circle at 15% -15%, rgba(184,147,90,0.16), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, #090d15 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(180deg, black, transparent 65%);
  mask-image: linear-gradient(180deg, black, transparent 65%);
  pointer-events: none;
}
.sidebar-brand, .sidebar-nav, .sidebar-footer { position: relative; z-index: 1; }
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 4px 8px 20px 8px;
  border-bottom: 2px solid var(--gold);
  margin-bottom: 16px;
}
.sidebar-brand img { width: 44px; height: auto; }
.sidebar-brand .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}
.sidebar-brand .wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 9px;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: var(--navy); }
.sidebar-nav a.nav-destacado { margin-top: 6px; border: 1px solid rgba(201,168,76,0.5); font-weight: 700; }
.sidebar-nav a.nav-destacado.active { border-color: var(--gold); }
.sidebar-footer { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 14px; font-size: 12.5px; color: rgba(255,255,255,0.6); }
.sidebar-footer .logout { display: block; margin-top: 6px; color: var(--gold-light); }

.main { flex: 1; padding: 32px 40px; max-width: 1200px; }
.main h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px 0; }
.main .subtitle { color: var(--text-muted); margin-bottom: 24px; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--navy);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0,0,0,0.5);
}
.login-head {
  background: var(--navy);
  text-align: center;
  padding: 34px 20px 28px;
  border-bottom: 2px solid var(--gold);
}
.login-head img { height: 60px; width: auto; margin-bottom: 12px; }
.login-head .wordmark {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}
.login-head .wordmark-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 10px;
  font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.38em;
  text-transform: uppercase;
  margin-top: 10px;
}
.login-body { background: var(--panel); padding: 30px 32px 34px; }
.login-body label {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: #222; margin: 0 0 8px;
}
.login-card input {
  width: 100%; padding: 12px 14px; margin-bottom: 18px;
  border: 1px solid var(--border); border-radius: 6px; font-size: 16px;
  background: #F5F7F9; outline: none;
}
.login-card input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.14); }
.login-card button {
  width: 100%; padding: 13px; border: none; border-radius: 6px;
  background: var(--gold); color: var(--navy); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; cursor: pointer;
}
.login-card button:hover { background: var(--gold-light); }
.login-foot { background: var(--panel); text-align: center; font-size: 10.5px; color: #6B7280; padding: 0 24px 26px; letter-spacing: 0.04em; }
.login-error { color: var(--danger); font-size: 13px; background: #F9E9E6; border: 1px solid #EDCFC8; border-radius: 6px; padding: 11px 14px; margin-bottom: 16px; line-height: 1.5; }

/* ---- Cards / tables ---- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(14,20,32,0.04), 0 8px 24px rgba(14,20,32,0.05); }
.card-title { font-weight: 600; margin-bottom: 12px; font-size: 15px; }

.summary-row { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-card {
  flex: 1; min-width: 140px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
}
.summary-card::before { content: ''; position: absolute; top:0; left:0; right:0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.summary-card .num { font-size: 26px; font-weight: 700; color: var(--navy); }
.summary-card .label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; padding: 10px 12px; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.02em; border-bottom: 1px solid var(--border); }
.th-sort { color: inherit; cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--navy); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #fbfaf7; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-pendiente { background: #f2ecdf; color: var(--warn); }
.badge-notificado { background: #e4ecf5; color: #5c7ea8; }
.badge-pagado { background: #e5f0e8; color: var(--success); }
.badge-vencido { background: #f6e6e3; color: var(--danger); }

.btn { display: inline-block; padding: 9px 18px; border-radius: 999px; background: var(--navy); color: #fff; border: none; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-outline { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }

.search-bar { margin-bottom: 18px; }
.search-bar input { width: 320px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; }

input[type="text"], input[type="date"], input[type="number"], input[type="password"],
input[type="file"], select, textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, input[type="date"]:focus, input[type="number"]:focus, input[type="password"]:focus,
select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.16);
}

.muted { color: var(--text-muted); }
.link { color: var(--navy); font-weight: 600; }
.link:hover { color: var(--gold); }

.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }

/* ---- Reclamos: tarjetas, alertas, formularios propios de este sistema ---- */
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 8px; }

.tarjeta {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(14,20,32,0.04), 0 8px 24px rgba(14,20,32,0.05);
}
.tarjeta h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; color: var(--navy); }

.tarjetas-resumen { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.tarjeta-kpi {
  display: block;
  flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 18px; position: relative; overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
a.tarjeta-kpi:hover {
  box-shadow: 0 4px 16px rgba(14,20,32,0.10), 0 0 0 3px rgba(201,168,76,0.16);
  transform: translateY(-2px);
  border-color: var(--gold-light);
}
.tarjeta-kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
.tarjeta-kpi .kpi-num { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.tarjeta-kpi .kpi-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-top: 2px;
}
.kpi-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kpi-dot-success { background: var(--success); }
.kpi-dot-warn { background: var(--warn); }
.kpi-dot-danger { background: var(--danger); }
.kpi-dot-info { background: var(--info); }
.kpi-dot-gold { background: var(--gold); }
.kpi-dot-muted { background: var(--text-muted); }

.alerta { border-radius: 8px; padding: 11px 14px; margin-bottom: 16px; font-size: 13.5px; line-height: 1.5; }
.alerta-error { color: var(--danger); background: #F9E9E6; border: 1px solid #EDCFC8; }
.alerta-exito { color: var(--success); background: #E9F3EC; border: 1px solid #CDE5D4; }

.form-angosto { max-width: 460px; display: flex; flex-direction: column; gap: 4px; }
.form-angosto label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-top: 10px; }
.form-angosto input, .form-angosto select, .form-angosto textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13.5px; font-family: inherit; margin-top: 4px;
}
.form-angosto textarea { min-height: 80px; resize: vertical; }
.form-angosto button {
  align-self: flex-start; padding: 10px 22px; border: none; border-radius: 999px;
  background: var(--gold); color: var(--navy); font-weight: 600; font-size: 13.5px; cursor: pointer; margin-top: 18px;
}
.form-angosto button:hover { background: var(--gold-light); }

.form-filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.form-filtros input, .form-filtros select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit;
}
.form-filtros input[type="text"] { flex: 1; min-width: 220px; }
.form-filtros button {
  padding: 9px 20px; border: none; border-radius: 999px; background: var(--navy); color: #fff;
  font-weight: 600; font-size: 13.5px; cursor: pointer;
}
.form-filtros button:hover { background: var(--navy-2); }

.form-inline, .form-inline-anular {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px;
}
.form-inline input, .form-inline select, .form-inline textarea, .form-inline-anular input {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit;
}
.form-inline textarea { flex-basis: 100%; min-height: 60px; resize: vertical; }
.form-inline button, .form-inline-anular button {
  padding: 8px 16px; border: none; border-radius: 999px; background: var(--navy); color: #fff;
  font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.form-inline button:hover, .form-inline-anular button:hover { background: var(--navy-2); }

.linea-tiempo { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.linea-tiempo li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.5; }
.linea-tiempo li:last-child { border-bottom: none; }

.fila-anulada { opacity: 0.55; text-decoration: line-through; }

.urgencia-rojo { color: var(--danger); font-weight: 600; }
.urgencia-naranja { color: #C9722E; font-weight: 600; }
.urgencia-amarillo { color: var(--warn); font-weight: 600; }
.urgencia-verde { color: var(--success); font-weight: 600; }
.urgencia-gris { color: var(--text-muted); }

.fila-logos { display: flex; gap: 16px; flex-wrap: wrap; }
.logo-aseguradora {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 20px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); transition: border-color .15s, transform .15s;
}
.logo-aseguradora:hover {
  border-color: var(--gold); transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(14,20,32,0.10), 0 0 0 3px rgba(201,168,76,0.16);
}
.logo-aseguradora img { height: 48px; width: auto; max-width: 120px; object-fit: contain; }
.logo-iniciales {
  height: 48px; width: 48px; border-radius: 50%; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px;
}
.logo-nombre { font-size: 12px; color: var(--text-muted); text-align: center; }

.boton-atras {
  display: inline-block; margin-bottom: 14px; font-size: 13px; color: var(--text-muted);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
}
.boton-atras:hover { color: var(--navy); border-color: var(--gold); }

.linea-tiempo li .nota-edicion { display: none; margin-top: 6px; }
.linea-tiempo li.editando .nota-vista { display: none; }
.linea-tiempo li.editando .nota-edicion { display: block; }
.nota-edicion textarea { width: 100%; min-height: 60px; }

.form-filtros fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 8px 0; }
.form-filtros fieldset legend { font-size: 12px; color: var(--text-muted); padding: 0 6px; }
.form-filtros fieldset label { display: inline-block; margin: 3px 10px 3px 0; font-size: 13px; }

#ayuda-buscar {
  width: 100%; max-width: 480px; padding: 10px 14px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px; margin-bottom: 18px;
}
.ayuda-item { margin-bottom: 14px; }
.ayuda-item p { margin: 4px 0 0; color: var(--text-muted); }
