/* ============================================================
   ConsultaEC – Professional Dashboard Styles
   ============================================================ */

/* ── Variables ── */
:root {
  --sidebar-w: 268px;
  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-hover: #1e293b;
  --sidebar-active: #1e3a5f;

  --main-bg: #f1f5f9;
  --topbar-bg: #ffffff;
  --card-bg: #ffffff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-muted: #64748b;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --success: #059669;
  --success-bg: #d1fae5;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0891b2;
  --info-bg: #cffafe;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --transition: 0.18s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--main-bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.brand-icon {
  width: 38px; height: 38px;
  background: #1e3a5f;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -.3px;
}
.brand-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-sidebar-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* Search */
.sidebar-search-wrap {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color var(--transition);
  margin-bottom: 10px;
}
.sidebar-search-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.search-ico { color: #64748b; flex-shrink: 0; }
.sidebar-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  letter-spacing: .5px;
}
.sidebar-search-input::placeholder { color: #475569; }
.sidebar-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.sidebar-search-btn:hover:not(:disabled) { background: #2563eb; }
.sidebar-search-btn:disabled { opacity: .45; cursor: not-allowed; }
.sidebar-search-btn.loading { opacity: .8; }

.sidebar-hint {
  font-size: 11px;
  color: #f87171;
  padding: 4px 2px 0;
  min-height: 18px;
}

/* Nav */
.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}
.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-sidebar-muted);
  letter-spacing: 1.2px;
  padding: 4px 8px 8px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-sidebar);
}
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); }
.nav-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--ibg);
  color: var(--ic);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-text { flex: 1; min-width: 0; }
.nav-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #e2e8f0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-sub {
  display: block;
  font-size: 10.5px;
  color: var(--text-sidebar-muted);
}
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #334155;
  flex-shrink: 0;
  transition: background var(--transition);
}
.nav-dot.success { background: var(--success); }
.nav-dot.error   { background: var(--danger); }
.nav-dot.warning { background: var(--warning); }
.nav-dot.loading { background: #3b82f6; animation: pulse-dot .9s infinite; }

@keyframes pulse-dot {
  0%,100% { opacity: 1; }
  50%      { opacity: .4; }
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-footer-text {
  font-size: 10.5px;
  color: #475569;
  font-weight: 500;
}
.sidebar-footer-sub {
  font-size: 10px;
  color: #334155;
  margin-top: 2px;
}

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

/* Topbar */
.topbar {
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: none;
}
.sidebar-toggle:hover { background: var(--border-light); }
/* Breadcrumb */
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topbar-breadcrumb-home {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}
.topbar-breadcrumb-sep { color: var(--text-muted); flex-shrink: 0; }
.topbar-breadcrumb-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Toolbar actions */
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.toolbar-btn:hover {
  background: var(--border-light);
  border-color: #cbd5e1;
  color: var(--text-primary);
}
.toolbar-btn:disabled { opacity: .4; cursor: not-allowed; }
.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 4px;
}
.toolbar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
}
.toolbar-status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toolbar-status-dot.idle    { background: #94a3b8; }
.toolbar-status-dot.loading { background: #3b82f6; animation: pulse-dot .9s infinite; }
.toolbar-status-dot.ok      { background: var(--success); }
.toolbar-status-dot.error   { background: var(--danger); }
.toolbar-status-text {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}


/* ══════════════════════════════════════════════════════════
   RESULTS AREA
══════════════════════════════════════════════════════════ */
.results-area {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ── Data Section ── */
.data-section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 72px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(to right, #fafbfd, #ffffff);
  border-left: 4px solid var(--sh-color);
}
.section-icon {
  width: 36px; height: 36px;
  background: var(--ibg);
  color: var(--ic);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-title-group { flex: 1; min-width: 0; }
.section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.section-source {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* Status badge */
.sec-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.sec-badge.loading { background: #e0f2fe; color: #0369a1; }
.sec-badge.success { background: var(--success-bg); color: var(--success); }
.sec-badge.error   { background: var(--danger-bg);  color: var(--danger);  }
.sec-badge.warning { background: var(--warning-bg); color: var(--warning); }
.sec-badge.empty   { background: #f1f5f9; color: #94a3b8; }

.section-body { padding: 0; }

/* ── Profile Card (Datos Personales) ── */
.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: #fff;
}
.profile-avatar {
  width: 64px; height: 64px;
  background: #3b82f6;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.5px;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,.2);
}
.profile-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.3px;
}
.profile-cedula {
  font-size: 12px;
  color: #93c5fd;
  letter-spacing: 1.2px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.profile-tag {
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  padding: 3px 10px;
  color: #e0f2fe;
}

/* ── Data Grid ── */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border-light);
}
.data-cell {
  padding: 13px 20px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.data-cell:nth-child(even) { background: #fafbfd; }
.data-cell--full { grid-column: 1 / -1; background: #fafbfd !important; }
.dc-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  margin-bottom: 4px;
}
.dc-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
}
.dc-value.success { color: var(--success); }
.dc-value.danger  { color: var(--danger); }
.dc-value.warning { color: var(--warning); }

/* ── Procesos Judiciales ── */
.pj-summary {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-light);
  gap: 0;
}
.pj-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 2px;
}
.pj-summary-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}
.pj-summary-num--blue { color: #2563eb; }
.pj-summary-num--red  { color: #dc2626; }
.pj-summary-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.pj-summary-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.pj-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }

.pj-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  border-left: 4px solid #94a3b8;
  background: #fff;
  transition: box-shadow var(--transition);
}
.pj-card:hover { box-shadow: var(--shadow-md); }
.pj-card.rol-actor     { border-left-color: #3b82f6; }
.pj-card.rol-demandado { border-left-color: #dc2626; }

.pj-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-light);
}
.pj-left { flex: 1; min-width: 0; }
.pj-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
  margin-bottom: 3px;
}
.pj-materia {
  font-size: 12.5px;
  font-weight: 600;
  color: #334155;
}
.pj-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.pj-estado {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.pj-estado--activo   { background: #d1fae5; color: #065f46; }
.pj-estado--inactivo { background: #f1f5f9; color: #64748b; }
.pj-rol {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.rol-actor     .pj-rol { color: #2563eb; }
.rol-demandado .pj-rol { color: #dc2626; }

.pj-parties {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-light);
}
.pj-party { flex: 1; min-width: 0; }
.pj-party-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 2px;
}
.pj-party-val {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pj-party-arrow {
  color: #cbd5e1;
  flex-shrink: 0;
}

.pj-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
}
.pj-footer-left { flex: 1; min-width: 0; }
.pj-footer-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.pj-juzgado {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.pj-juzgado svg { flex-shrink: 0; margin-top: 1px; }

.pj-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.pj-fecha {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.pj-more {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

/* ── Clean / No-Data States ── */
.clean-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px;
  text-align: center;
  gap: 10px;
}
.cs-icon {
  width: 48px; height: 48px;
  background: #f0fdf4;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--success);
  margin-bottom: 4px;
}
.cs-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.cs-sub   { font-size: 12px; color: var(--text-muted); }

.no-data-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  gap: 8px;
  text-align: center;
  color: var(--text-muted);
}
.no-data-state svg { opacity: .35; }
.no-data-state p { font-size: 13px; }

/* Error state */
.error-state {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff5f5;
}
.error-state-icon {
  width: 36px; height: 36px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
  flex-shrink: 0;
}
.error-state-title { font-size: 13px; font-weight: 600; color: #991b1b; margin-bottom: 4px; }
.error-state-msg   { font-size: 12px; color: #b91c1c; line-height: 1.5; }
.error-state-hint  { font-size: 11px; color: #94a3b8; margin-top: 6px; }

/* ── Skeleton Loader ── */
.skel-block {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.skel-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: #1e293b;
}
.skel-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  flex-shrink: 0;
}
.skel-profile-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 13px;
}
.skel.dark {
  background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
  background-size: 200% 100%;
}
.skel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-light);
}
.skel-cell {
  background: #fff;
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.skel-short { width: 40%; }
.skel-med   { width: 65%; }
.skel-long  { width: 85%; }
.skel-full  { width: 100%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Inline tables ── */
.table-section { border-top: 1px solid var(--border-light); }
.table-title {
  padding: 10px 20px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .6px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border-light);
}
.resp-table { overflow-x: auto; }
.resp-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.resp-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 9px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.resp-table td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}
.resp-table tr:last-child td { border-bottom: none; }
.resp-table tr:hover td { background: #f8fafc; }

/* Pills inside tables */
.pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-warn    { background: var(--warning-bg); color: var(--warning); }
.pill-danger  { background: var(--danger-bg);  color: var(--danger);  }
.pill-info    { background: var(--info-bg);    color: var(--info);    }

/* ── Spinner (button loading) ── */
.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile Search Bar ── */
.mobile-searchbar {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--sidebar-border);
  position: sticky;
  top: 56px;
  z-index: 49;
}
.mobile-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color var(--transition);
}
.mobile-search-box:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.mobile-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  letter-spacing: .5px;
}
.mobile-search-input::placeholder { color: #475569; }
.mobile-search-btn {
  width: 100%;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
}
.mobile-search-btn:hover:not(:disabled) { background: #2563eb; }
.mobile-search-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 240px; }
}
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .mobile-searchbar { display: flex; }
  .results-area { padding: 16px; gap: 14px; }
  .data-grid { grid-template-columns: 1fr 1fr; }
  .profile-card { flex-direction: column; text-align: center; }
  .profile-tags { justify-content: center; }
  .skel-grid { grid-template-columns: 1fr 1fr; }
  .toolbar-btn span:not(.spinner) { display: none; }
  .toolbar-btn { padding: 6px 8px; }
}
@media (max-width: 480px) {
  .data-grid { grid-template-columns: 1fr; }
  .skel-grid { grid-template-columns: 1fr; }
  .query-meta { flex-direction: column; gap: 10px; align-items: flex-start; }
  .topbar { padding: 0 16px; }
}

/* ── Print ── */
@media print {
  .sidebar, .topbar, .query-meta .btn-new-search, #newSearchBtn { display: none !important; }
  .main { margin-left: 0 !important; }
  .results-area { padding: 0 !important; }
  .data-section { break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc !important; }
}
