:root {
    color-scheme: light;
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --surface-strong: #eaf1f8;
    --text: #142033;
    --muted: #6f7d8f;
    --muted-strong: #4d6075;
    --line: #dce5ef;
    --line-strong: #cbd8e6;
    --brand: #0b5cab;
    --brand-hover: #084985;
    --accent: #f28c28;
    --good: #0b5cab;
    --good-bg: #eaf3fc;
    --warn: #a95400;
    --warn-bg: #fff3e6;
    --bad: #b42318;
    --bad-bg: #fff0ee;
    --info: #0b5cab;
    --info-bg: #edf5fd;
    --sidebar-width: 272px;
    --sidebar-collapsed: 84px;
    --topbar-height: 76px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(15, 18, 22, .04), 0 7px 22px rgba(15, 18, 22, .035);
    --shadow-md: 0 18px 50px rgba(15, 18, 22, .08);
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body.app-body { height: 100dvh; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
img { max-width: 100%; }
svg { display: block; }
::selection { background: #d8dce2; color: #111; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-sprite symbol, .icon-sprite path, .icon-sprite rect, .icon-sprite circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-link svg, .icon-btn svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    width: 100vw;
    height: 100dvh;
    overflow: hidden;
    transition: grid-template-columns .22s ease;
}
.app-shell.sidebar-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }

.sidebar {
    position: relative;
    z-index: 40;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100dvh;
    padding: 18px 14px 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, .97);
    border-right: 1px solid var(--line);
    box-shadow: 8px 0 28px rgba(24, 27, 31, .025);
}
.sidebar-head { flex: 0 0 auto; padding: 0 4px 16px; }
.brand {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 52px;
    gap: 12px;
    border-radius: 14px;
}
.brand-mark {
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}
.brand-mark img { width: 37px; height: 37px; object-fit: contain; }
.brand-copy { min-width: 0; white-space: nowrap; overflow: hidden; transition: opacity .15s ease, width .2s ease; }
.brand-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.brand-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .02em; }

.nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 4px 4px 18px;
    scrollbar-width: thin;
    scrollbar-color: #d6d9dd transparent;
}
.nav::-webkit-scrollbar { width: 5px; }
.nav::-webkit-scrollbar-thumb { background: #d6d9dd; border-radius: 99px; }
.nav-section + .nav-section { margin-top: 18px; }
.nav-group {
    padding: 0 11px 7px;
    color: #999ea5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity .15s ease;
}
.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 43px;
    gap: 12px;
    margin: 3px 0;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--muted-strong);
    font-weight: 650;
    letter-spacing: -.005em;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}
.nav-link svg { flex: 0 0 20px; width: 20px; height: 20px; }
.nav-link span { overflow: hidden; text-overflow: ellipsis; transition: opacity .15s ease; }
.nav-link:hover { background: var(--surface-soft); border-color: var(--line); color: var(--text); transform: translateX(1px); }
.nav-link.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 8px 20px rgba(16, 18, 20, .15);
}
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -7px;
    width: 3px;
    height: 20px;
    border-radius: 99px;
    background: #111;
}
.sidebar-foot { flex: 0 0 auto; padding: 10px 4px 0; border-top: 1px solid var(--line); }
.sidebar-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 13px;
    background: var(--surface-soft);
}
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(242, 140, 40, .16); }
.sidebar-meta > span:last-child { min-width: 0; overflow: hidden; white-space: nowrap; }
.sidebar-meta strong, .sidebar-meta small { display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-meta strong { font-size: 11px; }
.sidebar-meta small { color: var(--muted); font-size: 10px; }

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-group,
.app-shell.sidebar-collapsed .nav-link span,
.app-shell.sidebar-collapsed .sidebar-meta > span:last-child { width: 0; opacity: 0; pointer-events: none; }
.app-shell.sidebar-collapsed .sidebar { padding-inline: 14px; }
.app-shell.sidebar-collapsed .brand { justify-content: center; }
.app-shell.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 10px; }
.app-shell.sidebar-collapsed .nav-link.active::before { left: -8px; }
.app-shell.sidebar-collapsed .sidebar-meta { justify-content: center; padding-inline: 0; background: transparent; }

.sidebar-backdrop { display: none; }
.main { display: flex; flex-direction: column; min-width: 0; height: 100dvh; overflow: hidden; }
.topbar {
    position: relative;
    z-index: 30;
    flex: 0 0 var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    height: var(--topbar-height);
    padding: 0 28px;
    border-bottom: 1px solid rgba(215, 219, 224, .85);
    background: rgba(248, 249, 250, .88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.topbar-left, .topbar-actions, .userbox { display: flex; align-items: center; }
.topbar-left { min-width: 0; gap: 14px; }
.topbar-actions { gap: 16px; }
.icon-btn {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .82);
    color: var(--text);
    box-shadow: 0 1px 2px rgba(20, 23, 27, .025);
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-btn:hover { background: #fff; border-color: var(--line-strong); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.topbar-context { min-width: 0; }
.topbar-context span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.topbar-context strong { display: block; max-width: min(46vw, 620px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; letter-spacing: -.01em; }
.company-picker { display: flex; align-items: center; gap: 8px; }
.company-picker label { color: var(--muted); font-size: 11px; font-weight: 750; }
.company-picker select {
    max-width: 240px;
    height: 39px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    background: #fff;
    font-weight: 650;
}
.company-picker select:focus { border-color: #9298a0; box-shadow: 0 0 0 3px rgba(20, 22, 24, .07); }
.topbar-divider { width: 1px; height: 30px; background: var(--line); }
.userbox { gap: 10px; min-width: 0; }
.avatar {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border: 1px solid #111;
    border-radius: 50%;
    background: #17181a;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--line);
}
.user-copy { min-width: 0; }
.user-copy strong, .user-copy span { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 12px; }
.user-copy span { color: var(--muted); font-size: 11px; }
.logout-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; color: var(--muted-strong); }
.logout-btn:hover { border-color: var(--line); color: var(--bad); }

.content {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    overflow: auto;
    padding: clamp(22px, 2.5vw, 38px);
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cdd1d6 transparent;
}
.content::-webkit-scrollbar { width: 9px; height: 9px; }
.content::-webkit-scrollbar-thumb { background: #cdd1d6; border: 2px solid var(--bg); border-radius: 99px; }

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}
.page-head > div:first-child { min-width: 0; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.page-head p { max-width: 820px; margin: 0; color: var(--muted); font-size: 14px; }
h1, h2, h3 { color: var(--text); }
h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -.015em; }
h3 { margin: 0 0 12px; font-size: 15px; }
p { margin-top: 0; }

.card {
    margin-bottom: 20px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card:hover { border-color: #dadddf; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric {
    position: relative;
    min-height: 126px;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.metric::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -38px;
    width: 110px;
    height: 110px;
    border: 22px solid #f3f4f6;
    border-radius: 50%;
    pointer-events: none;
}
.metric span { position: relative; z-index: 1; color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.metric strong { position: relative; z-index: 1; display: block; margin-top: 12px; font-size: clamp(26px, 3vw, 36px); line-height: 1; letter-spacing: -.035em; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 2px rgba(15, 18, 22, .03);
    font-weight: 750;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-soft); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(15, 18, 22, .06); }
.btn:active { transform: translateY(0); }
.btn-primary { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(15, 17, 19, .13); }
.btn-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.btn-danger { border-color: #ffd6d2; background: var(--bad-bg); color: var(--bad); }
.btn-small { min-height: 33px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
form.card.actions { padding: 15px; }
.actions > input, .actions > select, form.actions input, form.actions select {
    min-width: 150px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    background: #fff;
}
.actions > input:focus, .actions > select:focus, form.actions input:focus, form.actions select:focus {
    border-color: #8b9199;
    box-shadow: 0 0 0 3px rgba(18, 20, 22, .065);
}

.table-wrap { width: 100%; overflow: auto; }
.card.table-wrap { padding: 8px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: #777c84;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}
.table th:first-child { border-radius: 12px 0 0 12px; }
.table th:last-child { border-radius: 0 12px 12px 0; }
.table td { padding: 14px; border-bottom: 1px solid #edf0f2; vertical-align: middle; }
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a strong { transition: color .15s ease; }
.table a:hover strong { color: var(--accent); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 7px; color: #373b40; font-size: 12px; font-weight: 780; }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 43px;
    padding: 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.field textarea { min-height: 108px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b7bcc3; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #7d838b; box-shadow: 0 0 0 4px rgba(17, 19, 21, .06); background: #fff; }
.field .hint { margin-top: 5px; color: var(--muted); font-size: 11px; }
.check-label { display: flex !important; align-items: center; gap: 9px; }
.check-label input[type="checkbox"] { width: auto; min-height: auto; }
input[type="checkbox"] { accent-color: #17181a; }

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid #e4e7ea;
    border-radius: 999px;
    background: #f1f3f5;
    color: #555b63;
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    white-space: nowrap;
}
.badge.good { border-color: #d6efe2; background: var(--good-bg); color: var(--good); }
.badge.warn { border-color: #f1e3bc; background: var(--warn-bg); color: var(--warn); }
.badge.bad { border-color: #ffd9d4; background: var(--bad-bg); color: var(--bad); }
.alert {
    position: relative;
    margin-bottom: 18px;
    padding: 14px 16px 14px 44px;
    border: 1px solid;
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
}
.alert::before { position: absolute; left: 17px; top: 14px; font-weight: 900; }
.alert-success { border-color: #c9def2; background: var(--good-bg); color: #084985; }
.alert-success::before { content: "✓"; }
.alert-error { border-color: #ffd5d0; background: var(--bad-bg); color: #8f1c15; }
.alert-error::before { content: "!"; }
.alert ul { margin: 7px 0 0; padding-left: 18px; }
.muted { color: var(--muted); }
.empty { padding: 44px 20px !important; color: var(--muted); text-align: center; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.split > a { color: var(--muted-strong); font-weight: 750; }
.split > a:hover { color: var(--text); }

.conversation { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: min(78%, 650px); padding: 11px 14px; border: 1px solid var(--line); border-radius: 15px 15px 15px 5px; background: var(--surface-soft); }
.bubble.out { align-self: flex-end; border-color: #cfe1f2; border-radius: 15px 15px 5px 15px; background: #edf5fd; }
.code { overflow: auto; padding: 16px; border-radius: 13px; background: #15171a; color: #eef1f4; white-space: pre-wrap; word-break: break-word; }

.pagination { display: flex; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.pagination .page-link { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pagination .page-link:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.pagination .active .page-link { border-color: var(--brand); background: var(--brand); color: #fff; }

/* Hoja operativa tipo Excel */
.sheet-card { padding: 0; overflow: hidden; }
.sheet-card:hover { border-color: var(--line); }
.sheet-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 19px 20px 14px; }
.sheet-toolbar h2 { margin: 0; font-size: 19px; }
.sheet-toolbar p { margin: 3px 0 0; color: var(--muted); }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cell-selection-toggle { display: inline-flex; align-items: center; gap: 6px; }
.cell-selection-toggle[aria-pressed="true"] { border-color: #1769c2; background: #e9f3ff; color: #0b5cab; box-shadow: 0 0 0 2px rgba(23,105,194,.14); }
.cell-color-control { position: relative; }
.cell-color-toggle { display: inline-flex; align-items: center; gap: 7px; }
.cell-color-toggle:disabled { cursor: not-allowed; opacity: .48; }
.cell-color-icon { width: 17px; height: 15px; border: 1px solid #929aa4; border-radius: 3px; background: linear-gradient(to bottom, transparent 0 68%, var(--current-cell-color, #57e32c) 68% 100%); }
.cell-color-palette {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 12;
    width: 252px;
    padding: 12px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(20, 32, 51, .2);
}
.cell-color-palette[hidden] { display: none; }
.cell-color-palette-head, .cell-color-custom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cell-color-palette-head { margin-bottom: 10px; font-size: 11px; }
.cell-color-palette-head span { color: var(--muted); }
.cell-color-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.cell-color-swatch { width: 23px; height: 23px; padding: 0; border: 1px solid rgba(20,32,51,.18); border-radius: 50%; background: var(--swatch-color); cursor: pointer; }
.cell-color-swatch:hover, .cell-color-swatch:focus-visible { outline: 2px solid #1d64aa; outline-offset: 2px; }
.cell-color-custom { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 10px; }
.cell-color-custom label { display: flex; align-items: center; gap: 6px; color: var(--muted-strong); font-weight: 750; }
.cell-color-custom input[type="color"] { width: 28px; height: 25px; padding: 1px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; }
.cell-color-reset { padding: 4px 7px; border: 0; background: transparent; color: #a12820; font-size: 10px; font-weight: 800; cursor: pointer; }
.sheet-paste-hint { padding: 9px 20px; border-top: 1px solid #dce5f0; border-bottom: 1px solid #dce5f0; background: #f4f8fd; color: #49617e; font-size: 11px; }
.excel-wrap { width: 100%; max-height: min(58vh, 590px); overflow: auto; background: #fff; scrollbar-width: thin; }
.excel-table { width: auto; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; counter-reset: sheet-row; }
.excel-table th, .excel-table td { padding: 0; border-right: 1px solid #d6d9dd; border-bottom: 1px solid #d6d9dd; background: #fff; }
.excel-table th {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 38px;
    padding: 5px 7px;
    background: #25272a;
    color: #f7f8fa;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
}
.excel-table th[data-operative-column] { position: sticky; overflow: visible; }
.excel-table .column-label { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-resizer { position: absolute; top: 0; right: -4px; z-index: 6; width: 9px; height: 100%; cursor: col-resize; touch-action: none; }
.column-resizer::after { content: ""; position: absolute; top: 7px; bottom: 7px; left: 4px; width: 1px; background: rgba(255,255,255,.32); }
.column-resizer:hover::after, body.is-resizing-column .column-resizer::after { width: 2px; background: #f28b25; }
body.is-resizing-column { cursor: col-resize; user-select: none; }
.excel-table th:first-child, .excel-table td:first-child { border-left: 1px solid #d6d9dd; }
.excel-table tbody tr:nth-child(even) td:not(.has-cell-color) { background: #fbfcfd; }
.excel-table tbody tr:hover td:not(.has-cell-color) { background: #f4f7fa; }
.excel-table td.operative-cell { position: relative; cursor: cell; }
.excel-table td.operative-cell.has-cell-color { background: var(--operative-cell-color) !important; }
.excel-table td.operative-cell.has-dark-cell-color input:not([type="checkbox"]) { color: #fff; }
.excel-table td.operative-cell.has-dark-cell-color input::placeholder { color: rgba(255,255,255,.72); }
.excel-table td.operative-cell.is-cell-selected { box-shadow: inset 0 0 0 3px #1769c2; }
.excel-table td.operative-cell.is-cell-selected::after { content: ""; position: absolute; inset: -1px; z-index: 2; border: 1px solid rgba(255,255,255,.7); pointer-events: none; }
body.is-selecting-operative-cells { user-select: none; }
.sheet-card.is-cell-selection-mode .excel-table td.operative-cell,
.sheet-card.is-cell-selection-mode .excel-table td.operative-cell input { cursor: crosshair; }
.sheet-card.is-cell-selection-mode .excel-table td.operative-cell input { user-select: none; touch-action: none; }
.excel-table input:not([type="checkbox"]) { box-sizing: border-box; width: 100%; min-width: 0; height: 36px; padding: 5px 7px; border: 0; border-radius: 0; outline: none; background: transparent; font-size: 11px; }
.excel-table input:focus { outline: 2px solid #4c79b4; outline-offset: -2px; background: rgba(245,249,255,.42) !important; }
.excel-table .row-number { position: sticky; left: 0; z-index: 2; width: 44px; min-width: 44px; background: #eceff2 !important; color: #646a72; font-weight: 820; text-align: center; }
.excel-table th.row-number { z-index: 4; background: #111315 !important; color: #fff; }
.wa-consent { min-width: 52px; text-align: center; }
.wa-consent input[type="checkbox"] { width: 17px; height: 17px; }
.sheet-delete { width: 37px; height: 36px; border: 0; background: transparent; color: #a4a9b0; font-size: 20px; line-height: 1; cursor: pointer; }
.sheet-delete:hover { background: var(--bad-bg); color: var(--bad); }
.operative-savebar {
    position: sticky;
    bottom: 18px;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 22px 0 2px;
    padding: 14px 16px 14px 20px;
    border: 1px solid #242629;
    border-radius: 16px;
    background: rgba(21, 23, 26, .96);
    color: #fff;
    box-shadow: 0 18px 46px rgba(13, 15, 17, .24);
    backdrop-filter: blur(12px);
}
.operative-savebar div { max-width: 940px; color: #cdd1d6; font-size: 11px; }
.operative-savebar strong { color: #fff; }
.operative-savebar .btn-primary { border-color: #fff; background: #fff; color: #151719; box-shadow: none; }
.operative-savebar .btn-primary:hover { background: #eef0f2; }

/* Login */
.auth-body { height: 100dvh; overflow: hidden; }
.login-page {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(420px, .95fr);
    width: 100%;
    min-height: 100dvh;
    padding: 18px;
    background: #e9ebee;
}
.login-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(32px, 5vw, 72px);
    border-radius: 26px;
    background: #17181a;
    color: #fff;
}
.login-visual::before, .login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; }
.login-visual::before { width: 520px; height: 520px; right: -190px; top: -190px; }
.login-visual::after { width: 340px; height: 340px; left: -140px; bottom: -140px; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-mark { border-color: rgba(255,255,255,.15); }
.login-brand strong { display: block; font-size: 17px; }
.login-brand span { color: #aeb3ba; font-size: 12px; }
.login-message { position: relative; z-index: 1; max-width: 640px; }
.login-message span { color: #aeb3ba; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.login-message h1 { max-width: 620px; margin: 14px 0 18px; color: #fff; font-size: clamp(38px, 5vw, 68px); line-height: .98; letter-spacing: -.055em; }
.login-message p { max-width: 520px; color: #bec2c8; font-size: 15px; }
.login-copyright { position: relative; z-index: 1; color: #7f858d; font-size: 11px; }
.login-form-pane { display: grid; place-items: center; padding: clamp(24px, 5vw, 72px); }
.login-card { width: min(440px, 100%); padding: 0; }
.login-card h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.035em; }
.login-card > p { margin-bottom: 30px; }
.login-card .field + .field { margin-top: 16px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 17px 0 22px; color: var(--muted-strong); font-size: 12px; }
.login-options label { display: flex; align-items: center; gap: 8px; }
.login-card .btn { width: 100%; min-height: 46px; }

/* Voucher público */
.voucher { max-width: 900px; margin: 32px auto; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: var(--shadow-md); }
.voucher-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 2px solid var(--brand); }
.voucher-head img { width: 86px; }

@media (max-width: 1180px) {
    :root { --sidebar-width: 244px; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-copy { display: none; }
    .company-picker label { display: none; }
}

@media (max-width: 980px) {
    body.app-body { overflow: hidden; }
    .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: minmax(0, 1fr); }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(286px, 88vw);
        transform: translateX(-105%);
        box-shadow: 20px 0 55px rgba(15, 18, 22, .17);
        transition: transform .22s ease;
    }
    .app-shell.sidebar-mobile-open .sidebar { transform: translateX(0); }
    .app-shell.sidebar-mobile-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(19, 22, 26, .28); backdrop-filter: blur(2px); }
    .app-shell.sidebar-collapsed .brand-copy,
    .app-shell.sidebar-collapsed .nav-group,
    .app-shell.sidebar-collapsed .nav-link span,
    .app-shell.sidebar-collapsed .sidebar-meta > span:last-child { width: auto; opacity: 1; pointer-events: auto; }
    .app-shell.sidebar-collapsed .brand { justify-content: flex-start; }
    .app-shell.sidebar-collapsed .nav-link { justify-content: flex-start; padding-inline: 11px; }
    .app-shell.sidebar-collapsed .sidebar-meta { justify-content: flex-start; padding-inline: 10px; background: var(--surface-soft); }
    .topbar { padding-inline: 18px; }
    .topbar-context span { display: none; }
    .topbar-actions { gap: 10px; }
    .topbar-divider { display: none; }
    .company-picker select { max-width: 180px; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .login-page { display: block; height: 100dvh; min-height: 100dvh; overflow: auto; padding: 0; background: #fff; }
    .login-visual { min-height: 310px; padding: 32px 28px; border-radius: 0 0 26px 26px; }
    .login-message h1 { font-size: clamp(38px, 8vw, 56px); }
    .login-form-pane { padding: 38px 24px 54px; }
}

@media (max-width: 680px) {
    :root { --topbar-height: 68px; }
    .topbar { padding-inline: 12px; }
    .topbar-left { gap: 9px; }
    .topbar-context strong { max-width: 40vw; font-size: 14px; }
    .company-picker { display: none; }
    .avatar { width: 34px; height: 34px; flex-basis: 34px; }
    .logout-btn { display: none; }
    .content { padding: 18px 14px 30px; }
    .page-head { flex-direction: column; align-items: stretch; margin-bottom: 18px; }
    .page-head .actions, .page-head > .btn { width: 100%; }
    .page-head .actions .btn, .page-head > .btn { flex: 1; }
    .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
    .field.full { grid-column: auto; }
    .metric { min-height: 110px; }
    .card { padding: 17px; border-radius: 17px; }
    form.card.actions { align-items: stretch; padding: 13px; }
    form.card.actions > * { width: 100%; min-width: 100%; }
    .table td, .table th { padding-inline: 11px; }
    .sheet-toolbar, .operative-savebar { align-items: stretch; flex-direction: column; }
    .sheet-actions { justify-content: flex-start; }
    .sheet-actions > .btn, .sheet-actions > .cell-color-control { flex: 1 1 auto; }
    .sheet-actions .cell-color-toggle { width: 100%; justify-content: center; }
    .cell-color-palette { right: auto; left: 0; width: min(252px, calc(100vw - 50px)); }
    .operative-savebar { bottom: 10px; }
    .operative-savebar .btn { width: 100%; }
    .login-visual { min-height: 290px; padding: 28px 22px; }
    .login-message h1 { font-size: 39px; }
    .login-message p { display: none; }
    .login-form-pane { padding: 34px 22px 48px; }
}

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

/* =========================================================
   The Boss Central UI v2 — blue and orange operations dashboard
   ========================================================= */
:root {
    --bg: #edf3f9;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --surface-strong: #eaf1f8;
    --text: #142033;
    --muted: #6f7d8f;
    --muted-strong: #4d6075;
    --line: #dce5ef;
    --line-strong: #cbd8e6;
    --brand: #0b5cab;
    --brand-hover: #084985;
    --accent: #f28c28;
    --good: #0b5cab;
    --good-bg: #eaf3fc;
    --warn: #a95400;
    --warn-bg: #fff3e6;
    --bad: #b33c32;
    --bad-bg: #fff0ee;
    --info: #0b5cab;
    --info-bg: #edf5fd;
    --sidebar-width: 238px;
    --sidebar-collapsed: 82px;
    --topbar-height: 72px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(13, 53, 91, .025), 0 8px 24px rgba(13, 53, 91, .04);
    --shadow-md: 0 22px 65px rgba(14, 55, 94, .13);
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body.app-body {
    padding: 18px;
    background:
        radial-gradient(circle at 9% 0%, rgba(11, 92, 171, .11), transparent 30%),
        radial-gradient(circle at 94% 100%, rgba(242, 140, 40, .10), transparent 27%),
        linear-gradient(145deg, #f1f6fb 0%, #e8f0f8 100%);
}

.app-shell {
    width: min(1640px, 100%);
    height: calc(100dvh - 36px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(211, 224, 237, .95);
    border-radius: 26px;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.sidebar {
    height: 100%;
    padding: 18px 13px 14px;
    border-right: 1px solid var(--line);
    background: #fbfdff;
    box-shadow: none;
}

.sidebar-head { padding: 0 7px 18px; }
.brand { height: 48px; gap: 10px; }
.brand-mark {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    border-color: #d6e3ef;
    border-radius: 12px;
    box-shadow: none;
}
.brand-mark img { width: 34px; height: 34px; }
.brand-copy strong { color: #14243a; font-size: 14px; }
.brand-copy small { color: #8795a5; font-size: 10px; }

.nav { padding: 3px 4px 16px; }
.nav-section + .nav-section { margin-top: 17px; }
.nav-group { padding: 0 10px 6px; color: #94a2b2; font-size: 9px; }
.nav-link {
    min-height: 40px;
    gap: 11px;
    margin: 2px 0;
    padding: 7px 10px;
    border-radius: 11px;
    color: #65778a;
    font-size: 12px;
    font-weight: 650;
}
.nav-link svg { width: 18px; height: 18px; color: #8192a5; }
.nav-link:hover {
    border-color: transparent;
    background: #f0f5fb;
    color: #193b61;
    transform: none;
}
.nav-link.active {
    border-color: transparent;
    background: #e8f2fc;
    color: #084985;
    box-shadow: none;
}
.nav-link.active svg { color: var(--brand); }
.nav-link.active::before {
    left: -7px;
    width: 4px;
    height: 25px;
    background: var(--accent);
}

.sidebar-foot { padding: 12px 4px 0; border-top-color: var(--line); }
.sidebar-meta {
    min-height: 68px;
    padding: 10px;
    border: 1px solid #d8e5f1;
    border-radius: 14px;
    background: linear-gradient(145deg, #edf5fd, #fff8f0);
}
.status-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(242, 140, 40, .16); }
.sidebar-meta strong { color: #174c7f; }

.main { height: 100%; background: #f5f8fc; }
.topbar {
    height: var(--topbar-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.topbar-left { flex: 1 1 auto; gap: 12px; }
.topbar-actions { flex: 0 0 auto; gap: 12px; }
.icon-btn {
    width: 38px;
    height: 38px;
    border-color: var(--line);
    border-radius: 11px;
    box-shadow: none;
}
.icon-btn:hover { border-color: #bed0e2; background: #f2f7fc; transform: none; }

.topbar-search {
    position: relative;
    display: flex;
    align-items: center;
    width: min(440px, 44vw);
    height: 42px;
    padding: 0 10px 0 40px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #f6f9fd;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.topbar-search:focus-within {
    border-color: #79a8d4;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 92, 171, .09);
}
.topbar-search > svg {
    position: absolute;
    left: 13px;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #708399;
    stroke-width: 1.8;
    stroke-linecap: round;
}
.topbar-search input {
    width: 100%;
    height: 40px;
    min-height: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
}
.topbar-search input::placeholder { color: #96a4b4; }
.search-hint {
    flex: 0 0 auto;
    padding: 4px 7px;
    border: 1px solid #d7e1eb;
    border-radius: 7px;
    background: #fff;
    color: #8e9cad;
    font-size: 9px;
    font-weight: 750;
}

.company-picker select {
    height: 38px;
    border-color: var(--line);
    border-radius: 10px;
    font-size: 11px;
}
.avatar {
    border-color: #c9dced;
    background: #e8f2fc;
    color: #0b5cab;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px #d8e5f1;
}
.user-copy strong { color: #25364a; }
.logout-btn:hover { color: var(--bad); }

.content {
    padding: clamp(20px, 2vw, 30px);
    background: #f5f8fc;
}

.page-head h1 { font-size: clamp(25px, 2.2vw, 32px); }
.card, .metric {
    border-color: var(--line);
    border-radius: 17px;
    box-shadow: 0 4px 18px rgba(18, 62, 104, .04);
}
.card:hover { border-color: #d1deeb; }
.btn {
    min-height: 38px;
    border-color: #cfdae6;
    border-radius: 11px;
    box-shadow: none;
    font-size: 12px;
}
.btn:hover { border-color: #b9cada; background: #f2f7fc; transform: none; box-shadow: none; }
.btn-primary { border-color: var(--brand); background: var(--brand); box-shadow: 0 8px 20px rgba(11, 92, 171, .18); }
.btn-primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.field input:focus, .field select:focus, .field textarea:focus,
.actions > input:focus, .actions > select:focus, form.actions input:focus, form.actions select:focus {
    border-color: #79a8d4;
    box-shadow: 0 0 0 4px rgba(11, 92, 171, .09);
}
input[type="checkbox"] { accent-color: var(--brand); }

.table th { background: #f3f7fb; color: #7d8c9d; }
.table tbody tr:hover { background: #f7faff; }
.table a:hover strong { color: var(--brand); }
.badge.good { border-color: #cfe1f2; }
.badge.warn { border-color: #f4d7b8; }

/* Dashboard */
.dashboard-page { width: 100%; }
.dashboard-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 20px;
}
.dashboard-kicker, .panel-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--brand);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.dashboard-heading h1 {
    margin: 0;
    font-size: clamp(30px, 3.2vw, 44px);
    line-height: 1;
    letter-spacing: -.045em;
}
.dashboard-heading p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-actions { display: flex; align-items: center; gap: 9px; }

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.dashboard-kpi {
    position: relative;
    min-width: 0;
    min-height: 142px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
}
.dashboard-kpi.is-featured {
    border-color: #0b5cab;
    background:
        radial-gradient(circle at 95% 120%, rgba(242, 140, 40, .48), transparent 42%),
        linear-gradient(145deg, #084985, #0b6bc0);
    color: #fff;
}
.dashboard-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dashboard-kpi-head > span:first-child { overflow: hidden; text-overflow: ellipsis; color: #4f6073; font-size: 11px; font-weight: 720; white-space: nowrap; }
.dashboard-kpi.is-featured .dashboard-kpi-head > span:first-child { color: rgba(255,255,255,.88); }
.dashboard-kpi-arrow {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid #d8e4ef;
    border-radius: 50%;
    background: #fff;
    color: #173d63;
    font-size: 14px;
}
.dashboard-kpi strong { display: block; margin-top: 18px; overflow: hidden; text-overflow: ellipsis; font-size: clamp(28px, 3vw, 38px); line-height: .95; letter-spacing: -.05em; white-space: nowrap; }
.dashboard-kpi small { display: block; margin-top: 13px; color: #7e8d9e; font-size: 9px; }
.dashboard-kpi.is-featured small { color: rgba(255,255,255,.7); }

.dashboard-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, .78fr);
    gap: 12px;
    align-items: start;
}
.dashboard-workspace.is-client { grid-template-columns: minmax(0, 1fr); }
.dashboard-panel {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fff;
}
.dashboard-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.dashboard-panel-head h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.panel-eyebrow { margin-bottom: 2px; color: #8493a4; font-size: 8px; }
.panel-link { color: var(--brand); font-size: 10px; font-weight: 750; white-space: nowrap; }
.panel-link:hover { text-decoration: underline; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border: 1px solid #f3d5b5;
    border-radius: 999px;
    background: #fff6ec;
    color: #a95400;
    font-size: 8px;
    font-weight: 750;
}
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(242,140,40,.16); }

.dashboard-bars {
    display: grid;
    grid-template-columns: repeat(6, minmax(48px, 1fr));
    gap: 10px;
    min-height: 205px;
    align-items: end;
}
.dashboard-bar-item { display: grid; grid-template-rows: 145px auto auto; min-width: 0; text-align: center; }
.dashboard-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 145px;
    overflow: hidden;
    border-radius: 14px 14px 8px 8px;
    background: repeating-linear-gradient(-45deg, #f2f6fa, #f2f6fa 3px, #e5edf5 3px, #e5edf5 5px);
}
.dashboard-bar-track span {
    display: block;
    width: 100%;
    min-height: 12%;
    border-radius: 14px 14px 7px 7px;
    background: linear-gradient(180deg, #2d83d1, #0b5cab);
}
.dashboard-bar-item:nth-child(3n + 2) .dashboard-bar-track span { background: linear-gradient(180deg, #ffad5c, #f28c28); }
.dashboard-bar-item:nth-child(3n) .dashboard-bar-track span { background: linear-gradient(180deg, #174d80, #083b6b); }
.dashboard-bar-item > strong { margin-top: 6px; font-size: 10px; }
.dashboard-bar-item > small { margin-top: 2px; overflow: hidden; color: #8493a4; font-size: 7px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-side-stack { display: grid; gap: 12px; }
.status-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid #edf2f7;
}
.status-row:last-child { border-bottom: 0; padding-bottom: 0; }
.status-icon { width: 25px; height: 25px; border-radius: 8px; background: linear-gradient(145deg, #2d83d1, #0b5cab); box-shadow: inset 0 0 0 6px rgba(255,255,255,.78); }
.status-icon.amber { background: linear-gradient(145deg, #f2b74f, #cf8124); }
.status-icon.violet { background: linear-gradient(145deg, #ffad5c, #e87912); }
.status-row div { min-width: 0; }
.status-row div strong, .status-row div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-row div strong { color: #2b3949; font-size: 10px; }
.status-row div small { margin-top: 2px; color: #8c99a8; font-size: 8px; }
.status-row > b { font-size: 13px; }

.lead-meter + .lead-meter { margin-top: 12px; }
.lead-meter > div:first-child { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #657487; font-size: 9px; }
.lead-meter > div:first-child strong { color: #26384b; }
.lead-meter-track { height: 6px; overflow: hidden; border-radius: 99px; background: #e9f0f7; }
.lead-meter-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0b5cab, #f28c28); }

.orders-panel { grid-column: 1; }
.conversations-panel { grid-column: 2; }
.dashboard-workspace.is-client .orders-panel { grid-column: 1; }
.dashboard-table-wrap { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.dashboard-table-wrap .table th { padding: 9px 10px; font-size: 8px; }
.dashboard-table-wrap .table td { padding: 10px; font-size: 10px; }

.conversation-list { display: grid; gap: 2px; }
.conversation-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 8px 6px;
    border-radius: 11px;
}
.conversation-row:hover { background: #f2f7fc; }
.conversation-avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e5f0fb;
    color: #0b5cab;
    font-size: 11px;
    font-weight: 850;
}
.conversation-row > span:nth-child(2) { min-width: 0; }
.conversation-row strong, .conversation-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-row strong { color: #293a4e; font-size: 10px; }
.conversation-row small { margin-top: 2px; color: #8c99a8; font-size: 8px; }
.conversation-row .badge { min-height: 20px; padding: 3px 7px; font-size: 8px; }

/* Login refreshed with the blue and orange system */
.login-visual {
    background:
        radial-gradient(circle at 90% 12%, rgba(242, 140, 40, .42), transparent 26%),
        linear-gradient(145deg, #073765, #0b5cab 58%, #1678cb);
}
.login-visual::before, .login-visual::after { border-color: rgba(255,255,255,.12); }
.login-card .btn-primary { background: var(--brand); }

@media (max-width: 1220px) {
    .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-workspace { grid-template-columns: minmax(0, 1.45fr) minmax(260px, .8fr); }
    .dashboard-bars { gap: 7px; }
}

@media (max-width: 980px) {
    body.app-body { padding: 0; }
    .app-shell, .app-shell.sidebar-collapsed {
        width: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .sidebar {
        top: 10px;
        bottom: 10px;
        left: 10px;
        width: min(286px, calc(100vw - 20px));
        height: auto;
        border: 1px solid var(--line);
        border-radius: 20px;
        box-shadow: 20px 0 55px rgba(14, 48, 82, .2);
    }
    .topbar-search { width: min(420px, 52vw); }
    .dashboard-workspace { grid-template-columns: 1fr; }
    .dashboard-side-stack, .orders-panel, .conversations-panel { grid-column: 1; }
    .dashboard-side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .topbar { padding-inline: 12px; }
    .topbar-search { width: min(100%, 250px); }
    .search-hint { display: none; }
    .topbar-actions { gap: 7px; }
    .dashboard-heading { align-items: stretch; flex-direction: column; }
    .dashboard-actions { width: 100%; }
    .dashboard-actions .btn { flex: 1; }
    .dashboard-kpis { grid-template-columns: 1fr; }
    .dashboard-kpi { min-height: 126px; }
    .dashboard-side-stack { grid-template-columns: 1fr; }
    .dashboard-bars { grid-template-columns: repeat(3, minmax(50px, 1fr)); row-gap: 18px; }
    .dashboard-bar-item { grid-template-rows: 105px auto auto; }
    .dashboard-bar-track { height: 105px; }
}

@media (max-width: 480px) {
    .topbar-search { display: none; }
    .content { padding: 16px 12px 28px; }
    .dashboard-heading h1 { font-size: 34px; }
    .dashboard-heading p { font-size: 11px; }
    .dashboard-actions { flex-direction: column-reverse; }
    .dashboard-actions .btn { width: 100%; }
    .dashboard-panel { padding: 15px; }
}

/* =========================================================
   Full viewport layout + bundled typography
   ========================================================= */
@font-face {
    font-family: "Roboto";
    src: url("../fonts/roboto-400.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Roboto";
    src: url("../fonts/roboto-500.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "Roboto";
    src: url("../fonts/roboto-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-600.woff2") format("woff2");
    font-style: normal;
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-700.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-800.woff2") format("woff2");
    font-style: normal;
    font-weight: 800;
    font-display: swap;
}

html,
body {
    width: 100%;
    max-width: none;
    height: 100%;
    font-family: "Roboto", Arial, sans-serif;
}

body,
button,
input,
select,
textarea {
    font-family: "Roboto", Arial, sans-serif;
}

body.app-body {
    width: 100vw;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #f5f8fc;
}

.app-shell,
.app-shell.sidebar-collapsed {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.main {
    height: 100dvh;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-copy strong,
.nav-group,
.nav-link,
.topbar-context,
.company-picker label,
.user-copy strong,
.avatar,
.page-head,
.dashboard-heading,
.dashboard-kicker,
.panel-eyebrow,
.dashboard-kpi,
.dashboard-panel-head,
.metric strong,
.btn,
.badge,
.table th,
.field label,
.login-brand,
.login-message h1,
.login-card h2 {
    font-family: "Montserrat", "Roboto", Arial, sans-serif;
}
