/* === PQRSD Colombia — Base Styles === */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:wght@400;700&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

:root {
  --color-primario:    #0A5C52;
  --color-acento:      #C8944A;
  --color-ink:         #1A1208;
  --color-muted:       #5C5448;
  --color-surface:     #FFFDF8;
  --color-sand:        #F5EDD8;
  --color-border:      #DDD4BE;
  --color-error:       #B91C1C;
  --color-success:     #1A5C2E;
  --color-white:       #FFFFFF;
  --font-display: 'Libre Baskerville', serif;
  --font-body:    'IBM Plex Sans', sans-serif;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 1px 3px rgba(26,18,8,0.08);
  --shadow-md:    0 4px 12px rgba(26,18,8,0.1);
  --shadow-lg:    0 8px 24px rgba(26,18,8,0.12);
  --max-width:    1140px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

a { color: var(--color-primario); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .625rem 1.5rem; border-radius: var(--radius); font-family: var(--font-body);
  font-size: .9rem; font-weight: 600; border: 2px solid transparent;
  cursor: pointer; transition: all .15s ease; text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--color-primario); color: var(--color-white);
  border-color: var(--color-primario);
}
.btn-primary:hover { background: #084a42; border-color: #084a42; }
.btn-outline {
  background: transparent; color: var(--color-primario);
  border-color: var(--color-primario);
}
.btn-outline:hover { background: var(--color-primario); color: var(--color-white); }
.btn-lg { padding: .875rem 2rem; font-size: 1rem; }
.btn-sm { padding: .375rem 1rem; font-size: .8rem; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Header */
.site-header {
  background: var(--color-white); border-bottom: 1px solid var(--color-border);
  padding: .875rem 0; position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
}
.municipio-logo { height: 48px; width: auto; border-radius: 4px; }
.municipio-info { flex: 1; }
.municipio-nombre {
  font-family: var(--font-display); font-size: 1.1rem; color: var(--color-primario);
  margin: 0; line-height: 1.2;
}
.municipio-sub { font-size: .8rem; color: var(--color-muted); margin: 0; }
.site-header nav { display: flex; gap: 1rem; align-items: center; }
.site-header nav a { font-size: .875rem; font-weight: 500; }
.btn-admin {
  background: var(--color-primario); color: var(--color-white) !important;
  padding: .375rem 1rem; border-radius: var(--radius); font-size: .8rem;
}
.btn-admin:hover { background: #084a42; text-decoration: none; }

/* Cards */
.card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: var(--shadow); transition: box-shadow .15s;
}
.card:hover { box-shadow: var(--shadow-md); }

/* Badges */
.badge {
  display: inline-block; padding: .2rem .6rem; border-radius: 4px;
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .02em;
}
.badge-PE { background: #EAF3FE; color: #1A5FA8; }
.badge-PI { background: #EEF0F8; color: #2D3580; }
.badge-PC { background: #E8F0FE; color: #1A4FA8; }
.badge-QU { background: #FEECEB; color: #8B1A1A; }
.badge-RE { background: #FFF3E0; color: #8B4500; }
.badge-SU { background: #E6F4EA; color: #1A5C2E; }
.badge-DE { background: #F5E8FE; color: #5C1A8B; }

.estado-radicado            { background: #F0F0F0; color: #444; }
.estado-en_revision         { background: #EAF3FE; color: #1A5FA8; }
.estado-en_tramite          { background: #FFF3E0; color: #8B4500; }
.estado-subsanacion_requerida { background: #FEF9EC; color: #7A4E00; }
.estado-respondida          { background: #E6F4EA; color: #1A5C2E; }
.estado-remitida            { background: #F5E8FE; color: #5C1A8B; }
.estado-cerrada             { background: #F0F0F0; color: #666; }
.estado-desistida_expresa,
.estado-desistida_tactica   { background: #F5F5F5; color: #888; }

/* Forms */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block; font-size: .875rem; font-weight: 500;
  margin-bottom: .375rem; color: var(--color-ink);
}
.field input, .field select, .field textarea {
  width: 100%; padding: .625rem .875rem; border: 1px solid var(--color-border);
  border-radius: var(--radius); font-family: var(--font-body); font-size: .9rem;
  background: var(--color-white); color: var(--color-ink);
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--color-primario);
  box-shadow: 0 0 0 3px rgba(10,92,82,0.1);
}
.field textarea { resize: vertical; min-height: 120px; }
.field-help { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; display: block; }
.field-error { font-size: .8rem; color: var(--color-error); margin-top: .25rem; display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
fieldset {
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 1.5rem; margin-bottom: 1.5rem;
}
fieldset legend {
  font-family: var(--font-display); font-size: 1rem; font-weight: 700;
  color: var(--color-primario); padding: 0 .5rem;
}
.checkbox-label {
  display: flex; gap: .5rem; align-items: flex-start; cursor: pointer;
  font-size: .875rem;
}
.checkbox-label input[type="checkbox"] { margin-top: .2rem; accent-color: var(--color-primario); }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: .5rem; top: .5rem; bottom: .5rem;
  width: 2px; background: var(--color-border);
}
.timeline-item { position: relative; padding-bottom: 1.5rem; }
.tl-dot {
  position: absolute; left: -1.75rem; top: .25rem; width: 14px; height: 14px;
  border-radius: 50%; border: 2px solid var(--color-border); background: var(--color-white);
}
.timeline-item.done .tl-dot { background: var(--color-primario); border-color: var(--color-primario); }
.timeline-item.active .tl-dot {
  background: var(--color-white); border-color: var(--color-primario);
  box-shadow: 0 0 0 4px rgba(10,92,82,0.15);
}
.tl-fecha { font-size: .75rem; color: var(--color-muted); }
.tl-content h4 { font-family: var(--font-body); font-size: .9rem; font-weight: 600; margin: .15rem 0; }
.tl-content p { font-size: .85rem; color: var(--color-muted); }

/* Alerts */
.alert {
  padding: 1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: .875rem;
}
.alert-success { background: #E6F4EA; color: var(--color-success); border: 1px solid #B7DFBF; }
.alert-error { background: #FEF2F2; color: var(--color-error); border: 1px solid #FECACA; }
.alert-info { background: #EAF3FE; color: #1A5FA8; border: 1px solid #BDD7F5; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .625rem .875rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th {
  font-weight: 600; color: var(--color-muted); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .03em; background: #FAFAF7;
}
tr:hover td { background: #FDFCF8; }

/* Metric cards */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.metric-card {
  background: var(--color-white); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.25rem; text-align: center;
}
.metric-value { font-size: 2rem; font-weight: 700; color: var(--color-primario); }
.metric-label { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; }

/* Footer */
.site-footer {
  background: var(--color-ink); color: rgba(255,255,255,0.7);
  padding: 2rem 0; margin-top: 3rem; font-size: .8rem;
}
.site-footer a { color: var(--color-acento); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.footer-brand { font-family: var(--font-display); color: var(--color-white); font-size: 1.1rem; margin-bottom: .5rem; }
.footer-bottom { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); text-align: center; }

/* Habeas Data notice */
.habeas-data-notice, .hd-block {
  background: var(--color-sand); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
  font-size: .85rem;
}

/* Success / Error boxes */
.success-box, .error-box {
  text-align: center; padding: 2rem; border-radius: var(--radius-lg);
}
.success-box { background: #E6F4EA; border: 1px solid #B7DFBF; }
.success-icon { font-size: 3rem; color: var(--color-success); margin-bottom: .5rem; }
.error-box { background: #FEF2F2; border: 1px solid #FECACA; }

/* Responsive */
@media (max-width: 768px) {
  h1 { font-size: 1.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .site-header .container { flex-wrap: wrap; }
  .site-header nav { width: 100%; justify-content: flex-end; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .metrics-grid { grid-template-columns: 1fr; }
}
