/**
 * Estilos Principales - Meta Design System Unificado
 * Concejo Municipal de Yacuiba (Gestión 2026-2027)
 * Línea visual institucional limpia sin degradados cromáticos.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --color-canvas: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-muted: #f1f5f9;
    --color-sidebar: #0f172a;
    --color-primary: #0f172a;
    --color-primary-hover: #1e293b;
    --color-cta: #2563eb;
    --color-cta-hover: #1d4ed8;

    --color-text-main: #0f172a;
    --color-text-body: #334155;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-input-border: #cbd5e1;

    --radius-pill: 9999px;
    --radius-btn: 0.5rem;
    --radius-card: 12px;
    --radius-input: 8px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-canvas);
    color: var(--color-text-body);
    letter-spacing: -0.011em;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    color: var(--color-text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ==========================================================================
   BANNERS INFORMATIVOS DEL PORTAL WEB CMS (Verde Institucional Uniforme #064e3b)
   ========================================================================== */
.portal-web-banner {
    background-color: #064e3b !important;
    background-image: none !important;
    color: #ffffff !important;
}

.portal-web-banner h1,
.portal-web-banner h2,
.portal-web-banner h3,
.portal-web-banner h4,
.portal-web-banner h5,
.portal-web-banner h6 {
    color: #ffffff !important;
}

.portal-web-banner p,
.portal-web-banner .banner-description {
    color: #ecfdf5 !important;
}

.font-mono-code {
    font-family: var(--font-mono);
}

/* ==========================================================================
   TARJETAS E INPUTS INSTITUCIONALES UNIFORMES
   ========================================================================== */

.card,
.card-meta {
    background-color: var(--color-surface);
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
}

.input-field,
.input-meta {
    width: 100%;
    background-color: var(--color-surface);
    color: var(--color-text-main);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-input);
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

input.input-field,
select.input-field,
input.input-meta,
select.input-meta {
    min-height: 2.5rem;
}

.input-field::placeholder,
.input-meta::placeholder {
    color: #94a3b8;
}

.input-field:focus,
.input-meta:focus {
    outline: none;
    border-color: var(--color-cta);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* ==========================================================================
   REGLA DE BOTONES (rounded-lg = 0.5rem) CON PALETA SÓLIDA Y DIMENSIONES UNIFORMES
   ========================================================================== */

button:not(.keep-round),
.btn,
a[class*="btn-"],
input[type="submit"],
input[type="button"] {
    border-radius: var(--radius-btn) !important;
}

/* Excepción estructural: botones acordeón internos del sidebar */
aside nav button,
div[role="dialog"] nav button {
    border-radius: 0.5rem !important;
}

/* 1. Botón Transaccional Principal (Azul Cobalto #2563eb) */
.btn-buy-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: #ffffff !important;
    background-color: var(--color-cta) !important;
    border: 1px solid transparent;
    border-radius: var(--radius-btn) !important;
    box-shadow: 0 1px 2px 0 rgba(37, 99, 235, 0.2);
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-buy-cta:hover {
    background-color: var(--color-cta-hover) !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-buy-cta:active {
    transform: translateY(1px);
}

/* 2. Botón Primario Oscuro (#0f172a) */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5625rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: #ffffff !important;
    background-color: var(--color-primary) !important;
    border: 1px solid transparent;
    border-radius: var(--radius-btn) !important;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.12);
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover {
    background-color: var(--color-primary-hover) !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
}
.btn-primary:active {
    transform: translateY(1px);
}

/* 3. Botón Secundario / Outline */
.btn-secondary,
.btn-outline-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: #334155 !important;
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: var(--radius-btn) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-secondary:hover,
.btn-outline-pill:hover {
    background-color: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* 4. Botón Ghost (Terciario / Enlace de tabla) */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: #475569 !important;
    background-color: transparent !important;
    border-radius: var(--radius-btn) !important;
    transition: background-color 150ms ease, color 150ms ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
}
.btn-ghost:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

/* 5. Pill Tab de Filtrado */
.btn-pill-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-btn) !important;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: #475569;
    transition: all 150ms ease;
    cursor: pointer;
    text-decoration: none;
}
.btn-pill-tab.active,
.btn-pill-tab:hover {
    background-color: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

/* ==========================================================================
   BADGES SEMÁNTICOS UNIFICADOS (WCAG ACCESIBLE)
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1rem;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-success,
.badge-meta-success {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

.badge-warning,
.badge-meta-attention {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.badge-danger,
.badge-meta-critical {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.badge-info {
    background-color: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.badge-neutral {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

/* ==========================================================================
   DIRECTIVAS ALPINE & SCROLLBARS DISCRETOS
   ========================================================================== */
[x-cloak] {
    display: none !important;
}

.sidebar-nav,
nav::-webkit-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}
.sidebar-nav::-webkit-scrollbar,
nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-nav::-webkit-scrollbar-track,
nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb,
nav::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9999px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover,
nav::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.4);
}

/* ==========================================================================
   EDITOR VISUAL ESTILO WORD Y PROSE INSTITUCIONAL
   ========================================================================== */
.word-editor-container {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Barra de herramientas Ribbon estilo Word */
.word-editor-toolbar {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.5rem 0.625rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    user-select: none;
    box-sizing: border-box;
}

/* Grupos funcionales en la barra (islas visuales) */
.we-group {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.3125rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Botones de acción del editor */
.we-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2rem;
    min-height: 2rem;
    border-radius: 0.375rem;
    color: #334155;
    background-color: transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
    user-select: none;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

/* Botón cuadrado estándar para iconos (32x32) */
.we-btn.we-btn-icon,
.we-btn:not(.we-btn-labeled) {
    width: 2rem;
    min-width: 2rem;
    padding: 0;
}

/* Botón con texto / etiqueta (ancho automático y sin desbordes) */
.we-btn.we-btn-labeled {
    width: auto !important;
    min-width: 2rem;
    padding: 0 0.55rem;
    gap: 0.35rem;
}

.we-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.we-btn:active, .we-btn.active {
    background-color: #e2e8f0;
    color: #047857;
    border-color: #94a3b8;
}

/* Selectores de fuente, tamaño y bloque */
.we-select {
    height: 2rem;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0 0.5rem;
    line-height: 1.25rem;
    outline: none;
    transition: all 0.15s ease;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
}
.we-select:hover {
    border-color: #94a3b8;
}
.we-select:focus {
    border-color: #059669;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.we-color-wrapper {
    position: relative;
    display: inline-flex;
}

.we-color-indicator {
    height: 3px;
    border-radius: 2px;
}

.word-editor-page {
    outline: none;
    word-break: break-word;
}
.word-editor-page:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

/* Tipografía y elementos dentro del editor visual de Word y del visor público */
.word-editor-page h1, .prose h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.word-editor-page h2, .prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.word-editor-page h3, .prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}
.word-editor-page h4, .prose h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}
.word-editor-page p, .prose p {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}
.word-editor-page blockquote, .prose blockquote {
    border-left: 4px solid #007a3d;
    background-color: #f0fdf4;
    padding: 0.75rem 1.25rem;
    margin: 1.25rem 0;
    border-radius: 0 0.75rem 0.75rem 0;
    font-style: italic;
    color: #166534;
}
.word-editor-page ul, .prose ul {
    list-style-type: disc;
    padding-left: 1.75rem;
    margin: 0.75rem 0;
}
.word-editor-page ol, .prose ol {
    list-style-type: decimal;
    padding-left: 1.75rem;
    margin: 0.75rem 0;
}
.word-editor-page li, .prose li {
    margin-bottom: 0.25rem;
}
.word-editor-page table, .prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.25rem 0;
}
.word-editor-page th, .prose th {
    background-color: #064e3b;
    color: #ffffff;
    font-weight: 700;
    padding: 0.625rem 0.875rem;
    border: 1px solid #043d2e;
    text-align: left;
}
.word-editor-page td, .prose td {
    padding: 0.5rem 0.875rem;
    border: 1px solid #cbd5e1;
}
.word-editor-page tr:nth-child(even) td, .prose tr:nth-child(even) td {
    background-color: #f8fafc;
}
.word-editor-page hr, .prose hr {
    border: 0;
    border-top: 1px solid #cbd5e1;
    margin: 1.75rem 0;
}

/* Soporte Unificado de Plantillas y Documentos Oficiales */
.documento-oficial {
    position: relative;
    width: 100%;
    min-height: 100%;
    box-sizing: border-box;
    z-index: 10;
}
.elemento-posicionado-libre {
    position: absolute !important;
    box-sizing: border-box;
    user-select: none;
}
.elemento-posicionado-libre.detras-texto {
    z-index: 1 !important;
}
.elemento-posicionado-libre.frente-texto {
    z-index: 25 !important;
}
.salto-pagina, .page-break {
    page-break-before: always;
    break-before: page;
    display: block;
    height: 0;
    margin: 0;
    padding: 0;
}
