/* ============================================================
   MUNICIPALIDAD DE GUAZACAPÁN — PROFESSIONAL PORTAL DESIGN
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── TOKENS ──────────────────────────────────────────────── */
:root {
  --navy:        #0B1E3D;
  --navy-light:  #132848;
  --navy-mid:    #1a3560;
  --navy-dark:   #060f1e;
  --gold:        #F5C200;
  --gold-light:  #FFD900;
  --gold-dark:   #D4A800;
  --gold-bg:     rgba(245,194,0,.1);
  --success:     #10b981;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --info:        #3b82f6;
  --text:        #1e293b;
  --text-light:  #64748b;
  --text-muted:  #94a3b8;
  --bg:          #f8fafc;
  --bg2:         #f1f5f9;
  --white:       #ffffff;
  --border:      #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:      0 4px 12px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 30px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
  --shadow-xl:   0 20px 50px rgba(0,0,0,.16);
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --transition:  all .2s cubic-bezier(.4,0,.2,1);
}

/* ─── RESET ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section { padding: 56px 0; }
.bg-white { background: var(--white); }
.bg-navy { background: var(--navy); }

/* ─── TOPBAR ──────────────────────────────────────────────── */
.topbar {
  background: var(--navy-dark);
  color: rgba(255,255,255,.55);
  font-size: .75rem;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar-right a {
  color: var(--gold-light);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.topbar-right a:hover { color: white; }

/* ─── NAVBAR ──────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 24px rgba(0,0,0,.5);
  border-bottom: 2px solid rgba(232,150,42,.25);
}
.navbar .container { display: flex; align-items: center; gap: 16px; height: 72px; }
.navbar-brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; text-decoration: none; }
.navbar-brand img {
  width: 58px; height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
  transition: transform .2s;
}
.navbar-brand:hover img { transform: scale(1.05); }
.navbar-brand-icon {
  width: 58px; height: 58px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: var(--navy);
}
.navbar-brand-text { display: flex; flex-direction: column; gap: 1px; }
.navbar-brand-text h1 {
  font-size: 1.05rem; font-weight: 800; color: white;
  line-height: 1.15; letter-spacing: -.01em;
  white-space: nowrap;
}
.navbar-brand-text span {
  font-size: .72rem; color: var(--gold-light);
  font-weight: 500; letter-spacing: .03em;
}
.navbar-menu { display: flex; align-items: center; gap: 1px; margin-left: auto; }
.navbar-menu a {
  display: block; padding: 7px 11px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.78); font-size: .8rem; font-weight: 500;
  transition: var(--transition); white-space: nowrap;
}
.navbar-menu a:hover { color: white; background: rgba(255,255,255,.1); }
.navbar-menu a.active { color: var(--gold-light) !important; background: rgba(232,150,42,.14) !important; }
.navbar-cta {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)) !important;
  color: var(--navy) !important;
  font-weight: 700 !important;
  padding: 8px 18px !important;
  border-radius: var(--radius-sm) !important;
  margin-left: 6px !important;
}
.navbar-cta:hover { opacity: .9; transform: translateY(-1px); }
.navbar-toggle {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; border-radius: var(--radius-sm);
  transition: var(--transition); margin-left: auto;
}
.navbar-toggle:hover { background: rgba(255,255,255,.1); }
.navbar-toggle span { width: 22px; height: 2px; background: white; border-radius: 2px; display: block; }

/* ─── PAGE HEADER ─────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, #1e4080 100%);
  padding: 44px 0 40px;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.page-header .container { position: relative; }
.page-header h1 { font-size: 1.9rem; font-weight: 800; color: white; margin-bottom: 8px; }
.page-header p { color: rgba(255,255,255,.7); font-size: .95rem; }

/* ─── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb {
  background: var(--white);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .8rem; color: var(--text-light);
}
.breadcrumb a { color: var(--navy); }
.breadcrumb a:hover { color: var(--gold); }

/* ─── SECTION HEADER ──────────────────────────────────────── */
.section-header { text-align: center; margin-bottom: 44px; }
.section-tag {
  display: inline-block;
  background: var(--gold-bg);
  color: var(--gold-dark);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 12px;
  border: 1px solid rgba(232,150,42,.2);
}
.section-header h2 { font-size: 1.85rem; font-weight: 800; color: var(--navy); }
.section-divider {
  width: 52px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px; margin: 14px auto;
}
.section-header p { color: var(--text-light); max-width: 560px; margin: 0 auto; font-size: .95rem; }

/* ─── HERO ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, rgba(10,20,44,.88) 0%, rgba(15,30,65,.82) 40%, rgba(20,40,80,.80) 100%), url('../img/hero-bg.jpg') center center / cover no-repeat;
  padding: 88px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(232,150,42,.18) 0%, transparent 65%);
}
.hero .container { position: relative; z-index: 1; }
.hero-content { max-width: 680px; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(232,150,42,.15);
  color: var(--gold-light);
  border: 1px solid rgba(232,150,42,.3);
  padding: 5px 14px; border-radius: 50px;
  font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 900; color: white; line-height: 1.15;
  margin-bottom: 18px;
}
.hero h1 span { color: var(--gold-light); }
.hero p { color: rgba(255,255,255,.72); font-size: 1.05rem; line-height: 1.7; margin-bottom: 32px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(255,255,255,.08);
  border-radius: var(--radius); overflow: hidden;
  margin-top: 52px; border: 1px solid rgba(255,255,255,.1);
}
.hero-stat {
  padding: 20px 16px; background: rgba(255,255,255,.04);
  text-align: center; transition: var(--transition);
}
.hero-stat:hover { background: rgba(255,255,255,.08); }
.hero-stat-num { font-size: 1.75rem; font-weight: 900; color: var(--gold-light); line-height: 1; }
.hero-stat-lbl { font-size: .72rem; color: rgba(255,255,255,.55); margin-top: 4px; text-transform: uppercase; letter-spacing: .05em; }

/* ─── QUICK SERVICES ──────────────────────────────────────── */
.quick-services { background: var(--white); padding: 0; box-shadow: var(--shadow); position: relative; z-index: 10; }
.quick-services-grid { display: grid; grid-template-columns: repeat(6, 1fr); }
.quick-service-item {
  padding: 22px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; cursor: pointer; transition: var(--transition);
  border-right: 1px solid var(--border); border-bottom: 3px solid transparent; color: var(--text);
}
.quick-service-item:last-child { border-right: none; }
.quick-service-item:hover { background: var(--gold-bg); border-bottom-color: var(--gold); color: var(--navy); }
.quick-service-item .icon {
  width: 44px; height: 44px; background: var(--gold-bg); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: var(--gold-dark); transition: var(--transition);
}
.quick-service-item:hover .icon { background: var(--gold); color: var(--navy); }
.quick-service-item span { font-size: .75rem; font-weight: 600; color: inherit; }

/* ─── CARDS ───────────────────────────────────────────────── */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: var(--transition); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card-img { width: 100%; height: 200px; object-fit: cover; }
.card-img-placeholder { width: 100%; height: 200px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: rgba(255,255,255,.2); }
.card-body { padding: 20px; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; line-height: 1.4; }
.card-text { font-size: .85rem; color: var(--text-light); line-height: 1.6; }
.card-meta { font-size: .75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; }

/* ─── NEWS GRID ───────────────────────────────────────────── */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: var(--transition); }
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: transparent; }
.news-card-img { width: 100%; height: 185px; object-fit: cover; }
.news-card-img-placeholder { width: 100%; height: 185px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: rgba(255,255,255,.2); }
.news-card-body { padding: 18px; }
.news-card-title { font-size: .95rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-excerpt { font-size: .82rem; color: var(--text-light); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }

/* ─── OBRAS GRID ──────────────────────────────────────────── */
.obras-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.obra-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; transition: var(--transition); }
.obra-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.obra-card-header { padding: 16px 18px; background: linear-gradient(135deg, var(--navy), var(--navy-mid)); }
.obra-card-title { font-size: .95rem; font-weight: 700; color: white; margin-bottom: 4px; }
.obra-card-loc { font-size: .78rem; color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 5px; }
.obra-card-body { padding: 16px 18px; }
.obra-card-desc { font-size: .83rem; color: var(--text-light); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.obra-card-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.obra-budget { font-size: .82rem; font-weight: 700; color: var(--navy); }

/* ─── SERVICES GRID ───────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px 22px;
  text-align: center; transition: var(--transition);
  cursor: pointer; display: block; color: var(--text);
}
.service-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.service-card .icon {
  width: 62px; height: 62px; border-radius: 50%;
  background: var(--gold-bg); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--gold-dark); margin: 0 auto 16px;
  transition: var(--transition); border: 2px solid rgba(232,150,42,.2);
}
.service-card:hover .icon { background: var(--gold); color: var(--navy); transform: scale(1.08); }
.service-card h4 { font-size: .95rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.service-card p { font-size: .81rem; color: var(--text-light); line-height: 1.5; }

/* ─── TRANSPARENCY GRID ───────────────────────────────────── */
.trans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trans-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 26px 22px;
  display: block; color: var(--text); transition: var(--transition); text-align: center;
}
.trans-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.trans-card-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold-bg); display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin: 0 auto 14px;
  border: 2px solid rgba(232,150,42,.2); transition: var(--transition);
}
.trans-card:hover .trans-card-icon { background: var(--gold); }
.trans-card:hover .trans-card-icon i { color: var(--navy) !important; }
.trans-card h4 { font-size: .95rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.trans-card p { font-size: .82rem; color: var(--text-light); line-height: 1.5; }

/* ─── ALCALDE SECTION ─────────────────────────────────────── */
.alcalde-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  border-radius: var(--radius-lg); overflow: hidden;
  display: grid; grid-template-columns: 260px 1fr;
  box-shadow: var(--shadow-lg);
}
.alcalde-photo {
  background: rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  min-height: 300px; position: relative; overflow: hidden;
}
.alcalde-photo img { width: 100%; height: 100%; object-fit: cover; }
.alcalde-photo-placeholder {
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(232,150,42,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.8rem; color: var(--gold-light);
  border: 3px solid rgba(232,150,42,.3);
}
.alcalde-info { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; }
.alcalde-cargo { font-size: .72rem; font-weight: 700; color: var(--gold-light); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; }
.alcalde-nombre { font-size: 1.75rem; font-weight: 900; color: white; margin-bottom: 4px; }
.alcalde-periodo { font-size: .82rem; color: rgba(255,255,255,.5); margin-bottom: 18px; display: flex; align-items: center; gap: 6px; }
.alcalde-bio { font-size: .87rem; color: rgba(255,255,255,.72); line-height: 1.8; margin-bottom: 22px; }
.alcalde-actions { display: flex; gap: 10px; }

/* ─── FOLDER / INFOPUBLICA ────────────────────────────────── */
.folder-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.folder-card {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 24px 20px;
  cursor: pointer; transition: var(--transition); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.folder-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.folder-icon {
  width: 60px; height: 60px; border-radius: var(--radius);
  background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: var(--gold-dark);
  border: 2px solid rgba(232,150,42,.2); transition: var(--transition);
}
.folder-card:hover .folder-icon { background: var(--gold); color: var(--navy); }
.folder-name { font-size: .9rem; font-weight: 700; color: var(--navy); }
.folder-count { font-size: .75rem; color: var(--text-light); }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: var(--transition);
}
.file-item:hover { border-color: var(--gold); background: var(--gold-bg); }
.file-icon { width: 38px; height: 38px; border-radius: var(--radius-sm); background: rgba(239,68,68,.1); display: flex; align-items: center; justify-content: center; font-size: .9rem; color: #dc2626; flex-shrink: 0; }
.file-icon.word { background: rgba(59,130,246,.1); color: var(--info); }
.file-icon.excel { background: rgba(16,185,129,.1); color: var(--success); }
.file-icon.img { background: rgba(168,85,247,.1); color: #9333ea; }
.file-name { font-size: .85rem; font-weight: 600; color: var(--navy); line-height: 1.4; text-transform: capitalize; }
.file-info { flex: 1; min-width: 0; }
.file-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.file-ext { font-size: .65rem; font-weight: 700; background: var(--navy); color: white; padding: 1px 5px; border-radius: 3px; letter-spacing: .03em; }
.file-size { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.year-card .folder-icon { font-size: 2rem !important; }

/* ─── DOC LIST ────────────────────────────────────────────── */
.doc-list { display: flex; flex-direction: column; gap: 10px; }
.doc-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; background: var(--white);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: var(--transition);
}
.doc-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.doc-icon-wrap {
  width: 42px; height: 42px; border-radius: var(--radius-sm);
  background: var(--gold-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  border: 1px solid rgba(232,150,42,.2);
}
.doc-info { flex: 1; min-width: 0; }
.doc-info h4 { font-size: .88rem; font-weight: 700; color: var(--navy); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-info p { font-size: .75rem; color: var(--text-light); }
.doc-size { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border-radius: var(--radius-sm);
  font-size: .85rem; font-weight: 600;
  transition: var(--transition); cursor: pointer; border: none;
  white-space: nowrap; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy); box-shadow: 0 2px 8px rgba(232,150,42,.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(232,150,42,.4); filter: brightness(1.05); }
.btn-secondary { background: var(--navy); color: white; }
.btn-secondary:hover { background: var(--navy-mid); transform: translateY(-1px); }
.btn-outline-navy { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-outline-navy:hover { background: var(--navy); color: white; }
.btn-outline-gold { background: transparent; border: 2px solid var(--gold); color: var(--gold-dark); }
.btn-outline-gold:hover { background: var(--gold); color: var(--navy); }
.btn-ghost { background: rgba(255,255,255,.1); color: white; border: 1px solid rgba(255,255,255,.2); }
.btn-ghost:hover { background: rgba(255,255,255,.2); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-warning { background: var(--warning); color: white; }
.btn-sm { padding: 6px 13px; font-size: .78rem; }
.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ─── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 50px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}
.badge-primary   { background: rgba(11,30,61,.1);   color: var(--navy); }
.badge-warning   { background: rgba(245,158,11,.12); color: #92400e; }
.badge-success   { background: rgba(16,185,129,.12); color: #065f46; }
.badge-danger    { background: rgba(239,68,68,.1);  color: #991b1b; }
.badge-info      { background: rgba(59,130,246,.1);  color: #1e40af; }
.badge-secondary { background: var(--bg2); color: var(--text-light); }
.badge-gold      { background: rgba(232,150,42,.15); color: var(--gold-dark); }

/* ─── FORMS ───────────────────────────────────────────────── */
.form-section {
  background: var(--white); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 28px;
  box-shadow: var(--shadow-sm);
}
.form-section-title {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  padding-bottom: 14px; margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 9px;
}
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label { display: block; font-size: .82rem; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: .88rem; color: var(--text); background: var(--white);
  transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,30,61,.1); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }

/* ─── SEARCH WRAP ─────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-wrap i, .search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; pointer-events: none; }
.search-wrap .form-control { padding-left: 38px; }

/* ─── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .85rem; display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; }
.alert i { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: rgba(16,185,129,.1); color: #065f46; border: 1px solid rgba(16,185,129,.2); }
.alert-danger   { background: rgba(239,68,68,.1);  color: #991b1b; border: 1px solid rgba(239,68,68,.2); }
.alert-warning  { background: rgba(245,158,11,.1); color: #92400e; border: 1px solid rgba(245,158,11,.2); }
.alert-info     { background: rgba(59,130,246,.1);  color: #1e40af; border: 1px solid rgba(59,130,246,.2); }

/* ─── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 9000; display: none; align-items: center; justify-content: center;
  padding: 20px; backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl); width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp .25s cubic-bezier(.4,0,.2,1);
}
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 420px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-title { font-size: 1rem; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 9px; }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--text-light); font-size: 1.1rem; transition: var(--transition); }
.modal-close:hover { background: var(--danger); color: white; }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: var(--bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ─── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead { background: var(--navy); }
thead th { padding: 12px 14px; color: rgba(255,255,255,.85); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg); }
tbody td { padding: 12px 14px; color: var(--text); vertical-align: middle; }

/* ─── LOADER ──────────────────────────────────────────────── */
.loader { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; gap: 12px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin .7s linear infinite; }
.loader p { font-size: .85rem; color: var(--text-muted); }

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state-icon { font-size: 2.8rem; color: var(--text-muted); margin-bottom: 14px; opacity: .5; }
.empty-state h3 { font-size: 1.05rem; color: var(--text-light); margin-bottom: 8px; }
.empty-state p { font-size: .85rem; color: var(--text-muted); }

/* ─── PAGINATION ──────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.page-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 600; cursor: pointer; transition: var(--transition); color: var(--text-light); border: 1px solid var(--border); background: var(--white); }
.page-btn:hover { background: var(--navy); color: white; border-color: var(--navy); }
.page-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── FILTER PILLS ────────────────────────────────────────── */
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-pill { padding: 7px 16px; border-radius: 50px; font-size: .8rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: 1.5px solid var(--border); background: var(--white); color: var(--text-light); }
.filter-pill:hover { border-color: var(--navy); color: var(--navy); }
.filter-pill.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ─── YEAR TABS ───────────────────────────────────────────── */
.year-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.year-tab { padding: 8px 20px; border-radius: 50px; font-size: .85rem; font-weight: 700; cursor: pointer; transition: var(--transition); border: 2px solid var(--border); background: var(--white); color: var(--text-light); }
.year-tab:hover { border-color: var(--navy); color: var(--navy); }
.year-tab.active { background: var(--navy); color: white; border-color: var(--navy); }

/* ─── GRID HELPERS ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ─── LOGIN ───────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(232,150,42,.15) 0%, transparent 60%);
}
.login-box {
  background: var(--white); border-radius: var(--radius-xl);
  padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--shadow-xl); position: relative; z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(11,30,61,.3);
}
.login-logo h2 { font-size: 1.25rem; font-weight: 800; color: var(--navy); }
.login-logo p { font-size: .8rem; color: var(--text-light); }
.pass-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); padding: 6px; border-radius: var(--radius-xs); transition: var(--transition); }
.pass-toggle:hover { color: var(--navy); }

/* ─── ADMIN LAYOUT ────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg); }
.admin-sidebar {
  width: 260px; flex-shrink: 0;
  background: var(--navy);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  overflow-y: auto; z-index: 100;
  box-shadow: 4px 0 20px rgba(0,0,0,.2);
}
.sidebar-brand { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; }
.sidebar-brand-icon { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-dark)); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--navy); flex-shrink: 0; overflow: hidden; }
.sidebar-brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand-text h3 { font-size: .9rem; font-weight: 700; color: white; line-height: 1.2; }
.sidebar-brand-text span { font-size: .7rem; color: rgba(255,255,255,.45); }
.sidebar-user { margin: 16px; padding: 12px; background: rgba(255,255,255,.06); border-radius: var(--radius-sm); display: flex; align-items: center; gap: 10px; }
.sidebar-user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: .9rem; font-weight: 700; color: var(--navy); flex-shrink: 0; }
.sidebar-user-name { font-size: .8rem; font-weight: 600; color: white; }
.sidebar-user-role { font-size: .7rem; color: rgba(255,255,255,.45); }
.sidebar-section { padding: 8px 16px 4px; font-size: .65rem; font-weight: 700; color: rgba(255,255,255,.3); text-transform: uppercase; letter-spacing: .1em; margin-top: 8px; }
.sidebar-nav { padding: 6px 10px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65); font-size: .84rem; font-weight: 500;
  transition: var(--transition); cursor: pointer;
  text-decoration: none; margin-bottom: 2px;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: white; }
.sidebar-nav a.active { background: var(--gold); color: var(--navy); font-weight: 700; }
.sidebar-nav a .nav-badge { margin-left: auto; background: var(--danger); color: white; font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 50px; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; }
.admin-content { margin-left: 260px; display: flex; flex-direction: column; min-height: 100vh; }
.admin-topbar { background: var(--white); border-bottom: 1px solid var(--border); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); }
.admin-topbar-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.admin-topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-main { padding: 28px; flex: 1; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.section-title { font-size: 1.35rem; font-weight: 800; color: var(--navy); margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.section-title-left { display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--gold); }

/* ─── STAT CARDS ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; display: flex; flex-direction: column; gap: 8px; transition: var(--transition); }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-card-icon.gold { background: var(--gold-bg); color: var(--gold-dark); }
.stat-card-icon.navy { background: rgba(11,30,61,.1); color: var(--navy); }
.stat-card-icon.green { background: rgba(16,185,129,.1); color: var(--success); }
.stat-card-icon.red { background: rgba(239,68,68,.1); color: var(--danger); }
.stat-card-icon.blue { background: rgba(59,130,246,.1); color: var(--info); }
.stat-card-num { font-size: 1.8rem; font-weight: 900; color: var(--navy); line-height: 1; }
.stat-card-lbl { font-size: .74rem; color: var(--text-light); font-weight: 500; }
.stat-card-sub { font-size: .72rem; color: var(--text-muted); }

/* ─── TOGGLE ──────────────────────────────────────────────── */
.toggle-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track { width: 44px; height: 24px; border-radius: 12px; background: var(--border-dark); position: relative; transition: var(--transition); }
.toggle-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: white; transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle-switch input:checked + .toggle-track { background: var(--success); }
.toggle-switch input:checked + .toggle-track::after { left: 23px; }
.toggle-label { font-size: .85rem; font-weight: 600; color: var(--text); }

/* ─── FOOTER ──────────────────────────────────────────────── */
.footer { background: var(--navy-dark); color: rgba(255,255,255,.6); padding: 48px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 36px; }
.footer-brand-name { font-size: 1.1rem; font-weight: 800; color: white; margin-bottom: 8px; }
.footer-brand-desc { font-size: .83rem; line-height: 1.7; margin-bottom: 18px; color: rgba(255,255,255,.5); }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 34px; height: 34px; border-radius: var(--radius-sm); background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.6); font-size: .9rem; transition: var(--transition); }
.footer-social a:hover { background: var(--gold); color: var(--navy); }
.footer-col h4 { font-size: .85rem; font-weight: 700; color: white; margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col ul a { font-size: .8rem; color: rgba(255,255,255,.5); transition: var(--transition); }
.footer-col ul a:hover { color: var(--gold-light); }
.footer-col .contact-item { display: flex; align-items: flex-start; gap: 8px; font-size: .8rem; color: rgba(255,255,255,.5); margin-bottom: 8px; }
.footer-col .contact-item i { color: var(--gold); margin-top: 2px; flex-shrink: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; display: flex; justify-content: space-between; align-items: center; font-size: .75rem; }

/* ─── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px) } to { opacity: 1; transform: translateY(0) } }
@keyframes spin { to { transform: rotate(360deg) } }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid, .obras-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .trans-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .alcalde-card { grid-template-columns: 220px 1fr; }
}
@media (max-width: 768px) {
  .navbar-menu { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); padding: 12px; gap: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.3); }
  .navbar-menu.open { display: flex; }
  .navbar-menu a { border-radius: var(--radius-sm); padding: 11px 14px; }
  .navbar { position: relative; }
  .navbar-toggle { display: flex; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); margin-top: 36px; }
  .quick-services-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid, .obras-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .trans-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .folder-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .alcalde-card { grid-template-columns: 1fr; }
  .alcalde-photo { min-height: 200px; }
  .admin-sidebar { transform: translateX(-100%); transition: transform .3s; }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  section { padding: 40px 0; }
  .hero h1 { font-size: 1.5rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .quick-services-grid { grid-template-columns: repeat(2, 1fr); }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .trans-grid { grid-template-columns: 1fr; }
  .folder-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .modal { margin: 0; border-radius: var(--radius) var(--radius) 0 0; max-height: 95vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
}
