/* ================================================================
   APROVIVA Portal – Shared Styles
   Villa Valencia · Costa Sur, Panama
   ================================================================ */

:root {
  --blue: #1A6BB8;
  --blue-dark: #145694;
  --blue-light: #e8f2fc;
  --blue-pale: #f0f7ff;
  --gold: #F5C842;
  --gold-dark: #d4a91a;
  --white: #ffffff;
  --gray: #f7f9fc;
  --text: #1a2340;
  --text-light: #5a6a85;
  --border: #dde6f0;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --red: #dc2626;
  --red-bg: #fef2f2;
}

/* ── RESET ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--gray);
  color: var(--text);
  min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.75rem;
  padding: 0.4rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

/* ── HEADER ── */
header {
  background: var(--white);
  border-bottom: 3px solid var(--gold);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26,107,184,0.08);
}

.logo-wrap, .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.logo-wrap img { height: 56px; width: auto; }

.brand-icon {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 1.3rem;
}

.logo-text, .brand-text { display: flex; flex-direction: column; }
.logo-text span:first-child, .brand-text strong {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
  font-weight: 700;
}
.brand-text strong {
  font-size: 1.1rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--blue-dark);
  display: block;
}
.logo-text span:last-child, .brand-text span {
  font-size: 0.7rem;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1rem;
  width: 100%;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--blue-dark); }

.btn-suggest {
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}
.btn-suggest:hover { background: var(--blue-dark); }

.btn-call {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-call:hover { background: var(--blue-dark); }

.btn-email {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-light);
  color: var(--blue);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-email:hover { background: var(--blue); color: var(--white); }

/* ── NAV ── */
nav {
  background: var(--blue);
  padding: 0 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
}
nav a:hover, nav a.active {
  color: var(--white);
  border-bottom-color: var(--gold);
  background: rgba(255,255,255,0.08);
}

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 60%, #2080d0 100%);
  color: var(--white);
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: var(--gold);
  opacity: 0.08;
  border-radius: 50%;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -30px;
  width: 250px; height: 250px;
  background: var(--gold);
  opacity: 0.05;
  border-radius: 50%;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  position: relative;
}
.hero p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  position: relative;
}
.hero-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--blue-dark);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  position: relative;
}

/* Hero variant: proveedores (left-aligned with stats) */
.hero--left {
  text-align: left;
  padding: 2.5rem 2rem;
}
.hero--left::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 28px;
  background: var(--gray);
  border-radius: 28px 28px 0 0;
}
.hero--left .hero-badge {
  background: rgba(245,200,66,0.2);
  border: 1px solid rgba(245,200,66,0.4);
  color: var(--gold);
}
.hero--left p { margin: 0 0 0; }
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.stat strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  display: block;
}
.stat span { font-size: 0.72rem; opacity: 0.75; }

/* ── MAIN LAYOUT ── */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--blue-dark);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-helper {
  margin: -0.35rem 0 1rem;
  color: var(--text-light);
  font-size: 0.84rem;
  line-height: 1.55;
  max-width: 720px;
}

/* ── CARDS GRID ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  border-color: var(--blue);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(26,107,184,0.14);
}
.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.9rem;
  font-size: 1.5rem;
}
.card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.card p {
  font-size: 0.75rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* ── TWO COLUMNS ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* ── PANEL ── */
.panel {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
}
.panel-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── COMUNICADOS ── */
.comunicado-item {
  display: flex;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.comunicado-item:last-child { border-bottom: none; }
.com-date {
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  text-align: center;
  min-width: 52px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
}
.com-body h4 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.com-body p { font-size: 0.75rem; color: var(--text-light); }
.com-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  margin-top: 0.25rem;
}

/* ── FORMS (PQRS + Suggest Provider) ── */
.pqrs-form label,
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  margin-top: 0.75rem;
}
.form-label { margin-top: 0; }
.req { color: var(--red); }

.pqrs-form select,
.pqrs-form input,
.pqrs-form textarea,
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--gray);
  outline: none;
  transition: border-color 0.2s;
}
.pqrs-form select:focus,
.pqrs-form input:focus,
.pqrs-form textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  background: var(--white);
}
.pqrs-form textarea,
.form-textarea { height: 80px; resize: none; }
.form-group { margin-bottom: 0.9rem; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ── FINANZAS TABLE ── */
.fin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.fin-table th {
  background: var(--blue-light);
  color: var(--blue-dark);
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-weight: 600;
}
.fin-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.fin-table tr:hover td { background: var(--gray); }
.budget-panel { margin-bottom: 2.5rem; }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap .fin-table {
  min-width: 560px;
}
.badge-ok { color: var(--green); font-weight: 600; }
.badge-pending { color: #d97706; font-weight: 600; }

.view-all {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.view-all:hover { text-decoration: underline; }

/* ── SIDEBAR (Proveedores) ── */
.main-sidebar {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
}
.sidebar-panel {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
  height: fit-content;
  position: sticky;
  top: 1rem;
}
.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.cat-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 0.82rem;
  color: var(--text);
  transition: all 0.15s;
  margin-bottom: 2px;
}
.cat-btn:hover { background: var(--blue-pale); color: var(--blue); }
.cat-btn.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.cat-icon { font-size: 0.95rem; width: 20px; text-align: center; }
.cat-count {
  margin-left: auto;
  background: var(--border);
  color: var(--text-light);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.cat-btn.active .cat-count { background: var(--blue); color: var(--white); }

/* ── PROVIDER CARDS ── */
.search-wrap { position: relative; margin-bottom: 1.25rem; }
.search-wrap input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}
.search-wrap input:focus { border-color: var(--blue); }
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.grid-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--blue-dark);
}
.grid-count { font-size: 0.8rem; color: var(--text-light); }

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.provider-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
  border: 1.5px solid transparent;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  cursor: pointer;
}
.provider-card:hover {
  border-color: var(--blue);
  box-shadow: 0 6px 20px rgba(26,107,184,0.12);
  transform: translateY(-2px);
}
.card-top { display: flex; align-items: flex-start; gap: 0.75rem; }
.card-avatar {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.card-service {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.badge-community {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--green-bg);
  color: var(--green);
  font-size: 0.67rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
  margin-top: 0.25rem;
}
.card-info { display: flex; flex-direction: column; gap: 0.3rem; }
.info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-light);
}
.info-row strong { color: var(--text); }
.info-icon { font-size: 0.82rem; width: 16px; text-align: center; flex-shrink: 0; }
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.1rem; }
.casa-chip {
  font-size: 0.7rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,40,80,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--blue-dark);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0.25rem;
}
.modal-desc {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  line-height: 1.5;
  background: var(--blue-pale);
  border-radius: 8px;
  padding: 0.75rem;
  border-left: 3px solid var(--blue);
}
.btn-submit {
  width: 100%;
  padding: 0.75rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--blue-dark); }
.approval-note {
  font-size: 0.72rem;
  color: var(--text-light);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.5;
}
.success-msg { display: none; text-align: center; padding: 1rem 0; }
.success-msg.show { display: block; }
.success-icon-wrap {
  width: 64px; height: 64px;
  background: var(--green-bg);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 1rem;
}
.success-msg h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--blue-dark);
  margin-bottom: 0.5rem;
}
.success-msg p { font-size: 0.82rem; color: var(--text-light); line-height: 1.6; }

/* Detail modal (proveedores) */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20,40,80,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.detail-overlay.open { display: flex; }
.detail-modal {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 0.75rem;
}
.detail-avatar {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.detail-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--blue-dark);
  margin-bottom: 0.25rem;
}
.detail-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}
.detail-row {
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  align-items: flex-start;
}
.detail-row:last-child { border-bottom: none; }
.detail-label {
  color: var(--text-light);
  font-size: 0.76rem;
  width: 90px;
  flex-shrink: 0;
  padding-top: 1px;
}
.detail-val {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
.detail-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

/* ── BUDGET DASHBOARD ── */
.budget-dashboard {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
}
.budget-month-bar {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  border-radius: 8px;
  border: 1.5px solid var(--border);
}
.budget-month-btn {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.25rem;
  border: none;
  background: var(--white);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border-right: 1px solid var(--border);
}
.budget-month-btn:last-child { border-right: none; }
.budget-month-btn:hover { background: var(--blue-pale); color: var(--blue); }
.budget-month-btn.disabled {
  color: var(--border);
  cursor: default;
  background: var(--gray);
}
.budget-month-btn.disabled:hover { background: var(--gray); color: var(--border); }
.budget-month-btn.active {
  background: var(--blue);
  color: var(--white);
}
.budget-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.budget-kpi {
  background: var(--gray);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
}
.budget-kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}
.budget-kpi-value.positive { color: var(--green); }
.budget-kpi-value.negative { color: var(--red); }
.budget-kpi-label {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.budget-kpi-sub {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}
.budget-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.budget-cat-card {
  background: var(--gray);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.budget-cat-card:hover { border-color: var(--blue); }
.budget-cat-card.expanded { border-color: var(--blue); background: var(--blue-pale); }
.budget-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.budget-cat-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.budget-cat-amount {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--blue);
}
.budget-cat-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.budget-cat-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.budget-cat-pct {
  font-size: 0.65rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  text-align: right;
}
.budget-trend-panel {
  background: var(--gray);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.budget-trend {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 160px;
  padding-top: 0.5rem;
}
.budget-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.budget-trend-stack {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
}
.budget-trend-seg {
  width: 100%;
  min-height: 1px;
  transition: height 0.3s ease;
}
.budget-trend-label {
  font-size: 0.6rem;
  color: var(--text-light);
  margin-top: 0.3rem;
  text-align: center;
  font-weight: 600;
}
.budget-trend-legend {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  justify-content: center;
}
.budget-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.65rem;
  color: var(--text-light);
}
.budget-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.budget-detail-panel { margin-bottom: 0.5rem; }
.budget-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  background: var(--gray);
  border-radius: 10px;
  overflow: hidden;
}
.budget-detail-table th {
  background: var(--blue-light);
  color: var(--blue-dark);
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.budget-detail-table th:last-child { text-align: right; }
.budget-detail-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.budget-detail-table td:last-child {
  text-align: right;
  font-weight: 600;
}
.budget-detail-table tr:last-child td { border-bottom: none; }
.budget-detail-table tr:hover td { background: var(--white); }

/* ── PQRS DASHBOARD ── */
.pqrs-dashboard {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 6px rgba(26,107,184,0.06);
}
.dash-loading, .dash-error {
  text-align: center;
  padding: 2rem;
  font-size: 0.85rem;
  color: var(--text-light);
}
.dash-error { color: var(--red); }
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dash-kpi {
  background: var(--gray);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
}
.dash-kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}
.dash-kpi-alta { color: var(--red); }
.dash-kpi-media { color: #d97706; }
.dash-kpi-baja { color: var(--green); }
.dash-kpi-label {
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.dash-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.dash-chart-panel {
  background: var(--gray);
  border-radius: 10px;
  padding: 1.25rem;
}
.dash-chart-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.dash-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.dash-bar-label {
  font-size: 0.75rem;
  color: var(--text);
  width: 140px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-bar-track {
  flex: 1;
  height: 20px;
  background: var(--white);
  border-radius: 4px;
  overflow: hidden;
}
.dash-bar-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  min-width: 2px;
  transition: width 0.4s ease;
}
.dash-bar-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  width: 28px;
  text-align: right;
  flex-shrink: 0;
}
.dash-recent-panel {
  background: var(--gray);
  border-radius: 10px;
  padding: 1.25rem;
}
.dash-recent-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.dash-recent-row:last-child { border-bottom: none; }
.dash-recent-date {
  font-size: 0.7rem;
  color: var(--text-light);
  width: 70px;
  flex-shrink: 0;
}
.dash-recent-tipo {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: var(--blue-light);
  color: var(--blue);
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-recent-desc {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-recent-urgencia {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-urg-alta { background: var(--red-bg); color: var(--red); }
.dash-urg-media { background: #fef9e7; color: #d97706; }
.dash-urg-baja { background: var(--green-bg); color: var(--green); }

/* ── FOOTER ── */
footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem;
  margin-top: 2rem;
  font-size: 0.8rem;
}
footer strong { color: var(--white); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .main-sidebar { grid-template-columns: 1fr; }
  header { flex-direction: column; gap: 1rem; height: auto; padding: 1rem; }
}
@media (max-width: 1024px) {
  header {
    height: auto;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
  }
  .logo-wrap, .brand {
    width: 100%;
  }
  .btn-primary,
  .btn-suggest,
  .btn-call,
  .btn-email,
  .btn-login {
    width: 100%;
    justify-content: center;
  }
  nav {
    padding: 0 1rem;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a { padding: 0.8rem 1rem; }
  main,
  .main-sidebar {
    margin-top: 1.5rem;
  }
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col,
  .main-sidebar {
    grid-template-columns: 1fr;
  }
  .panel,
  .budget-dashboard,
  .sidebar-panel,
  .provider-card,
  .card {
    min-width: 0;
  }
  .comunicado-item {
    gap: 0.8rem;
  }
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .budget-kpis { grid-template-columns: repeat(2, 1fr); }
  .budget-categories { grid-template-columns: 1fr; }
  .budget-month-btn { font-size: 0.6rem; padding: 0.4rem 0.15rem; }
  .dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .dash-charts { grid-template-columns: 1fr; }
  .dash-bar-label { width: 100px; }
  .dash-recent-date { display: none; }
}
@media (max-width: 640px) {
  header {
    padding: 0.9rem 1rem;
  }
  .logo-wrap, .brand {
    gap: 0.75rem;
    align-items: flex-start;
  }
  .logo-wrap img {
    height: 48px;
  }
  .logo-text span:first-child,
  .brand-text strong {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
  }
  .logo-text span:last-child,
  .brand-text span {
    font-size: 0.67rem;
    line-height: 1.3;
  }
  nav {
    padding: 0 0.75rem;
  }
  nav a {
    padding: 0.75rem 0.85rem;
    font-size: 0.78rem;
  }
  .hero {
    padding: 2.25rem 1rem;
  }
  .hero h1 {
    font-size: 1.65rem;
    line-height: 1.15;
  }
  .hero p {
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
  }
  main,
  .main-sidebar {
    padding: 0 1rem;
    margin: 1.25rem auto;
  }
  .section-title,
  .grid-title,
  .panel-title,
  .modal-title,
  .detail-name,
  .success-msg h3 {
    font-size: 1.05rem;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .card,
  .panel,
  .budget-dashboard,
  .sidebar-panel,
  .provider-card,
  .modal,
  .detail-modal {
    padding: 1rem;
    border-radius: 14px;
  }
  .card-icon,
  .detail-avatar,
  .success-icon-wrap {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
  }
  .brand-icon {
    padding: 6px 10px;
    font-size: 1.1rem;
  }
  .comunicado-item,
  .card-top,
  .detail-header,
  .detail-row,
  .dash-bar-row,
  .dash-recent-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .com-date,
  .dash-bar-label,
  .dash-bar-count,
  .dash-recent-date,
  .dash-recent-tipo,
  .dash-recent-urgencia,
  .detail-label {
    width: auto;
  }
  .form-row,
  .budget-kpis,
  .dash-kpis,
  .dash-charts {
    grid-template-columns: 1fr;
  }
  .table-wrap {
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
  }
  .table-wrap .fin-table {
    min-width: 540px;
    font-size: 0.75rem;
  }
  footer {
    padding: 1.25rem 1rem;
    font-size: 0.75rem;
  }
}

/* villa valencia responsive convergence */
@media (max-width: 1024px) {
  nav {
    scrollbar-width: auto;
    padding-bottom: 0.35rem;
  }

  nav::-webkit-scrollbar {
    display: block;
    height: 6px;
  }

  nav ul {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

@media (max-width: 820px) {
  .cards-grid,
  .form-row,
  .budget-kpis,
  .dash-kpis,
  .dash-charts {
    grid-template-columns: 1fr;
  }

  .sidebar-panel {
    position: static;
    top: auto;
  }
}
