:root{
  --ds-font-sans: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --ds-bg: #f4f7fb;
  --ds-bg-soft: #eef3f9;
  --ds-surface: rgba(255,255,255,.88);
  --ds-surface-strong: #ffffff;
  --ds-surface-elevated: rgba(255,255,255,.96);
  --ds-text: #0f172a;
  --ds-text-soft: #475569;
  --ds-text-muted: #64748b;
  --ds-border: rgba(148,163,184,.22);
  --ds-border-strong: rgba(100,116,139,.26);
  --ds-primary: #1d4ed8;
  --ds-primary-2: #2563eb;
  --ds-primary-soft: rgba(37,99,235,.10);
  --ds-accent: #0f766e;
  --ds-success: #15803d;
  --ds-warning: #b45309;
  --ds-danger: #b91c1c;
  --ds-shadow-xs: 0 6px 14px rgba(15,23,42,.05);
  --ds-shadow-sm: 0 14px 34px rgba(15,23,42,.07);
  --ds-shadow-md: 0 20px 45px rgba(15,23,42,.10);
  --ds-shadow-lg: 0 28px 60px rgba(15,23,42,.16);
  --ds-radius-xs: 12px;
  --ds-radius-sm: 16px;
  --ds-radius-md: 22px;
  --ds-radius-lg: 28px;
  --ds-radius-xl: 34px;
  --ds-space-1: .35rem;
  --ds-space-2: .5rem;
  --ds-space-3: .75rem;
  --ds-space-4: 1rem;
  --ds-space-5: 1.25rem;
  --ds-space-6: 1.5rem;
  --ds-space-7: 1.75rem;
  --ds-space-8: 2rem;
  --ds-space-10: 2.5rem;
  --ds-transition-fast: 160ms cubic-bezier(.2,.8,.2,1);
  --ds-transition: 240ms cubic-bezier(.2,.8,.2,1);
  --ds-backdrop: blur(14px);
  --ds-sidebar-bg: linear-gradient(180deg, #0b1630 0%, #13213f 42%, #18284b 100%);
  --ds-sidebar-border: rgba(255,255,255,.08);
  --ds-sidebar-text: #e5edf8;
  --ds-sidebar-muted: #9fb3d1;
  --ds-sidebar-hover: rgba(255,255,255,.08);
  --ds-sidebar-active: linear-gradient(135deg, rgba(59,130,246,.26), rgba(14,165,233,.12));
}

html{
  font-family: var(--ds-font-sans);
  color-scheme: light;
}

body{
  background:
    radial-gradient(circle at 0% 0%, rgba(37,99,235,.10), transparent 25%),
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.08), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--ds-bg) 56%, #edf3f8 100%);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0));
}

.main{
  padding: 32px clamp(18px, 2.1vw, 34px);
}

.container,
.admin-page-shell,
.users-page-shell,
.premium-page,
.dashboard-page,
.registros-page,
.reuniones-shell,
.gacetas-shell,
.admin-shell{
  position:relative;
  z-index:1;
}

.page-header,
.admin-hero,
.gacetas-topbar,
.registros-page-header,
.consulta-header,
.reuniones-hero,
.users-hero-card,
.admin-hero-card{
  background: linear-gradient(180deg, rgba(255,255,255,.80), rgba(255,255,255,.68));
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-lg);
  padding: clamp(20px, 2vw, 30px);
  box-shadow: var(--ds-shadow-sm);
  backdrop-filter: var(--ds-backdrop);
}

.header-badge,
.section-badge,
.admin-mini-badge,
.section-chip-title,
.mini-pill,
.status-badge,
.badge,
.chip{
  backdrop-filter: blur(10px);
}

.sidebar{
  background: var(--ds-sidebar-bg);
  color: var(--ds-sidebar-text);
  border-right: 1px solid var(--ds-sidebar-border);
  box-shadow: 18px 0 46px rgba(2,6,23,.18);
  overflow:hidden;
}

.sidebar::before{
  content:"";
  position:absolute;
  inset:-20% auto auto -18%;
  width:240px;
  height:240px;
  border-radius:999px;
  background: radial-gradient(circle, rgba(59,130,246,.24) 0%, rgba(59,130,246,0) 70%);
  pointer-events:none;
}

.sidebar::after{
  content:"";
  position:absolute;
  inset:auto -18% 8% auto;
  width:260px;
  height:260px;
  border-radius:999px;
  background: radial-gradient(circle, rgba(14,165,233,.16) 0%, rgba(14,165,233,0) 68%);
  pointer-events:none;
}

.sidebar > *{position:relative;z-index:1;}

.sidebar-brand{
  align-items:center;
  margin-bottom: 20px;
}

.sidebar-brand strong,
.sidebar-brand-text h1{
  display:block;
  font-size: 1rem;
  color:#fff;
  margin:0 0 4px;
  letter-spacing:-.02em;
}

.sidebar-brand span,
.sidebar-brand-text p{
  color: var(--ds-sidebar-muted);
  display:block;
  line-height:1.45;
}

.sidebar-user,
.sidebar-user-card,
.sidebar-footer-card,
.sidebar-footnote{
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 28px rgba(2,6,23,.14);
}

.sidebar-user,
.sidebar-footnote,
.sidebar-user-card,
.sidebar-footer-card{
  padding: 14px 16px;
}

.sidebar-user strong,
.sidebar-user-card strong,
.sidebar-footer-card strong{
  color:#fff;
  font-size:.95rem;
  display:block;
  margin-bottom:4px;
}

.sidebar-user small,
.sidebar-footnote small,
.sidebar-footer-card span,
.sidebar-user-card small{
  display:block;
  color: var(--ds-sidebar-muted);
  line-height:1.45;
}

.sidebar-section-title{
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:#8bb5f4;
  margin: 18px 4px 6px;
}

.sidebar-link{
  position:relative;
  min-height:52px;
  border-radius: 18px;
  border-color: transparent;
  color: var(--ds-sidebar-text);
}

.sidebar-link::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius:inherit;
  background: transparent;
  transition: background var(--ds-transition), opacity var(--ds-transition), transform var(--ds-transition);
  opacity: 0;
}

.sidebar-link:hover::before,
.sidebar-link.is-active::before{
  opacity:1;
  background: var(--ds-sidebar-active);
}

.sidebar-link:hover,
.sidebar-link.is-active{
  transform: translateX(4px);
  border-color: rgba(255,255,255,.06);
  box-shadow: 0 14px 28px rgba(2,6,23,.14);
}

.sidebar-link > *{position:relative;z-index:1;}

.sidebar-link-icon{
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.sidebar-link.is-active .sidebar-link-icon{
  background: rgba(255,255,255,.14);
}

.sidebar-link-label{flex:1;}

.sidebar-link-subitem{margin-left:10px;width:calc(100% - 10px);}

.card,
.surface-card,
.section-card,
.module-panel,
.system-control-card,
.users-filter-card,
.users-table-card,
.chart-card,
.dashboard-table,
.table-shell,
.table-card,
.reuniones-filter-card,
.reuniones-table-card,
.reuniones-agenda-card,
.premium-card,
.console-panel-card,
.debug-card,
.admin-module,
.collection-item,
.premium-collection-item,
.section-subblock,
.diputado-subcard,
.diputado-form-section,
.registros-section-card,
.registros-summary-card,
.date-card-shell,
.info-chip,
.empty-state,
.listas-print-sheet,
.listas-print-toolbar{
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  border:1px solid var(--ds-border);
  border-radius: var(--ds-radius-md);
  box-shadow: var(--ds-shadow-sm);
  backdrop-filter: var(--ds-backdrop);
}

.card,
.surface-card,
.module-panel,
.premium-card,
.system-control-card,
.reuniones-table-card,
.reuniones-agenda-card,
.debug-card,
.console-panel-card,
.registros-section-card,
.registros-summary-card,
.section-card,
.section-subblock,
.collection-item,
.premium-collection-item,
.info-chip,
.empty-state{
  padding: clamp(18px, 1.8vw, 24px);
}

.stat-card,
.metric-card,
.users-stat-card,
.system-kpi,
.summary-item{
  position:relative;
  overflow:hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.88));
  border:1px solid rgba(148,163,184,.18);
  border-radius: 24px;
  box-shadow: var(--ds-shadow-sm);
  transition: transform var(--ds-transition), box-shadow var(--ds-transition), border-color var(--ds-transition);
}

.stat-card::after,
.metric-card::after,
.users-stat-card::after,
.system-kpi::after,
.summary-item::after{
  content:"";
  position:absolute;
  inset:auto -20% -30% auto;
  width:140px;
  height:140px;
  border-radius:999px;
  background: radial-gradient(circle, rgba(37,99,235,.10), rgba(37,99,235,0) 72%);
}

.stat-card:hover,
.metric-card:hover,
.users-stat-card:hover,
.system-kpi:hover,
.summary-item:hover,
.chart-card:hover,
.card:hover,
.surface-card:hover,
.module-panel:hover,
.section-card:hover,
.reuniones-table-card:hover,
.reuniones-agenda-card:hover,
.premium-card:hover,
.collection-item:hover,
.premium-collection-item:hover,
.empty-state:hover{
  transform: translateY(-3px);
  box-shadow: var(--ds-shadow-md);
  border-color: rgba(59,130,246,.18);
}

.dashboard-grid,
.users-stats-grid,
.reuniones-kpi-grid,
.system-kpi-grid,
.summary-stack,
.info-grid,
.stats-grid{
  gap: 18px;
}

.dashboard-grid,
.users-stats-grid,
.reuniones-kpi-grid,
.system-kpi-grid,
.stats-grid{
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card,
.users-stat-card,
.metric-card,
.system-kpi{
  padding: 22px;
}

.stat-icon,
.date-card-icon,
.admin-icon{
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(14,165,233,.08));
  border:1px solid rgba(37,99,235,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

h1,h2,h3,h4,h5,h6{
  letter-spacing:-.03em;
  color: var(--ds-text);
}

.page-header h1,
.admin-hero h1,
.gacetas-topbar h1,
.registros-page-header h1,
.consulta-header h1,
.reuniones-hero h1,
.users-hero-main h1,
.admin-hero-card h1{
  font-size: clamp(1.9rem, 2.8vw, 2.5rem);
  margin: 10px 0 10px;
}

.page-header p,
.admin-hero p,
.gacetas-topbar p,
.registros-page-header p,
.consulta-header p,
.reuniones-hero p,
.users-hero-main p,
.admin-hero-card p,
.helper-text,
.section-copy,
.card-header p,
.chart-header p,
.table-header p,
.modal-subtitle,
.field-help,
.info-copy{
  color: var(--ds-text-muted);
  line-height: 1.68;
}

.card-title,
.section-title,
.table-header h3,
.chart-header h3,
.card-header h3,
.section-head h3,
.subblock-header h3,
.diputado-subcard-head h5{
  font-size: 1.05rem;
  margin:0;
}

.field-group,
.field-block,
.campo,
.input-text,
.input-field,
.input-select,
.input-select-search,
.search-select,
.full,
textarea,
select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="tel"]{
  min-width:0;
}

.field-label,
.field-group > label,
.field-block > label,
label{
  display:block;
  margin-bottom: 8px;
  font-size: .84rem;
  font-weight: 700;
  color: #334155;
}

.campo,
.input-text,
.input-field,
.input-select,
.input-select-search,
.search-select,
textarea,
select,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="tel"]{
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border:1px solid rgba(148,163,184,.24);
  background: rgba(255,255,255,.92);
  color: var(--ds-text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 12px rgba(15,23,42,.03);
  outline:none;
  transition: border-color var(--ds-transition-fast), box-shadow var(--ds-transition-fast), transform var(--ds-transition-fast), background var(--ds-transition-fast);
}

textarea{min-height:120px;resize:vertical;}

.campo:hover,
.input-text:hover,
.input-field:hover,
.input-select:hover,
textarea:hover,
select:hover,
input:hover{
  border-color: rgba(59,130,246,.26);
}

.campo:focus,
.input-text:focus,
.input-field:focus,
.input-select:focus,
.input-select-search:focus,
.search-select:focus,
textarea:focus,
select:focus,
input:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.10), 0 10px 22px rgba(37,99,235,.08);
  transform: translateY(-1px);
  background: #fff;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-sm,
.btn-table,
.btn-table-action,
button[type="submit"],
button[type="button"]{
  position:relative;
  border-radius: 16px;
  min-height: 44px;
  padding: 10px 16px;
  font-weight: 700;
  border:1px solid transparent;
  cursor:pointer;
  transition: transform var(--ds-transition-fast), box-shadow var(--ds-transition-fast), background var(--ds-transition-fast), border-color var(--ds-transition-fast), color var(--ds-transition-fast);
}

.btn-primary,
button[type="submit"],
.btn-table-action:not(.danger):not(.secondary):not(.btn-secondary):not(.btn-ghost){
  color:#fff;
  background: linear-gradient(135deg, var(--ds-primary) 0%, var(--ds-primary-2) 100%);
  box-shadow: 0 16px 30px rgba(37,99,235,.22);
}

.btn-primary:hover,
button[type="submit"]:hover,
.btn-table-action:not(.danger):not(.secondary):not(.btn-secondary):not(.btn-ghost):hover{
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(37,99,235,.28);
}

.btn-secondary,
.btn-sm.secondary,
.btn-table.secondary,
.btn-table-action.secondary{
  color: var(--ds-text);
  border-color: rgba(148,163,184,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.88));
  box-shadow: var(--ds-shadow-xs);
}

.btn-secondary:hover,
.btn-sm.secondary:hover,
.btn-table.secondary:hover,
.btn-table-action.secondary:hover,
.btn-ghost:hover{
  transform: translateY(-1px);
  border-color: rgba(37,99,235,.20);
  box-shadow: var(--ds-shadow-sm);
}

.btn-ghost{
  border-color: rgba(148,163,184,.18);
  background: rgba(255,255,255,.68);
  color: var(--ds-text-soft);
}

.danger,
.btn-table-action.danger,
.btn-danger,
.btn-danger-lite{
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: rgba(185,28,28,.2);
  box-shadow: 0 16px 30px rgba(185,28,28,.18);
}

.danger:hover,
.btn-table-action.danger:hover,
.btn-danger:hover,
.btn-danger-lite:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(185,28,28,.24);
}

.table-wrap,
.table-responsive,
.premium-table-shell,
.table-shell{
  overflow:auto;
  border-radius: 20px;
}

.premium-table,
.users-premium-table,
.tabla-registros,
.reuniones-table,
table{
  width:100%;
  border-collapse: separate;
  border-spacing: 0;
}

.premium-table thead th,
.users-premium-table thead th,
.tabla-registros thead th,
.reuniones-table thead th,
thead th{
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, #f8fbff, #eef4fb);
  color:#334155;
  font-size: .79rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom:1px solid rgba(148,163,184,.20);
  padding: 14px 16px;
}

.premium-table tbody td,
.users-premium-table tbody td,
.tabla-registros tbody td,
.reuniones-table tbody td,
tbody td{
  padding: 14px 16px;
  border-bottom:1px solid rgba(226,232,240,.85);
  vertical-align:top;
  color: var(--ds-text-soft);
}

.premium-table tbody tr,
.users-premium-table tbody tr,
.tabla-registros tbody tr,
.reuniones-table tbody tr,
tbody tr{
  transition: transform var(--ds-transition-fast), background var(--ds-transition-fast), box-shadow var(--ds-transition-fast);
}

.premium-table tbody tr:nth-child(even),
.users-premium-table tbody tr:nth-child(even),
.tabla-registros tbody tr:nth-child(even),
.reuniones-table tbody tr:nth-child(even),
tbody tr:nth-child(even){
  background: rgba(248,250,252,.54);
}

.premium-table tbody tr:hover,
.users-premium-table tbody tr:hover,
.tabla-registros tbody tr:hover,
.reuniones-table tbody tr:hover,
tbody tr:hover{
  background: rgba(239,246,255,.72);
}

.status-badge,
.mini-pill,
.badge,
.chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.02em;
  border:1px solid transparent;
}

.status-success,
.mini-pill-success{background: rgba(22,163,74,.10); color:#166534; border-color: rgba(22,163,74,.12);}
.status-warning,
.mini-pill-warning{background: rgba(245,158,11,.12); color:#92400e; border-color: rgba(245,158,11,.16);}
.status-muted,
.mini-pill-muted{background: rgba(148,163,184,.14); color:#475569; border-color: rgba(148,163,184,.18);}
.status-info,
.mini-pill-info,
.header-badge,
.section-badge,
.admin-mini-badge{background: rgba(37,99,235,.10); color:#1d4ed8; border-color: rgba(37,99,235,.12);}
.status-danger,
.is-error{background: rgba(220,38,38,.10); color:#991b1b; border-color: rgba(220,38,38,.15);}

.modal-overlay{
  background: rgba(15,23,42,.54);
  backdrop-filter: blur(10px);
  padding: 18px;
}

.modal-container,
.premium-modal,
.users-drawer{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  border:1px solid rgba(255,255,255,.52);
  border-radius: 28px;
  box-shadow: var(--ds-shadow-lg);
}

.modal-container,
.premium-modal{
  width: min(1040px, 96vw);
}

.modal-header,
.premium-modal-header,
.users-drawer-header,
.diputado-drawer-header{
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.84));
  border-bottom: 1px solid rgba(148,163,184,.16);
  padding: 22px 24px;
  backdrop-filter: blur(12px);
}

.modal-body,
.users-drawer-body{
  padding: 22px 24px 24px;
  scrollbar-gutter: stable both-edges;
}

.modal-close,
.users-drawer-close{
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 14px;
  border:1px solid rgba(148,163,184,.18);
  background: rgba(255,255,255,.78);
  color: #334155;
  box-shadow: var(--ds-shadow-xs);
}

.modal-close:hover,
.users-drawer-close:hover{
  background: #fff;
  transform: translateY(-1px);
}

.users-drawer{
  width: min(980px, 96vw);
}

.diputado-modal-xl{
  width: min(1120px, 97vw);
  max-width: 1120px;
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
}

.users-drawer-form,
.diputado-form-layout,
.diputado-fields-grid,
.diputado-comision-row,
.reuniones-filter-grid,
.reuniones-form-grid,
.filters-grid-modal,
.form-grid,
.registros-form-grid,
.users-form-grid,
.users-form-two-columns,
.debug-grid,
.diputados-two-columns,
.admin-grid,
.gacetas-grid,
.dashboard-charts,
.reuniones-grid-main,
.console-layout,
.refined-console-layout,
.system-control-grid{
  display:grid;
  gap: 16px;
}

.diputado-form-layout{
  grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
  align-items:start;
}

.diputado-fields-grid,
.users-form-two-columns,
.reuniones-filter-grid,
.reuniones-form-grid,
.filters-grid-modal,
.form-grid,
.registros-form-grid,
.users-form-grid,
.diputados-two-columns,
.debug-grid,
.gacetas-grid,
.admin-grid,
.system-control-grid{
  grid-template-columns: repeat(2, minmax(0,1fr));
}

.diputado-comision-row{
  grid-template-columns: repeat(5, minmax(0,1fr)) minmax(180px,.9fr);
  align-items:end;
}

.dashboard-charts,
.reuniones-grid-main,
.console-layout,
.refined-console-layout{
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .82fr);
}

.reuniones-grid-main > *,
.dashboard-charts > *,
.console-layout > *,
.refined-console-layout > *{min-width:0;}

.chart-wrap,
.chart-card .chart-wrap,
canvas.chart-canvas{
  min-height: 320px;
}

.modal-log,
.console-box,
.debug-card pre,
#syncTextoExtraido,
#syncOrdenDia,
#syncPuntos,
#syncLog{
  border-radius: 20px;
  border:1px solid rgba(255,255,255,.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.02);
}

.diputado-photo-card,
.diputado-photo-dropzone,
.listas-print-sheet,
.listas-print-toolbar,
.date-card-shell{
  border-radius: 24px;
}

.app-footer-meta{
  margin: 24px auto 6px;
  padding: 14px 18px;
  border:1px solid var(--ds-border);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  color: var(--ds-text-muted);
  background: rgba(255,255,255,.72);
  box-shadow: var(--ds-shadow-xs);
}

.ds-alert-stack{
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1400;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 28px));
}

.ds-alert{
  display:grid;
  grid-template-columns: auto 1fr auto;
  gap:12px;
  align-items:flex-start;
  padding:14px 16px;
  border-radius:20px;
  background: rgba(255,255,255,.94);
  border:1px solid rgba(148,163,184,.18);
  box-shadow: var(--ds-shadow-md);
  animation: dsAlertIn .24s ease;
}

.ds-alert--success{border-color:rgba(22,163,74,.18)}
.ds-alert--warning{border-color:rgba(245,158,11,.18)}
.ds-alert--error{border-color:rgba(220,38,38,.18)}
.ds-alert--info{border-color:rgba(37,99,235,.18)}
.ds-alert__icon{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:rgba(37,99,235,.08)}
.ds-alert__title{font-weight:800;color:var(--ds-text);margin-bottom:2px}
.ds-alert__text{color:var(--ds-text-muted);line-height:1.45}
.ds-alert__close{border:none;background:transparent;box-shadow:none;min-height:auto;padding:0;color:#64748b}

.ds-tooltip{
  position:fixed;
  z-index:1500;
  max-width:260px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(15,23,42,.95);
  color:#e2e8f0;
  font-size:.78rem;
  line-height:1.4;
  box-shadow: 0 16px 30px rgba(2,6,23,.28);
  pointer-events:none;
  opacity:0;
  transform: translateY(4px);
  transition: opacity var(--ds-transition-fast), transform var(--ds-transition-fast);
}
.ds-tooltip.is-visible{opacity:1;transform:translateY(0)}

.ds-dropdown{position:relative}
.ds-dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  min-width:220px;
  padding:8px;
  border-radius:18px;
  background:rgba(255,255,255,.97);
  border:1px solid rgba(148,163,184,.16);
  box-shadow: var(--ds-shadow-md);
  opacity:0;
  transform: translateY(8px);
  pointer-events:none;
  transition: opacity var(--ds-transition-fast), transform var(--ds-transition-fast);
}
.ds-dropdown.is-open .ds-dropdown-menu{opacity:1;transform:translateY(0);pointer-events:auto}

[data-ui-animate]{
  opacity:0;
  transform: translateY(10px);
  animation: dsFadeUp .44s ease forwards;
}

[data-ui-animate="2"]{animation-delay:.04s}
[data-ui-animate="3"]{animation-delay:.08s}
[data-ui-animate="4"]{animation-delay:.12s}

@keyframes dsFadeUp{
  to{opacity:1;transform:translateY(0)}
}

@keyframes dsAlertIn{
  from{opacity:0;transform:translateY(-8px) scale(.98)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

@media (max-width: 1280px){
  .layout{grid-template-columns: 92px 1fr;}
  .sidebar{padding-inline:14px;}
  .sidebar-brand{justify-content:center;}
  .sidebar-brand strong,
  .sidebar-brand span,
  .sidebar-user,
  .sidebar-section-title,
  .sidebar-footnote,
  .sidebar-link-label{display:none;}
  .sidebar-link,
  .sidebar-link-subitem{width:100%;margin-left:0;justify-content:center;padding-inline:0;}
  .sidebar-link-icon{margin:0;}
}

@media (max-width: 1100px){
  .diputado-form-layout,
  .dashboard-charts,
  .reuniones-grid-main,
  .console-layout,
  .refined-console-layout,
  .reuniones-filter-grid,
  .reuniones-form-grid,
  .users-form-two-columns,
  .users-form-grid,
  .diputado-fields-grid,
  .diputado-comision-row,
  .filters-grid-modal,
  .form-grid,
  .registros-form-grid,
  .debug-grid,
  .gacetas-grid,
  .admin-grid,
  .system-control-grid{
    grid-template-columns: 1fr;
  }
  .users-drawer,
  .diputado-modal-xl{width:min(96vw, 1100px)}
}

@media (max-width: 820px){
  .layout{grid-template-columns: 1fr;}
  .sidebar{
    position:relative;
    top:auto;
    height:auto;
    padding:18px;
    border-right:none;
    border-bottom:1px solid var(--ds-sidebar-border);
  }
  .sidebar-brand,
  .sidebar-user,
  .sidebar-footnote,
  .sidebar-link-label,
  .sidebar-section-title{display:block;}
  .sidebar-nav{gap:8px;}
  .sidebar-link,
  .sidebar-link-subitem{justify-content:flex-start;padding-inline:14px;}
  .main{padding:18px 14px 26px;}
  .page-header,
  .admin-hero,
  .gacetas-topbar,
  .registros-page-header,
  .consulta-header,
  .reuniones-hero,
  .users-hero-card,
  .admin-hero-card,
  .modal-header,
  .premium-modal-header,
  .users-drawer-header,
  .diputado-drawer-header,
  .modal-body,
  .users-drawer-body{padding-left:18px;padding-right:18px;}
  .modal-overlay{padding:10px;}
  .modal-container,
  .premium-modal,
  .users-drawer,
  .diputado-modal-xl{width:100%;max-width:none;border-radius:24px;}
  .page-header h1,
  .admin-hero h1,
  .gacetas-topbar h1,
  .registros-page-header h1,
  .consulta-header h1,
  .reuniones-hero h1{font-size:1.7rem;}
  .dashboard-grid,
  .users-stats-grid,
  .reuniones-kpi-grid,
  .system-kpi-grid,
  .stats-grid{grid-template-columns:1fr;}
}

body.theme-dark{
  --ds-bg: #08111f;
  --ds-bg-soft: #0b1728;
  --ds-surface: rgba(15,23,42,.84);
  --ds-surface-strong: #0f172a;
  --ds-surface-elevated: rgba(15,23,42,.96);
  --ds-text: #e5eefc;
  --ds-text-soft: #d0dbef;
  --ds-text-muted: #8ea0bf;
  --ds-border: rgba(148,163,184,.16);
}


:root.dark-mode,
html.dark-mode{
  color-scheme: dark;
  --ds-bg: #07111f;
  --ds-bg-soft: #0b1729;
  --ds-surface: rgba(10,19,34,.88);
  --ds-surface-strong: #0f1b2d;
  --ds-surface-elevated: rgba(12,21,38,.96);
  --ds-text: #e5edf8;
  --ds-text-soft: #d6e0ef;
  --ds-text-muted: #9fb3d1;
  --ds-border: rgba(148,163,184,.18);
  --ds-border-strong: rgba(148,163,184,.26);
  --ds-shadow-xs: 0 6px 14px rgba(2,6,23,.28);
  --ds-shadow-sm: 0 14px 34px rgba(2,6,23,.34);
  --ds-shadow-md: 0 20px 45px rgba(2,6,23,.40);
  --ds-shadow-lg: 0 28px 60px rgba(2,6,23,.52);
}

html.dark-mode body{
  background:
    radial-gradient(circle at 0% 0%, rgba(37,99,235,.16), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(14,165,233,.13), transparent 24%),
    linear-gradient(180deg, #06101d 0%, #091525 44%, #0c182b 100%);
}

html.dark-mode body::before{background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));}
html.dark-mode .page-header,
html.dark-mode .admin-hero,
html.dark-mode .gacetas-topbar,
html.dark-mode .registros-page-header,
html.dark-mode .consulta-header,
html.dark-mode .reuniones-hero,
html.dark-mode .users-hero-card,
html.dark-mode .admin-hero-card,
html.dark-mode .card,
html.dark-mode .module-panel,
html.dark-mode .premium-card,
html.dark-mode .section-card,
html.dark-mode .modal-container,
html.dark-mode .premium-modal,
html.dark-mode .users-drawer,
html.dark-mode .system-control-card,
html.dark-mode .debug-card,
html.dark-mode .info-chip,
html.dark-mode .users-stat-card,
html.dark-mode .system-kpi,
html.dark-mode .date-card-shell,
html.dark-mode .diputado-subcard,
html.dark-mode .diputado-photo-card,
html.dark-mode .theme-mode-status,
html.dark-mode .chart-container{
  background: linear-gradient(180deg, rgba(12,21,38,.96), rgba(8,16,29,.92));
  border-color: rgba(148,163,184,.16);
  color: var(--ds-text-soft);
}

html.dark-mode .modal-header,
html.dark-mode .premium-modal-header,
html.dark-mode .users-drawer-header,
html.dark-mode .diputado-drawer-header{
  background: linear-gradient(180deg, rgba(11,21,37,.98), rgba(10,18,32,.92));
}

html.dark-mode .premium-table thead th,
html.dark-mode .users-premium-table thead th,
html.dark-mode .tabla-registros thead th,
html.dark-mode .reuniones-table thead th,
html.dark-mode thead th{background:linear-gradient(180deg,#0d1a2d,#0f1d31); color:#d6e0ef; border-bottom-color:rgba(148,163,184,.16);}
html.dark-mode .premium-table tbody td,
html.dark-mode .users-premium-table tbody td,
html.dark-mode .tabla-registros tbody td,
html.dark-mode .reuniones-table tbody td,
html.dark-mode tbody td{border-bottom-color:rgba(148,163,184,.10); color:var(--ds-text-soft);}
html.dark-mode .premium-table tbody tr:nth-child(even),
html.dark-mode .users-premium-table tbody tr:nth-child(even),
html.dark-mode .tabla-registros tbody tr:nth-child(even),
html.dark-mode .reuniones-table tbody tr:nth-child(even),
html.dark-mode tbody tr:nth-child(even){background:rgba(255,255,255,.015);}
html.dark-mode .premium-table tbody tr:hover,
html.dark-mode .users-premium-table tbody tr:hover,
html.dark-mode .tabla-registros tbody tr:hover,
html.dark-mode .reuniones-table tbody tr:hover,
html.dark-mode tbody tr:hover{background:rgba(37,99,235,.08);}
html.dark-mode .campo,
html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea{background:rgba(15,23,42,.72); color:#e5edf8; border-color:rgba(148,163,184,.18);}
html.dark-mode .helper-text,
html.dark-mode small,
html.dark-mode p{color:var(--ds-text-muted);}
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode strong,
html.dark-mode label{color:var(--ds-text);}
html.dark-mode .app-footer-meta{background:rgba(11,21,37,.9);}

.sidebar{padding:28px 20px; gap:14px;}
.sidebar-nav{display:grid; gap:8px; margin-top:18px;}
.sidebar-link{padding:12px 14px; display:flex; align-items:center; gap:12px; font-weight:600; letter-spacing:.01em;}
.sidebar-link-icon{font-size:1rem; width:30px; height:30px;}
.sidebar-link-label{font-size:.94rem;}
.sidebar-link.is-active{transform:translateX(6px);}

.table-responsive.users-table-wrap{overflow-x:auto; overflow-y:hidden;}
.diputados-premium-table{table-layout:fixed; min-width:980px;}
.diputados-premium-table .col-foto{width:88px;}
.diputados-premium-table .col-perfil{width:210px;}
.diputados-premium-table .col-representacion{width:190px;}
.diputados-premium-table .col-contacto{width:220px;}
.diputados-premium-table .col-comisiones{width:auto;}
.diputados-premium-table .col-estado{width:120px;}
.diputados-premium-table .col-acciones{width:150px;}
.diputado-cell-stack{display:grid; gap:6px; min-width:0;}
.diputado-cell-stack strong,.diputado-cell-stack small{overflow:hidden; text-overflow:ellipsis;}
.diputado-cell-stack-contacto strong{font-size:.88rem;}
.table-actions-wrap-vertical{display:grid; gap:8px;}
.diputados-filter-shell{overflow:visible;}
.diputados-filter-grid-premium{grid-template-columns: minmax(260px,1.3fr) repeat(3, minmax(160px,.75fr)); align-items:end;}
.diputados-filter-header{display:flex; justify-content:space-between; align-items:center; gap:16px;}
.diputados-filter-actions{display:flex; gap:10px; flex-wrap:wrap;}
.diputado-drawer-header{z-index:8;}
.diputado-form-section{background:linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.42)); border:1px solid rgba(148,163,184,.14); border-radius:24px; padding:18px;}
html.dark-mode .diputado-form-section{background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));}
.diputado-subcard{background:linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,252,.84)); border:1px solid rgba(148,163,184,.12); border-radius:22px; padding:18px; box-shadow:var(--ds-shadow-xs);}
.diputado-photo-card{position:sticky; top:96px; background:linear-gradient(180deg, rgba(255,255,255,.86), rgba(248,250,252,.94)); border:1px solid rgba(148,163,184,.14); box-shadow:var(--ds-shadow-sm);}
.diputado-photo-dropzone{min-height:100%;}
.diputado-comisiones-list{display:grid; gap:14px;}
.diputado-comision-row{padding:16px; border:1px solid rgba(148,163,184,.14); border-radius:22px; background:rgba(255,255,255,.52);}
html.dark-mode .diputado-comision-row{background:rgba(255,255,255,.02);}
.users-drawer-backdrop{background:rgba(2,6,23,.48); backdrop-filter:blur(8px); z-index:1224;}
.users-drawer{z-index:1248; overflow:hidden;}
.modal-overlay{z-index:1200;}
.modal-overlay.is-open{display:flex; align-items:center; justify-content:center;}
.modal-contenido.modal-fecha-lectura{width:min(560px, 96vw); max-width:560px; border-radius:28px; background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98)); border:1px solid rgba(255,255,255,.56); box-shadow:var(--ds-shadow-lg); overflow:hidden;}
html.dark-mode .modal-contenido.modal-fecha-lectura{background:linear-gradient(180deg, rgba(12,21,38,.98), rgba(8,16,29,.98));}

.iniciativas-upload-card{overflow:visible;}
.iniciativas-upload-layout{display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr); gap:18px; align-items:stretch;}
.iniciativas-upload-main{min-width:0;}
.iniciativas-dropzone{min-height:100%; box-shadow:var(--ds-shadow-sm); background:linear-gradient(180deg, rgba(255,255,255,.62), rgba(248,250,252,.78));}
html.dark-mode .iniciativas-dropzone{background:linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));}
.iniciativas-timebox-card{display:grid; align-content:start; gap:14px; padding:22px; border-radius:26px; border:1px solid rgba(148,163,184,.14); background:linear-gradient(160deg, rgba(29,78,216,.08), rgba(14,165,233,.08), rgba(255,255,255,.68)); box-shadow:var(--ds-shadow-sm);}
html.dark-mode .iniciativas-timebox-card{background:linear-gradient(160deg, rgba(29,78,216,.14), rgba(14,165,233,.08), rgba(255,255,255,.02));}
.iniciativas-timebox-card h3{margin:0;}
.iniciativas-timebox-card p{margin:0;}
.iniciativas-timebox-list{margin:0; padding-left:18px; display:grid; gap:10px; color:var(--ds-text-soft);}
.iniciativas-date-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px;}
.date-card-shell{box-shadow:var(--ds-shadow-xs);}
#cargaEstado[data-state="error"]{color:#b91c1c;}
#cargaEstado[data-state="success"]{color:#166534;}
#cargaEstado[data-state="loading"]{color:#1d4ed8;}
html.dark-mode #cargaEstado[data-state="error"]{color:#fda4af;}
html.dark-mode #cargaEstado[data-state="success"]{color:#86efac;}
html.dark-mode #cargaEstado[data-state="loading"]{color:#93c5fd;}

.bitacora-shell{display:grid; gap:18px;}
.bitacora-filter-grid{grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; align-items:end;}
.bitacora-filter-panel,.bitacora-chart-panel,.bitacora-table-panel{overflow:hidden;}
.bitacora-chart-toolbar{justify-content:space-between;}
.bitacora-chart-panel .chart-container{height:300px; max-height:300px; min-height:300px; padding:14px; box-shadow:var(--ds-shadow-xs);}
.bitacora-table-panel .table-responsive{max-width:100%;}
.bitacora-table-panel td:last-child{max-width:320px; word-break:break-word;}
.theme-mode-status{display:flex; align-items:center; min-height:48px; padding:12px 14px; border-radius:16px; border:1px solid rgba(148,163,184,.16); background:rgba(255,255,255,.68); color:var(--ds-text-soft);}

[data-ui-animate]{animation: dsFadeUp .36s ease both; animation-delay: calc((var(--delay, 0) + attr(data-ui-animate number)) * 40ms);}
@keyframes dsFadeUp{from{opacity:0; transform:translateY(12px);}to{opacity:1; transform:translateY(0);}}

@media (max-width: 1180px){
  .iniciativas-upload-layout,
  .diputado-form-layout,
  .bitacora-filter-grid,
  .diputados-filter-grid-premium{grid-template-columns:1fr;}
  .diputado-photo-card{position:relative; top:auto;}
}
@media (max-width: 920px){
  .iniciativas-date-grid,
  .users-form-grid,
  .users-form-two-columns,
  .diputados-two-columns,
  .system-control-grid{grid-template-columns:1fr;}
  .sidebar{padding:20px 16px;}
}
@media (max-width: 720px){
  .main{padding:24px 14px;}
  .modal-contenido.modal-fecha-lectura{width:min(96vw, 96vw);}
  .diputados-premium-table{min-width:860px;}
}
