/* ====================================================
   CASA SEIXIDO · INTRANET DE GESTIÓN
   Paleta: ocean #1a3a4a | arena #f5f0e8 | ardora #2d6a5a | fondo #2d4a7a
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --ocean: #1a3a4a;
  --ocean-mid: #2d5a70;
  --ocean-light: #4a8fa8;
  --sand: #f5f0e8;
  --sand-dark: #e8dfc8;
  --coral: #e8614a;
  --gold: #c9a84c;
  --white: #fdfcfa;
  --text: #1a2530;
  --text-soft: #5a7080;
  --ardora: #2d6a5a;
  --ardora-light: #e8f4f0;
  --fondo: #2d4a7a;
  --fondo-light: #e8eef8;
  --booking: #003580;
  --vrbo: #195ABD;
  --airbnb: #FF5A5F;
  --personal: #c9a84c;
  --escapada: #6a8040;
  --toprutal: #8B4513;
  --sidebar-w: 240px;
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--sand);
  color: var(--text);
  min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--ocean);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo h1 {
  font-family: 'Playfair Display', serif;
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.sidebar-logo span {
  font-family: 'DM Sans', sans-serif;
  color: var(--ocean-light);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  display: block;
  margin-top: 4px;
}

.sidebar-nav {
  padding: 16px 12px;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  color: rgba(255,255,255,0.3);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 12px 6px;
  font-weight: 500;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.15s;
  margin-bottom: 2px;
  text-decoration: none;
}

.nav-item:hover { background: rgba(255,255,255,0.07); color: white; }
.nav-item.active { background: rgba(255,255,255,0.12); color: white; font-weight: 500; }
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.vivienda-pills {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.vivienda-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 4px;
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-ardora { background: #5bc4a0; }
.dot-fondo  { background: #6ba3e8; }

.vivienda-pill span {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}

/* ── MAIN ─────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────────────────── */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--sand-dark);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--ocean);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── BOTONES ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
}

.btn-primary { background: var(--ocean); color: white; }
.btn-primary:hover { background: var(--ocean-mid); }

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--sand-dark);
}
.btn-ghost:hover { background: var(--sand); }

.btn-coral { background: var(--coral); color: white; }
.btn-coral:hover { background: #d45035; }

.btn-ardora { background: var(--ardora); color: white; }
.btn-ardora:hover { background: #235a4a; }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-icon { padding: 6px 8px; }

/* ── CONTENT ──────────────────────────────────────── */
.content { padding: 32px; }

/* ── TABS ─────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 28px;
  background: var(--white);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--sand-dark);
  width: fit-content;
}

.tab {
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-soft);
  transition: all 0.15s;
}

.tab.active { background: var(--ocean); color: white; }
.tab:hover:not(.active) { background: var(--sand); }

/* ── STATS ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--sand-dark);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card.total::before   { background: var(--ocean); }
.stat-card.ardora::before  { background: var(--ardora); }
.stat-card.fondo::before   { background: var(--fondo); }
.stat-card.ocupacion::before { background: var(--gold); }

.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--ocean);
  font-weight: 600;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub { font-size: 12px; color: var(--text-soft); }

.stat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.badge-up   { background: #e8f5ee; color: #2d7a50; }
.badge-down { background: #fef0ee; color: #c04030; }
.badge-neutral { background: var(--sand); color: var(--text-soft); }

/* ── GRID ─────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

/* ── CARDS ────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--sand-dark);
  overflow: hidden;
}

.card-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--sand-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--ocean);
  font-weight: 600;
}

.card-body { padding: 20px; }

.section-full {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--sand-dark);
  margin-bottom: 20px;
  overflow: hidden;
}

/* ── CALENDARIO ───────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-day-label {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-soft);
  padding: 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-day {
  text-align: center;
  padding: 4px 2px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.cal-day-num { line-height: 1; }
.cal-day-name {
  font-size: 8px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 96%;
  opacity: 0.85;
  line-height: 1.1;
}

.cal-day.other-month { color: rgba(0,0,0,0.2); }
.cal-day.occupied-ardora { background: var(--ardora-light); color: var(--ardora); font-weight: 600; }
.cal-day.occupied-fondo  { background: var(--fondo-light); color: var(--fondo); font-weight: 600; }
.cal-day.occupied-both   { background: linear-gradient(135deg, var(--ardora-light) 50%, var(--fondo-light) 50%); }
.cal-day.today { font-weight: 700; color: var(--coral); outline: 2px solid var(--coral); outline-offset: -2px; }
.cal-day:hover:not(.other-month) { background: var(--sand-dark); }

.cal-legend {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-soft);
}

.cal-dot {
  width: 10px; height: 10px;
  border-radius: 2px;
}

/* ── TABLA RESERVAS ───────────────────────────────── */
.reservas-table {
  width: 100%;
  border-collapse: collapse;
}

.reservas-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--sand);
  border-bottom: 1px solid var(--sand-dark);
  white-space: nowrap;
}

.reservas-table td {
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--sand);
  vertical-align: middle;
}

.reservas-table tr:last-child td { border-bottom: none; }
.reservas-table tr:hover td { background: #faf8f4; }

/* ── BADGES ───────────────────────────────────────── */
.vivienda-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-ardora { background: var(--ardora-light); color: var(--ardora); }
.badge-fondo  { background: var(--fondo-light); color: var(--fondo); }

.canal-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: white;
  white-space: nowrap;
}

.canal-Booking      { background: var(--booking); }
.canal-VRBO         { background: var(--vrbo); }
.canal-Airbnb       { background: var(--airbnb); }
.canal-personal,
.canal-web,
.canal-Web\ Personal { background: var(--personal); color: #3a2800; }
.canal-Escapada\ Rural,
.canal-escapada     { background: var(--escapada); }
.canal-Top\ Rural,
.canal-toprutal     { background: var(--toprutal); }

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.1s;
}
.action-btn:hover { background: var(--sand-dark); color: var(--ocean); }

/* ── CHART ────────────────────────────────────────── */
.chart-container {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.chart-yaxis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 28px;
  padding-top: 4px;
  min-width: 36px;
  text-align: right;
}
.chart-yaxis span {
  font-size: 10px;
  color: var(--text-soft);
  line-height: 1;
}

.chart-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 220px;
  padding-bottom: 28px;
  padding-top: 4px;
  position: relative;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  align-self: stretch;
  position: relative;
  cursor: pointer;
}
.chart-bar-group:hover .chart-bar { opacity: 0.8; }

.chart-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: opacity 0.15s, filter 0.15s;
}
.bar-ardora { background: #5bc4a0; }
.bar-fondo  { background: #6ba3e8; }
.bar-total  { background: var(--ocean-mid); opacity: 0.75; }

.chart-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-soft);
  white-space: nowrap;
}

.chart-grid-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed var(--sand-dark);
}

.chart-tooltip {
  display: none;
  position: fixed;
  background: var(--ocean);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  line-height: 1.8;
  pointer-events: none;
  z-index: 999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  white-space: nowrap;
}
.chart-tooltip.visible { display: block; }

/* ── CANAL LIST ───────────────────────────────────── */
.canal-list { display: flex; flex-direction: column; gap: 10px; }

.canal-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canal-name {
  font-size: 12px;
  color: var(--text-soft);
  width: 100px;
  flex-shrink: 0;
}

.canal-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--sand-dark);
  border-radius: 4px;
  overflow: hidden;
}

.canal-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.canal-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--ocean);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── MODAL ────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,42,58,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 90%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.22);
}

.modal-header {
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--sand-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--ocean);
  font-weight: 600;
}

.modal-body { padding: 24px 28px; }

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--sand-dark);
}

/* ── FORMS ────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.full { grid-column: 1 / -1; }
.form-group.col3 { grid-column: span 1; }

.form-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.form-input, .form-select, .form-textarea {
  padding: 9px 12px;
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  transition: border 0.15s;
  outline: none;
  width: 100%;
}

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ocean-light);
  box-shadow: 0 0 0 3px rgba(74,143,168,0.12);
}

.form-input.error { border-color: var(--coral); }
.form-hint { font-size: 11px; color: var(--text-soft); margin-top: 2px; }
.form-error { font-size: 11px; color: var(--coral); margin-top: 2px; }

/* ── FACTURAS ─────────────────────────────────────── */
.factura-preview {
  background: white;
  border: 1px solid var(--sand-dark);
  border-radius: 10px;
  padding: 32px;
}

.factura-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--ocean);
}

.factura-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: var(--ocean);
  font-weight: 600;
}

.factura-num { color: var(--text-soft); font-size: 12px; margin-top: 4px; }

.factura-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.factura-block-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.factura-block p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--text);
}

.factura-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.factura-table th {
  background: var(--ocean);
  color: white;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.factura-table td {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--sand-dark);
}

.factura-total {
  text-align: right;
  padding-top: 16px;
  border-top: 2px solid var(--ocean);
}

.factura-total-label { font-size: 12px; color: var(--text-soft); }
.factura-total-value {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--ocean);
  font-weight: 600;
}

.factura-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--sand-dark);
  font-size: 10px;
  color: var(--text-soft);
  line-height: 1.6;
}

/* ── FILTER / SEARCH ──────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--sand);
  border: 1px solid var(--sand-dark);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-soft);
  width: 220px;
  cursor: text;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  width: 100%;
}

.filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.tag {
  display: inline-block;
  background: var(--sand);
  border: 1px solid var(--sand-dark);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.1s;
  white-space: nowrap;
}

.tag:hover, .tag.active {
  background: var(--ocean);
  color: white;
  border-color: var(--ocean);
}

/* ── AVATAR ───────────────────────────────────────── */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ocean-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── TOAST ────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  animation: slideIn 0.2s ease;
  min-width: 260px;
}

.toast-success { background: var(--ardora); color: white; }
.toast-error   { background: var(--coral); color: white; }
.toast-info    { background: var(--ocean); color: white; }

@keyframes slideIn {
  from { transform: translateX(60px); opacity: 0; }
  to   { transform: translateX(0);  opacity: 1; }
}

/* ── LOADING ──────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(245,240,232,0.8);
  z-index: 400;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.loading-overlay.show { display: flex; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--sand-dark);
  border-top-color: var(--ocean);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  font-size: 13px;
  color: var(--text-soft);
}

/* ── PAGES ────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── EMPTY STATE ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-soft);
}
.empty-icon  { font-size: 44px; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-text  { font-size: 13px; }

/* ── GASTOS ───────────────────────────────────────── */
.categoria-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--sand);
  color: var(--text-soft);
  border: 1px solid var(--sand-dark);
}

/* ── PAGINATION ───────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--sand);
}

.page-btn {
  width: 32px; height: 32px;
  border-radius: 6px;
  border: 1px solid var(--sand-dark);
  background: white;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.1s;
  font-family: 'DM Sans', sans-serif;
}

.page-btn:hover { background: var(--sand); }
.page-btn.active { background: var(--ocean); color: white; border-color: var(--ocean); }
.page-info { font-size: 12px; color: var(--text-soft); margin: 0 8px; }

/* ── PRÓXIMAS LLEGADAS ────────────────────────────── */
.llegada-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.llegada-item.ardora { background: var(--ardora-light); }
.llegada-item.fondo  { background: var(--fondo-light); }

.llegada-bar {
  width: 4px;
  height: 48px;
  border-radius: 2px;
  flex-shrink: 0;
}
.llegada-bar.ardora { background: var(--ardora); }
.llegada-bar.fondo  { background: var(--fondo); }

/* ── CLOSE BTN ────────────────────────────────────── */
.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-soft);
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.1s;
}
.close-btn:hover { background: var(--sand); color: var(--text); }

/* ── SEPARADOR ────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--sand-dark);
  margin: 16px 0;
}

/* ── TEXTO HELPERS ────────────────────────────────── */
.text-ardora { color: var(--ardora); }
.text-fondo  { color: var(--fondo); }
.text-coral  { color: var(--coral); }
.text-soft   { color: var(--text-soft); }
.text-bold   { font-weight: 700; }
.text-right  { text-align: right; }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }

/* ── MOBILE NAV ───────────────────────────────────── */
.mobile-nav { display: none; }

@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; padding-bottom: 80px; }
  .topbar { padding: 0 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .factura-section { grid-template-columns: 1fr; }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--ocean);
    padding: 8px 0 env(safe-area-inset-bottom, 16px);
    z-index: 100;
    justify-content: space-around;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: rgba(255,255,255,0.6);
    font-size: 10px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: all 0.15s;
  }

  .mobile-nav-item.active { color: white; }
  .mobile-nav-item .icon { font-size: 20px; }
}

@media (max-width: 500px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-right .search-bar { display: none; }
}

/* ── TABLA ANUAL ──────────────────────────────────── */
.annual-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.annual-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-soft);
  background: var(--sand);
  border-bottom: 1px solid var(--sand-dark);
}

.annual-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--sand);
}

.annual-table tr.current-year { background: var(--sand); font-weight: 700; }
.annual-table tr.current-year td { border-bottom: none; }

/* ── GASTOS CATEGORIAS ────────────────────────────── */
.gasto-cat-bar {
  width: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── IMPUTACIÓN ───────────────────────────────────── */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--sand-dark);
  font-size: 13px;
}

.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-soft); }
.info-value { font-weight: 600; }
