/* =================================================================
   eBoleta Federal - Fluent Design 2, tema naranja
   ================================================================= */

:root {
  /* Marca (naranja) */
  --brand-shade10: #c43e00;
  --brand-shade20: #a03500;
  --brand: #ff6a00;
  --brand-tint10: #ff7f26;
  --brand-tint20: #ff984d;
  --brand-tint40: #ffc999;
  --brand-tint50: #ffe0c2;
  --brand-tint60: #fff1e6;

  /* Neutrales Fluent2 */
  --bg-canvas: #faf9f8;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f2f1;
  --border: #e1dfdd;
  --border-strong: #d2d0ce;
  --text-primary: #242424;
  --text-secondary: #616161;
  --text-tertiary: #8a8886;
  --text-on-brand: #ffffff;

  /* Estado */
  --success: #0f7b0f;
  --success-bg: #e8f5e8;
  --danger: #d13438;
  --danger-bg: #fdecea;
  --warning: #b25a00;
  --warning-bg: #fff1e6;

  /* Forma */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Sombras Fluent2 */
  --shadow-2: 0 1.6px 3.6px rgba(0, 0, 0, 0.13), 0 0.3px 0.9px rgba(0, 0, 0, 0.11);
  --shadow-4: 0 3.2px 7.2px rgba(0, 0, 0, 0.13), 0 0.6px 1.8px rgba(0, 0, 0, 0.11);
  --shadow-8: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.11);

  --font: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  --topbar-h: 52px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-canvas);
  -webkit-font-smoothing: antialiased;
}

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

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.icon-lg { width: 28px; height: 28px; }
.icon-sm { width: 16px; height: 16px; }

/* =================================================================
   Layout general
   ================================================================= */
.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-body {
  display: flex;
  flex: 1;
  min-height: calc(100vh - var(--topbar-h));
}

.main-content {
  flex: 1;
  padding: 24px 28px 60px;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 2px;
}

/* =================================================================
   Topbar
   ================================================================= */
.topbar {
  height: var(--topbar-h);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-shade10) 100%);
  color: var(--text-on-brand);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-4);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-on-brand);
  white-space: nowrap;
}
.topbar .brand:hover { text-decoration: none; }

.topbar .brand-logo {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar .brand-logo .icon { color: #fff; }

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.nav-toggle-btn {
  display: none;
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-on-brand);
  cursor: pointer;
  transition: background 0.1s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  color: var(--text-on-brand);
  position: relative;
}
.user-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand-shade10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.user-chip .user-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu {
  position: relative;
}
.user-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-8);
  min-width: 220px;
  padding: 8px;
  z-index: 200;
}
.user-menu:focus-within .user-menu-panel,
.user-menu.open .user-menu-panel {
  display: block;
}
.user-menu-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
}
.user-menu-panel a:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}
.user-menu-panel .menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 2px;
}
.user-menu-panel .menu-email {
  padding: 6px 10px 10px;
  color: var(--text-secondary);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  word-break: break-all;
}

/* =================================================================
   Sidebar
   ================================================================= */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 16px 10px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar .nav-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-tertiary);
  padding: 14px 12px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-subtle);
  text-decoration: none;
}
.nav-item .icon {
  color: var(--text-secondary);
}
.nav-item.active {
  background: var(--brand-tint60);
  color: var(--brand-shade10);
  font-weight: 600;
}
.nav-item.active .icon {
  color: var(--brand);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 4px;
  background: var(--brand);
}

.sidebar-footer-item {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* =================================================================
   Cards / Tarjetas
   ================================================================= */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 20px;
}

.card + .card {
  margin-top: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.summary-card .summary-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--brand-tint60);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.summary-card .summary-label {
  color: var(--text-secondary);
  font-size: 12.5px;
  margin-bottom: 2px;
}
.summary-card .summary-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}
.summary-card .summary-value.alt-danger { color: var(--danger); }
.summary-card .summary-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.summary-card a.summary-link {
  margin-top: 10px;
  align-self: flex-start;
}
.summary-card a.summary-link .icon-sm {
  width: 15px;
  height: 15px;
}

/* Tarjeta de deuda total, destacada, al final del resumen */
.summary-total {
  margin-top: 16px;
  align-items: center;
}
.summary-total .summary-icon {
  width: 48px;
  height: 48px;
}
.summary-total .summary-label {
  font-size: 13.5px;
}
.summary-total .summary-value {
  font-size: 26px;
}
.summary-total.has-debt {
  border-color: var(--danger);
  background: var(--danger-bg);
}
.summary-total.has-debt .summary-icon {
  background: var(--danger);
  color: #fff;
}

/* =================================================================
   Tabla de tasas
   ================================================================= */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--shadow-2);
}

table.tasas {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 760px;
}

table.tasas thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.tasas tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}

table.tasas tbody tr:last-child td {
  border-bottom: none;
}

table.tasas tbody tr:hover {
  background: var(--bg-subtle);
}

table.tasas td.total-col {
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge .icon { width: 14px; height: 14px; }
.badge-pagado { background: var(--success-bg); color: var(--success); }
.badge-vencido { background: var(--danger-bg); color: var(--danger); }
.badge-pendiente { background: var(--warning-bg); color: var(--warning); }

.row-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* -------- Tabla responsive: apilado tipo tarjeta en tablet/celular -------- */
@media (max-width: 820px) {
  .table-wrap {
    overflow-x: visible;
  }
  table.tasas {
    min-width: 0;
  }
  table.tasas thead {
    display: none;
  }
  table.tasas,
  table.tasas tbody,
  table.tasas tr,
  table.tasas td {
    display: block;
    width: 100%;
  }
  table.tasas tbody tr {
    padding: 6px 4px;
    border-bottom: 6px solid var(--bg-subtle);
  }
  table.tasas tbody tr:last-child {
    border-bottom: none;
  }
  table.tasas tbody tr:hover {
    background: transparent;
  }
  table.tasas tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border: none;
    white-space: normal;
    text-align: right;
  }
  table.tasas tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: left;
    flex-shrink: 0;
  }
  /* La celda de acciones ocupa toda la fila, sin etiqueta */
  table.tasas tbody td.acciones-col {
    justify-content: flex-start;
    padding-top: 10px;
  }
  table.tasas tbody td.acciones-col::before {
    display: none;
  }
  .row-actions {
    width: 100%;
  }
  .btn-pay {
    flex: 1;
  }
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-secondary);
}
.empty-state .icon {
  width: 44px;
  height: 44px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

/* =================================================================
   Acordeon de registros (varias partidas / nichos / comercios)
   ================================================================= */
.registros {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.registro-acordeon {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.registro-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.registro-head:hover {
  background: var(--bg-subtle);
}

.registro-head .registro-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--brand-tint60);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

.registro-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.registro-direccion {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--text-primary);
}

.registro-meta {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.registro-nro {
  font-weight: 600;
}

.registro-deuda-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  text-align: right;
}

.registro-deuda-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.registro-deuda-valor {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.registro-deuda-valor.alt-danger {
  color: var(--danger);
}

.registro-chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.registro-acordeon.open .registro-chevron {
  transform: rotate(180deg);
}

/* Cuerpo contraible */
.registro-body {
  display: none;
  border-top: 1px solid var(--border);
}

.registro-acordeon.open .registro-body {
  display: block;
}

/* La tabla adentro del acordeon no repite borde/sombra: ya los pone el acordeon */
.registro-body .table-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

/* Panel de datos catastrales dentro del acordeon (Inmobiliaria+Agua) */
.registro-detalle {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.registro-detalle .detalle-titulo {
  margin-top: 0;
}

@media (max-width: 560px) {
  .registro-head {
    flex-wrap: wrap;
  }
  .registro-deuda-box {
    align-items: flex-start;
    text-align: left;
    order: 3;
    width: 100%;
    flex-direction: row;
    gap: 6px;
    padding-left: 54px;
  }
}

/* =================================================================
   Mis asociaciones
   ================================================================= */
.asociaciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.asociacion-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 16px 18px;
}
.asociacion-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--brand-tint60);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.asociacion-info {
  flex: 1;
  min-width: 0;
}
.asociacion-tipo {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--brand);
}
.asociacion-dir {
  font-weight: 600;
  font-size: 14.5px;
  margin-top: 1px;
}
.asociacion-nro {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 1px;
}
.asociacion-deuda {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.asociacion-deuda b.alt-danger { color: var(--danger); }
.asociacion-ver {
  flex-shrink: 0;
  align-self: center;
}

.page-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  margin: 22px 0 12px;
}
.page-subhead .icon { width: 19px; height: 19px; color: var(--brand); }

/* =================================================================
   Accesos rapidos (inicio)
   ================================================================= */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.quick-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  font-weight: 600;
  color: var(--text-primary);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.quick-btn:hover {
  text-decoration: none;
  border-color: var(--brand);
  background: var(--bg-subtle);
}
.quick-btn .quick-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--brand-tint60);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =================================================================
   Banner de Chito (IA) y pagina de reclamos
   ================================================================= */
.chito-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--brand), var(--brand-shade10));
  color: #fff;
  box-shadow: var(--shadow-2);
}
.chito-avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chito-avatar { overflow: hidden; }
.chito-avatar .icon { width: 30px; height: 30px; color: #fff; }
.chito-avatar .chito-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chito-text { flex: 1; min-width: 0; }
.chito-title { font-weight: 700; font-size: 16px; }
.chito-sub { font-size: 13px; opacity: 0.92; margin-top: 2px; }
.chito-banner .btn-primary {
  background: #fff;
  color: var(--brand);
  flex-shrink: 0;
}
.chito-banner .btn-primary:hover { background: var(--bg-subtle); }
.chito-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.chito-intro p { margin: 0; color: var(--text-secondary); font-size: 13.5px; }
.chito-avatar-lg { background: var(--brand); }
.chito-avatar-lg .icon { color: #fff; }

@media (max-width: 560px) {
  .chito-banner { flex-wrap: wrap; }
  .chito-banner .btn-primary { width: 100%; justify-content: center; }
}

/* =================================================================
   Acciones en el encabezado de pagina
   ================================================================= */
.page-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =================================================================
   Modal (aviso de sesion)
   ================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-8);
  padding: 26px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.modal .modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--warning-bg);
  color: var(--warning);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal .modal-icon .icon { width: 28px; height: 28px; }
.modal h2 { font-size: 18px; margin-bottom: 6px; }
.modal p { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 18px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions .btn { flex: 1; }

/* =================================================================
   Detalle del comprobante (Inmobiliaria + Agua) y codigo de barras
   ================================================================= */
.detalle-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--brand);
  margin: 18px 0 10px;
}
.detalle-titulo .icon {
  width: 18px;
  height: 18px;
}
.detalle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 16px;
}
.detalle-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.detalle-item span {
  font-size: 11px;
  color: var(--text-secondary);
}
.detalle-item b {
  font-size: 13.5px;
  color: var(--text-primary);
}
.detalle-item-total {
  background: var(--brand-tint60);
  border-color: var(--brand-tint20);
}
.detalle-item-total b {
  color: var(--brand-shade10);
}

.barcode-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: center;
}
.barcode-caption {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.barcode-box .barcode {
  max-width: 100%;
  height: 48px;
}
.barcode-number {
  margin-top: 6px;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-primary);
}

/* =================================================================
   Botones
   ================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  line-height: 1.2;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-shade10); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-danger {
  background: var(--bg-surface);
  color: var(--danger);
  border-color: var(--border-strong);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn-sm {
  padding: 6px 10px;
  font-size: 12.5px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn-icon-only .icon { width: 17px; height: 17px; }

/* Boton Pagar con signo de peso */
.btn-pay {
  gap: 5px;
}
.btn-pay .peso-sign {
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}

.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* =================================================================
   Formularios
   ================================================================= */
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  padding: 0 10px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input-group:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint50);
}
.input-group .icon {
  color: var(--text-tertiary);
}
.input-group input,
.input-group select {
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  color: var(--text-primary);
}
.input-group button.toggle-visibility {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  padding: 4px;
}
input[type="text"].plain,
input[type="email"].plain,
input[type="tel"].plain,
select.plain,
textarea.plain {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-surface);
  color: var(--text-primary);
}
textarea.plain { resize: vertical; }
input.plain:focus,
select.plain:focus,
textarea.plain:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-tint50);
}
input.plain[readonly] { background: var(--bg-subtle); color: var(--text-secondary); }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  margin-bottom: 16px;
}
.alert-danger { background: var(--danger-bg); color: var(--danger); }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert .icon { flex-shrink: 0; margin-top: 1px; }

/* =================================================================
   Login
   ================================================================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, var(--brand-tint20), var(--brand-shade10) 70%);
}
.login-page {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-wrap .site-footer {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.login-wrap .site-footer .icon { color: #fff; }
.login-wrap .site-footer .footer-logo { filter: brightness(0) invert(1); opacity: 0.9; }

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-8);
  padding: 32px 30px;
}

.login-card .login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 19px;
  font-weight: 700;
  color: var(--brand);
}
.login-card .login-logo .brand-logo {
  width: 36px;
  height: 36px;
  background: var(--brand-tint60);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card p.login-subtitle {
  color: var(--text-secondary);
  margin: 0 0 22px;
  font-size: 13px;
}

.login-card .login-demo-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
}

/* =================================================================
   Footer
   ================================================================= */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 16px 28px;
  font-size: 12.5px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.site-footer .footer-logos {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer .footer-logo {
  height: 22px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  opacity: 0.85;
}
.site-footer .footer-logo.footer-logo-sm {
  height: 18px;
}

.site-footer .footer-contact {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-footer .footer-contact span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.site-footer .icon { color: var(--brand); }

/* =================================================================
   Responsive / mobile sidebar
   ================================================================= */
@media (max-width: 900px) {
  .nav-toggle-btn {
    display: inline-flex;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-8);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  body.nav-open::after {
    content: '';
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 80;
  }
  .main-content {
    padding: 18px 16px 40px;
  }
  .user-chip .user-name {
    display: none;
  }
}

/* =================================================================
   Impresion (comprobante.php)
   ================================================================= */
@media print {
  .topbar, .sidebar, .site-footer, .no-print {
    display: none !important;
  }
  .main-content {
    padding: 0;
  }
  body {
    background: #fff;
  }
  .card {
    box-shadow: none;
    border: 1px solid #999;
  }
}
