/* BANANA360 — misma línea visual que el panel de OasisCMS (pill inputs,
   botón negro, arte lateral redondeado, shell oscuro flotante), con la
   paleta amarilla de la marca. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('/assets/fonts/inter-variable.woff2') format('woff2');
}

:root {
    --color-bg: #f4f3ef;
    --color-surface: #ffffff;
    --color-border: #e7e5df;
    --color-text: #17171a;
    --color-text-muted: #6b6b73;
    --color-ink: #1f1f22;
    --color-success: #16a34a;
    --color-warning: #b45309;
    --color-danger: #dc2626;

    --accent: #ffd43b;
    --accent-strong: #f2b705;
    --accent-deep: #9a6b00;
    --accent-soft: #fff4c2;
    --accent-lime: #a3d93b;

    --shell-frame: #f6e9ad;
    --shell-dark: #1f1f22;

    --radius: 10px;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--color-surface);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d6d3cb; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a49a; }

.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex-shrink: 0;
}

[x-cloak] { display: none !important; }

.muted { color: var(--color-text-muted); }

.top-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent-lime), var(--accent-strong));
    background-size: 200% 100%;
    animation: progress-slide 1.1s linear infinite;
    z-index: 400;
}

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

/* --- Marca --- */
.brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--accent);
    color: var(--color-ink);
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}

.brand-badge-lg {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-size: 1.7rem;
    animation: boot-pulse 1.2s ease-in-out infinite;
}

@keyframes boot-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(242, 183, 5, .45); }
    50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(242, 183, 5, 0); }
}

.boot-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    z-index: 300;
}

/* --- Formularios / botones base --- */
label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.9rem;
    background: var(--color-surface);
    color: var(--color-text);
}

.field { margin-bottom: 14px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-ink);
    color: #fff;
    transition: background .2s ease, transform .15s ease, opacity .2s ease;
}
.btn:hover:not(:disabled) { background: #000; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }

.error-text {
    color: var(--color-danger);
    font-size: 0.85rem;
    margin: 8px 0;
}

.btn-spinner {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ================= LOGIN ================= */
.login-screen {
    min-height: 100vh;
    display: flex;
    background: var(--color-surface);
}

@keyframes login-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Formulario --- */
.login-form-side {
    flex: 1 1 46%;
    display: flex;
    flex-direction: column;
    padding: 32px clamp(20px, 5vw, 64px);
    min-width: 0;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.login-brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.login-brand-name b,
.side-nav-title b { color: var(--accent-strong); }

.login-form-box {
    width: 100%;
    max-width: 380px;
    margin: auto;
    padding: 40px 0;
    animation: login-rise .55s var(--ease-out) both;
}
.login-form-box.is-shaking { animation: login-shake .42s ease; }

@keyframes login-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

.login-mobile-art { display: none; }

.login-form-box h1 {
    font-size: 2.1rem;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -.025em;
}
.login-subtitle {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin: 0 0 30px;
}

.login-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 7px 4px;
}

.pill-input {
    border-radius: 14px !important;
    padding: 13px 16px !important;
    border: 1.5px solid #e2e0d9 !important;
    background: #fcfcfa !important;
    font-size: 0.95rem !important;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.pill-input::placeholder { color: #b3b1aa; }
.pill-input:hover:not(:disabled) { border-color: #cfccc3 !important; }
.pill-input:focus {
    border-color: var(--color-ink) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(255, 212, 59, .35);
    outline: none;
}
.pill-input:disabled { background: #f5f4f0 !important; }

.btn-pill {
    border-radius: 999px;
    padding: 12px 20px;
}

.login-btn-black {
    background: var(--color-ink) !important;
    color: #fff;
    padding: 15px 20px !important;
    font-size: 0.98rem !important;
    border-radius: 14px !important;
    border: none !important;
    box-shadow: 0 10px 24px rgba(31, 31, 34, .18);
    transition: background .2s ease, box-shadow .2s ease, transform .15s ease;
}
.login-btn-black:hover:not(:disabled) {
    background: #000 !important;
    box-shadow: 0 14px 28px rgba(31, 31, 34, .24);
    transform: translateY(-1px);
}

.login-password-field { position: relative; }
.login-password-field .pill-input { padding-right: 48px !important; }

.login-password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-password-toggle:hover { color: var(--color-text); background: var(--color-bg); }

.login-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -6px 4px 10px;
    font-size: 0.8rem;
    color: var(--color-warning);
}

.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 4px 22px;
    font-size: 0.82rem;
}
.login-options-row a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.login-options-row a:hover { text-decoration: underline; }

.login-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
}
.login-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-ink);
    margin: 0;
}

.login-error {
    background: #fef2f2;
    border-radius: 12px;
    padding: 10px 14px;
    margin: 0 0 14px;
}

.login-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.76rem;
    color: var(--color-text-muted);
}
.login-foot .icon { width: 13px; height: 13px; color: var(--accent-deep); flex: none; }

/* --- Lado ilustrado: una sola imagen, mucho aire --- */
.login-art-side {
    flex: 1 1 54%;
    position: relative;
    margin: 14px 14px 14px 0;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 40px 40px;
    background:
        radial-gradient(circle at 18% 12%, rgba(255, 255, 255, .9), transparent 42%),
        linear-gradient(165deg, #fffbea 0%, #fff3c4 55%, #ffe792 100%);
}
.login-art-side::after {
    /* grano muy sutil para que el fondo no se vea plano */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(154, 107, 0, .07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent);
    pointer-events: none;
}

.login-art-glow {
    position: absolute;
    width: min(64vh, 560px);
    aspect-ratio: 1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -58%);
    background: radial-gradient(circle, rgba(255, 212, 59, .75) 0%, rgba(255, 212, 59, .28) 48%, transparent 70%);
    filter: blur(6px);
}
.login-art-ring {
    position: absolute;
    width: min(56vh, 480px);
    aspect-ratio: 1;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    translate: -50% -60%;
    border: 1.5px dashed rgba(154, 107, 0, .22);
    animation: spin 90s linear infinite;
}

.login-art-img {
    position: relative;
    z-index: 1;
    width: auto;
    height: min(54vh, 470px);
    max-width: 88%;
    object-fit: contain;
    filter: drop-shadow(0 24px 30px rgba(120, 82, 0, .18));
    animation: login-float 7s ease-in-out infinite, login-fade .8s ease both;
}
@keyframes login-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes login-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-art-caption {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 380px;
    margin-top: 28px;
    animation: login-rise .8s .15s var(--ease-out) both;
}
.login-art-caption h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.25;
    color: var(--color-ink);
    text-wrap: balance;
}
.login-art-caption p { text-wrap: balance; }
.login-art-caption p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #6b5a2a;
}

@media (prefers-reduced-motion: reduce) {
    .login-art-img, .login-art-ring { animation: none; }
}

@media (max-width: 960px) {
    .login-art-side { display: none; }
    .login-form-side { padding: 22px 20px; }
    .login-mobile-art {
        display: block;
        width: 132px;
        height: auto;
        margin: 0 0 18px;
        filter: drop-shadow(0 12px 16px rgba(120, 82, 0, .16));
    }
    .login-form-box { padding: 24px 0; }
    .login-form-box h1 { font-size: 1.8rem; }
}

/* ================= SHELL ================= */
.app-shell {
    height: 100vh;
    padding: 14px;
    background: var(--shell-frame);
    display: flex;
    overflow: hidden;
}

.shell-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--shell-dark);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(80, 60, 0, .18);
    min-height: 0;
    min-width: 0;
}

.shell-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.side-nav {
    width: 228px;
    flex-shrink: 0;
    background: var(--shell-dark);
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: width .18s ease, transform .22s var(--ease-out);
    overflow: hidden;
}
.side-nav.collapsed { width: 68px; }

.side-nav-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 19px;
    font-weight: 800;
    white-space: nowrap;
}
.side-nav-title { font-size: 1rem; letter-spacing: .02em; }

.side-nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 10px 10px;
    overflow-y: auto;
}

.side-nav-section { display: flex; flex-direction: column; gap: 2px; }

.side-nav-group {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #6f6f78;
    padding: 14px 14px 6px;
    white-space: nowrap;
}

.side-nav-menu button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: #a3a3ab;
    padding: 11px 14px;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
    white-space: nowrap;
    text-align: left;
    transition: background .15s ease, color .15s ease;
}
.side-nav-menu button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-nav-menu button.active { background: #fff; color: var(--shell-dark); font-weight: 600; }
.side-nav-menu button.active .icon { color: var(--accent-deep); }

.side-nav-collapse {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    border-top: 1px solid #2c2c31;
    color: #9ca3af;
    padding: 14px 24px;
    cursor: pointer;
    font: inherit;
    font-size: 0.85rem;
    white-space: nowrap;
}
.side-nav-collapse:hover { color: #fff; }

.side-nav.collapsed .nav-label { display: none; }
.side-nav.collapsed .side-nav-group { padding: 10px 0 4px; }
.side-nav.collapsed .side-nav-menu button,
.side-nav.collapsed .side-nav-collapse { justify-content: center; padding-left: 0; padding-right: 0; }
.side-nav.collapsed .side-nav-section + .side-nav-section { border-top: 1px solid #2c2c31; margin-top: 6px; padding-top: 6px; }

.side-nav-backdrop { display: none; }

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    background: var(--color-bg);
    border-radius: 24px;
    margin: 10px 10px 10px 0;
}

.top-header {
    padding: 20px 24px 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.greeting-title { font-size: 1.25rem; font-weight: 700; }
.greeting-date {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.greeting-date::first-letter { text-transform: uppercase; }

.top-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: color .15s ease, transform .15s ease;
}
.icon-btn:hover { color: var(--color-text); transform: translateY(-1px); }

.top-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface);
    border-radius: 999px;
    padding: 4px 16px 4px 4px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .08);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--color-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.top-header-user-info .user-name { font-weight: 600; font-size: 0.85rem; line-height: 1.2; }
.top-header-user-info .user-role { font-size: 0.74rem; color: var(--color-text-muted); }

.mobile-only { display: none; }

main.content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 24px 28px;
}

/* --- Marcador de módulo (se reemplaza en cada fase) --- */
.module-placeholder {
    max-width: 760px;
    margin: 12px auto 16px;
    background: var(--color-surface);
    border-radius: 24px;
    padding: 44px 32px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
    animation: login-rise .45s var(--ease-out) both;
}

.placeholder-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    background: var(--accent-soft);
    color: var(--accent-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}
.placeholder-icon .icon { width: 30px; height: 30px; }

.phase-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.module-placeholder h2 { font-size: 1.6rem; margin: 14px 0 8px; }
.module-placeholder p {
    color: var(--color-text-muted);
    line-height: 1.55;
    max-width: 540px;
    margin: 0 auto;
}

.access-card {
    max-width: 760px;
    margin: 0 auto;
    background: var(--color-surface);
    border-radius: 20px;
    padding: 20px 24px;
}
.access-card h3 { margin: 0 0 4px; font-size: 1rem; }
.access-card .muted { margin: 0 0 14px; font-size: 0.85rem; }
.access-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.access-chip {
    background: var(--color-bg);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* ================= COMPONENTES DE MÓDULO ================= */
.page { max-width: 1240px; margin: 0 auto; animation: login-rise .35s var(--ease-out) both; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 6px 0 16px;
}
.page-head h2 { margin: 0 0 4px; font-size: 1.5rem; }
.page-head h3 { margin: 0 0 4px; font-size: 1.05rem; }
.page-head p { margin: 0; font-size: 0.88rem; max-width: 640px; line-height: 1.45; }
.page-head.compact { margin: 0 0 14px; }

.card {
    background: var(--color-surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.card > .muted { margin: 0 0 14px; font-size: 0.86rem; }
.table-card { padding: 6px 0 0; overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: 16px; }

.tabs {
    display: flex;
    gap: 4px;
    background: var(--color-surface);
    border-radius: 999px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.tab {
    border: none;
    background: none;
    border-radius: 999px;
    padding: 8px 16px;
    font: inherit;
    font-size: 0.86rem;
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
}
.tab:hover { color: var(--color-text); }
.tab.active { background: var(--color-ink); color: #fff; font-weight: 600; }

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-surface);
    border-radius: 999px;
    padding: 0 16px;
    margin: 0;
    flex: 1;
    max-width: 380px;
    color: var(--color-text-muted);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.search-box input { border: none; background: none; padding: 11px 0; }
.search-box input:focus { outline: none; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-ink);
    box-shadow: 0 0 0 3px rgba(255, 212, 59, .35);
}
input[type="time"] { width: 118px; }
input[type="color"] { width: 48px; height: 38px; padding: 3px; cursor: pointer; }
input:disabled, select:disabled { background: #f7f6f2; color: var(--color-text-muted); cursor: not-allowed; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover:not(:disabled) { background: var(--color-bg); }
.btn-danger-ghost { background: transparent; color: var(--color-danger); border-color: #fecaca; margin-right: auto; }
.btn-danger-ghost:hover:not(:disabled) { background: #fef2f2; }
.link-btn {
    border: none;
    background: none;
    color: var(--accent-deep);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    align-self: flex-start;
}
.link-btn:hover { text-decoration: underline; }
.icon-btn-sm { width: 30px; height: 30px; box-shadow: none; background: var(--color-bg); }

/* Tablas */
.table-scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--color-text-muted);
    font-weight: 600;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #f0eee8; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fbfaf6; }
.table tr.clickable { cursor: pointer; }
.table tr.is-muted td { opacity: .5; }
.t-right { text-align: right !important; }
.nowrap { white-space: nowrap; }
.empty-row { text-align: center; color: var(--color-text-muted); padding: 28px !important; }
code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.78rem;
    background: var(--color-bg);
    padding: 2px 6px;
    border-radius: 6px;
}

.person { display: flex; align-items: center; gap: 10px; }
.person-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.76rem;
    color: var(--color-ink);
    flex-shrink: 0;
}
.person-name { font-weight: 600; }
.person-sub { font-size: 0.78rem; color: var(--color-text-muted); }

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-bg);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}
.pill-system { background: #eef2ff; color: #4338ca; font-size: 0.68rem; vertical-align: middle; }
.act-create { background: #dcfce7; color: #166534; }
.act-delete, .act-deactivate, .act-login_failed { background: #fee2e2; color: #991b1b; }
.act-update, .act-setting_change { background: var(--accent-soft); color: var(--accent-deep); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    background: var(--color-bg);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.76rem;
    border: 1px solid transparent;
}
.chip-toggle { cursor: pointer; font: inherit; font-size: 0.8rem; border-color: var(--color-border); background: var(--color-surface); }
.chip-toggle.on { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }

.bool { font-size: 0.78rem; color: var(--color-text-muted); }
.bool.on { color: var(--color-success); font-weight: 600; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .08); vertical-align: middle; }

.switch {
    width: 40px;
    height: 22px;
    border-radius: 999px;
    border: none;
    background: #d6d3cb;
    position: relative;
    cursor: pointer;
    padding: 0;
    transition: background .2s ease;
    flex-shrink: 0;
}
.switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    transition: transform .2s var(--ease-out);
}
.switch.on { background: var(--color-success); }
.switch.on span { transform: translateX(18px); }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* Lista lateral + detalle */
.split { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.split-side { padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.split-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 10px;
}
.side-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    border: none;
    background: none;
    padding: 10px 12px;
    border-radius: 12px;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    color: var(--color-text);
}
.side-item:hover { background: var(--color-bg); }
.side-item.active { background: var(--accent-soft); font-weight: 600; }
.side-item-meta { font-size: 0.74rem; color: var(--color-text-muted); font-weight: 400; }
.split-main { min-width: 0; }

/* Formularios */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-full { grid-column: 1 / -1; }
.field-check { display: flex; align-items: center; }
.field-error { color: var(--color-danger); font-size: 0.78rem; margin: 4px 2px 0; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.sticky-actions {
    position: sticky;
    bottom: 0;
    background: linear-gradient(transparent, var(--color-bg) 35%);
    padding: 18px 0 4px;
    margin-top: 0;
}
.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}
.check-label input, .perm-item input { width: 16px; height: 16px; accent-color: var(--color-ink); margin: 0; flex-shrink: 0; }
.check-label.disabled { color: var(--color-text-muted); cursor: not-allowed; }
.color-field { display: flex; align-items: center; gap: 10px; }
.input-with-action { display: flex; gap: 8px; }
.select-inline { width: auto; min-width: 240px; }

.notice {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--accent-soft);
    color: #6b4b00;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.84rem;
    margin: 4px 0 14px;
}

/* Permisos */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--color-border); border-radius: 14px; padding: 10px 12px; }
.perm-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: none;
    font: inherit;
    font-weight: 700;
    font-size: 0.86rem;
    padding: 2px 0 8px;
    cursor: pointer;
}
.perm-group-head:disabled { cursor: default; }
.tri { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #b9b5aa; display: inline-block; }
.tri.all { background: var(--color-ink); border-color: var(--color-ink); }
.tri.some { background: linear-gradient(135deg, var(--color-ink) 50%, transparent 50%); border-color: var(--color-ink); }
.perm-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 5px 0;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
}
.perm-item input { margin-top: 2px; }
.perm-item code { display: block; margin-top: 2px; font-size: 0.68rem; color: var(--color-text-muted); background: none; padding: 0; }
.perm-item.disabled { cursor: default; }

/* Semana laboral */
.week { display: flex; flex-direction: column; }
.week-day {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f0eee8;
}
.week-day:last-child { border-bottom: none; }
.week-day-head { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.week-day-head .muted { font-size: 0.78rem; }
.week-slots { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot select { width: auto; }

.inline-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.inline-form input[type="date"] { width: auto; }
.inline-form input[type="text"] { flex: 1; min-width: 200px; }
.holiday-list { display: flex; flex-direction: column; gap: 6px; }
.holiday {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--color-bg);
    border-radius: 12px;
    font-size: 0.86rem;
}
.holiday .icon-btn { margin-left: auto; background: var(--color-surface); }
.holiday-date { font-weight: 600; min-width: 150px; }

/* Configuración general */
.settings-list { display: flex; flex-direction: column; margin-top: 8px; }
.setting-row {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px);
    gap: 16px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0eee8;
}
.setting-row:last-child { border-bottom: none; }
.setting-label { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.setting-label small { font-size: 0.76rem; }
.setting-control { display: flex; flex-direction: column; align-items: flex-start; }

/* Auditoría */
.filters-card { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; padding: 12px; }
.filters-card select, .filters-card input { width: auto; min-width: 150px; flex: 1; }
.diff { font-size: 0.8rem; min-width: 240px; max-width: 420px; }
.diff-old { color: #991b1b; text-decoration: line-through; text-decoration-color: rgba(153, 27, 27, .35); word-break: break-word; }
.diff-new { color: #166534; word-break: break-word; }
.diff-arrow { color: var(--color-text-muted); margin: 0 6px; }
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
    font-size: 0.82rem;
}

.small { font-size: 0.78rem; }
.person-avatar { background: var(--accent); }
.avatar-lg { width: 44px; height: 44px; font-size: 0.9rem; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.2rem; border-radius: 20px; }
.btn-spinner-dark { border-color: rgba(31, 31, 34, .2); border-top-color: var(--color-ink); }

/* WHMCS */
.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--color-bg);
}
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #a8a49a; }
.status-dot.ok { background: #dcfce7; color: #166534; }
.status-dot.ok::before { background: var(--color-success); }
.status-dot.off { background: #fef3c7; color: #92400e; }
.status-dot.off::before { background: var(--color-warning); }

.test-result {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.86rem;
    margin-top: 8px;
}
.test-result.ok { background: #dcfce7; color: #166534; }
.test-result.fail { background: #fef2f2; color: #991b1b; }

.steps { margin: 0 0 14px; padding-left: 20px; font-size: 0.88rem; line-height: 1.6; }
.steps li { margin-bottom: 6px; }
.copy-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.copy-line code { font-size: 0.82rem; padding: 6px 10px; }

.mini-table { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; font-size: 0.84rem; }
.mini-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid #f0eee8; }

.mirror-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.84rem; color: var(--color-text-muted); }
.mirror-stats b { color: var(--color-text); font-size: 1rem; }
.sync-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.run-error { max-width: 360px; white-space: pre-line; }

.cron-help { margin-top: 14px; font-size: 0.84rem; }
.cron-help summary { cursor: pointer; font-weight: 600; }
.cron-help pre {
    background: var(--shell-dark);
    color: #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    overflow-x: auto;
    font-size: 0.76rem;
    line-height: 1.6;
}

/* Clientes: búsqueda */
.search-hero { max-width: none; padding: 4px 20px; margin-bottom: 14px; }
.search-hero input { font-size: 1rem; padding: 12px 0; }

.result-list { display: flex; flex-direction: column; gap: 8px; }
.result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    text-align: left;
    background: var(--color-surface);
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 14px 18px;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.result-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(120, 90, 0, .08); }
.result-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.result-title { font-weight: 700; font-size: 0.95rem; }
.result-sub { font-size: 0.8rem; color: var(--color-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-radios { font-size: 0.8rem; color: var(--accent-deep); font-weight: 600; }
.result-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }

.due {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--color-bg);
    color: var(--color-text-muted);
    white-space: nowrap;
}
.due-overdue { background: #fee2e2; color: #991b1b; }
.due-today { background: #dc2626; color: #fff; }
.due-urgent { background: #ffedd5; color: #9a3412; }
.due-soon { background: #fef3c7; color: #92400e; }
.due-later { background: #ecfccb; color: #3f6212; }
.amount-due { color: var(--color-danger); font-weight: 700; font-size: 0.84rem; }

.empty-state { text-align: center; padding: 36px 16px; }
.empty-state p { margin: 4px 0; }
.loading-block { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--color-text-muted); }

/* Clientes: ficha */
.client-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.client-head-main { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.client-head-main h2 { margin: 0; font-size: 1.4rem; }
.client-contact { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.86rem; }
.client-contact a { color: var(--color-text); text-decoration: none; border-bottom: 1px dashed #c9c5ba; }
.client-contact a:hover { border-bottom-color: var(--color-ink); }
.wa-link { color: #15803d !important; font-weight: 600; }
.client-head-side { display: flex; flex-direction: column; gap: 8px; min-width: 220px; align-items: stretch; }
.client-head-side label { margin: 0; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi {
    background: var(--color-surface);
    border-radius: 18px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}
.kpi-label { font-size: 0.74rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi-value { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-sm { font-size: 0.95rem; }
.kpi-alert { box-shadow: inset 0 0 0 2px var(--accent); }
.kpi-danger { box-shadow: inset 0 0 0 2px #fecaca; }
.kpi-danger .kpi-value { color: var(--color-danger); }

@media (max-width: 700px) {
    .result-card { flex-wrap: wrap; }
    .result-meta { align-items: flex-start; flex-direction: row; flex-wrap: wrap; width: 100%; }
}

/* ================= KANBAN ================= */
.page-wide { max-width: none; }
.board-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sum-chip {
    background: var(--color-surface);
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font: inherit;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.sum-chip b { color: var(--color-text); font-variant-numeric: tabular-nums; }
.sum-danger { cursor: pointer; background: #fee2e2; color: #991b1b; }
.sum-danger b { color: #991b1b; }
.sum-danger.active { background: var(--color-danger); color: #fff; }
.sum-danger.active b { color: #fff; }
.filters-more { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }

.board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    align-items: flex-start;
    min-height: 60vh;
    transition: opacity .2s ease;
}
.board.is-loading { opacity: .6; }
.board-col {
    flex: 0 0 280px;
    background: #ebe9e2;
    border-radius: 18px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 290px);
    min-height: 200px;
    transition: background .15s ease, box-shadow .15s ease;
}
.board-col.col-closed { background: #e5e3dc; }
.board-col.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-strong); }
.board-col-head { padding: 4px 6px 10px; }
.board-col-title { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
.stage-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--stage); flex-shrink: 0; }
.board-col-title .count {
    margin-left: auto;
    background: var(--color-surface);
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 0.76rem;
    font-weight: 700;
}
.col-totals { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.board-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding: 2px; min-height: 60px; }
.board-empty {
    border: 2px dashed #d6d3cb;
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    font-size: 0.78rem;
    color: #a8a49a;
}

.opp-card {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 12px;
    cursor: grab;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
    border-left: 4px solid transparent;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform .12s ease, box-shadow .12s ease;
    user-select: none;
}
.opp-card:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(16, 24, 40, .1); }
.opp-card.dragging { opacity: .45; }
.opp-card.locked { cursor: pointer; }
.opp-card.prio-high { border-left-color: #f97316; }
.opp-card.prio-urgent { border-left-color: var(--color-danger); }
.opp-card.overdue { box-shadow: 0 0 0 2px #fecaca, 0 1px 2px rgba(16, 24, 40, .06); }
.opp-card-top { display: flex; align-items: center; gap: 6px; }
.type-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--type);
    background: color-mix(in srgb, var(--type) 14%, white);
    white-space: nowrap;
}
.opp-code { font-size: 0.7rem; color: var(--color-text-muted); font-family: ui-monospace, Consolas, monospace; }
.prio-flag { margin-left: auto; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; color: #c2410c; }
.prio-urgent .prio-flag { color: var(--color-danger); }
.opp-card-party { font-weight: 700; font-size: 0.9rem; line-height: 1.25; }
.opp-card-sub { font-size: 0.78rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-card-amounts { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.opp-card-amounts strong { font-size: 0.95rem; }
.opp-card-commit { font-size: 0.76rem; background: #ecfccb; color: #3f6212; border-radius: 8px; padding: 3px 8px; }
.opp-card-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.opp-card-badges:empty { display: none; }
.badge-alert {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: .03em;
    background: var(--color-danger);
    color: #fff;
    border-radius: 6px;
    padding: 2px 6px;
}
.badge-soft { font-size: 0.68rem; font-weight: 600; background: var(--color-bg); color: var(--color-text-muted); border-radius: 6px; padding: 2px 6px; }
.badge-fin { background: #eef2ff; color: #4338ca; }
.opp-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-top: 6px; border-top: 1px solid #f0eee8; }
.next-action {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    color: var(--color-text-muted);
    min-width: 0;
    flex: 1;
}
.next-action span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.next-action b { white-space: nowrap; color: var(--color-text); font-weight: 600; }
.overdue .next-action b { color: var(--color-danger); }
.avatar-sm { width: 24px; height: 24px; font-size: 0.6rem; }

/* Renovaciones */
.board-col.col-overdue { background: #f7e4e1; }
.ren-card { cursor: pointer; }
.ren-card.pending { border-left-color: #8b5cf6; background: #faf7ff; }
.ren-facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 4px 0 0; font-size: 0.76rem; }
.ren-facts dt { color: var(--color-text-muted); }
.ren-facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.ren-facts .ren-commit { color: #3f6212; font-weight: 700; }
.sum-ok { background: #dcfce7; color: #166534; }

/* Cobranzas / facturas */
.page > .kpi-row, .page > .card:not(.table-card):not(.filters-card) { margin-bottom: 14px; }
.invoice-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-surface);
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 0.86rem;
    flex-wrap: wrap;
}
.invoice-row + .invoice-row { margin-top: 6px; }
.invoice-candidate { background: #fbfaf6; border: 1px dashed #d6d3cb; }
.invoice-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; }
.invoice-amounts { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.amount-input { width: 120px; }

.convert-box { background: #eef2ff; border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.convert-head { display: flex; flex-direction: column; gap: 2px; }
.convert-head strong { color: #3730a3; }
.convert-create { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.commit-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.commit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border: none;
    background: var(--color-bg);
    border-radius: 14px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    border-left: 4px solid var(--accent-lime);
}
.commit-item.today { border-left-color: var(--accent-strong); background: var(--accent-soft); }
.commit-item.late { border-left-color: var(--color-danger); background: #fef2f2; }
.commit-when { font-weight: 800; font-size: 0.76rem; min-width: 74px; }
.commit-party { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.commit-amount { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }

/* Diálogo de confirmación */
.modal-overlay.dialog-overlay { z-index: 420; align-items: center; padding-top: 16px; }
.modal-box.dialog-box { max-width: 420px; text-align: center; padding: 26px 26px 20px; }
.dialog-box h3 { margin: 4px 0 6px; font-size: 1.1rem; }
.dialog-box > .muted { margin: 0 0 12px; font-size: 0.9rem; line-height: 1.45; }
.dialog-box .field { text-align: left; }
.dialog-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-deep);
}
.dialog-icon .icon { width: 24px; height: 24px; }
.dialog-icon.danger { background: #fee2e2; color: var(--color-danger); }
.dialog-actions { justify-content: center; }
.btn-danger { background: var(--color-danger); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

/* Facturación propia */
/* ".modal-box.x": más específico que .modal-box (definido más abajo con max-width 460px). */
.modal-box.modal-xl { max-width: 1180px; }
.btn-accent { background: var(--accent); color: var(--color-ink); border-color: var(--accent-strong); }
.btn-accent:hover:not(:disabled) { background: var(--accent-strong); }

/* --- Factura: hoja blanca sobre fondo oscuro --- */
.modal-overlay.paper-overlay {
    z-index: 360;
    background: radial-gradient(ellipse at top, rgba(52, 54, 60, .92), rgba(14, 15, 18, .94));
    backdrop-filter: blur(6px);
    padding: 20px 16px 40px;
}
.paper-stage { width: 100%; max-width: 860px; margin: 0 auto; animation: login-rise .3s var(--ease-out) both; }

.paper-toolbar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    margin-bottom: 16px;
    background: rgba(28, 29, 33, .82);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color: #f4f4f5;
}
.paper-toolbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; font-weight: 700; font-size: 0.95rem; }
.paper-toolbar-title > span:not(.pill) { font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-toolbar-title .icon { width: 17px; height: 17px; opacity: .7; flex: none; }
.paper-toolbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 36px;
    padding: 0 13px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, .07);
    color: #e9e9ec;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.tb-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.tb-btn .icon { width: 15px; height: 15px; }
.tb-primary { background: var(--accent); color: var(--color-ink); }
.tb-primary:hover { background: var(--accent-strong); color: var(--color-ink); }
.tb-danger { color: #fca5a5; }
.tb-danger:hover { background: rgba(220, 38, 38, .2); color: #fecaca; }
.tb-close { width: 36px; padding: 0; justify-content: center; background: transparent; }

.paper-sheet {
    position: relative;
    min-height: 420px;
    background: #fff;
    border-radius: 6px;
    padding: 56px 60px 40px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 30px 70px rgba(0, 0, 0, .55);
    overflow: hidden;
}
.paper-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); }

/* Visor de PDF (facturas y órdenes) */
.modal-overlay.pdf-overlay { z-index: 400; align-items: stretch; justify-content: stretch; padding: 12px; background: rgba(14, 15, 18, .9); backdrop-filter: blur(6px); }
.modal-box.pdf-viewer { max-width: none; width: 100%; height: calc(100vh - 24px); max-height: none; margin: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; border-radius: 14px; background: #1c1d21; color: #f4f4f5; border: 1px solid rgba(255, 255, 255, .08); }
.pdf-viewer .modal-head { padding: 8px 8px 8px 16px; margin: 0; flex-wrap: wrap; gap: 8px; }
.pdf-viewer .modal-head h3 { font-size: 0.95rem; }
.pdf-viewer .head-actions { display: flex; align-items: center; gap: 6px; }
.pdf-viewer .head-actions .tb-btn { text-decoration: none; }
.pdf-frame-wrap { position: relative; flex: 1; background: #3a3b40; }
.pdf-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pdf-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #d4d4d8; font-size: 0.9rem; }

/* --- Registrar pago --- */
.modal-overlay.pay-overlay { z-index: 380; align-items: center; background: rgba(10, 10, 12, .55); }
.modal-box.pay-modal { max-width: 440px; padding: 22px 22px 18px; border-radius: 20px; }
.pay-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pay-head > div { flex: 1; min-width: 0; }
.pay-head h3 { margin: 0; font-size: 1.05rem; }
.pay-head p { margin: 2px 0 0; font-size: 0.8rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pay-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); flex: none; }
.pay-icon .icon { width: 20px; height: 20px; }
.pay-summary { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--color-bg); border-radius: 14px; margin-bottom: 18px; }
.pay-summary > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; }
.pay-summary > div + div { border-left: 1px solid var(--color-border); }
.pay-summary span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-text-muted); font-weight: 700; }
.pay-summary b { font-size: 0.92rem; white-space: nowrap; }
.pay-summary .due b { color: var(--color-danger); }
.pay-modal label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); margin-bottom: 6px; }
.pay-amount { display: flex; align-items: center; border: 1.5px solid var(--color-border); border-radius: 14px; padding: 0 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.pay-amount:focus-within { border-color: var(--color-ink); box-shadow: 0 0 0 4px rgba(255, 212, 59, .35); }
.pay-amount.invalid { border-color: var(--color-danger); }
.pay-amount span { font-weight: 700; color: var(--color-text-muted); font-size: 1.1rem; }
.pay-amount input { border: 0 !important; box-shadow: none !important; background: transparent; font-size: 1.6rem; font-weight: 800; padding: 10px 8px; letter-spacing: -.01em; }
.pay-amount input::-webkit-outer-spin-button, .pay-amount input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-amount input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.pay-quick, .pay-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pay-methods { margin-top: 0; }
.pay-quick button, .pay-methods button {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.pay-quick button:hover, .pay-methods button:hover { background: var(--color-bg); }
.pay-quick button.on, .pay-methods button.on { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.pay-modal input[type="datetime-local"] { width: 100%; padding: 9px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); font: inherit; font-size: 0.88rem; background: var(--color-surface); color: var(--color-text); }
.pay-modal .field { margin-bottom: 14px; }
.pay-hint { font-size: 0.8rem; border-radius: 12px; padding: 9px 12px; margin: 2px 0 14px; line-height: 1.4; }
.pay-hint.ok { background: #dcfce7; color: #166534; }
.pay-hint.info { background: var(--accent-soft); color: var(--accent-deep); }
.pay-hint.warn { background: #fee2e2; color: #991b1b; }
.pay-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.pay-actions .btn { padding: 12px 16px; }

/* ================= METAS Y DESEMPEÑO ================= */
.gol-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.gol-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: #eceef2; color: #5b6170; white-space: nowrap; }
.gol-chip.ok { background: #dcfce7; color: #166534; }
.gol-chip.warn { background: #fff1c2; color: #8a5a00; }
.gol-chip.bad { background: #fee2e2; color: #991b1b; }
.gol-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.gol-weights { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

.gol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; transition: opacity .2s ease; }
.gol-grid.is-loading { opacity: .55; }
.gol-grid.gol-single { grid-template-columns: minmax(0, 640px); }
.gol-card { background: var(--color-surface); border-radius: 20px; padding: 18px 18px 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); border: 1px solid var(--color-border); }
.gol-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gol-avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 0.85rem; color: var(--color-ink); flex: none; }
.gol-avatar-sm { width: 26px; height: 26px; border-radius: 8px; font-size: 0.68rem; display: inline-grid; vertical-align: middle; margin-right: 6px; }
.gol-person { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gol-person b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gol-person span { font-size: 0.78rem; color: var(--color-text-muted); }
.gol-score { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.gol-score span { width: 42px; height: 42px; border-radius: 50%; background: var(--color-surface); display: grid; place-items: center; font-weight: 800; font-size: 0.95rem; }
.gol-list { list-style: none; margin: 0; padding: 0; }
.gol-item { padding: 10px 0; border-top: 1px solid #f0eee8; --st: var(--color-text-muted); }
.gol-item.st-done { --st: var(--color-success); }
.gol-item.st-on_track { --st: #22a45d; }
.gol-item.st-warn { --st: var(--accent-strong); }
.gol-item.st-behind, .gol-item.st-missed { --st: var(--color-danger); }
.gol-item-top { display: flex; align-items: baseline; gap: 8px; }
.gol-label { font-weight: 600; font-size: 0.88rem; }
.gol-period { font-size: 0.7rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-right: auto; }
.gol-values { font-size: 0.86rem; white-space: nowrap; color: var(--color-text-muted); }
.gol-values b { color: var(--color-text); font-size: 0.95rem; }
.gol-bar { position: relative; height: 8px; border-radius: 999px; background: #f0eee8; margin: 7px 0 6px; overflow: visible; }
.gol-fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--st); transition: width .6s var(--ease-out); }
.gol-mark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--color-ink); border-radius: 2px; opacity: .55; transform: translateX(-1px); }
.gol-pace { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--color-text-muted); }
.gol-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--st); flex: none; }
.gol-weight { margin-left: auto; font-size: 0.7rem; opacity: .8; }
.gol-scorebar { display: inline-block; width: 90px; height: 7px; border-radius: 999px; background: #f0eee8; vertical-align: middle; margin-right: 8px; overflow: hidden; }
.gol-scorebar span { display: block; height: 100%; border-radius: 999px; }
.gol-scorebar .ok { background: var(--color-success); }
.gol-scorebar .warn { background: var(--accent-strong); }
.gol-scorebar .bad { background: var(--color-danger); }
.seg { display: inline-flex; padding: 3px; background: var(--color-bg); border-radius: 12px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--color-text-muted); cursor: pointer; }
.seg button.on { background: var(--color-surface); color: var(--color-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.link-btn.danger { color: var(--color-danger); }

/* ================= EXTENSIÓN WHATSAPP (claves) ================= */
.ext-steps { margin: 4px 0 16px; padding-left: 20px; font-size: 0.88rem; line-height: 1.7; }
.ext-copy { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.ext-copy code { background: var(--color-bg); border-radius: 8px; padding: 4px 10px; font-size: 0.8rem; word-break: break-all; }
.ext-copy.big code { font-size: 0.92rem; padding: 8px 12px; background: #fff; border: 1px dashed var(--accent-strong); }
.ext-created { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.ext-new { display: flex; gap: 10px; margin-bottom: 8px; }
.ext-new input { flex: 1; }
.ext-token { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--color-border); }
.ext-token > div { display: flex; flex-direction: column; gap: 2px; }
.ext-token .pill { margin-top: 2px; }
.text-danger { color: var(--color-danger, #dc2626); font-weight: 600; }

/* Facturación electrónica SUNAT (complemento) */
.modal-overlay.sn-over { z-index: 380; }
.sn-panel { background: #fff; border-radius: 14px; padding: 12px 16px; margin: 0 0 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.sn-panel-title { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; margin-bottom: 6px; }
.sn-doc { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--color-border); }
.sn-doc:first-of-type { border-top: 0; }
.sn-doc-note { padding-left: 14px; border-left: 3px solid var(--color-border); }
.sn-doc-main { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; font-size: 0.86rem; }
.sn-doc-main > div { flex-basis: 100%; }
.sn-doc-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: flex-end; align-items: center; }
.sn-doc-buttons { display: contents; }
.sn-error { color: #991b1b; background: #fee2e2; border-radius: 8px; padding: 5px 8px; font-size: 0.78rem; }
.sn-emit { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; border-top: 1px dashed var(--color-border); }
.sn-client { border: 1px solid var(--color-border); border-radius: 14px; padding: 12px 14px; margin: 4px 0 14px; background: var(--color-bg); }
.sn-client.on { background: #fff; border-color: var(--accent-strong, #f2b705); }
.sn-client > div > * + * { margin-top: 8px; }
.sn-kind { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; }
.input-bad { border-color: #dc2626 !important; }
.sn-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.sn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sn-chip { border: 1px solid var(--color-border); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.82rem; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sn-chip b { background: var(--color-bg); border-radius: 999px; padding: 0 7px; font-size: 0.74rem; }
.sn-chip.on { background: var(--color-ink, #1f1f22); color: #fff; border-color: var(--color-ink, #1f1f22); }
.sn-chip.on b { background: rgba(255, 255, 255, .18); }
.sn-warning { background: var(--accent-soft); color: var(--accent-deep, #9a6b00); border-radius: 10px; padding: 8px 12px; font-size: 0.84rem; margin: 8px 0; }
.sn-items { margin-top: 10px; }
.sn-totals { display: flex; justify-content: flex-end; gap: 18px; font-size: 0.88rem; margin: 10px 0; }
.sn-section { border: 1px solid var(--color-border); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.sn-detr { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 8px; font-size: 0.88rem; }
.sn-detr select { width: auto; max-width: 100%; }
.sn-days { width: 72px !important; padding: 5px 8px !important; }
.sn-cuotas { margin-top: 8px; }
.sn-cuotas input[type="date"] { width: auto; }
.sn-amount { width: 120px !important; text-align: right; }
.sn-cuotas-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.84rem; margin-top: 6px; }
/* Salud del sistema */
.hl-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px; margin-bottom: 14px; background: var(--color-bg); }
.hl-head > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.hl-head b { font-size: 1.02rem; }
.hl-head.hl-ok { background: #dcfce7; color: #14532d; }
.hl-head.hl-warn { background: var(--accent-soft); color: #713f12; }
.hl-head.hl-fail { background: #fee2e2; color: #7f1d1d; }
.hl-counts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hl-c { font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); }
.hl-c.ok { color: #166534; } .hl-c.warn { color: #9a6b00; } .hl-c.fail { color: #b91c1c; }
.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 10px; }
.hl-group h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 0.9rem; }
.hl-dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex: none; }
.hl-dot.ok { background: #16a34a; } .hl-dot.warn { background: #f59e0b; } .hl-dot.fail { background: #dc2626; }
.hl-item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--color-border); font-size: 0.86rem; }
.hl-item:first-of-type { border-top: 0; }
.hl-icon { width: 16px; flex: none; text-align: center; font-weight: 800; }
.hl-item.ok .hl-icon { color: #16a34a; } .hl-item.warn .hl-icon { color: #d97706; } .hl-item.fail .hl-icon { color: #dc2626; } .hl-item.off .hl-icon { color: #9ca3af; }
.hl-item.off { color: var(--color-text-muted); }
.hl-fix { color: #9a6b00; margin-top: 2px; }
.hl-item.fail .hl-fix { color: #b91c1c; }
.lu-input { display: flex; gap: 6px; align-items: center; }
.lu-input input { flex: 1; min-width: 0; }
.lu-input .btn { flex: none; }
.sn-ruc { border-radius: 10px; padding: 8px 12px; font-size: 0.86rem; display: flex; flex-direction: column; gap: 4px; }
.sn-ruc-ok { background: #dcfce7; color: #166534; }
.sn-ruc-warn, .sn-ruc-unverified { background: var(--accent-soft); color: var(--accent-deep, #9a6b00); }
.sn-ruc-block { background: #fee2e2; color: #991b1b; }
.sn-ruc-checking { background: var(--color-bg); color: var(--color-text-muted); }
.sn-retry { font-size: 0.76rem; color: #1d4ed8; font-weight: 600; }
.sn-providers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sn-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sn-void-hint { flex-basis: 100%; text-align: right; margin-top: 2px; }
.sn-chip b.sn-count-warn { background: #fff1c2; color: #8a5a00; }
.sn-chip b.sn-count-bad { background: #fde0e0; color: #a61b1b; }
.sn-chip.on b.sn-count-warn, .sn-chip.on b.sn-count-bad { background: rgba(255, 255, 255, .25); color: #fff; }
.sn-queue-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: #fffaf0; border: 1px solid #f3e2b3; border-radius: 12px; padding: 10px 14px; margin: 8px 0; font-size: 0.88rem; }
.sn-queue-bar.is-outage { background: #fdecec; border-color: #f5c2c2; }
.sn-queue-bar.is-outage b { color: #a61b1b; }
.sn-queue-help { margin: 4px 0 8px; }

/* ---------- Pagos (cuentas por pagar) ---------- */
.py-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.py-chips { margin: 4px 0 10px; }
.py-orders-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.py-cat { display: inline-block; border-left: 3px solid var(--color-border); padding: 0 6px; font-size: 0.78rem; color: var(--color-text-muted); }
.py-estimated { color: #8a5a00; font-weight: 600; }
.table tr.is-muted td { opacity: .55; }
.modal-box.modal-xl { max-width: 1180px; width: calc(100vw - 32px); }
.btn.danger { color: var(--color-danger); }
.py-detail-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.py-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 18px; margin: 10px 0; }
.py-kv div { display: flex; flex-direction: column; border-bottom: 1px solid var(--color-border); padding: 4px 0; }
.py-kv dt { font-size: 0.74rem; color: var(--color-text-muted); }
.py-kv dd { margin: 0; font-weight: 600; }
.py-detail-actions { flex-wrap: wrap; justify-content: flex-start; }
.py-detail-buttons { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.py-order-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: -4px 0 8px; font-size: 1.02rem; }
.py-order-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.py-order-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.py-accounts { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.py-account { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: 1px solid var(--color-border); border-radius: 12px; padding: 8px 12px; background: #fff; font: inherit; font-size: 0.82rem; cursor: pointer; text-align: left; min-width: 150px; }
.py-account b { font-size: 1rem; }
.py-account-total { background: var(--color-bg); cursor: default; }
.py-bulk-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fffaf0; border: 1px solid #f3e2b3; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; font-size: 0.88rem; }
.py-order-table td { vertical-align: top; }
.py-order-table select { max-width: 150px; font-size: 0.82rem; }
.py-amount { width: 105px; text-align: right; }
.py-line-note { margin-top: 4px; width: 100%; max-width: 260px; font-size: 0.8rem; padding: 3px 6px; }
.py-line-actions { display: inline-flex; gap: 8px; }
.py-candidates { max-height: 52vh; overflow: auto; }
.sn-situation { max-width: 340px; }
.sn-exp-dates { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sn-exp-summary { border-top: 1px solid var(--color-border); margin-top: 12px; padding-top: 10px; min-height: 40px; }
.sn-exp-summary .table td { padding-top: 6px; padding-bottom: 6px; }
.sn-conn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.86rem; margin-bottom: 12px; }
.sn-series-form { border-top: 1px solid var(--color-border); margin-top: 14px; padding-top: 10px; }

/* Base de conocimientos */
.kb-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.kb-index { position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow: auto; padding: 14px; }
.search-box.kb-search { max-width: none; width: 100%; margin-bottom: 12px; padding: 0 12px; background: var(--color-bg); border: 1px solid var(--color-border); box-shadow: none; transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.search-box.kb-search:focus-within { background: #fff; border-color: var(--color-ink); box-shadow: 0 0 0 3px rgba(255, 212, 59, .35); }
.search-box.kb-search .icon { width: 15px; height: 15px; flex: none; }
.search-box.kb-search input { padding: 9px 0; font-size: 0.86rem; min-width: 0; }
.search-box.kb-search input:focus { box-shadow: none; border: none; }
.kb-search-clear { display: grid; place-items: center; border: 0; background: transparent; padding: 4px; border-radius: 999px; color: var(--color-text-muted); cursor: pointer; flex: none; }
.kb-search-clear:hover { background: var(--color-border); }
.kb-search-clear .icon { width: 12px; height: 12px; }
.kb-group + .kb-group { margin-top: 12px; }
.kb-group-name { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); padding: 4px 8px; }
.kb-link { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; font-size: 0.86rem; padding: 7px 10px; border-radius: 9px; cursor: pointer; color: inherit; }
.kb-link:hover { background: var(--color-bg); }
.kb-link.active { background: var(--accent-soft); font-weight: 700; }
.kb-article { padding: 26px 30px; min-height: 60vh; }
.kb-article-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 1px solid var(--color-border); padding-bottom: 14px; margin-bottom: 8px; }
.kb-article-head h2 { margin: 2px 0 4px; font-size: 1.45rem; letter-spacing: -.01em; }
.kb-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.kb-body { font-size: 0.94rem; line-height: 1.65; max-width: 860px; }
.kb-body h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.kb-body h3 { font-size: 1.04rem; margin: 22px 0 6px; }
.kb-body h4 { font-size: 0.95rem; margin: 18px 0 6px; }
.kb-body p { margin: 8px 0; }
.kb-body ul, .kb-body ol { margin: 8px 0; padding-left: 22px; }
.kb-body li { margin: 4px 0; }
.kb-body li ul { margin: 4px 0; }
.kb-body code { background: var(--color-bg); border-radius: 6px; padding: 1px 6px; font-size: 0.84em; }
.kb-body pre { background: var(--color-bg); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.kb-body pre code { background: none; padding: 0; }
.kb-body a { color: var(--accent-deep, #9a6b00); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.kb-body hr { border: 0; border-top: 1px solid var(--color-border); margin: 20px 0; }
.kb-note { background: var(--accent-soft); border-left: 4px solid var(--accent-strong, #f2b705); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
.kb-table { overflow-x: auto; margin: 10px 0; }
.kb-table table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.kb-table th { text-align: left; background: var(--color-bg); font-size: 0.76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); }
.kb-table th, .kb-table td { padding: 8px 10px; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.kb-editor { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 0.86rem; line-height: 1.5; margin-top: 8px; }
.kb-preview { border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 18px; margin-top: 8px; max-height: 60vh; overflow: auto; }
.kb-editor-tabs { margin-top: 12px; }
@media (max-width: 900px) {
    .kb-layout { grid-template-columns: 1fr; }
    .kb-index { position: static; max-height: none; }
    .kb-article { padding: 18px; }
    .kb-article-head { flex-direction: column; }
}

/* ================= COTIZACIONES ================= */
.qt-items { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.qt-item { display: grid; grid-template-columns: 2.4fr 1.1fr 1.5fr 0.6fr 0.9fr 0.8fr 0.9fr 32px; gap: 8px; align-items: start; background: var(--color-bg); border-radius: 12px; padding: 8px; }
.qt-item-head { background: none; padding: 0 8px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--color-text-muted); letter-spacing: .04em; }
.qt-item input, .qt-item select { padding: 7px 8px; font-size: 0.84rem; }
.qt-item .qt-desc { margin-top: 6px; }
.qt-line { font-weight: 700; padding-top: 8px; white-space: nowrap; }
.qt-add { display: flex; gap: 18px; }
.qt-bottom { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.qt-totals { background: var(--color-bg); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.qt-totals > div { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.qt-total { border-top: 2px solid var(--color-ink); padding-top: 8px; margin-top: 2px; font-size: 1.05rem !important; }
.qt-banner { padding: 10px 14px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: 0.86rem; font-weight: 600; }
.qt-banner.ok { background: #dcfce7; color: #166534; }
.qt-banner.warn { background: var(--accent-soft); color: var(--accent-deep); }
.qt-opp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.qt-opp-head p { margin: 0; }
.qt-opp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; color: var(--color-text); text-align: left; }
.qt-opp-row:hover { background: #fbfaf6; }
.qt-opp-row > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.qt-opp-right { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.qt-opp-link { color: var(--accent-deep); font-weight: 600; text-decoration: none; }
.qt-opp-link:hover { text-decoration: underline; }
.qt-send-list { margin: 0 0 14px; padding-left: 18px; font-size: 0.86rem; line-height: 1.6; color: var(--color-text); }
@media (max-width: 1000px) {
    .qt-item { grid-template-columns: 1fr 1fr; }
    .qt-item-head { display: none; }
    .qt-bottom { grid-template-columns: 1fr; }
}

/* ================= MI DÍA ================= */
.md-wrap.is-loading { opacity: .6; transition: opacity .2s ease; }
.md-summary { display: grid; grid-template-columns: auto auto 1fr; gap: 12px; margin-bottom: 18px; align-items: stretch; }
.md-sum-main, .md-sum-done { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 12px 18px; display: flex; align-items: center; gap: 10px; }
.md-sum-main { background: var(--color-ink); color: #fff; border-color: var(--color-ink); }
.md-sum-main.clear { background: #16a34a; border-color: #16a34a; }
.md-sum-main b, .md-sum-done b { font-size: 1.7rem; letter-spacing: -.02em; }
.md-sum-main span, .md-sum-done span { font-size: 0.82rem; line-height: 1.3; max-width: 150px; }
.md-sum-main span { color: rgba(255, 255, 255, .75); }
.md-sum-done span { color: var(--color-text-muted); }
.md-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 10px 14px; }
.md-goal { --st: var(--color-text-muted); font-size: 0.78rem; }
.md-goal.st-done { --st: var(--color-success); } .md-goal.st-on_track { --st: #22a45d; }
.md-goal.st-warn { --st: var(--accent-strong); } .md-goal.st-behind, .md-goal.st-missed { --st: var(--color-danger); }
.md-goal-top { display: flex; justify-content: space-between; gap: 6px; }
.md-goal .gol-bar { margin: 5px 0 0; height: 6px; }
.md-clear { text-align: center; padding: 40px 16px; background: var(--color-surface); border-radius: 20px; border: 1px solid var(--color-border); }
.md-clear .icon { width: 42px; height: 42px; color: var(--color-success); }
.md-clear h3 { margin: 8px 0 4px; }

.md-block { margin-bottom: 16px; }
.md-block-head { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px 2px; cursor: pointer; font: inherit; color: var(--color-text); text-align: left; }
.md-block-icon { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--blk) 14%, transparent); color: var(--blk); }
.md-block-icon .icon { width: 16px; height: 16px; }
.md-block-head b { font-size: 1rem; }
.md-count { background: var(--blk); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 0.74rem; font-weight: 700; }
.md-chevron { margin-left: auto; width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s ease; color: var(--color-text-muted); }
.md-chevron.closed { transform: rotate(0deg); }
.md-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; margin-top: 8px; }
.md-card { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--blk); border-radius: 14px; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .15s ease; }
.md-card:hover { box-shadow: 0 6px 18px rgba(16, 24, 40, .08); transform: translateY(-1px); }
.md-card-main { padding: 12px 14px 8px; cursor: pointer; flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.md-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.md-card-top b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-amount { font-weight: 700; font-size: 0.86rem; white-space: nowrap; }
.md-sub { display: flex; align-items: center; gap: 6px; font-size: 0.76rem; color: var(--color-text-muted); min-width: 0; }
.md-sub span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-next { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.md-next .icon { width: 13px; height: 13px; color: var(--blk); flex: none; }
.md-next b { margin-left: auto; white-space: nowrap; font-size: 0.78rem; }
.md-card-actions { display: flex; gap: 6px; padding: 8px 14px 12px; border-top: 1px dashed #efeee9; }
.md-more { display: inline-block; margin-top: 8px; }

/* ================= CAMPANITA ================= */
.ntf-wrap { position: relative; }
.ntf-bell { position: relative; }
.ntf-bell.active { background: var(--accent-soft); }
.ntf-badge { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--color-danger); color: #fff; font-size: 0.66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--color-surface); }
.ntf-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 300; width: min(400px, calc(100vw - 32px)); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px; box-shadow: 0 18px 50px rgba(16, 24, 40, .18); overflow: hidden; }
.ntf-panel header, .ntf-panel footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.ntf-panel header { border-bottom: 1px solid var(--color-border); }
.ntf-panel footer { border-top: 1px solid var(--color-border); justify-content: center; }
.ntf-list { max-height: min(460px, 70vh); overflow-y: auto; }
.ntf-item { display: grid; grid-template-columns: 10px 1fr; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 16px; cursor: pointer; font: inherit; color: var(--color-text); border-bottom: 1px solid #f3f2ee; --sev: #9ca3af; }
.ntf-item:hover { background: #fbfaf6; }
.ntf-item.sev-danger { --sev: var(--color-danger); } .ntf-item.sev-warning { --sev: var(--accent-strong); } .ntf-item.sev-info { --sev: #3b82f6; }
.ntf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sev); margin-top: 5px; opacity: .35; }
.ntf-item.unread .ntf-dot { opacity: 1; }
.ntf-item.unread { background: #fffdf4; }
.ntf-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ntf-body b { font-size: 0.84rem; font-weight: 600; }
.ntf-item.unread .ntf-body b { font-weight: 800; }
.ntf-msg { font-size: 0.78rem; color: var(--color-text-muted); }
.ntf-meta { font-size: 0.7rem; color: var(--color-text-muted); opacity: .8; }
.ntf-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 34px 16px; color: var(--color-text-muted); font-size: 0.86rem; }
.ntf-empty .icon { width: 30px; height: 30px; color: var(--color-success); }

@media (max-width: 900px) {
    .md-summary { grid-template-columns: 1fr 1fr; }
    .md-goals { grid-column: 1 / -1; }
    .md-cards { grid-template-columns: 1fr; }
}

/* ================= DASHBOARD / PROYECCIÓN / REPORTE DIARIO ================= */
.rep-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-controls select { width: auto; min-width: 180px; }
.rep-month { display: inline-flex; align-items: center; gap: 6px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 4px 6px; }
.rep-month b { min-width: 130px; text-align: center; font-size: 0.92rem; }
.rep-month input[type="date"] { border: 0; padding: 4px 6px; width: auto; }
.rep-dash.is-loading, .rep-daily.is-loading, .is-loading > .rep-flow { opacity: .6; transition: opacity .2s ease; }
.rep-health { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: #fee2e2; color: #991b1b; font-weight: 600; font-size: 0.86rem; text-decoration: none; }
.rep-health .icon { width: 17px; height: 17px; flex: none; }
.rep-health-go { margin-left: auto; white-space: nowrap; }

.rep-flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.rep-flow-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rep-kpi { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rep-kpi-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--color-text-muted); }
.rep-kpi b { font-size: 1.25rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-kpi small { font-size: 0.74rem; color: var(--color-text-muted); line-height: 1.35; }
.rep-kpi-strong { background: var(--color-ink); border-color: var(--color-ink); color: #fff; }
.rep-kpi-strong .rep-kpi-label, .rep-kpi-strong small { color: rgba(255, 255, 255, .65); }

.rep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rep-span-2 { grid-column: span 2; }
.rep-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.rep-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.rep-card h3 { margin: 0; font-size: 0.95rem; }
.rep-big { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; }
.rep-sub { font-size: 0.78rem; color: var(--color-text-muted); margin: 2px 0 12px; }
.rep-list { list-style: none; margin: 0; padding: 0; }
.rep-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #f0eee8; font-size: 0.84rem; }
.rep-list li b { margin-left: auto; white-space: nowrap; }
.rep-list li.danger { color: var(--color-danger); font-weight: 600; }
.rep-sw { width: 10px; height: 10px; border-radius: 3px; flex: none; background: #d1d5db; }
.rep-sw.ok, .rep-stack .ok { background: var(--color-success); }
.rep-a0 { background: #93c5fd; } .rep-a1 { background: #fcd34d; } .rep-a2 { background: #fb923c; } .rep-a3 { background: #f87171; } .rep-a4 { background: #b91c1c; }
.rep-stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: #f0eee8; margin-bottom: 8px; }
.rep-stack span { height: 100%; }

.rep-legend { display: flex; gap: 12px; font-size: 0.74rem; color: var(--color-text-muted); }
.rep-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-inv::before, .b-inv { background: #cbd5e1; }
.lg-col::before, .b-col { background: var(--color-success); }
.lg-sale::before, .b-sale { background: var(--accent-strong); }
.rep-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 220px; align-items: end; }
.rep-chart-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 6px 4px 0; border-radius: 12px; }
.rep-chart-col.current { background: var(--accent-soft); }
.rep-chart-bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.rep-chart-bars span { width: 26%; max-width: 22px; border-radius: 6px 6px 2px 2px; transition: height .6s var(--ease-out); }
.rep-chart-label { font-size: 0.74rem; font-weight: 700; text-transform: capitalize; }
.rep-chart-value { font-size: 0.7rem; color: var(--color-text-muted); white-space: nowrap; padding-bottom: 6px; }

.rep-funnel { list-style: none; margin: 0; padding: 0; }
.rep-funnel li { padding: 6px 0; }
.rep-funnel-top { display: flex; align-items: center; gap: 8px; font-size: 0.84rem; }
.rep-funnel-top b { margin-left: auto; white-space: nowrap; }
.rep-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rep-funnel-bar { height: 6px; border-radius: 999px; background: #f0eee8; margin: 5px 0 2px; overflow: hidden; }
.rep-funnel-bar span { display: block; height: 100%; border-radius: 999px; opacity: .85; }
.rep-funnel small { font-size: 0.72rem; color: var(--color-text-muted); }
.rep-team { list-style: none; margin: 0; padding: 0; }
.rep-team li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.86rem; }
.rep-team-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-team .gol-scorebar { width: 80px; margin: 0; }
.rep-team b { width: 28px; text-align: right; }

.rep-fc-table td, .rep-fc-table th { padding: 10px 12px; }
.rep-fc-table .fc-label { font-weight: 600; }
.rep-fc-table tr.fc-total td { background: var(--accent-soft); font-weight: 800; border-top: 2px solid var(--accent-strong); }
.rep-fc-table tr.fc-extra td { color: #5b6170; }
.rep-fc-table tr.fc-extra .fc-label { font-weight: 500; }
.rep-fc-table tr.fc-info td { color: var(--color-text-muted); font-style: italic; background: #fafaf8; }
.rep-fc-table tr.fc-info .fc-label { font-weight: 500; }
.rep-fc-table .fc-total { font-weight: 700; }
.rep-items-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.rep-items-head h3 { margin: 0; font-size: 1rem; }

.rep-daily { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.rep-day-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.rep-day-card header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rep-day-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.rep-day-stats > div { background: var(--color-bg); border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 2px; }
.rep-day-stats b { font-size: 1.1rem; white-space: nowrap; }
.rep-day-stats span { font-size: 0.72rem; color: var(--color-text-muted); line-height: 1.3; }
.rep-day-stats .good { background: #dcfce7; }
.rep-day-stats .bad { background: #fee2e2; }
.rep-day-toggle { margin-top: 8px; }
.rep-acts { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px dashed var(--color-border); max-height: 420px; overflow-y: auto; }
.rep-acts li { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f3f2ee; font-size: 0.84rem; }
.rep-acts li.internal { opacity: .7; }
.rep-act-time { font-variant-numeric: tabular-nums; color: var(--color-text-muted); font-weight: 600; }
.rep-act-notes { color: var(--color-text-muted); font-size: 0.8rem; margin-top: 2px; white-space: pre-line; }
.rep-acts .gol-chip { margin-left: 4px; padding: 1px 8px; font-size: 0.7rem; }

@media (max-width: 1280px) {
    .rep-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .rep-flow, .rep-flow-3, .rep-grid { grid-template-columns: 1fr; }
    .rep-span-2 { grid-column: auto; }
    .rep-daily { grid-template-columns: 1fr; }
    .rep-chart { height: 180px; gap: 4px; }
}

/* ================= MONITOR DE TAREAS ================= */
.mon-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.mon-head .btn { margin-left: auto; }
.mon-alert { margin: 0 0 14px; padding: 11px 14px; border-radius: 12px; background: #fee2e2; color: #991b1b; font-weight: 600; font-size: 0.88rem; }
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.mon-card { background: var(--color-surface); border: 1px solid var(--color-border); border-left: 4px solid var(--h, #d1d5db); border-radius: 16px; padding: 16px 18px 12px; }
.mon-card.h-ok { --h: var(--color-success); }
.mon-card.h-warn { --h: var(--accent-strong); }
.mon-card.h-bad { --h: var(--color-danger); }
.mon-card.h-info { --h: #3b82f6; }
.mon-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.mon-card header > div { display: flex; flex-direction: column; gap: 2px; }
.mon-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; background: #eceef2; color: #5b6170; }
.mon-pill.ok { background: #dcfce7; color: #166534; }
.mon-pill.warn { background: #fff1c2; color: #8a5a00; }
.mon-pill.bad { background: #fee2e2; color: #991b1b; }
.mon-pill.info { background: #dbeafe; color: #1e40af; }
.mon-does { margin: 6px 0 10px; font-size: 0.8rem; color: var(--color-text-muted); }
.mon-last { background: var(--color-bg); border-radius: 10px; padding: 9px 12px; font-size: 0.86rem; }
.mon-summary { margin-top: 3px; }
.mon-hint { margin-top: 10px; font-size: 0.8rem; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); }
.mon-hint.bad { background: #fef2f2; color: #991b1b; }
.mon-hint pre, .mon-details { margin: 0; white-space: pre-wrap; word-break: break-word; font: 0.76rem/1.45 ui-monospace, Consolas, monospace; }
.mon-card footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.mon-runs { list-style: none; margin: 8px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--color-border); max-height: 320px; overflow-y: auto; }
.mon-runs li { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 6px 0; --r: #9ca3af; }
.mon-runs li.r-ok { --r: var(--color-success); }
.mon-runs li.r-warning { --r: var(--accent-strong); }
.mon-runs li.r-error { --r: var(--color-danger); }
.mon-runs li.r-running { --r: #3b82f6; }
.mon-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--r); margin-top: 5px; }
.mon-details { margin-top: 4px; color: #991b1b; }
.mon-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
button.gol-chip { border: 0; cursor: pointer; font: inherit; font-size: 0.76rem; font-weight: 600; }

/* Configuración > Facturas y documentos */
.brd-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.brd-form { padding: 20px 22px; }
.brd-form h3 { margin: 4px 0 12px; font-size: 0.95rem; }
.brd-form h3:not(:first-child) { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--color-border); }
.brd-form textarea { resize: vertical; }
.brd-logo-row { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.brd-logo-box { width: 160px; height: 80px; border-radius: 12px; border: 1px solid var(--color-border); display: grid; place-items: center; background: #fff; flex: none; padding: 8px; }
.brd-logo-box.empty { border-style: dashed; color: var(--color-text-muted); font-size: 0.8rem; background: var(--color-bg); }
.brd-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brd-upload { position: relative; overflow: hidden; cursor: pointer; }
.brd-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.brd-upload.disabled { opacity: .6; pointer-events: none; }
.brd-logo-row p { margin: 6px 0 0; }
.brd-preview-wrap { position: sticky; top: 12px; }
.brd-preview-label { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--color-text-muted); margin-bottom: 8px; }
.brd-sheet { background: #fff; border-radius: 6px; padding: 28px 30px 20px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 16px 40px rgba(0, 0, 0, .12); border-top: 5px solid var(--accent); font-size: 0.8rem; color: #1f2430; display: flex; flex-direction: column; gap: 14px; }
.brd-sheet-head { display: flex; justify-content: space-between; gap: 16px; }
.brd-company { font-size: 1.15rem; font-weight: 800; }
.brd-muted { color: #7b8190; font-size: 0.76rem; }
.brd-number { text-align: right; display: flex; flex-direction: column; gap: 3px; }
.brd-number span { font-size: 0.6rem; letter-spacing: .12em; color: #7b8190; font-weight: 700; }
.brd-number b { font-family: ui-monospace, Consolas, monospace; font-size: 0.95rem; }
.brd-qr { align-self: flex-end; width: 64px; height: 64px; margin-top: 4px; border: 1px solid #e6e8ec; border-radius: 4px; padding: 3px; background: #fff; }
.brd-qr-warn { margin: -4px 0 12px; color: var(--accent-deep); }
.brd-ghost-lines, .brd-ghost-table { display: flex; flex-direction: column; gap: 6px; }
.brd-ghost-lines i, .brd-ghost-table i { display: block; height: 8px; border-radius: 4px; background: #eef0f3; }
.brd-ghost-lines i.short { width: 55%; }
.brd-ghost-table { border-top: 2px solid #1f2430; padding-top: 10px; }
.brd-ghost-table i { height: 12px; }
.brd-ghost-total { display: flex; justify-content: flex-end; gap: 18px; font-size: 0.9rem; }
.brd-sheet .inv-doc-note { font-size: 0.76rem; padding: 10px 12px; }
.brd-footer { text-align: center; color: #7b8190; font-size: 0.68rem; border-top: 1px solid #eceef2; padding-top: 10px; white-space: pre-line; }
@media (max-width: 1100px) {
    .brd-layout { grid-template-columns: 1fr; }
    .brd-preview-wrap { position: static; }
}

/* Productos de tipo dominio */
.domain-box { border: 1px dashed var(--color-border); border-radius: 14px; padding: 10px 14px; }
.domain-box.on { border-style: solid; border-color: var(--accent-strong); background: var(--accent-soft); }
.domain-box .check-label { margin: 0; }
.domain-tld { display: grid; grid-template-columns: auto 160px 1fr; align-items: center; gap: 4px 12px; margin-top: 10px; }
.domain-tld label { margin: 0; }
.domain-tld small, .domain-tld .field-error { grid-column: 1 / -1; }
.domain-input { font-family: ui-monospace, Consolas, monospace; }
.domain-input.invalid { border-color: var(--color-danger) !important; }
.domain-required { display: block; color: var(--accent-deep); font-size: 0.72rem; font-weight: 600; }

/* Correos al cliente */
.mail-options { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.mail-options .check-label { margin: 0; }
.mail-banner { margin: 12px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-deep); font-size: 0.84rem; }
.pay-mail { margin: -2px 0 12px; font-size: 0.84rem; }
.pay-modal .check-label { display: flex; font-weight: 500; color: var(--color-text); margin-bottom: 12px; }

.code-link { text-decoration: none; }
.code-link:hover code { text-decoration: underline; }
.link-btn .icon { width: 14px; height: 14px; vertical-align: -2px; }
.row-actions { display: flex; gap: 12px; margin-top: 2px; }
.product-group { margin-bottom: 14px; }
.product-group-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 4px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.order-items { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.order-item {
    display: grid;
    grid-template-columns: 2fr 1.3fr 1.1fr 1fr 1fr 1.4fr 32px;
    gap: 8px;
    align-items: start;
    background: var(--color-bg);
    border-radius: 12px;
    padding: 8px;
}
.order-item-head { background: none; padding: 0 8px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--color-text-muted); letter-spacing: .04em; }
.order-item input, .order-item select { padding: 7px 8px; font-size: 0.84rem; }
.price-edited { border-color: var(--accent-strong) !important; background: var(--accent-soft) !important; }
.order-total { margin-right: auto; font-weight: 700; }
.manual-item { display: grid; grid-template-columns: 1fr 140px 32px; gap: 8px; margin-bottom: 8px; }

/* Contenido de la hoja (factura) */
.invoice-doc { position: relative; display: flex; flex-direction: column; gap: 26px; color: #1f2430; font-size: 0.9rem; }
.inv-muted { color: #7b8190; font-size: 0.82rem; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.inv-company { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 4px; }
.inv-number { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.inv-kind { font-size: 0.68rem; letter-spacing: .14em; text-transform: uppercase; color: #7b8190; font-weight: 700; }
.inv-number strong { font-size: 1.5rem; font-family: ui-monospace, Consolas, monospace; letter-spacing: -.02em; }
.inv-meta { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 18px 0; border-top: 1px solid #eceef2; border-bottom: 1px solid #eceef2; }
.inv-party { display: flex; flex-direction: column; gap: 3px; min-width: 220px; }
.inv-label { font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: #7b8190; font-weight: 700; margin-bottom: 2px; }
.inv-client { font-size: 1.08rem; }
.inv-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, auto)); gap: 4px 24px; margin: 0; align-content: start; }
.inv-dates div { display: flex; flex-direction: column; gap: 2px; }
.inv-dates dt { font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: #7b8190; font-weight: 700; }
.inv-dates dd { margin: 0; font-weight: 600; }
.inv-items { width: 100%; border-collapse: collapse; }
.inv-items th { text-align: left; font-size: 0.68rem; letter-spacing: .08em; text-transform: uppercase; color: #7b8190; font-weight: 700; padding: 0 12px 10px; border-bottom: 2px solid #1f2430; }
.inv-items td { padding: 14px 12px; border-bottom: 1px solid #eceef2; vertical-align: top; }
.inv-items th:first-child, .inv-items td:first-child { padding-left: 0; }
.inv-items th:last-child, .inv-items td:last-child { padding-right: 0; }
.inv-desc { font-weight: 600; white-space: pre-line; }
.inv-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-top: -8px; }
.inv-totals > div { display: flex; gap: 24px; justify-content: space-between; min-width: 300px; font-size: 0.9rem; color: #5b6170; }
.inv-totals > div b { color: #1f2430; }
.inv-balance { margin-top: 4px; padding: 12px 16px; background: #f6f7f9; border-radius: 10px; font-size: 1.1rem !important; color: #1f2430 !important; }
.inv-balance.due { background: #fef2f2; }
.inv-balance.due b { color: var(--color-danger) !important; }
.inv-payments h4 { margin: 0 0 8px; font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; color: #7b8190; }
.inv-payment { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed #e3e5ea; }
.inv-pay-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-success); box-shadow: 0 0 0 4px #dcfce7; }
.inv-notes { white-space: pre-line; font-size: 0.85rem; background: #fffaf0; border-left: 3px solid var(--accent-strong); border-radius: 0 10px 10px 0; padding: 12px 14px; margin: 0; }
.inv-footer { font-size: 0.76rem; color: #7b8190; border-top: 1px solid #eceef2; padding-top: 14px; text-align: center; white-space: pre-line; }
.inv-qr { width: 104px; height: 104px; margin-top: 6px; image-rendering: pixelated; border: 1px solid #eceef2; border-radius: 6px; }
.inv-logo { display: block; max-height: 64px; max-width: 240px; object-fit: contain; margin-bottom: 10px; }
.inv-pre { white-space: pre-line; }
.inv-doc-note { white-space: pre-line; font-size: 0.86rem; line-height: 1.55; padding: 14px 16px; border-radius: 10px; border: 1px solid #f2d36b; background: #fffbea; }
.inv-stamp {
    position: absolute;
    top: 80px;
    right: 26%;
    transform: rotate(-12deg);
    border: 3px solid currentColor;
    border-radius: 10px;
    padding: 4px 16px;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: .12em;
    opacity: .16;
    pointer-events: none;
}
.inv-stamp.paid { color: var(--color-success); }
.inv-stamp.void { color: var(--color-danger); }

.inv-period-m { display: none; }
.paper-stage, .paper-sheet, .invoice-doc { min-width: 0; }
@media (max-width: 700px) {
    .modal-overlay.paper-overlay { padding: 8px 8px 24px; }
    .paper-sheet { padding: 32px 18px 24px; }
    .tb-label { display: none; }
    .paper-toolbar { flex-wrap: wrap; padding: 8px; }
    .paper-toolbar-title { order: 1; flex: 1 1 calc(100% - 50px); padding-left: 6px; }
    .tb-close { order: 2; }
    .paper-toolbar-actions { order: 3; width: 100%; justify-content: stretch; }
    .paper-toolbar-actions .tb-btn { flex: 1; justify-content: center; }
    .inv-period { display: none; }
    .inv-period-m { display: block; }
    .inv-meta { flex-direction: column; gap: 14px; }
    .inv-party { min-width: 0; }
    .inv-head { flex-direction: column; }
    .inv-number { align-items: flex-start; text-align: left; }
    .inv-totals > div { min-width: 0; width: 100%; }
    .inv-stamp { display: none; }
    .pay-actions { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .order-item { grid-template-columns: 1fr 1fr; }
    .order-item-head { display: none; }
}

/* ================= FICHA LATERAL ================= */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 26, .35);
    z-index: 330;
    display: flex;
    justify-content: flex-end;
}
.drawer {
    width: min(620px, 100vw);
    height: 100%;
    background: var(--color-bg);
    box-shadow: -20px 0 50px rgba(0, 0, 0, .18);
    overflow-y: auto;
    border-radius: 24px 0 0 24px;
}
.drawer-enter { transition: transform .25s var(--ease-out); }
.drawer-enter-start { transform: translateX(40px); }
.drawer-enter-end { transform: translateX(0); }
.drawer-inner { padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 14px; }
.drawer-inner h4 { margin: 10px 0 4px; font-size: 0.86rem; }
.drawer-head { background: var(--color-surface); border-radius: 20px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.drawer-head h2 { margin: 4px 0 0; font-size: 1.3rem; }
.drawer-head-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-close { margin-left: auto; }
.drawer-links { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; }
.drawer-links a { color: var(--accent-deep); font-weight: 600; text-decoration: none; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.select-sm { min-width: 0; width: auto; padding: 8px 10px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.next-box {
    background: var(--accent-soft);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.next-box-label { font-size: 0.7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-deep); }
.next-box-main { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
.next-box.overdue { background: #fee2e2; }
.next-box.overdue .next-box-label { color: var(--color-danger); }

.amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.amount {
    background: var(--color-surface);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-top: 3px solid #e7e5df;
}
.amount span { font-size: 0.68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-muted); font-weight: 700; }
.amount span i { font-style: normal; font-size: 0.6rem; background: #eef2ff; color: #4338ca; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.amount b { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.amount small { font-size: 0.7rem; color: var(--color-text-muted); }
.amount-proj { border-top-color: var(--accent-strong); }
.amount-commit { border-top-color: var(--accent-lime); }
.amount-closed { border-top-color: var(--color-success); }
.amount-balance { border-top-color: var(--color-ink); }
.amount-balance.due b { color: var(--color-danger); }

.tabs-sm { margin-bottom: 0; }
.tabs-sm .tab { padding: 6px 12px; font-size: 0.8rem; }

.details { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; margin: 0; font-size: 0.86rem; background: var(--color-surface); border-radius: 16px; padding: 14px 16px; }
.details dt { color: var(--color-text-muted); }
.details dd { margin: 0; }
.prose { background: var(--color-surface); border-radius: 16px; padding: 12px 16px; font-size: 0.86rem; }
.prose p { margin: 4px 0 0; white-space: pre-line; line-height: 1.5; }

.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: #e7e5df; }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: #d6d3cb; margin-top: 4px; flex-shrink: 0; position: relative; z-index: 1; }
.tl-dot.ok { background: var(--color-success); }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; }
.tl-notes { font-size: 0.86rem; white-space: pre-line; line-height: 1.45; background: var(--color-surface); border-radius: 10px; padding: 8px 10px; }

.opp-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: var(--color-surface);
    border: none;
    border-radius: 14px;
    padding: 10px 12px;
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
}
.opp-row:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.opp-row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Formularios de oportunidad / gestión */
.modal-top { z-index: 360; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sub-grid { gap: 0 16px; }
.next-fieldset { border: 1.5px solid var(--accent); border-radius: 16px; padding: 10px 14px 0; margin: 6px 0 0; }
.next-fieldset legend { font-size: 0.78rem; font-weight: 800; color: var(--accent-deep); padding: 0 6px; }
.commit-box { background: #f7fee7; border-radius: 14px; padding: 12px 14px 2px; margin: 4px 0 8px; }
.commit-box > strong { display: block; font-size: 0.82rem; margin-bottom: 8px; color: #3f6212; }
.commit-won { background: #dcfce7; }
.commit-lost { background: #fef2f2; }
.party-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 10px 14px;
}
.party-search { position: relative; }
.party-results {
    margin-top: 6px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    max-height: 260px;
    overflow-y: auto;
    background: var(--color-surface);
}
.party-result {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #f0eee8;
    background: none;
    padding: 9px 12px;
    font: inherit;
    font-size: 0.86rem;
    cursor: pointer;
}
.party-result:hover { background: var(--accent-soft); }
.dupes { background: #fef3c7; border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dupe { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--color-text); text-decoration: none; font-size: 0.86rem; }
.dupe:hover b { text-decoration: underline; }

@media (max-width: 700px) {
    .form-grid-3 { grid-template-columns: 1fr; }
    .details { grid-template-columns: 1fr; }
    .board-col { flex-basis: 85vw; }
    .drawer { border-radius: 0; }
}

/* Modales */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 26, .45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 16px 16px;
    z-index: 350;
    overflow-y: auto;
}
.modal-box {
    background: var(--color-surface);
    border-radius: 22px;
    padding: 22px 24px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    animation: login-rise .25s var(--ease-out) both;
}
.modal-lg { max-width: 680px; }
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.modal-head h3 { margin: 0; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.modal-box > .muted { font-size: 0.86rem; line-height: 1.45; margin: 0 0 14px; }

@media (max-width: 900px) {
    .split { grid-template-columns: 1fr; }
    .split-side { flex-direction: row; overflow-x: auto; }
    .split-side-head { display: none; }
    .side-item { white-space: nowrap; }
    .week-day { grid-template-columns: 1fr; gap: 6px; }
    .setting-row { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
    .select-inline { min-width: 0; width: 100%; }
}

/* --- Toast --- */
.toast {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
    font-size: 0.88rem;
    max-width: min(380px, calc(100vw - 32px));
    border-left: 4px solid var(--color-text-muted);
}
.toast-success { border-left-color: var(--color-success); color: #166534; }
.toast-success .icon { color: var(--color-success); }
.toast-warning { border-left-color: var(--color-warning); color: #92400e; }
.toast-warning .icon { color: var(--color-warning); }
.toast-error { border-left-color: var(--color-danger); color: #991b1b; }
.toast-error .icon { color: var(--color-danger); }
.toast button {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: .6;
    margin-left: auto;
    padding: 0;
}
.toast button:hover { opacity: 1; }

/* --- Responsive del shell --- */
@media (max-width: 900px) {
    .app-shell { padding: 8px; }
    .shell-card { border-radius: 20px; }

    .side-nav,
    .side-nav.collapsed {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px;
        z-index: 250;
        transform: translateX(-100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, .3);
    }
    .side-nav.mobile-open { transform: translateX(0); }
    .side-nav.collapsed .nav-label { display: initial; }
    .side-nav.collapsed .side-nav-menu button { justify-content: flex-start; padding: 11px 14px; }
    .side-nav-collapse { display: none; }

    .side-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .35);
        z-index: 240;
    }

    .main-area { margin: 8px; border-radius: 16px; }
    .mobile-only { display: flex; }
    .top-header { padding: 14px 16px 6px; }
    main.content { padding: 8px 16px 20px; }
}

@media (max-width: 560px) {
    .top-header-user-info { display: none; }
    .top-header-user { padding: 3px; }
    .greeting-title { font-size: 1.05rem; }
    .module-placeholder { padding: 32px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
