/* ============================================================
   Admin Panel — Comisión Vecinal
   Modern dark sidebar + clean content area
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,600;12..96,700;12..96,800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

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

:root {
  --sidebar-w: 256px;
  --topbar-h: 60px;

  --ink:        #0c1a2e;
  --primary:    #1a3a6b;
  --primary-lt: #2554a0;
  --accent:     #e85d26;
  --accent-lt:  #ff7540;
  --gold:       #c9a84c;

  --bg:         #f5f3ef;
  --surface:    #ffffff;
  --surface-2:  #f0ede8;
  --border:     #e0dbd2;

  --text:       #1a1a1a;
  --text-2:     #4a4a4a;
  --text-muted: #7a7a7a;

  --sidebar-bg: #0c1a2e;
  --sidebar-border: rgba(255,255,255,.07);

  --shadow-sm: 0 1px 3px rgba(12,26,46,.08);
  --shadow:    0 4px 16px rgba(12,26,46,.10);
  --shadow-lg: 0 12px 40px rgba(12,26,46,.14);
  --radius:    10px;
  --radius-lg: 16px;
  --transition: all .2s cubic-bezier(.4,0,.2,1);

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Plus Jakarta Sans', system-ui, sans-serif;
}

html { font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-lt); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* === Layout === */
.admin-body { overflow-x: hidden; }
.admin-layout { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: .7rem;
  color: #fff; font-family: var(--font-display);
  font-size: .9rem; font-weight: 700; letter-spacing: -.01em;
}
.sidebar-logo:hover { color: var(--accent); }
.sidebar-close {
  color: rgba(255,255,255,.4); padding: .25rem;
  display: none; border-radius: 6px;
  transition: var(--transition);
}
.sidebar-close:hover { color: #fff; background: rgba(255,255,255,.08); }

.sidebar-nav { flex: 1; padding: .75rem; }
.nav-section { margin-bottom: .25rem; }
.nav-section-title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .85rem .75rem .4rem;
  display: block;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem .85rem;
  border-radius: var(--radius);
  color: rgba(255,255,255,.6);
  font-size: .875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .7; transition: var(--transition); }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  color: #fff;
  background: rgba(232,93,38,.18);
  font-weight: 600;
}
.nav-item.active svg { color: var(--accent-lt); opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: 50px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.user-info { display: flex; align-items: center; gap: .75rem; margin-bottom: .85rem; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.user-name { font-size: .875rem; font-weight: 600; color: #fff; }
.user-role { font-size: .72rem; color: rgba(255,255,255,.4); text-transform: capitalize; }
.sidebar-actions { display: flex; gap: .5rem; }
.btn-sidebar-link {
  flex: 1; text-align: center; padding: .45rem .6rem;
  border-radius: var(--radius); font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.7);
  transition: var(--transition);
}
.btn-sidebar-link:hover { background: rgba(255,255,255,.15); color: #fff; }
.btn-logout { background: rgba(232,93,38,.15); color: rgba(232,93,38,.9); }
.btn-logout:hover { background: rgba(232,93,38,.25); color: var(--accent-lt); }

/* === Main content === */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* === Topbar === */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.75rem;
  position: sticky;
  top: 0; z-index: 100;
}
.sidebar-toggle {
  color: var(--text-muted); padding: .35rem;
  border-radius: var(--radius); transition: var(--transition); display: none;
}
.sidebar-toggle:hover { color: var(--ink); background: var(--surface-2); }
.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions { display: flex; gap: .65rem; align-items: center; flex-shrink: 0; }

/* === Content area === */
.admin-content { padding: 2rem 1.75rem; flex: 1; }

/* === Alerts === */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 1.75rem 0;
  font-size: .875rem;
  display: flex; align-items: flex-start; gap: .75rem;
  border-left: 3px solid;
}
.alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.alert-danger  { background: #fff1f0; border-color: var(--accent); color: #b91c1c; }

/* === Stats cards === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-icon {
  width: 42px; height: 42px;
  background: var(--stat-bg, rgba(26,58,107,.08));
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.stat-icon svg { width: 20px; height: 20px; color: var(--stat-color, var(--primary)); }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -.04em;
  margin-bottom: .3rem;
}
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-change { font-size: .78rem; color: var(--text-muted); margin-top: .5rem; }
.stat-up   { color: #16a34a; }
.stat-down { color: var(--accent); }

.stat-primary { --stat-color: var(--primary-lt); --stat-bg: rgba(37,84,160,.08); }
.stat-accent  { --stat-color: var(--accent);     --stat-bg: rgba(232,93,38,.08); }
.stat-green   { --stat-color: #16a34a;            --stat-bg: rgba(22,163,74,.08); }
.stat-gold    { --stat-color: #b45309;            --stat-bg: rgba(180,83,9,.08); }

/* === Tables === */
.table-wrapper {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem; flex-wrap: wrap;
}
.table-header h3 { font-size: 1rem; margin: 0; }
.table-toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .85rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: .9rem 1.25rem;
  font-size: .875rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #faf9f7; }
.td-main { font-weight: 600; color: var(--ink); }

/* === Badges === */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25rem .7rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .7;
}
.badge-success   { background: #dcfce7; color: #15803d; }
.badge-warning   { background: #fef9c3; color: #a16207; }
.badge-danger    { background: #fee2e2; color: #b91c1c; }
.badge-info      { background: #dbeafe; color: #1d4ed8; }
.badge-primary   { background: rgba(37,84,160,.1); color: var(--primary-lt); }
.badge-secondary { background: var(--surface-2); color: var(--text-muted); }

/* === Action buttons in tables === */
.btn-action {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .75rem;
  border-radius: 50px;
  font-size: .78rem; font-weight: 600;
  transition: var(--transition); cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-2);
}
.btn-action:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-action svg { width: 14px; height: 14px; }
.btn-action-success { border-color: #bbf7d0; color: #15803d; background: #f0fdf4; }
.btn-action-success:hover { background: #15803d; border-color: #15803d; color: #fff; }
.btn-action-danger { border-color: #fecaca; color: #b91c1c; background: #fff1f0; }
.btn-action-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.3rem;
  border-radius: 50px;
  font-size: .875rem; font-weight: 600; font-family: var(--font-body);
  transition: var(--transition); line-height: 1; white-space: nowrap;
  cursor: pointer; border: 2px solid transparent;
}
.btn-primary   { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--primary); color: #fff; box-shadow: var(--shadow); }
.btn-accent    { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-lt); color: #fff; }
.btn-outline   { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-success   { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-sm  { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg  { padding: .75rem 1.75rem; font-size: .95rem; }
.btn-block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }

/* === Forms === */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; margin-bottom: .45rem; font-size: .85rem; color: var(--ink); }
.form-label .required { color: var(--accent); margin-left: .2rem; }
.form-control {
  display: block; width: 100%;
  padding: .68rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem; transition: var(--transition);
  background: var(--surface); color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary-lt); box-shadow: 0 0 0 3px rgba(37,84,160,.1); }
.form-control::placeholder { color: #b0aca4; }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.form-card-title {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}

/* === Filters bar === */
.filters-bar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex; gap: .85rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filters-bar label { font-size: .8rem; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.filter-control {
  padding: .45rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: .85rem;
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: var(--transition);
  font-family: var(--font-body);
}
.filter-control:focus { outline: none; border-color: var(--primary-lt); }

/* === Quick actions === */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .85rem;
}
.quick-action-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: .65rem;
}
.quick-action-item:hover { border-color: var(--ink); box-shadow: var(--shadow); transform: translateY(-2px); }
.quick-action-icon {
  width: 44px; height: 44px;
  background: var(--surface-2);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.quick-action-icon svg { width: 20px; height: 20px; color: var(--primary); transition: var(--transition); }
.quick-action-item:hover .quick-action-icon { background: var(--ink); }
.quick-action-item:hover .quick-action-icon svg { color: #fff; }
.quick-action-label { font-size: .82rem; font-weight: 600; color: var(--ink); }

/* === Chart bars === */
.chart-bar-list { display: flex; flex-direction: column; gap: .65rem; }
.chart-bar-item { display: flex; align-items: center; gap: .85rem; }
.chart-bar-label { font-size: .82rem; color: var(--text-2); white-space: nowrap; min-width: 90px; }
.chart-bar-track { flex: 1; background: var(--surface-2); border-radius: 50px; height: 10px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: var(--primary-lt); border-radius: 50px; transition: width .6s ease; }
.chart-bar-value { font-size: .82rem; font-weight: 700; color: var(--ink); min-width: 60px; text-align: right; }

/* === Upload zone === */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem; text-align: center;
  cursor: pointer; transition: var(--transition);
}
.upload-zone:hover { border-color: var(--primary-lt); background: rgba(37,84,160,.03); }
.upload-preview { max-width: 200px; max-height: 150px; border-radius: var(--radius); margin: .75rem auto 0; object-fit: cover; }

/* === Pagination === */
.pagination { display: flex; gap: .3rem; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }
.page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 .7rem;
  border-radius: 50px; background: var(--surface); color: var(--ink);
  font-size: .85rem; font-weight: 600; border: 1.5px solid var(--border);
  transition: var(--transition);
}
.page-link:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.page-link.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* === Overlay === */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 150;
  background: rgba(12,26,46,.5);
  backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* === Responsive === */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: flex; }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .admin-content { padding: 1.25rem 1rem; }
  .admin-topbar { padding: 0 1rem; }
  .table-header { padding: 1rem; }
  tbody td { padding: .75rem 1rem; }
  thead th { padding: .7rem 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .85rem; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .alert { margin: 1rem 1rem 0; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .stat-value { font-size: 1.5rem; }
  .stat-card { padding: 1.1rem; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .table-toolbar { flex-direction: column; width: 100%; }
  .table-toolbar .btn { width: 100%; justify-content: center; }
}

/* === Utility === */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-muted { color: var(--text-muted); font-size: .85rem; }
.text-center { text-align: center; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.d-flex{display:flex}.align-center{align-items:center}
.gap-1{gap:.5rem}.gap-2{gap:1rem}
.fw-600{font-weight:600}.fw-700{font-weight:700}
.color-accent{color:var(--accent)}.color-success{color:#16a34a}
.w-full{width:100%}


/* === Summary bar (bonos, listados) === */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}
.summary-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.summary-item:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.summary-item .label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .4rem;
}
.summary-item .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.03em;
  line-height: 1.1;
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.card-header h3 {
  font-size: .95rem;
  margin: 0;
  font-weight: 700;
}
.card-header-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* === Stat card color variants === */
.stat-card.blue,
.stat-card.stat-primary { --stat-color: var(--primary-lt); --stat-bg: rgba(37,84,160,.08); }
.stat-card.green,
.stat-card.stat-green { --stat-color: #16a34a; --stat-bg: rgba(22,163,74,.08); }
.stat-card.yellow,
.stat-card.stat-gold { --stat-color: #b45309; --stat-bg: rgba(180,83,9,.08); }
.stat-card.accent,
.stat-card.stat-accent { --stat-color: var(--accent); --stat-bg: rgba(232,93,38,.08); }
.stat-icon.blue,
.stat-icon.stat-primary { --stat-color: var(--primary-lt); --stat-bg: rgba(37,84,160,.08); }
.stat-icon.green,
.stat-icon.stat-green { --stat-color: #16a34a; --stat-bg: rgba(22,163,74,.08); }
.stat-icon.yellow,
.stat-icon.stat-gold { --stat-color: #b45309; --stat-bg: rgba(180,83,9,.08); }
.stat-icon.accent,
.stat-icon.stat-accent { --stat-color: var(--accent); --stat-bg: rgba(232,93,38,.08); }

/* === Extra buttons === */
.btn-light {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px solid var(--border);
}
.btn-light:hover {
  background: var(--surface-2);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-xs { padding: .28rem .65rem; font-size: .72rem; }

/* === Filters (bonos) === */
.filters-bar .form-group {
  flex: 1;
  min-width: 140px;
  margin-bottom: 0;
}
.filters-bar .form-label {
  font-size: .72rem;
  margin-bottom: .3rem;
  color: var(--text-muted);
}
.filters-actions {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
  flex-shrink: 0;
  padding-bottom: .1rem;
}

/* === Tables (clases usadas en bonos/reportes) === */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  padding: .85rem 1.25rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table tbody td {
  padding: .9rem 1.25rem;
  font-size: .875rem;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #faf9f7; }
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
}

/* === Chart (reportes) === */
.chart-container { padding: .5rem 0 1rem; overflow-x: auto; }
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: .65rem;
  min-height: 200px;
  padding: 1rem 0 .5rem;
}
.bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 48px;
}
.bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: var(--transition);
  cursor: default;
}
.bar:hover { opacity: .85; }
.bar-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: .7rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 4px;
}
.bar:hover .bar-tooltip { display: block; }
.bar-label {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: .5rem;
  text-align: center;
  max-width: 56px;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .summary-bar { grid-template-columns: 1fr; }
  .filters-bar .form-group { min-width: 100%; }
  .filters-actions { width: 100%; justify-content: stretch; }
  .filters-actions .btn { flex: 1; justify-content: center; }
}

/* === Marketplace admin additions === */
.cat-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .18rem .6rem;
    border-radius: 50px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.cat-vendo     { background: rgba(22,163,74,.12);  color: #15803d; }
.cat-compro    { background: rgba(37,84,160,.12);  color: #1d4ed8; }
.cat-cambio    { background: rgba(180,83,9,.12);   color: #b45309; }
.cat-servicios { background: rgba(109,40,217,.12); color: #6d28d9; }
.cat-busco     { background: rgba(232,93,38,.12);  color: #e85d26; }


/* ============================================================
   Login page
   ============================================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0c1a2e 0%, #1a3a6b 60%, #2554a0 100%);
    padding: 1.5rem;
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}
.login-logo svg { margin-bottom: .75rem; }
.login-logo h2 {
    font-family: var(--font-display, 'Bricolage Grotesque', sans-serif);
    font-size: 1.15rem;
    color: var(--ink);
    margin: .25rem 0 .15rem;
}
.login-logo p { font-size: .85rem; color: var(--text-muted); margin: 0; }

.login-form .form-group { margin-bottom: 1.1rem; }
.login-form .form-label {
    display: block;
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.login-form .form-control {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    color: var(--ink);
    background: var(--bg);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,58,107,.12);
    background: #fff;
}

.form-check { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.form-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

.btn-block { display: block; width: 100%; text-align: center; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: .82rem;
}
.login-footer a { color: var(--primary); text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }
