:root {
  --brand-wine: #790B27;
  --brand-wine-hover: #681022;
  --brand-wine-dark: #571124;
  --brand-wine-light: #FBF0F2;
  --brand-navy: #111D33;
  --brand-navy-soft: #1E2D4A;
  --brand-navy-light: #F0F4FA;
  --surface: #FFFFFF;
  --surface-soft: #F8F6F7;
  --surface-card: #FFFFFF;
  --border: #E5DEE1;
  --border-focus: #790B27;
  --text-main: #1E242B;
  --text-muted: #656E7B;
  --text-light: #FFFFFF;
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--surface-soft);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background-color: #F3F4F6;
  color: #1E293B;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 20px 18px;
  background-color: #E5E7EB;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-brand-content {
  min-width: 0;
}

.sidebar-brand h1 {
  font-size: 16px;
  color: var(--brand-navy);
  font-weight: 700;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand p {
  font-size: 11px;
  color: var(--brand-wine);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-close-btn:hover {
  color: var(--brand-wine);
  background-color: rgba(121, 11, 39, 0.08);
  border-color: rgba(121, 11, 39, 0.2);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

/* Nav Section Container & Divider */
.nav-section {
  position: relative;
  margin-bottom: 6px;
  padding-bottom: 4px;
}

.nav-section + .nav-section {
  border-top: 1px solid rgba(203, 213, 225, 0.7);
  padding-top: 10px;
  margin-top: 6px;
}

/* Section Header Badge */
.nav-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  margin: 4px 10px 6px 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.85px;
  font-weight: 700;
  border-radius: 0 6px 6px 0;
  border-left: 3px solid #94A3B8;
  background-color: rgba(148, 163, 184, 0.12);
  color: #475569;
  user-select: none;
  transition: all 0.15s ease;
}

.nav-section-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

/* Nav Link Item */
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  margin: 1px 8px;
  border-radius: 6px;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link:hover {
  color: #0F172A;
  background-color: rgba(0, 0, 0, 0.04);
}

.nav-link.active {
  color: #FFFFFF;
  background-color: var(--brand-wine);
  font-weight: 600;
}

.nav-link svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  flex-shrink: 0;
  color: #64748B;
  transition: color 0.15s ease;
}

.nav-link.active svg {
  color: #FFFFFF !important;
}

/* Nav Badge Pill */
.nav-badge-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9999px;
  background-color: #DC2626;
  color: #FFFFFF;
  line-height: 1;
}

/* -------------------------------------------------------------
   PALETA CROMÁTICA DE SECCIONES DEL SIDEBAR
   ------------------------------------------------------------- */

/* 1. SECCIÓN INICIO / PRINCIPAL (Neutro / Slate) */
.nav-section-main .nav-link:hover {
  color: var(--brand-wine);
  background-color: rgba(121, 11, 39, 0.07);
}
.nav-section-main .nav-link:hover svg {
  color: var(--brand-wine);
}
.nav-section-main .nav-link.active {
  color: #FFFFFF;
  background-color: var(--brand-wine);
}
.nav-section-main .nav-link.active svg {
  color: #FFFFFF;
}

/* 2. SECCIÓN CONTENIDO (Azul Real / Editorial) */
.nav-section-content {
  --sec-color: #1D4ED8;
  --sec-hover-bg: rgba(37, 99, 235, 0.08);
  --sec-title-bg: rgba(37, 99, 235, 0.09);
}
.nav-section-content .nav-section-title {
  color: #1E40AF;
  border-left-color: #2563EB;
  background-color: var(--sec-title-bg);
}
.nav-section-content .nav-link svg {
  color: #2563EB;
}
.nav-section-content .nav-link:hover {
  color: #1D4ED8;
  background-color: var(--sec-hover-bg);
}
.nav-section-content .nav-link:hover svg {
  color: #1D4ED8;
}
.nav-section-content .nav-link.active {
  color: #FFFFFF;
  background-color: #1D4ED8;
}
.nav-section-content .nav-link.active svg {
  color: #FFFFFF;
}

/* 3. SECCIÓN TRANSPARENCIA (Verde Esmeralda / Rendición LGCG) */
.nav-section-transparency {
  --sec-color: #047857;
  --sec-hover-bg: rgba(5, 150, 105, 0.08);
  --sec-title-bg: rgba(5, 150, 105, 0.09);
}
.nav-section-transparency .nav-section-title {
  color: #065F46;
  border-left-color: #059669;
  background-color: var(--sec-title-bg);
}
.nav-section-transparency .nav-link svg {
  color: #059669;
}
.nav-section-transparency .nav-link:hover {
  color: #047857;
  background-color: var(--sec-hover-bg);
}
.nav-section-transparency .nav-link:hover svg {
  color: #047857;
}
.nav-section-transparency .nav-link.active {
  color: #FFFFFF;
  background-color: #047857;
}
.nav-section-transparency .nav-link.active svg {
  color: #FFFFFF;
}

/* 4. SECCIÓN ATENCIÓN Y REPORTES (Ámbar / Naranja Cívico) */
.nav-section-citizen {
  --sec-color: #D97706;
  --sec-hover-bg: rgba(217, 119, 6, 0.08);
  --sec-title-bg: rgba(217, 119, 6, 0.09);
}
.nav-section-citizen .nav-section-title {
  color: #92400E;
  border-left-color: #D97706;
  background-color: var(--sec-title-bg);
}
.nav-section-citizen .nav-link svg {
  color: #D97706;
}
.nav-section-citizen .nav-link:hover {
  color: #B45309;
  background-color: var(--sec-hover-bg);
}
.nav-section-citizen .nav-link:hover svg {
  color: #B45309;
}
.nav-section-citizen .nav-link.active {
  color: #FFFFFF;
  background-color: #D97706;
}
.nav-section-citizen .nav-link.active svg {
  color: #FFFFFF;
}

/* 5. SECCIÓN ADMINISTRACIÓN (Púrpura / Gobernanza y Control) */
.nav-section-admin {
  --sec-color: #6D28D9;
  --sec-hover-bg: rgba(124, 58, 237, 0.08);
  --sec-title-bg: rgba(124, 58, 237, 0.09);
}
.nav-section-admin .nav-section-title {
  color: #5B21B6;
  border-left-color: #7C3AED;
  background-color: var(--sec-title-bg);
}
.nav-section-admin .nav-link svg {
  color: #7C3AED;
}
.nav-section-admin .nav-link:hover {
  color: #6D28D9;
  background-color: var(--sec-hover-bg);
}
.nav-section-admin .nav-link:hover svg {
  color: #6D28D9;
}
.nav-section-admin .nav-link.active {
  color: #FFFFFF;
  background-color: #6D28D9;
}
.nav-section-admin .nav-link.active svg {
  color: #FFFFFF;
}

/* 6. SECCIÓN MI CUENTA (Teal Petróleo / Perfil de Funcionario) */
.nav-section-account {
  --sec-color: #0F766E;
  --sec-hover-bg: rgba(13, 148, 136, 0.08);
  --sec-title-bg: rgba(13, 148, 136, 0.09);
}
.nav-section-account .nav-section-title {
  color: #115E59;
  border-left-color: #0D9488;
  background-color: var(--sec-title-bg);
}
.nav-section-account .nav-link svg {
  color: #0D9488;
}
.nav-section-account .nav-link:hover {
  color: #0F766E;
  background-color: var(--sec-hover-bg);
}
.nav-section-account .nav-link:hover svg {
  color: #0F766E;
}
.nav-section-account .nav-link.active {
  color: #FFFFFF;
  background-color: #0F766E;
}
.nav-section-account .nav-link.active svg {
  color: #FFFFFF;
}

/* 7. SECCIÓN AYUDA Y GUÍAS (Azul Cielo / Cerúleo) */
.nav-section-help {
  --sec-color: #0284C7;
  --sec-hover-bg: rgba(2, 132, 199, 0.08);
  --sec-title-bg: rgba(2, 132, 199, 0.09);
}
.nav-section-help .nav-section-title {
  color: #075985;
  border-left-color: #0284C7;
  background-color: var(--sec-title-bg);
}
.nav-section-help .nav-link svg {
  color: #0284C7;
}
.nav-section-help .nav-link:hover {
  color: #0369A1;
  background-color: var(--sec-hover-bg);
}
.nav-section-help .nav-link:hover svg {
  color: #0369A1;
}
.nav-section-help .nav-link.active {
  color: #FFFFFF;
  background-color: #0284C7;
}
.nav-section-help .nav-link.active svg {
  color: #FFFFFF;
}

/* 8. SECCIÓN PORTAL PÚBLICO (Guinda Institucional / Rose) */
.nav-section-public {
  --sec-color: #790B27;
  --sec-hover-bg: rgba(121, 11, 39, 0.08);
  --sec-title-bg: rgba(121, 11, 39, 0.09);
}
.nav-section-public .nav-section-title {
  color: #571124;
  border-left-color: #790B27;
  background-color: var(--sec-title-bg);
}
.nav-section-public .nav-link svg {
  color: #790B27;
}
.nav-section-public .nav-link:hover {
  color: #790B27;
  background-color: var(--sec-hover-bg);
}
.nav-section-public .nav-link:hover svg {
  color: #790B27;
}
.nav-section-public .nav-link.active {
  color: #FFFFFF;
  background-color: #790B27;
}
.nav-section-public .nav-link.active svg {
  color: #FFFFFF;
}

/* Main Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  height: 64px;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background-color: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--brand-navy);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  padding: 0;
}

.sidebar-toggle-btn:hover {
  background-color: var(--surface-soft);
  color: var(--brand-wine);
  border-color: var(--brand-wine);
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--brand-wine);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--brand-navy);
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Content Area */
.content-area {
  padding: 24px;
  flex: 1;
}

/* Cards */
.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy);
}

.card-body {
  padding: 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-top: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background-color: var(--brand-wine);
  color: #FFFFFF;
}

.btn-primary:hover {
  background-color: var(--brand-wine-hover);
}

.btn-secondary {
  background-color: var(--surface);
  border-color: var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--surface-soft);
}

.btn-danger {
  background-color: var(--danger);
  color: #FFFFFF;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  color: var(--text-main);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(121, 11, 39, 0.12);
}

/* Tables */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive > .table,
.card-body > .table {
  min-width: 600px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background-color: var(--surface-soft);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

.table tr:hover td {
  background-color: #FAFAFA;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-active {
  background-color: var(--success-bg);
  color: var(--success);
}

.badge-inactive {
  background-color: #F1F5F9;
  color: #64748B;
}

.badge-blocked {
  background-color: var(--danger-bg);
  color: var(--danger);
}

.badge-role-dev {
  background-color: #EDE9FE;
  color: #6D28D9;
}

.badge-role-admin {
  background-color: var(--brand-wine-light);
  color: var(--brand-wine);
}

.badge-role-editor {
  background-color: var(--brand-navy-light);
  color: var(--brand-navy-soft);
}

.badge-status-new {
  background-color: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}

.badge-status-progress {
  background-color: #DBEAFE;
  color: #1D4ED8;
  border: 1px solid #93C5FD;
}

.badge-status-resolved {
  background-color: #DCFCE7;
  color: #15803D;
  border: 1px solid #86EFAC;
}

.badge-status-archived {
  background-color: #F1F5F9;
  color: #64748B;
  border: 1px solid #CBD5E1;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-success {
  background-color: var(--success-bg);
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.alert-error, .alert-danger {
  background-color: var(--danger-bg);
  color: #B91C1C;
  border: 1px solid #FECACA;
}

.alert-info {
  background-color: var(--brand-navy-light);
  color: var(--brand-navy-soft);
  border: 1px solid #BFDBFE;
}

/* Login Card */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #F3F4F6;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.auth-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-navy);
  margin-top: 12px;
}

.auth-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==================================================
   ESTILOS INSTITUCIONALES PARA EDITOR TINYMCE 7
   ================================================== */
.tox-tinymce {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}

.tox .tox-toolbar-overlord {
  background-color: #F8FAFC !important;
  border-bottom: 1px solid var(--border) !important;
}

.tox .tox-toolbar, 
.tox .tox-toolbar__primary,
.tox .tox-toolbar__overflow {
  background-color: #F8FAFC !important;
}

.tox .tox-toolbar__group {
  padding: 0 4px !important;
  border-color: rgba(226, 232, 240, 0.8) !important;
}

.tox .tox-tbtn {
  border-radius: 4px !important;
  margin: 1px !important;
}

.tox .tox-tbtn:hover {
  background: rgba(27, 54, 93, 0.08) !important;
}

.tox .tox-tbtn--enabled, 
.tox .tox-tbtn--active {
  background: rgba(105, 28, 50, 0.12) !important;
  color: var(--brand-wine) !important;
}

.tox .tox-tbtn[title*="Subir Imagen"],
.tox .tox-tbtn[aria-label*="Subir Imagen"] {
  background-color: var(--brand-wine) !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  padding: 0 10px !important;
}

.tox .tox-tbtn[title*="Subir Imagen"] .tox-icon svg,
.tox .tox-tbtn[aria-label*="Subir Imagen"] .tox-icon svg {
  fill: #FFFFFF !important;
}

.tox .tox-tbtn[title*="Subir Imagen"]:hover,
.tox .tox-tbtn[aria-label*="Subir Imagen"]:hover {
  background-color: var(--brand-wine-dark) !important;
  color: #FFFFFF !important;
}

/* ==================================================
   COMPONENTE REUTILIZABLE: AVISOS TÉCNICOS & OPERATIVOS
   ================================================== */
.technical-notice {
  background-color: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-left: 4px solid var(--brand-navy, #1B365D);
  border-radius: var(--radius, 8px);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.technical-notice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.technical-notice-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.technical-notice-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: #EEF2F6;
  color: var(--brand-navy, #1B365D);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.technical-notice-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-navy, #1B365D);
  margin: 0;
}

.technical-notice-badge {
  background-color: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.technical-notice-description {
  font-size: 13px;
  color: var(--text-main, #334155);
  line-height: 1.6;
  margin-bottom: 16px;
}

.technical-notice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px 20px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 12px;
}

.technical-notice-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.technical-notice-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748B);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.technical-notice-value {
  font-size: 13px;
  color: var(--text-main, #0F172A);
  font-weight: 500;
  word-break: break-all;
}

.technical-notice-value code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  background-color: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 2px 6px;
  border-radius: 4px;
  color: #0F172A;
}

.technical-notice-notes {
  margin-top: 14px;
  padding: 10px 14px;
  background-color: #FFFBEB;
  border: 1px solid #FEF3C7;
  border-radius: 6px;
  font-size: 12px;
  color: #92400E;
  line-height: 1.5;
}

/* Operational Notice (para Administradores y Editores) */
.operational-notice {
  background-color: #FFFFFF;
  border: 1px solid var(--border, #E5DEE1);
  border-radius: var(--radius, 8px);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.operational-notice-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.operational-notice-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-navy, #1B365D);
  margin: 0;
}

.operational-notice-message {
  font-size: 14px;
  color: var(--text-muted, #475569);
  line-height: 1.6;
  margin-bottom: 16px;
}

.operational-notice-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

/* ==================================================
   UTILIDADES RESPONSIVE Y REJILLAS
   ================================================== */
.grid {
  display: grid;
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gap-4 {
  gap: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

/* Modales y Diálogos Base */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.admin-modal-container {
  background: #ffffff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.admin-modal-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-navy, #1B365D);
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.admin-modal-close:hover {
  color: var(--brand-wine);
  background-color: rgba(121, 11, 39, 0.08);
}

.admin-modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.admin-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

dialog {
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 12px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* ==================================================
   RESPONSIVE DESIGN: TABLET & MOBILE (<= 1024px)
   ================================================== */
@media (max-width: 1024px) {
  body.sidebar-open {
    overflow: hidden;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
  }

  .sidebar-close-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .main-wrapper {
    width: 100%;
    min-width: 0;
    flex: 1;
  }

  /* Manual TOC colapso en pantallas medianas */
  [style*="grid-template-columns: 280px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  [style*="position: sticky; top: 20px;"] {
    position: static !important;
    margin-bottom: 20px;
  }
}

/* ==================================================
   RESPONSIVE DESIGN: MOBILE (<= 768px)
   ================================================== */
@media (max-width: 768px) {
  .topbar {
    padding: 0 16px;
    height: 60px;
  }

  .topbar-title {
    font-size: 15px;
    max-width: none;
  }

  .user-meta {
    display: none;
  }

  .user-profile-menu {
    gap: 10px;
    flex-shrink: 0;
  }

  .content-area {
    padding: 16px 14px;
    max-width: 100%;
  }

  /* Tarjetas y Encabezados */
  .card-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 16px;
  }

  .card-body {
    padding: 16px;
  }

  /* Grilla de Métricas */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 14px 16px;
  }

  .stat-value {
    font-size: 20px;
  }

  /* Colapso Transversal de Rejillas Multi-Columna en Formularios y Tarjetas */
  .grid-cols-2,
  .grid-cols-3,
  .form-grid {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="grid-template-columns: 2fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1.5fr 1fr 1fr"],
  [style*="grid-template-columns: 2fr 2fr 1.5fr"],
  [style*="grid-template-columns: 2fr 1fr 1fr 1.5fr"],
  [style*="grid-template-columns: 2fr 1.5fr 1fr"],
  [style*="minmax(360px"],
  [style*="minmax(340px"],
  [style*="minmax(320px"],
  [style*="minmax(300px"],
  [style*="minmax(280px"],
  [style*="minmax(260px"],
  [style*="minmax(240px"],
  [style*="minmax(220px"],
  [style*="minmax(210px"],
  [style*="minmax(200px"],
  [style*="minmax(180px"] {
    grid-template-columns: 1fr !important;
  }

  /* Tablas Responsivas */
  .table th,
  .table td {
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Avisos Técnicos y Operativos */
  .technical-notice {
    padding: 16px 14px;
  }

  .technical-notice-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
    padding: 12px;
  }

  .technical-notice-value {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .operational-notice {
    padding: 18px 16px;
  }

  .operational-notice-actions {
    flex-wrap: wrap;
  }

  /* Componente de Especificación de Imágenes */
  .image-spec-card {
    padding: 10px 12px;
    font-size: 11px;
  }
}

/* ==================================================
   RESPONSIVE DESIGN: NARROW SCREENS (<= 640px)
   ================================================== */
@media (max-width: 640px) {
  .admin-image-upload-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .admin-image-upload-grid .image-preview-box {
    width: 100% !important;
    max-width: 220px;
    height: 110px !important;
  }

  /* Filtros de tablas y formularios en móviles */
  form[action*="audit"] > div,
  form[action*="users"] > div,
  form[action*="forms"] > div,
  .card-body > form[method="GET"] > div {
    width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
  }

  /* Modales en móviles y pantallas táctiles */
  [id$="Modal"],
  .admin-modal-overlay {
    padding: 10px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  [id$="Modal"] > div,
  .admin-modal-container {
    max-width: min(540px, calc(100vw - 20px)) !important;
    max-height: calc(100vh - 24px) !important;
    width: 100% !important;
    border-radius: 8px !important;
    display: flex !important;
    flex-direction: column !important;
    margin: auto !important;
  }

  [id$="Modal"] form,
  .admin-modal-body {
    padding: 14px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: calc(100vh - 110px) !important;
  }

  .admin-modal-footer {
    padding: 12px 14px;
    flex-wrap: wrap;
  }
}

/* ==================================================
   RESPONSIVE DESIGN: ULTRA COMPACT (<= 480px)
   ================================================== */
@media (max-width: 480px) {
  .topbar {
    padding: 0 12px;
    height: 56px;
    gap: 8px;
  }

  .topbar-title {
    font-size: 13.5px;
    max-width: none;
  }

  .user-profile-menu {
    gap: 8px;
    flex-shrink: 0;
  }

  .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .sidebar-toggle-btn {
    width: 34px;
    height: 34px;
  }

  .content-area {
    padding: 12px 10px;
    max-width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .auth-wrapper {
    padding: 12px;
  }

  .auth-card {
    padding: 24px 16px;
    border-radius: 8px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .btn-sm {
    padding: 4px 8px;
    font-size: 11px;
  }

  .card {
    border-radius: 6px;
    margin-bottom: 16px;
  }

  .card-header {
    padding: 12px 14px;
  }

  .card-body {
    padding: 14px;
  }

  .form-control {
    font-size: 14px;
    padding: 7px 10px;
  }
}

/* ==================================================
   ADMIN CAROUSEL (SELECTOR DE EJERCICIOS Y PERIODOS)
   ================================================== */
.btn-outline {
  background-color: var(--surface, #ffffff);
  border-color: var(--border, #e2e8f0);
  color: var(--text-main, #1e293b);
}

.btn-outline:hover {
  background-color: var(--surface-soft, #f8fafc);
  border-color: var(--border-hover, #cbd5e1);
  color: var(--brand-wine, #790B27);
}

.admin-carousel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.admin-carousel-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  min-width: 80px;
  flex-shrink: 0;
}

.admin-carousel {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  position: relative;
}

.admin-carousel-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-soft, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--brand-navy, #1e293b);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: all 150ms ease;
  user-select: none;
}

.admin-carousel-nav:hover:not(:disabled) {
  background: var(--surface-wine-soft, #fbf2f4);
  color: var(--brand-wine, #790B27);
  border-color: var(--brand-wine, #790B27);
  box-shadow: 0 2px 4px rgba(121, 11, 39, 0.15);
}

.admin-carousel-nav:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

.admin-carousel.is-scrollable-none .admin-carousel-nav {
  display: none;
}

.admin-carousel-icon {
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.admin-carousel-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
  padding: 2px 1px;
}

.admin-carousel-track::-webkit-scrollbar {
  display: none;
}

.admin-carousel-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  user-select: none;
}

.admin-carousel-track .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .admin-carousel-row {
    gap: 8px;
  }

  .admin-carousel-label {
    min-width: 72px;
    font-size: 11px;
  }

  .admin-carousel-nav {
    width: 26px;
    height: 26px;
  }
}



/* ==========================================================================
   Estándar de Tablas (Administrador) — alcance exclusivo: dentro de .table
   ========================================================================== */
.table-responsive { border-radius: 0 0 8px 8px; }
.table { border-collapse: separate; border-spacing: 0; }
.table th {
  background-color: #F8FAFC;
  color: #475569;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 11px 16px;
  white-space: nowrap;
  border-bottom: 1px solid #E2E8F0;
}
.table th + th { border-left: 1px solid #EEF2F6; }
.table td {
  background: #fff;
  padding: 11px 16px;
  font-size: 13px;
  color: #1E293B;
  border-bottom: 1px solid #EEF2F6;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background-color: #F8FAFC; }

/* Acciones compactas */
.table .btn-sm,
.table .btn-link {
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}
.table .btn-link { padding: 2px 4px; background: none; border: 0; cursor: pointer; text-decoration: none; }
.table .btn-link:hover { text-decoration: underline; }
.tbl-actions { display: inline-flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.tbl-actions form { margin: 0; display: inline; }
.tbl-sep { color: #CBD5E1; font-size: 10px; }
.tbl-link-edit { color: var(--brand-wine, #790B27); }
.tbl-link-danger { color: #DC2626; }

/* Estados */
.table .badge { text-transform: none; font-size: 11.5px; font-weight: 600; padding: 3px 9px; letter-spacing: 0; }
.tbl-status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 9999px; font-size: 11.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tbl-status-ok   { background: rgba(16,185,129,.12); color: #047857; }
.tbl-status-off  { background: #F1F5F9; color: #64748B; }
.tbl-status-err  { background: #FEE2E2; color: #B91C1C; }
.tbl-status-warn { background: #FEF3C7; color: #92400E; }

/* Matriz de entregables (contabilidad / sipot) */
.tbl-deliverables { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.tbl-deliverable { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tbl-deliverable-head { display: flex; align-items: center; justify-content: center; gap: 6px; }
.tbl-file-type { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: #64748B; min-width: 56px; text-align: right; }

@media (max-width: 640px) {
  .table th, .table td { padding: 9px 10px; }
  .tbl-file-type { min-width: 0; }
}
.table thead th { padding: 11px 14px !important; font-size: 11.5px !important; }
.table thead tr { background: transparent !important; }

/* Matriz de formatos (contabilidad): distribución inteligente por contenido */
.tbl-matrix-admin { width: 100%; table-layout: auto; }
.tbl-matrix-admin th.tbl-col-name,
.tbl-matrix-admin td.tbl-col-name { width: auto; min-width: 280px; text-align: left; padding: 9px 14px 9px 18px !important; white-space: normal; }
.tbl-matrix-admin th.tbl-col-period,
.tbl-matrix-admin td.tbl-col-period,
.tbl-matrix-admin th.tbl-col-other,
.tbl-matrix-admin td.tbl-col-other { width: 1%; white-space: nowrap; text-align: center; padding: 8px 10px !important; }
.tbl-matrix-admin td + td { border-left: 1px solid #F1F5F9; }
.tbl-matrix-admin .tbl-name { font-weight: 600; color: var(--brand-navy, #1B2A41); overflow-wrap: break-word; word-break: normal; line-height: 1.4; }
.tbl-matrix-admin tbody tr:nth-child(even) td { background: #FAFBFC; }
.tbl-matrix-admin tbody tr:hover td { background: #F1F5F9; }
.tbl-matrix-admin .tbl-deliverable { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.tbl-matrix-admin .tbl-deliverables,
.tbl-matrix-admin .tbl-deliverables.tbl-deliverables-inline,
.tbl-matrix-admin .tbl-deliverables.tbl-deliverables-other { display: inline-flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; width: max-content; margin: 0 auto; }
.tbl-matrix-admin .tbl-deliverables.tbl-deliverables-conac { display: inline-flex; flex-direction: row; flex-wrap: nowrap; gap: 6px; align-items: flex-start; justify-content: center; width: max-content; margin: 0 auto; }
.tbl-matrix-admin .tbl-file-type { text-align: left; min-width: 0; font-size: 10.5px; overflow-wrap: anywhere; max-width: 90px; }
.tbl-matrix-admin .tbl-deliverable-head { gap: 6px; flex-wrap: wrap; }
.tbl-matrix-admin .tbl-actions { gap: 3px; }
.tbl-matrix-admin .tbl-actions .btn-link { font-size: 11px; font-weight: 600; padding: 0 2px; background: none; border: 0; }
.tbl-matrix-admin .tbl-actions .btn-link:hover { text-decoration: underline; }
.tbl-dl,
.tbl-dl-off,
.tbl-year-badge {
  box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 68px; height: 30px; min-height: 30px; padding: 5px 10px; border-radius: 5px;
  border: 1px solid transparent;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; text-align: center; line-height: 1.2; white-space: nowrap;
  text-decoration: none !important;
  transition: background-color 150ms ease, border-color 150ms ease, filter 150ms ease;
}
.tbl-dl.tbl-dl-pdf { background-color: #850D30; border-color: #850D30; color: #ffffff !important; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.tbl-dl.tbl-dl-pdf:hover, .tbl-dl.tbl-dl-pdf:focus { background-color: #6E0A27; border-color: #6E0A27; color: #ffffff !important; filter: brightness(1.04); }
.tbl-dl.tbl-dl-xls { background-color: #168447; border-color: #168447; color: #ffffff !important; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.tbl-dl.tbl-dl-xls:hover, .tbl-dl.tbl-dl-xls:focus { background-color: #126C3A; border-color: #126C3A; color: #ffffff !important; filter: brightness(1.04); }
.tbl-dl.tbl-dl-other { background-color: #365C78; border-color: #365C78; color: #ffffff !important; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.tbl-dl.tbl-dl-other:hover, .tbl-dl.tbl-dl-other:focus { background-color: #2B4A61; border-color: #2B4A61; color: #ffffff !important; filter: brightness(1.04); }
.tbl-dl.tbl-dl-pdf .tbl-doc-icon,
.tbl-dl.tbl-dl-xls .tbl-doc-icon,
.tbl-dl.tbl-dl-other .tbl-doc-icon { color: #ffffff; }
.tbl-dl.tbl-dl-off,
.tbl-dl-off {
  background-color: #EDF1F5; border-color: #E2E8F0; color: #718096 !important;
  cursor: not-allowed; user-select: none; box-shadow: none;
}
.tbl-dl.tbl-dl-off:hover,
.tbl-dl.tbl-dl-off:focus,
.tbl-dl-off:hover,
.tbl-dl-off:focus {
  background-color: #EDF1F5; border-color: #E2E8F0; color: #718096 !important;
  filter: none; box-shadow: none;
}
.tbl-dl.tbl-dl-off .tbl-doc-icon,
.tbl-dl-off .tbl-doc-icon { color: #94A3B8; }
.tbl-dl.tbl-year-badge,
.tbl-year-badge {
  background-color: #F8FAFC; border-color: #CBD5E1; color: #334155 !important;
  cursor: default; user-select: none; box-shadow: none;
}
.tbl-dl.tbl-year-badge .tbl-doc-icon,
.tbl-year-badge .tbl-doc-icon { color: #64748B; }
.tbl-matrix-admin .tbl-name-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.tbl-matrix-admin .tbl-btn-rename { font-size: 11px; font-weight: 600; color: #64748B; padding: 0; background: none; border: 0; cursor: pointer; }
.tbl-matrix-admin .tbl-btn-rename:hover { color: var(--brand-wine, #850D30); text-decoration: underline; }
.tbl-dl .tbl-doc-icon,
.tbl-doc-icon { width: 13px; height: 13px; flex-shrink: 0; display: inline-block; color: currentColor; }
.tbl-empty-other { color: #CBD5E1; font-size: 12px; user-select: none; }
.tbl-matrix-admin tbody tr.tbl-empty-row td,
.tbl-matrix-admin tbody tr.tbl-empty-row:hover td,
.table tbody tr.tbl-empty-row td,
.table tbody tr.tbl-empty-row:hover td { background-color: #ffffff !important; }
.tbl-matrix-admin td.tbl-empty-cell,
.table td.tbl-empty-cell,
.tbl-empty-cell {
  padding: 30px 24px !important;
  text-align: center !important;
  vertical-align: middle !important;
  background-color: #ffffff;
  border-bottom: 1px solid #EEF2F6;
}
.tbl-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  margin: 0 auto;
}
.tbl-empty-icon {
  width: 24px;
  height: 24px;
  color: #94A3B8;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.tbl-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  line-height: 1.35;
  margin: 0 0 3px 0;
}
.tbl-empty-subtitle {
  font-size: 12.5px;
  font-weight: 400;
  color: #64748B;
  line-height: 1.4;
  margin: 0;
}

/* Acordeón de categorías (mismo comportamiento y diseño que el portal público) */
.categories-accordion-group { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; }
.category-card { background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; margin: 0; box-shadow: 0 1px 3px rgba(0,0,0,.03); overflow: hidden; transition: box-shadow 150ms ease, border-color 150ms ease; }
.category-card:hover { box-shadow: 0 4px 12px rgba(17,29,51,.06); border-color: #cbd5e1; }
.category-card-header { padding: 12px 20px; background: #F8FAFC; border-bottom: 1px solid var(--border, #e2e8f0); display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; user-select: none; transition: background-color 150ms ease; }
.category-card-header:hover { background: #F1F5F9; }
.category-card-header:focus-visible { outline: 2px solid var(--brand-wine, #790B27); outline-offset: -2px; }
.category-title-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }
.category-title-bar { width: 4px; height: 18px; background: var(--brand-wine, #790B27); border-radius: 2px; flex-shrink: 0; }
.category-title-text { font-size: 15.5px; font-weight: 700; color: var(--brand-navy, #1e293b); margin: 0; }
.category-meta-wrap { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.category-badge-count { display: inline-flex; align-items: center; padding: 4px 10px; background: #E2E8F0; border-radius: 9999px; font-size: 12px; font-weight: 700; color: #475569; }
.category-arrow-icon { width: 20px; height: 20px; color: #64748B; transition: transform 150ms ease; }
.category-card.is-collapsed .category-arrow-icon { transform: rotate(-90deg); }
.category-card.is-collapsed .category-card-header { border-bottom-color: transparent; }
.category-card.is-collapsed .category-card-body { display: none; }
.category-card-body { padding: 0; }
