/* Panel CS · CompuServicios BCS
   Sistema de diseño: tokens de marca + componentes. Sin compilación. */

:root {
    /* Marca */
    --navy: #0A1628;
    --navy-2: #12223A;
    --navy-3: #1B2F4D;
    --blue: #0D47A1;
    --blue-600: #0B3D8A;
    --blue-50: #EAF1FC;
    --cyan: #00B4D8;
    --cyan-50: #E3F7FB;
    --orange: #FF6B35;
    --orange-600: #E85A26;
    --orange-50: #FFF0EA;
    --yellow: #FFD60A;

    /* Estados */
    --ok: #2A7A52;
    --ok-50: #E7F4EC;
    --err: #C2410C;
    --err-50: #FDEDE6;
    --warn: #8A6100;
    --warn-50: #FFF6D6;

    /* Neutros */
    --bg: #F3F5F9;
    --surface: #FFFFFF;
    --surface-2: #F7F9FC;
    --border: #E2E7EF;
    --border-strong: #CBD3DF;
    --text: #0F1B2D;
    --text-2: #43536B;
    --muted: #6B7A90;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(10, 22, 40, .05), 0 4px 16px rgba(10, 22, 40, .05);
    --shadow-lg: 0 12px 40px rgba(10, 22, 40, .18);
    --ring: 0 0 0 3px rgba(0, 180, 216, .35);

    --font: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-display: "Space Grotesk", "DM Sans", system-ui, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: none; box-shadow: var(--ring); }

/* ---------- LOGIN ---------- */
.login { position: fixed; inset: 0; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--surface); z-index: 50; }
.login-brand {
    background: radial-gradient(1200px 600px at 0% 100%, rgba(0, 180, 216, .22), transparent 60%),
                radial-gradient(800px 500px at 100% 0%, rgba(13, 71, 161, .55), transparent 60%),
                var(--navy);
    color: #fff; display: flex; align-items: center; padding: 48px;
}
.login-brand-inner { max-width: 440px; }
.login-logo { width: 72px; height: 72px; background: #fff; border-radius: 18px; padding: 10px; margin-bottom: 28px; }
.login-brand h1 { font-size: 44px; line-height: 1.05; margin-bottom: 14px; }
.login-brand p { color: #B9C6DA; font-size: 17px; }
.login-points { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 14px; }
.login-points li { display: flex; align-items: center; gap: 12px; color: #DCE5F2; }
.login-points i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--cyan); }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form-logo { width: 180px; margin: 0 0 8px -12px; }
.login-form h2 { font-size: 28px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; }

/* ---------- LAYOUT ---------- */
.app { display: flex; height: 100vh; }
.sidebar { width: 244px; flex-shrink: 0; background: var(--navy); color: #C9D4E5; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 24px; }
.sidebar-logo { width: 38px; height: 38px; background: #fff; border-radius: 10px; padding: 5px; flex-shrink: 0; }
.sidebar-title { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 18px; white-space: nowrap; }
.version-tag { font-family: var(--font); font-size: 10px; font-weight: 700; background: var(--cyan); color: var(--navy); padding: 2px 6px; border-radius: 6px; margin-left: 4px; vertical-align: middle; }
.sidebar-nav { display: grid; gap: 4px; padding: 0 12px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--navy-3); }
.nav-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px;
    background: none; border: 0; border-radius: 10px; color: inherit; cursor: pointer; text-align: left; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-btn i { width: 20px; text-align: center; font-size: 16px; }
.nav-btn:hover { background: var(--navy-2); color: #fff; }
.nav-btn.active { background: var(--blue); color: #fff; box-shadow: inset 3px 0 0 var(--cyan); }
.nav-logout:hover { color: #FFB59A; }

.main { flex: 1; min-width: 0; overflow-y: auto; padding: 0 32px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 0 20px; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.topbar-title { font-size: 26px; }
.topbar-sub { color: var(--muted); font-size: 14px; }
.topbar-status { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.view { animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.split-even { grid-template-columns: 1fr 1fr; margin-bottom: 24px; }
.stack { display: grid; gap: 20px; }
.sticky { position: sticky; top: 96px; display: grid; gap: 16px; }

/* ---------- CARDS ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.card-head h3 { font-size: 17px; }
.card-head p { color: var(--muted); font-size: 13px; }
.push-right { margin-left: auto; }
.step {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue); font-weight: 700; font-family: var(--font-display); font-size: 14px;
}
.card.is-done .step { background: var(--ok); color: #fff; }
.card.is-disabled { opacity: .55; }
.card-dark { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-lg); }

/* ---------- FORMS ---------- */
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-help { font-size: 12px; color: var(--muted); }
.form-grid { display: grid; gap: 14px; }
.form-error { color: var(--err); background: var(--err-50); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; }
.input {
    width: 100%; height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: #9AA7B9; }
.input:hover { border-color: #AEB9C9; }
.input:focus { outline: none; border-color: var(--cyan); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); }
.select { appearance: none; padding-right: 38px; cursor: pointer; font-weight: 600;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%236B7A90' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; }
.select-sm { width: auto; min-width: 160px; font-weight: 500; }
.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-addon { width: 46px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); cursor: pointer; color: var(--muted); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px;
    border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 600; font-size: 14px; cursor: pointer;
    white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, opacity .15s; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 50px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; padding: 0; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-600); }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--orange-600); }
.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #AEB9C9; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost-danger { background: transparent; color: var(--err); }
.btn-ghost-danger:hover:not(:disabled) { background: var(--err-50); }
.btn-danger { background: var(--err); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-ghost-light { background: transparent; color: #C9D4E5; border-color: var(--navy-3); }
.btn-ghost-light:hover { background: var(--navy-2); color: #fff; }
.btn-link { background: none; border: 0; color: var(--blue); padding: 0; height: auto; margin-top: 12px; font-weight: 600; }
.btn-link:hover { text-decoration: underline; }
.btn .fa-spin { animation-duration: .8s; }

/* ---------- CHIPS / BADGES ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip-ok { background: var(--ok-50); border-color: transparent; color: var(--ok); }
.chip-err { background: var(--err-50); border-color: transparent; color: var(--err); }
.chip-warn { background: var(--warn-50); border-color: #F3DE8A; color: var(--warn); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge-err { background: var(--err-50); color: var(--err); border-color: transparent; }
.badge-blue { background: var(--blue-50); color: var(--blue); border-color: transparent; }
.badge-orange { background: var(--orange-50); color: var(--orange-600); border-color: transparent; }
.badge-cyan { background: var(--cyan-50); color: #007C96; border-color: transparent; }

/* ---------- BANNERS ---------- */
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }
.banner-error { background: var(--err-50); color: var(--err); }
.banner-info { background: var(--cyan-50); color: #035E72; }
.banner-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- SEARCH / DROPDOWN ---------- */
.search-box { position: relative; }
.search-box > i { position: absolute; left: 14px; top: 14px; color: var(--muted); font-size: 14px; pointer-events: none; }
.search-box > .input { padding-left: 40px; }
.grow { flex: 1; min-width: 200px; }
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 280px; overflow-y: auto; z-index: 30; padding: 6px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.dropdown-item:hover, .dropdown-item.active { background: var(--blue-50); }
.dropdown-item .mono { color: var(--muted); margin-left: auto; font-size: 12px; }
.dropdown-empty { padding: 12px; text-align: center; color: var(--muted); font-size: 13px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; font-family: var(--font-display); }
.dropdown-item .avatar { width: 30px; height: 30px; font-size: 13px; }

.selected-item { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.selected-info { display: grid; min-width: 0; flex: 1; }
.selected-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-info span { font-size: 13px; color: var(--muted); }
.file-icon { width: 38px; height: 44px; border-radius: 8px; display: grid; place-items: center; font-size: 18px; background: var(--err-50); color: var(--err); flex-shrink: 0; }
.file-icon.is-image { background: var(--cyan-50); color: #007C96; }
.file-icon.is-zip { background: var(--warn-50); color: var(--warn); }

/* ---------- DROPZONE ---------- */
.dropzone {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px 16px;
    border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
    color: var(--muted); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; font-size: 14px;
}
.dropzone input { display: none; }
.dropzone i { font-size: 26px; color: var(--blue); }
.dropzone strong { color: var(--blue); }
.dropzone:hover, .dropzone.drag { border-color: var(--cyan); background: var(--cyan-50); }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone-sm { padding: 20px 16px; }

/* ---------- PLANTILLAS / VARIABLES ---------- */
.tpl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tpl-meta:empty { display: none; }
.vars { display: grid; gap: 10px; margin-top: 16px; }
.vars:empty { display: none; }
.vars-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.var-row { display: grid; grid-template-columns: 44px 210px minmax(0, 1fr); gap: 8px; align-items: center; }
.var-tag { font-family: var(--font-mono); font-size: 12px; color: var(--blue); background: var(--blue-50); border-radius: 6px; padding: 4px 0; text-align: center; font-weight: 600; }
.var-row .input { height: 40px; }
.var-row .select { font-weight: 500; }
.var-auto { font-size: 13px; color: var(--text-2); background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); height: 40px; display: flex; align-items: center; padding: 0 12px; gap: 6px; }

/* ---------- VISTA PREVIA WHATSAPP ---------- */
.phone { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.phone-bar { display: flex; align-items: center; gap: 10px; background: #075E54; color: #fff; padding: 10px 14px; }
.phone-bar .avatar { width: 32px; height: 32px; background: #fff; padding: 4px; border-radius: 50%; }
.phone-bar strong { font-size: 14px; display: block; line-height: 1.2; }
.phone-bar span { font-size: 11px; opacity: .8; }
.phone-chat {
    background: #EFE7DE; min-height: 300px; max-height: 460px; overflow-y: auto; padding: 16px 12px;
    background-image: radial-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px); background-size: 14px 14px;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.bubble { background: #fff; border-radius: 10px; border-top-left-radius: 2px; max-width: 92%; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); overflow: hidden; font-size: 13.5px; color: #111B21; }
.bubble-media { background: #DDE3EA; height: 150px; display: grid; place-items: center; color: #8696A0; font-size: 32px; background-size: cover; background-position: center; }
.bubble-doc { display: flex; align-items: center; gap: 10px; margin: 4px; padding: 10px; background: #F0F2F5; border-radius: 8px; }
.bubble-doc i { font-size: 26px; color: #E5484D; }
.bubble-doc strong { font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.bubble-doc span { font-size: 11px; color: #667781; text-transform: uppercase; }
.bubble-head { padding: 8px 10px 0; font-weight: 700; }
.bubble-text { padding: 6px 10px 2px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.bubble-text .ph { background: var(--yellow); background: rgba(255, 214, 10, .45); border-radius: 3px; padding: 0 2px; }
.bubble-text .fill { background: rgba(0, 180, 216, .16); border-radius: 3px; padding: 0 2px; }
.bubble-foot { padding: 0 10px 2px; font-size: 12px; color: #667781; }
.bubble-time { text-align: right; font-size: 10.5px; color: #667781; padding: 0 8px 6px; }
.bubble-btn { border-top: 1px solid #E9EDEF; color: #027EB5; text-align: center; padding: 9px; font-size: 13.5px; font-weight: 500; }
.bubble-btn i { margin-right: 6px; }
.bubble-empty { align-self: center; background: rgba(255, 255, 255, .85); border-radius: 8px; padding: 10px 14px; font-size: 13px; color: #54656F; text-align: center; margin: auto; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.checklist li { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.checklist li i { width: 16px; text-align: center; }
.checklist li.done { color: var(--ok); }

/* ---------- LANZAR CAMPAÑA ---------- */
.launch h3 { font-size: 18px; margin-bottom: 6px; }
.launch-summary { color: #B9C6DA; font-size: 14px; margin-bottom: 16px; }
.launch-summary strong { color: #fff; }
.launch-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.muted-dark { color: #8FA1BC; font-size: 13px; }
.progress { height: 10px; background: var(--navy-3); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--blue)); border-radius: 999px; transition: width .3s ease; }
.run-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.run-stats div { background: var(--navy-2); border-radius: 10px; padding: 10px; text-align: center; }
.run-stats strong { display: block; font-family: var(--font-display); font-size: 22px; }
.run-stats span { font-size: 12px; color: #8FA1BC; }
.run-stats div:nth-child(1) strong { color: #6EE7A8; }
.run-stats div:nth-child(2) strong { color: #FFA27A; }
.run-error { font-size: 12.5px; color: #FFC2A8; background: rgba(255, 107, 53, .12); border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; word-break: break-word; }
.run-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- TABLAS ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-x: auto; }
.table-scroll { max-height: 380px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); z-index: 1; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFD; }
.table .col-check { width: 44px; text-align: center; }
.table .col-actions { width: 96px; text-align: right; white-space: nowrap; }
.table .empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.table .empty i { display: block; font-size: 26px; margin-bottom: 8px; color: var(--border-strong); }
.table .row-error { font-size: 12px; color: var(--err); margin-top: 2px; max-width: 360px; }
.table .row-sub { font-size: 12px; color: var(--muted); }
.icon-btn { width: 32px; height: 32px; border: 0; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--err-50); color: var(--err); }
.table-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* ---------- ESTADÍSTICAS ---------- */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat strong { display: block; font-family: var(--font-display); font-size: 28px; margin-top: 2px; }
.stat.ok strong { color: var(--ok); }
.stat.err strong { color: var(--err); }

/* ---------- AJUSTES ---------- */
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow-y: auto; }
.tpl-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tpl-list .tpl-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.tpl-list .tpl-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.tpl-list .tpl-info { flex: 1; min-width: 0; }
.sysinfo { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.sysinfo dt { color: var(--muted); }
.sysinfo dd { margin: 0; font-weight: 600; word-break: break-all; }

/* ---------- MODAL / TOASTS ---------- */
.modal { position: fixed; inset: 0; background: rgba(10, 22, 40, .55); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s ease; }
.modal-card { background: var(--surface); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal-card h3 { font-size: 19px; margin-bottom: 10px; }
.modal-body { color: var(--text-2); font-size: 14.5px; display: grid; gap: 12px; }
.modal-body ul { margin: 0; padding-left: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 70; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--navy); color: #fff; padding: 12px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; animation: slide .2s ease; }
.toast i { margin-top: 3px; }
.toast.ok i { color: #6EE7A8; }
.toast.err { background: #3B1305; }
.toast.err i { color: #FFA27A; }
.toast.info i { color: var(--cyan); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1180px) {
    .split { grid-template-columns: minmax(0, 1fr) 320px; }
    .var-row { grid-template-columns: 44px minmax(0, 1fr); }
    .var-row > :last-child { grid-column: 2; }
}
@media (max-width: 1024px) {
    .sidebar { width: 72px; }
    .sidebar-title, .nav-btn span { display: none; }
    .sidebar-brand { justify-content: center; padding: 20px 0; }
    .nav-btn { justify-content: center; }
    .split, .split-even { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    body { font-size: 14px; }
    .login { grid-template-columns: 1fr; overflow-y: auto; }
    .login-brand { display: none; }
    .app { flex-direction: column-reverse; }
    .sidebar { width: 100%; flex-direction: row; height: 62px; }
    .sidebar-brand, .sidebar-foot { display: none; }
    .sidebar-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; padding: 6px; gap: 2px; }
    .nav-btn { flex-direction: column; gap: 2px; padding: 6px 2px; font-size: 10px; }
    .nav-btn span { display: block; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
    .nav-btn.active { box-shadow: inset 0 -3px 0 var(--cyan); }
    .main { padding: 0 16px 24px; }
    .topbar { padding: 16px 0 12px; flex-direction: column; align-items: flex-start; }
    .topbar-title { font-size: 22px; }
    .topbar-status { justify-content: flex-start; }
    .card { padding: 16px; }
    .toolbar > * { flex: 1 1 100%; }
    .select-sm { width: 100%; }
    .stats-row { gap: 10px; }
    .banner { flex-wrap: wrap; }
    .table .col-hide-sm { display: none; }
}
