:root {
    --bg-main: #0a0e17;
    --bg-sidebar: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #26354a;
    --border-color: #334155;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-cyan: #06b6d4;
    --accent-blue: #3b82f6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
}

/* APP LAYOUT */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* HEADER STICKY */
.app-header {
    height: 56px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    flex-shrink: 0;
    z-index: 100;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.brand-container:hover {
    background: rgba(255, 255, 255, 0.06);
}

.logo-circle {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
}

.brand-text h1 {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-caret {
    font-size: 11px;
    color: var(--accent-cyan);
    transition: transform 0.3s ease;
}

.app-layout.sidebar-collapsed .brand-caret {
    transform: rotate(-90deg);
}

.sub-brand {
    font-size: 10px;
    color: var(--accent-cyan);
    font-weight: 500;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent-green);
}

.wa-dot {
    background: #25d366;
    box-shadow: 0 0 6px #25d366;
}

.time-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(30, 41, 59, 0.5);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.btn-sync {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sync:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}

/* APP BODY */
.app-body {
    display: flex;
    flex: 1;
    height: calc(100vh - 56px);
    overflow: hidden;
    position: relative;
}

/* SIDEBAR */
.app-sidebar {
    width: 200px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 8px;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), padding 0.25s ease, opacity 0.2s ease;
}

.app-layout.sidebar-collapsed .app-sidebar {
    width: 0;
    padding: 14px 0;
    opacity: 0;
    pointer-events: none;
    border-right: none;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.1));
    color: var(--accent-cyan);
    border-left: 3px solid var(--accent-cyan);
}

.nav-icon {
    font-size: 15px;
}

/* CONTENT CONTAINER */
.app-content {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-main);
    padding: 16px 20px;
}

.tab-pane {
    display: none;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.15s ease-in-out;
}

.tab-pane.active {
    display: block;
}

#tab-chat, #tab-admin, #tab-documentos {
    height: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CHAT CON EL BOT */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 90px);
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.chat-header {
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.85);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.chat-session-nav {
    display: flex;
    gap: 8px;
    width: 100%;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    padding-bottom: 6px;
}

.btn-chat-session {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.6);
    color: var(--text-muted);
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-chat-session:hover {
    color: #ffffff;
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
}

.btn-chat-session.active {
    background: var(--accent-cyan);
    color: #0f172a;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.chat-quick-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.chip-cmd {
    background: rgba(6, 182, 212, 0.08);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.chip-cmd:hover {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
}

.chip-cmd.chip-main {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(59, 130, 246, 0.25));
    border-color: var(--accent-cyan);
    font-weight: 700;
}

.chip-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
    margin-left: auto;
}

.chip-danger:hover {
    background: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.msg {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.bot-msg { align-self: flex-start; }
.user-msg { align-self: flex-end; }

.msg-author {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.user-msg .msg-author {
    color: var(--accent-blue);
    text-align: right;
}

.msg-bubble {
    background: #0f172a;
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.user-msg .msg-bubble {
    background: linear-gradient(135deg, #1e3a8a, #1e40af);
    border-color: #3b82f6;
    color: white;
}

.msg-time {
    font-size: 10px;
    color: var(--text-muted);
}

.user-msg .msg-time { text-align: right; }

.chat-input-bar {
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.85);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.chat-input-bar input {
    flex: 1;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}

.chat-input-bar input:focus { border-color: var(--accent-cyan); }

.btn-send {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

/* COTIZADOR */
.cotizador-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

.cotizador-form-card, .cotizador-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-head h3 { font-size: 14px; font-weight: 700; }

.badge-obsidian {
    font-size: 10px;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group.span-2 { grid-column: span 2; }

.form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: #0f172a;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}

.form-control:focus { border-color: var(--accent-cyan); }

.catalog-add-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
}

.catalog-add-section h4 {
    font-size: 11px;
    color: var(--accent-cyan);
}

.catalog-add-bar-stacked {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-action-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.manual-section {
    background: rgba(30, 41, 59, 0.4);
}

.qty-input {
    width: 80px;
    text-align: center;
}

.partidas-table-wrapper {
    overflow-x: auto;
    margin-top: 6px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.custom-table th {
    background: #0f172a;
    color: var(--text-muted);
    font-weight: 700;
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.summary-box {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.total-line {
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    font-size: 14px;
    color: var(--accent-cyan);
    font-weight: 700;
}

.conditions-box {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 10px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
}

.btn-emitir {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border: none;
    padding: 11px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
}

.btn-emitir:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

.pdf-result-card {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download {
    margin-left: auto;
    background: var(--accent-cyan);
    color: #000;
    text-decoration: none;
    font-weight: 700;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 4px;
}

/* PRESUPUESTOS & CLIENTES */
.table-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.title-meta h3 { font-size: 14px; font-weight: 700; }
.title-meta span { font-size: 11px; color: var(--text-muted); }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.filter-chip {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-chip.active {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
}

.search-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 11px;
    width: 220px;
}

.table-scroll-area {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow-x: auto;
}

/* FINANZAS UNIFICADO & INTERACTIVE CHARTS */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-title { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.kpi-value { font-size: 18px; font-weight: 800; }
.text-cyan { color: var(--accent-cyan); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-white { color: #ffffff; }
.kpi-sub { font-size: 10px; color: var(--text-muted); }

.finanzas-main-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 16px;
    align-items: start;
}

.fin-unified-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fin-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.fin-toggle-header h4 {
    font-size: 13px;
    font-weight: 700;
}

.toggle-lever-group {
    display: flex;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: #fff;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
}

.toggle-btn.active-gasto {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

/* CHARTS */
.fin-charts-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fin-charts-card h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-cyan);
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.chart-box {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-head-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main);
}

.chart-sub-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.progress-bar-interactive {
    height: 20px;
    width: 100%;
    background: #0a0e17;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.15s ease;
}

.progress-bar-interactive:hover {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
    transform: scaleY(1.05);
}

.progress-fill {
    height: 100%;
    transition: width 0.4s ease;
}

.progress-ingresos {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-gastos {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.chart-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dot-green { background: #10b981; }
.dot-red { background: #ef4444; }

.cost-categories-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.cost-cat-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.cost-cat-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.cost-cat-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.cost-cat-bar-bg {
    height: 6px;
    width: 100%;
    background: #0a0e17;
    border-radius: 3px;
    overflow: hidden;
}

.cost-cat-bar-fill {
    height: 100%;
    background: var(--accent-cyan);
    border-radius: 3px;
}

.btn-action {
    background: var(--accent-cyan);
    color: #000;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-action:hover { filter: brightness(1.1); }
.btn-danger { background: var(--accent-red); color: white; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.btn-sm {
    background: var(--border-color);
    color: var(--text-main);
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* ADMIN & TERMINAL PTY */
.admin-layout {
    height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

.terminal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #05080f;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    font-family: var(--font-mono);
}

.terminal-header {
    padding: 8px 14px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-main);
    font-weight: 600;
}

.terminal-actions {
    display: flex;
    gap: 6px;
}

.terminal-output {
    flex: 1;
    padding: 12px 14px;
    overflow-y: auto;
    color: #38bdf8;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
    background: #05080f;
}

.terminal-input-bar {
    padding: 8px 12px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    align-items: center;
}

.term-prompt {
    color: #10b981;
    font-weight: 700;
    font-size: 12px;
}

.terminal-input-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    outline: none;
}

/* NOTAS & DOCS OBSIDIAN */
.docs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 14px;
    height: calc(100vh - 90px);
}

.docs-sidebar-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-head {
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border-color);
}

.panel-head h3 { font-size: 12px; font-weight: 700; }

.docs-search-box {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.docs-tree-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.doc-item-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-family: var(--font-mono);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-item-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.doc-item-btn.active {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    font-weight: 600;
}

.docs-editor-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.docs-editor-header {
    padding: 8px 14px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.docs-file-info {
    font-size: 12px;
    font-family: var(--font-mono);
}

.docs-file-info span { color: var(--text-muted); }
.docs-file-info strong { color: var(--accent-cyan); margin-left: 4px; }

.docs-textarea {
    flex: 1;
    width: 100%;
    background: #070a12;
    color: #f1f5f9;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    padding: 14px;
    border: none;
    outline: none;
    resize: none;
    tab-size: 4;
}

.docs-editor-status-bar {
    padding: 5px 14px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* MODALES */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 480px;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-head {
    padding: 14px 18px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-foot {
    padding: 12px 18px;
    background: #0f172a;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.partidas-modal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.partida-modal-row {
    display: flex;
    gap: 6px;
    align-items: center;
    background: #0f172a;
    padding: 6px 8px;
    border-radius: 6px;
}

.partida-modal-row input { font-size: 11px; }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .cotizador-layout { grid-template-columns: 1fr; }
    .docs-layout { grid-template-columns: 1fr; }
    .finanzas-main-grid { grid-template-columns: 1fr; }
}

/* CUSTOM SCROLLBARS */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-cyan); }

/* SALDO HERO CARD & MINI METRICS */
.saldo-hero-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.8));
    border: 1px solid rgba(6, 182, 212, 0.35);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.saldo-hero-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saldo-hero-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

.saldo-hero-val {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: -0.5px;
}

.saldo-hero-metrics {
    display: flex;
    gap: 20px;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    padding: 10px 16px;
    border-radius: 8px;
}

.metric-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-mini .m-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.metric-mini .m-val {
    font-size: 13px;
    font-family: var(--font-mono);
}

@media (max-width: 768px) {
    .saldo-hero-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .saldo-hero-metrics {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* COTIZADOR COMPACT LAYOUT */
.client-banner-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 6px;
    font-size: 11px;
    margin-bottom: 8px;
}

.cot-selectors-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 8px;
}

.form-group-compact {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.form-group-compact label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control-sm {
    padding: 5px 8px;
    font-size: 11px;
    height: 32px;
}

/* SOLID FIXED TABLE HEADER */
.solid-header-table thead th {
    background: #090d16 !important;
    color: #94a3b8 !important;
    border-top: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.solid-header-table tbody td {
    padding: 4px 6px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

/* FINANZAS LOGS CARD & ITEMS */
.fin-logs-card {
    display: flex;
    flex-direction: column;
    max-height: 480px;
}

.fin-logs-container {
    overflow-y: auto;
    max-height: 410px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.fin-log-item {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    transition: all 0.15s ease;
}

.fin-log-item:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(6, 182, 212, 0.4);
}

.fin-log-item.log-ingreso {
    border-left-color: var(--accent-green);
}

.fin-log-item.log-egreso {
    border-left-color: var(--accent-red);
}

.log-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.log-title {
    font-weight: 700;
    color: var(--text-main);
}

.log-date {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.log-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.log-monto {
    font-weight: 700;
    font-family: var(--font-mono);
}

.log-saldo {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

/* NO HEADER TABLE */
.no-header-table tbody tr td {
    padding: 5px 6px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}

/* COTIZADOR COLLAPSIBLE SIDEBAR */
.cotizador-layout.summary-collapsed #cot-summary-sidebar {
    display: none;
}

.cotizador-layout.summary-collapsed {
    grid-template-columns: 1fr;
}

/* WHATSAPP TAB LAYOUT */
.wa-panel-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    height: calc(100vh - 120px);
}

.wa-contacts-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wa-panel-head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
}

.wa-panel-head h4 {
    margin: 0;
    font-size: 13px;
    color: var(--text-main);
}

.wa-search-box {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.wa-conversaciones-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.wa-conv-item {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
}

.wa-conv-item:hover {
    background: rgba(30, 41, 59, 0.7);
}

.wa-conv-item.active {
    background: rgba(6, 182, 212, 0.15);
    border-left: 3px solid var(--accent-cyan);
}

.wa-conv-name {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-conv-badge {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.wa-conv-preview {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.wa-chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wa-chat-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
}

.wa-target-info {
    display: flex;
    flex-direction: column;
}

.wa-target-info strong {
    font-size: 13px;
    color: var(--text-main);
}

.wa-templates-bar {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.template-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.btn-template {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.btn-template:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.wa-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #080c14;
}

.wa-bubble {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-word;
}

.wa-bubble.wa-in {
    align-self: flex-start;
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.wa-bubble.wa-out {
    align-self: flex-end;
    background: #065f46;
    border: 1px solid #059669;
    color: #ecfdf5;
}

.wa-bubble-time {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.6);
    text-align: right;
    margin-top: 3px;
    font-family: var(--font-mono);
}

.wa-input-bar {
    padding: 10px 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    background: rgba(15, 23, 42, 0.6);
}

.wa-input-bar input {
    flex: 1;
    background: #0b1120;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.wa-input-bar input:focus {
    border-color: #25d366;
    outline: none;
}

.btn-send-wa {
    background: #25d366;
    color: #000;
    font-weight: 700;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-send-wa:hover {
    background: #1ebe5d;
}

/* WHATSAPP SINGLE PANEL LAYOUT */
.wa-single-panel-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.wa-top-bar {
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wa-client-quick-info {
    display: flex;
    gap: 14px;
    font-size: 11px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* FINANZAS VISUAL CHARTS & PROGRESS */
.fin-bar-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.fin-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fin-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

.fin-bar-track {
    height: 10px;
    background: #090d16;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.fin-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.fill-cyan {
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
}

.fill-green {
    background: linear-gradient(90deg, #10b981, #059669);
}

.fill-red {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

/* CORTINA DE BIENVENIDA / SPLASH SCREEN */
.welcome-curtain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 40%, rgba(15, 23, 42, 0.88), #060911 85%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s ease;
}

.welcome-curtain-overlay.curtain-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(6, 182, 212, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(6, 182, 212, 0.2);
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    max-width: 480px;
    width: 90%;
    animation: welcomePop 0.4s ease-out;
}

@keyframes welcomePop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.welcome-logo-glow {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 16px;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.6);
    animation: pulseGlow 2.5s infinite alternate;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.4); transform: scale(1); }
    100% { box-shadow: 0 0 40px rgba(6, 182, 212, 0.8); transform: scale(1.05); }
}

.welcome-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.welcome-subtitle {
    font-size: 12px;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-bottom: 20px;
}

.welcome-features-pills {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.welcome-features-pills span {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 11px;
    color: var(--text-muted);
}

.btn-enter-system {
    background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    transition: all 0.2s ease;
    width: 100%;
}

.btn-enter-system:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.6);
}

.welcome-hint {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 14px;
}

/* ==========================================================================
   ⚡ CONSULTOR NORMATIVO SEC (RIC) & ASISTENTE PRESUPUESTOS PDF STYLES
   ========================================================================== */

/* SEC LAYOUT */
.sec-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sec-header-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.7));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.sec-badge {
    display: inline-block;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sec-search-container {
    display: flex;
    gap: 10px;
    margin: 16px 0 12px;
}

.sec-search-input {
    flex: 1;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.sec-search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.sec-quick-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sec-chip {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(51, 65, 85, 0.8);
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sec-chip:hover {
    background: rgba(6, 182, 212, 0.2);
    color: #ffffff;
    border-color: var(--accent-cyan);
}

.sec-results-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
}

.sec-result-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    min-height: 380px;
    overflow-y: auto;
}

.sec-result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    text-align: center;
}

.sec-icon-big {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.7;
}

.sec-pliegos-sidebar {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    height: fit-content;
}

.sec-pliegos-sidebar h4 {
    font-size: 12px;
    color: var(--accent-cyan);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sec-pliegos-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 420px;
    overflow-y: auto;
}

.pliego-mini-item {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.4);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.pliego-mini-item:hover {
    background: rgba(6, 182, 212, 0.2);
    color: #ffffff;
    border-color: var(--accent-cyan);
}

/* WIZARD LAYOUT */
.wizard-layout {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.wizard-interactive-card {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 24px;
    width: 100%;
    max-width: 850px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.3);
}

.wizard-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 6px;
}

.wizard-steps-bar {
    display: flex;
    justify-content: space-between;
    margin: 20px 0 24px;
    position: relative;
}

.wizard-steps-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: rgba(51, 65, 85, 0.6);
    z-index: 1;
}

.w-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 2;
    position: relative;
}

.w-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1e293b;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.w-step-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

.w-step.active .w-step-num {
    background: var(--accent-cyan);
    border-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

.w-step.active .w-step-label {
    color: #ffffff;
    font-weight: 700;
}

.w-step.completed .w-step-num {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #ffffff;
}

.wizard-pane-step h4 {
    color: var(--accent-cyan);
    font-size: 14px;
    margin-bottom: 14px;
}

.wiz-items-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-bottom: 10px;
}

.wiz-items-table th {
    background: #1e293b;
    padding: 8px 10px;
    color: var(--text-muted);
    text-align: left;
}

.wiz-items-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.wiz-totales-summary {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wiz-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.wiz-total-row.highlight {
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
    font-size: 13px;
    font-weight: 800;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.wiz-success-card {
    text-align: center;
    padding: 20px;
}

.wiz-success-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.wiz-pdf-preview-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin: 16px auto;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   🌌 PROTECTOR DE PANTALLA / CORTINA DE BIENVENIDA
   ========================================================================== */
.welcome-screensaver {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #090d16;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.45s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.45s;
}

.welcome-screensaver.unlocked {
    opacity: 0;
    transform: translateY(-100%);
    visibility: hidden;
    pointer-events: none;
}

.screensaver-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.12) 0%, rgba(9, 13, 22, 0.95) 75%);
    pointer-events: none;
}

.screensaver-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
}

.screensaver-logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #06b6d4, #3b82f6);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    margin-bottom: 20px;
    box-shadow: 0 0 35px rgba(6, 182, 212, 0.5);
    animation: iconPulse 3s infinite alternate ease-in-out;
}

.screensaver-title {
    font-size: 26px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin-bottom: 6px;
}

.screensaver-subtitle {
    font-size: 11px;
    font-weight: 700;
    color: #06b6d4;
    letter-spacing: 2px;
    margin-bottom: 25px;
    font-family: 'JetBrains Mono', monospace;
}

.screensaver-clock-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 35px;
}

.screensaver-clock {
    font-size: 42px;
    font-weight: 800;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.screensaver-date {
    font-size: 12px;
    color: #94a3b8;
    text-transform: capitalize;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.screensaver-action-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-unlock-system {
    background: linear-gradient(135deg, #06b6d4, #0284c7);
    color: #090d16;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 800;
    padding: 12px 28px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
    transition: all 0.2s ease;
    letter-spacing: 1px;
}

.btn-unlock-system:hover {
    background: #22d3ee;
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.7);
    transform: translateY(-1px);
}

.screensaver-hint {
    font-size: 10px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
}
