/* =====================================================================
   ScaffoldPro · Design system
   Paleta: navy industrial + ámbar de seguridad
   ===================================================================== */
:root {
    --sp-font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --sp-mono: 'JetBrains Mono', ui-monospace, monospace;

    --sp-bg: #f4f6fa;
    --sp-surface: #ffffff;
    --sp-surface-2: #f8fafc;
    --sp-border: #e5e9f0;
    --sp-text: #0f172a;
    --sp-muted: #64748b;
    --sp-faint: #94a3b8;

    --sp-accent: #f59e0b;
    --sp-accent-600: #d97706;
    --sp-accent-50: #fff8eb;
    --sp-primary: #1d4ed8;
    --sp-primary-50: #eef3ff;

    --sp-success: #059669; --sp-success-50: #ecfdf5;
    --sp-warning: #d97706; --sp-warning-50: #fffbeb;
    --sp-danger:  #dc2626; --sp-danger-50:  #fef2f2;
    --sp-info:    #0284c7; --sp-info-50:    #f0f9ff;

    --sp-side: #0b1220;
    --sp-side-2: #121b2e;
    --sp-side-text: #9aa8bf;

    --sp-radius: 14px;
    --sp-radius-sm: 10px;
    --sp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
    --sp-shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);
    --sb-w: 264px;

    --bs-body-font-family: var(--sp-font);
    --bs-primary: var(--sp-primary);
    --bs-primary-rgb: 29, 78, 216;
    --bs-border-radius: var(--sp-radius-sm);
}
[data-bs-theme="dark"] {
    --sp-bg: #0a0f1a;
    --sp-surface: #111827;
    --sp-surface-2: #0f1624;
    --sp-border: #1f2a3d;
    --sp-text: #e5e9f0;
    --sp-muted: #94a3b8;
    --sp-faint: #64748b;
    --sp-accent-50: rgba(245, 158, 11, .12);
    --sp-primary-50: rgba(59, 130, 246, .14);
    --sp-success-50: rgba(16, 185, 129, .14);
    --sp-warning-50: rgba(245, 158, 11, .14);
    --sp-danger-50: rgba(239, 68, 68, .14);
    --sp-info-50: rgba(14, 165, 233, .14);
    --sp-side: #070b14;
    --sp-side-2: #0e1525;
    --sp-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --bs-body-bg: var(--sp-bg);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    font-family: var(--sp-font);
    background: var(--sp-bg);
    color: var(--sp-text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -.005em;
}
a { color: var(--sp-primary); text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: inherit; }
.hero h2, .login-art h1 { color: #fff; }
.mono { font-family: var(--sp-mono); font-size: .92em; }

/* ---------------- Layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sb-w); position: fixed; inset: 0 auto 0 0; z-index: 1040;
    background: linear-gradient(180deg, var(--sp-side) 0%, var(--sp-side-2) 100%);
    display: flex; flex-direction: column; color: var(--sp-side-text);
    border-right: 1px solid rgba(255, 255, 255, .04);
    transition: transform .25s ease;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; color: #fff; }
.brand strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.brand small { display: block; font-size: 11px; color: var(--sp-side-text); line-height: 1.2; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: #24304a transparent; }
.nav-group { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #56627a; padding: 18px 12px 6px; }
.nav-link-sp {
    display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0;
    border-radius: 9px; color: var(--sp-side-text); font-weight: 500; position: relative;
    transition: background .15s, color .15s;
}
.nav-link-sp i { font-size: 17px; width: 20px; text-align: center; }
.nav-link-sp:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-link-sp.active { background: rgba(245, 158, 11, .12); color: #fff; }
.nav-link-sp.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sp-accent); }
.nav-link-sp.active i { color: var(--sp-accent); }
.nav-link-sp em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 700; border-radius: 20px; padding: 1px 8px; }
.pill-count { background: var(--sp-danger); color: #fff; }
.pill-new { background: linear-gradient(90deg, #f59e0b, #f97316); color: #1a1205; }
.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(255, 255, 255, .05); }
.ia-status { display: flex; gap: 12px; align-items: center; background: rgba(255, 255, 255, .04); border-radius: 10px; padding: 10px 12px; }
.ia-status small { display: block; font-size: 10.5px; color: #56627a; text-transform: uppercase; letter-spacing: .08em; }
.ia-status b { color: #e2e8f0; font-size: 12.5px; font-weight: 600; }
.pulse { width: 9px; height: 9px; border-radius: 50%; flex: none; position: relative; }
.pulse.on { background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
.pulse.local { background: var(--sp-accent); box-shadow: 0 0 0 0 rgba(245, 158, 11, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(0, 0, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); } }

.main { flex: 1; margin-left: var(--sb-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 16px;
    padding: 14px 28px; background: color-mix(in srgb, var(--sp-bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--sp-border);
}
.page-head h1 { font-size: 20px; font-weight: 750; margin: 0; letter-spacing: -.025em; }
.page-head p { margin: 1px 0 0; color: var(--sp-muted); font-size: 13px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn-icon {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--sp-border); background: var(--sp-surface);
    color: var(--sp-text); display: inline-grid; place-items: center; font-size: 17px; transition: .15s;
}
.btn-icon:hover { border-color: var(--sp-faint); }
.user-chip { display: flex; align-items: center; gap: 10px; border: 1px solid var(--sp-border); background: var(--sp-surface); border-radius: 12px; padding: 4px 12px 4px 4px; color: var(--sp-text); }
.user-chip b { display: block; font-size: 13px; line-height: 1.1; }
.user-chip small { font-size: 11px; color: var(--sp-muted); }
.avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #1a1205; background: linear-gradient(135deg, #fbbf24, #f97316); }
.content { padding: 24px 28px 32px; flex: 1; }
.foot { padding: 16px 28px; color: var(--sp-faint); font-size: 12px; border-top: 1px solid var(--sp-border); }
.foot span { float: right; font-family: var(--sp-mono); }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    body.sb-open .sidebar { transform: none; }
    body.sb-open .sidebar-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 1035; }
    .main { margin-left: 0; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
}

/* ---------------- Cards ---------------- */
.card-sp { background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); box-shadow: var(--sp-shadow); }
.card-sp > .card-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--sp-border); }
.card-h h6 { margin: 0; font-weight: 700; font-size: 14.5px; letter-spacing: -.01em; }
.card-h small { color: var(--sp-muted); }
.card-h .ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sp-primary-50); color: var(--sp-primary); }
.card-h .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 20px; }

/* KPI */
.kpi { position: relative; padding: 18px 20px; overflow: hidden; height: 100%; }
.kpi .k-label { color: var(--sp-muted); font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.kpi .k-val { font-size: 30px; font-weight: 800; letter-spacing: -.035em; margin-top: 6px; line-height: 1; }
.kpi .k-sub { font-size: 12px; color: var(--sp-muted); margin-top: 8px; }
.kpi .k-ico { position: absolute; right: 16px; top: 16px; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; }
.k-ico.c-primary { background: var(--sp-primary-50); color: var(--sp-primary); }
.k-ico.c-success { background: var(--sp-success-50); color: var(--sp-success); }
.k-ico.c-warning { background: var(--sp-warning-50); color: var(--sp-warning); }
.k-ico.c-danger { background: var(--sp-danger-50); color: var(--sp-danger); }
.k-ico.c-accent { background: var(--sp-accent-50); color: var(--sp-accent-600); }
.trend-up { color: var(--sp-success); font-weight: 600; }
.trend-down { color: var(--sp-danger); font-weight: 600; }

/* Hero banner */
.hero {
    border-radius: var(--sp-radius); padding: 26px 28px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(1200px 300px at 100% 0%, rgba(245, 158, 11, .35), transparent 60%),
                linear-gradient(120deg, #0b1220 0%, #16233d 60%, #1c2c4d 100%);
}
.hero::after {
    content: ''; position: absolute; right: -30px; bottom: -30px; width: 280px; height: 200px; opacity: .14;
    background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 46px), repeating-linear-gradient(0deg, #fff 0 3px, transparent 3px 46px);
    transform: skewX(-8deg);
}
.hero h2 { font-weight: 800; letter-spacing: -.03em; font-size: 24px; margin: 0; }
.hero p { color: #b6c2d6; margin: 6px 0 0; max-width: 560px; }
.hero .btn { position: relative; z-index: 1; }

/* ---------------- Buttons ---------------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; font-size: 13.5px; }
.btn-sm { padding: .3rem .65rem; font-size: 12.5px; border-radius: 8px; }
.btn-accent { background: var(--sp-accent); color: #1a1205; border: 0; }
.btn-accent:hover { background: var(--sp-accent-600); color: #1a1205; }
.btn-primary { background: var(--sp-primary); border-color: var(--sp-primary); }
.btn-soft { background: var(--sp-surface-2); border: 1px solid var(--sp-border); color: var(--sp-text); }
.btn-soft:hover { border-color: var(--sp-faint); color: var(--sp-text); background: var(--sp-surface); }
.btn-ghost-danger { color: var(--sp-danger); background: transparent; border: 1px solid transparent; }
.btn-ghost-danger:hover { background: var(--sp-danger-50); color: var(--sp-danger); }
.btn-ai { color: #fff; border: 0; background: linear-gradient(110deg, #6d28d9, #2563eb 55%, #0891b2); box-shadow: 0 6px 18px rgba(79, 70, 229, .3); }
.btn-ai:hover { color: #fff; filter: brightness(1.08); }
.act-btns { display: flex; gap: 4px; justify-content: flex-end; }
.act-btns .btn { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; }

/* ---------------- Tables ---------------- */
.table-sp { margin: 0; --bs-table-bg: transparent; }
.table-sp thead th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--sp-muted); font-weight: 700;
    background: var(--sp-surface-2); border-bottom: 1px solid var(--sp-border); padding: 11px 16px; white-space: nowrap;
}
.table-sp tbody td { padding: 12px 16px; border-color: var(--sp-border); vertical-align: middle; }
.table-sp tbody tr { transition: background .12s; }
.table-sp tbody tr:hover { background: var(--sp-surface-2); }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--sp-muted); }
.thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; border: 1px solid var(--sp-border); }
.thumb-ph { width: 44px; height: 44px; border-radius: 9px; display: grid; place-items: center; background: var(--sp-surface-2); color: var(--sp-faint); border: 1px dashed var(--sp-border); }

/* Chips / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 10px; white-space: nowrap; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip-success { background: var(--sp-success-50); color: var(--sp-success); }
.chip-warning { background: var(--sp-warning-50); color: var(--sp-warning); }
.chip-danger { background: var(--sp-danger-50); color: var(--sp-danger); }
.chip-info { background: var(--sp-info-50); color: var(--sp-info); }
.chip-primary { background: var(--sp-primary-50); color: var(--sp-primary); }
.chip-muted { background: var(--sp-surface-2); color: var(--sp-muted); border: 1px solid var(--sp-border); }
.chip-ai { background: linear-gradient(90deg, rgba(109, 40, 217, .12), rgba(8, 145, 178, .12)); color: #6d28d9; }
[data-bs-theme="dark"] .chip-ai { color: #c4b5fd; }

/* ---------------- Forms ---------------- */
.form-label { font-weight: 600; font-size: 12.5px; color: var(--sp-text); margin-bottom: 6px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--sp-border); padding: .55rem .8rem; font-size: 13.5px; background-color: var(--sp-surface); }
.form-control:focus, .form-select:focus { border-color: var(--sp-accent); box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--sp-faint); pointer-events: none; }
.input-icon > .form-control, .input-icon > .form-select { padding-left: 36px; }
.form-section { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.form-section .num { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--sp-accent-50); color: var(--sp-accent-600); }
.form-section h6 { margin: 0; font-weight: 700; }
.form-section p { margin: 2px 0 0; color: var(--sp-muted); font-size: 12.5px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .form-control, .filters .form-select { min-width: 160px; }
.req::after { content: ' *'; color: var(--sp-danger); }

/* Checklist */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.check-item { display: flex; gap: 12px; align-items: center; border: 1px solid var(--sp-border); border-radius: 12px; padding: 10px 12px; background: var(--sp-surface); transition: .15s; }
.check-item.ok { border-color: color-mix(in srgb, var(--sp-success) 40%, transparent); background: var(--sp-success-50); }
.check-item.ko { border-color: color-mix(in srgb, var(--sp-danger) 40%, transparent); background: var(--sp-danger-50); }
.check-item .ci-txt { flex: 1; font-size: 13px; font-weight: 500; line-height: 1.3; }
.check-item .ci-txt small { display: block; font-size: 11px; color: var(--sp-muted); font-weight: 500; }
.check-item .ai-flag { font-size: 10px; font-weight: 700; color: #6d28d9; }
.tri { display: inline-flex; border: 1px solid var(--sp-border); border-radius: 9px; overflow: hidden; flex: none; background: var(--sp-surface); }
.tri input { display: none; }
.tri label { padding: 4px 9px; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--sp-muted); }
.tri input:checked + label.l-ok { background: var(--sp-success); color: #fff; }
.tri input:checked + label.l-ko { background: var(--sp-danger); color: #fff; }
.tri input:checked + label.l-na { background: var(--sp-faint); color: #fff; }

/* Dropzone */
.dropzone {
    border: 2px dashed var(--sp-border); border-radius: var(--sp-radius); padding: 28px 18px; text-align: center; cursor: pointer;
    background: var(--sp-surface-2); transition: .2s; position: relative;
}
.dropzone:hover, .dropzone.drag { border-color: var(--sp-accent); background: var(--sp-accent-50); }
.dropzone .dz-ico { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; background: var(--sp-surface); color: var(--sp-accent-600); box-shadow: var(--sp-shadow); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-preview { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; }

/* ---------------- IA ---------------- */
.ai-panel { border-radius: var(--sp-radius); position: relative; overflow: hidden; }
.ai-scan { position: relative; border-radius: 12px; overflow: hidden; background: #0b1220; }
.ai-scan img { display: block; width: 100%; max-height: 460px; object-fit: contain; }
.ai-scan.scanning::after {
    content: ''; position: absolute; left: 0; right: 0; height: 90px; top: -90px;
    background: linear-gradient(180deg, transparent, rgba(56, 189, 248, .35), transparent);
    animation: scan 1.6s linear infinite;
}
.ai-scan.scanning::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(56, 189, 248, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(56, 189, 248, .12) 1px, transparent 1px); background-size: 28px 28px; z-index: 1; }
@keyframes scan { to { top: 100%; } }
.ai-steps { list-style: none; padding: 0; margin: 0; }
.ai-steps li { display: flex; gap: 10px; align-items: center; padding: 7px 0; color: var(--sp-muted); font-size: 13px; }
.ai-steps li i { width: 18px; }
.ai-steps li.done { color: var(--sp-text); }
.ai-steps li.done i { color: var(--sp-success); }
.ai-steps li.run i { color: var(--sp-primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.metric { background: var(--sp-surface-2); border: 1px solid var(--sp-border); border-radius: 12px; padding: 12px 14px; height: 100%; }
.metric small { display: block; font-size: 11px; font-weight: 700; color: var(--sp-muted); text-transform: uppercase; letter-spacing: .06em; }
.metric b { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.metric span { font-size: 12px; color: var(--sp-muted); margin-left: 3px; }
.gauge { --v: 0; width: 120px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
    background: conic-gradient(var(--gc, var(--sp-success)) calc(var(--v) * 1%), var(--sp-border) 0); }
.gauge > div { width: 84%; aspect-ratio: 1; border-radius: 50%; background: var(--sp-surface); display: grid; place-items: center; text-align: center; }
.gauge b { font-size: 26px; font-weight: 800; line-height: 1; }
.gauge small { font-size: 10.5px; color: var(--sp-muted); font-weight: 600; text-transform: uppercase; }
.brand-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--sp-border); }
.brand-row:last-child { border-bottom: 0; }
.brand-row .bar { flex: 1; height: 8px; border-radius: 6px; background: var(--sp-surface-2); overflow: hidden; }
.brand-row .bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #fbbf24, #f97316); }
.brand-row.sel .bar > i { background: linear-gradient(90deg, #2563eb, #0891b2); }
.brand-row b { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.ai-note { border-left: 3px solid #7c3aed; background: var(--sp-surface-2); border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 13px; }

/* Timeline (aprobaciones) */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--sp-border); }
.timeline li { position: relative; padding: 0 0 18px 46px; }
.timeline .tl-dot { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; border: 3px solid var(--sp-surface); }
.timeline b { display: block; font-size: 13.5px; }
.timeline small { color: var(--sp-muted); }

/* Detail */
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.dl > div small { display: block; color: var(--sp-muted); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.dl > div b { font-weight: 600; }
.tarjeta-big { border-radius: var(--sp-radius); padding: 18px; color: #fff; display: flex; align-items: center; gap: 14px; }
.tarjeta-big.VERDE { background: linear-gradient(135deg, #047857, #10b981); }
.tarjeta-big.AMARILLA { background: linear-gradient(135deg, #b45309, #f59e0b); }
.tarjeta-big.ROJA { background: linear-gradient(135deg, #991b1b, #ef4444); }
.tarjeta-big.NONE { background: linear-gradient(135deg, #334155, #64748b); }
.tarjeta-big i { font-size: 30px; }
.tarjeta-big b { font-size: 18px; display: block; }
.map-box { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--sp-border); z-index: 0; }

/* Empty / misc */
.empty { text-align: center; padding: 48px 20px; }
.empty-ico { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; font-size: 28px; background: var(--sp-surface-2); color: var(--sp-faint); }
.empty h6 { font-weight: 700; margin-bottom: 4px; }
.empty p { color: var(--sp-muted); font-size: 13px; }
.pagination .page-link { border-radius: 8px !important; margin: 0 2px; border-color: var(--sp-border); color: var(--sp-text); font-weight: 600; font-size: 13px; background: var(--sp-surface); }
.pagination .active .page-link { background: var(--sp-text); border-color: var(--sp-text); color: var(--sp-surface); }
.modal-content { border-radius: 16px; background: var(--sp-surface); }
.modal-header { border-bottom-color: var(--sp-border); padding: 18px 22px; }
.modal-footer { border-top-color: var(--sp-border); }
.modal-title { font-weight: 700; font-size: 16px; }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 24px; background: var(--sp-danger-50); color: var(--sp-danger); }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sp-border); }
.list-plain li:last-child { border-bottom: 0; }
.alert-item-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* Toasts */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.sp-toast { min-width: 280px; max-width: 380px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 12px; box-shadow: var(--sp-shadow-lg); padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; animation: tin .25s ease; font-size: 13.5px; }
.sp-toast i { font-size: 18px; }
.sp-toast.success i { color: var(--sp-success); } .sp-toast.danger i { color: var(--sp-danger); }
.sp-toast.warning i { color: var(--sp-warning); } .sp-toast.info i { color: var(--sp-info); }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }

/* Login */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
    background: radial-gradient(800px 400px at 0% 100%, rgba(245, 158, 11, .35), transparent 60%), linear-gradient(140deg, #070b14, #13203a 70%, #1b2d50); }
.login-art .grid-art { position: absolute; inset: 0; opacity: .1;
    background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 80px), repeating-linear-gradient(0deg, #fff 0 3px, transparent 3px 80px), repeating-linear-gradient(45deg, transparent 0 110px, #fff 110px 113px, transparent 113px 226px); }
.login-art h1 { font-size: 40px; font-weight: 800; letter-spacing: -.04em; line-height: 1.08; max-width: 520px; position: relative; }
.login-art p { color: #aab6cb; max-width: 460px; position: relative; font-size: 15px; }
.login-feats { display: flex; gap: 22px; flex-wrap: wrap; position: relative; }
.login-feats div { display: flex; gap: 10px; align-items: center; color: #d5ddea; font-size: 13px; }
.login-feats i { color: var(--sp-accent); font-size: 18px; }
.login-form { display: grid; place-items: center; padding: 32px; background: var(--sp-surface); }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-weight: 800; letter-spacing: -.03em; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* Print */
@media print {
    .sidebar, .topbar, .foot, .no-print, .toast-stack { display: none !important; }
    .main { margin: 0; } .content { padding: 0; }
    .card-sp { box-shadow: none; break-inside: avoid; }
    body { background: #fff; }
}
