:root {
    --ink: #111827;
    --ink-soft: #64748b;
    --navy: #0b1220;
    --blue: #2764ff;
    --blue-dark: #1748cc;
    --blue-soft: #edf3ff;
    --cyan: #28c7d9;
    --green: #11845b;
    --green-soft: #e9f9f2;
    --amber: #a86304;
    --amber-soft: #fff7df;
    --red: #c33a4a;
    --red-soft: #fff0f1;
    --surface: #fff;
    --surface-soft: #f6f8fc;
    --line: #e2e8f0;
    --line-dark: #cbd5e1;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, .05);
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--surface-soft);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 200;
    padding: 10px 14px;
    border-radius: 10px;
    color: white;
    background: var(--blue);
}
.skip-link:focus { top: 12px; }

/* App frame */
.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    display: flex;
    width: 256px;
    flex-direction: column;
    padding: 24px 18px 18px;
    color: #dbe4f3;
    background:
        radial-gradient(circle at 20% 0, rgba(39, 100, 255, .22), transparent 31%),
        var(--navy);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 24px; }
.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -.035em;
    text-decoration: none;
}
.app-logo-mark {
    display: grid;
    width: 34px;
    height: 34px;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 3px;
    padding: 7px;
    border-radius: 10px;
    background: linear-gradient(145deg, var(--blue), #5a8aff);
    box-shadow: 0 8px 20px rgba(39, 100, 255, .28);
}
.app-logo-mark i { display: block; border-radius: 3px; background: white; }
.app-logo-mark i:nth-child(1) { height: 45%; }
.app-logo-mark i:nth-child(2) { height: 72%; }
.app-logo-mark i:nth-child(3) { height: 100%; }
.sidebar-close { display: none; color: white; background: none; border: 0; font-size: 28px; cursor: pointer; }
.business-switcher {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 20px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 13px;
    background: rgba(255,255,255,.055);
}
.business-switcher > span:last-child { min-width: 0; }
.business-switcher b, .business-switcher small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-switcher b { color: white; font-size: 13px; }
.business-switcher small { color: #93a4bf; font-size: 11px; }
.business-avatar, .user-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    font-weight: 800;
}
.business-avatar { width: 34px; height: 34px; color: #a9c4ff; background: rgba(39,100,255,.22); }
.user-avatar { width: 38px; height: 38px; color: #1748cc; background: #e7efff; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-label {
    margin: 16px 12px 6px;
    color: #71829d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 9px 12px;
    border-radius: 10px;
    color: #aebbd0;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: .18s ease;
}
.sidebar-nav a:hover { color: white; background: rgba(255,255,255,.06); }
.sidebar-nav a.active { color: white; background: rgba(39,100,255,.22); box-shadow: inset 3px 0 var(--cyan); }
.nav-icon { display: inline-grid; width: 20px; place-items: center; color: #8ea6cb; font-size: 17px; }
.sidebar-nav a.active .nav-icon { color: #74dcf0; }
.sidebar-upgrade {
    margin-top: auto;
    padding: 15px;
    border: 1px solid rgba(93,137,255,.24);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(39,100,255,.18), rgba(40,199,217,.08));
}
.sidebar-upgrade .eyebrow { color: #7ddcea; }
.sidebar-upgrade b { display: block; margin-top: 4px; color: white; font-size: 13px; }
.sidebar-upgrade p { margin: 3px 0 10px; color: #9fb0c9; font-size: 11px; }
.sidebar-upgrade a { color: #dce8ff; font-size: 12px; font-weight: 750; }
.sidebar-logout { margin-top: 9px; }
.sidebar-logout button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    color: #8999b1;
    background: transparent;
    text-align: left;
    cursor: pointer;
}
.sidebar-logout button:hover { color: white; }
.app-main { min-height: 100vh; margin-left: 256px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    min-height: 72px;
    align-items: center;
    gap: 18px;
    padding: 12px 34px;
    border-bottom: 1px solid rgba(226,232,240,.9);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(14px);
}
.topbar-context { display: grid; }
.topbar-context span { color: var(--ink-soft); font-size: 11px; }
.topbar-context b { font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; margin-left: auto; }
.quick-create {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    color: white;
    background: var(--blue);
    box-shadow: 0 8px 18px rgba(39,100,255,.2);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.quick-create:hover { background: var(--blue-dark); }
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    cursor: pointer;
}
.content-wrap { width: min(100% - 56px, 1240px); margin: 0 auto; padding: 34px 0 60px; }
.sidebar-backdrop { display: none; }

/* Typography and reusable surfaces */
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
h2 { font-size: 18px; letter-spacing: -.02em; }
h3 { font-size: 15px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading p { margin-bottom: 0; color: var(--ink-soft); }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 0; }
.card-head h2 { margin: 0; }
.stack { display: grid; gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.layout-main-aside { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(280px,.75fr); gap: 20px; }
.button, button.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: white;
    background: var(--blue);
    font-weight: 750;
    text-decoration: none;
    cursor: pointer;
}
.button:hover { background: var(--blue-dark); }
.button-secondary { border-color: var(--line-dark); color: #334155; background: white; box-shadow: none; }
.button-secondary:hover { color: var(--blue); background: var(--blue-soft); }
.button-ghost { color: var(--blue); background: transparent; box-shadow: none; }
.button-ghost:hover { background: var(--blue-soft); }
.button-danger { color: white; background: var(--red); }
.button-whatsapp { color: white; background: #179c56; box-shadow: 0 8px 18px rgba(23,156,86,.2); }
.button-whatsapp:hover { background: #128047; }
.button:disabled { cursor: wait; opacity: .62; }
.button-sm { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.button-block { width: 100%; }
.text-link { color: var(--blue); font-weight: 700; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 20px; }
.stat-card {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-sm);
}
.stat-card::after { content: ""; position: absolute; right: -25px; bottom: -32px; width: 90px; height: 90px; border-radius: 50%; background: var(--blue-soft); }
.stat-label { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.stat-value { display: block; margin: 8px 0 3px; font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.stat-detail { position: relative; z-index: 1; color: var(--ink-soft); font-size: 11px; }
.stat-card.accent { color: white; border-color: transparent; background: linear-gradient(145deg, #184edf, #3478ff); }
.stat-card.accent::after { background: rgba(255,255,255,.1); }
.stat-card.accent .stat-label, .stat-card.accent .stat-detail { color: #dce8ff; }
.usage-bar { height: 7px; margin: 11px 0 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.2); }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: #76e4f2; }

/* Tables and statuses */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #64748b; background: #fbfcfe; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfdff; }
.table-title { display: block; color: var(--ink); font-weight: 750; text-decoration: none; }
.table-title:hover { color: var(--blue); }
.table-subtitle { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; }
.money { font-weight: 750; white-space: nowrap; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 999px;
    color: #475569;
    background: #eef2f7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .025em;
    white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-draft { color: #64748b; background: #f1f5f9; }
.status-sent { color: #2159cf; background: #e9f0ff; }
.status-viewed { color: #6c42b8; background: #f1eaff; }
.status-accepted, .status-active, .status-received { color: var(--green); background: var(--green-soft); }
.status-rejected, .status-expired { color: var(--red); background: var(--red-soft); }
.status-pending { color: var(--amber); background: var(--amber-soft); }
.empty-state { padding: 46px 24px; text-align: center; }
.empty-icon { display: grid; width: 54px; height: 54px; place-items: center; margin: 0 auto 15px; border-radius: 16px; color: var(--blue); background: var(--blue-soft); font-size: 24px; }
.empty-state h2 { margin-bottom: 6px; }
.empty-state p { max-width: 430px; margin: 0 auto 18px; color: var(--ink-soft); }

/* Forms */
label { display: grid; gap: 7px; color: #334155; font-size: 12px; font-weight: 700; }
input, select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--line-dark);
    border-radius: 10px;
    outline: none;
    color: var(--ink);
    background: white;
    transition: border .15s, box-shadow .15s;
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #7da1ff; box-shadow: 0 0 0 4px rgba(39,100,255,.1); }
input::placeholder, textarea::placeholder { color: #94a3b8; }
.field-help { color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.form-section { padding: 22px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section-head { margin-bottom: 18px; }
.form-section-head h2 { margin-bottom: 4px; }
.form-section-head p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.item-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 100px 150px 42px;
    gap: 10px;
    align-items: end;
    margin-bottom: 10px;
}
.document-item-row { grid-template-columns:minmax(220px,1fr) 190px 150px 42px; }
.item-quantity-group { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.item-remove {
    display: grid;
    width: 42px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--red);
    background: white;
    cursor: pointer;
}
.item-remove:hover { background: var(--red-soft); }
.summary-list { display: grid; gap: 10px; }
.summary-row { display: flex; justify-content: space-between; gap: 20px; color: var(--ink-soft); }
.summary-row strong { color: var(--ink); }
.summary-total { margin-top: 5px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 17px; font-weight: 800; }
.filter-bar { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.filter-bar input { max-width: 330px; min-height: 38px; }
.filter-bar select { width: auto; min-height: 38px; }
.color-field { display: flex; align-items: center; gap: 9px; }
.color-field input[type="color"] { width: 48px; padding: 4px; }
.brand-settings { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.brand-settings > div:first-child { grid-column:1/-1; }
.brand-preview-head { display:flex; align-items:center; gap:14px; margin-top:18px; }
.brand-preview-head img { width:64px; height:64px; object-fit:contain; border:1px solid var(--line); border-radius:12px; padding:5px; }
.brand-preview-head h2,.brand-preview-head p { margin:0; }
.brand-placeholder { display:grid; width:58px; height:58px; place-items:center; border-radius:14px; color:white; background:var(--preview-primary,var(--blue)); font-size:24px; font-weight:800; }
.brand-preview-line { height:5px; margin:18px 0; border-radius:999px; background:linear-gradient(90deg,var(--preview-primary,var(--blue)),var(--preview-accent,var(--cyan))); }

/* Multi-step forms */
.wizard { overflow:hidden; }
.wizard-progress { display:grid; grid-template-columns:repeat(var(--steps,4),1fr); padding:18px 22px; border-bottom:1px solid var(--line); background:#fbfcff; }
.wizard-progress button { position:relative; display:grid; justify-items:center; gap:7px; border:0; color:#94a3b8; background:transparent; font-size:11px; font-weight:750; cursor:default; }
.wizard-progress button::after { content:""; position:absolute; top:14px; left:calc(50% + 18px); width:calc(100% - 36px); height:2px; background:var(--line); }
.wizard-progress button:last-child::after { display:none; }
.wizard-progress .step-number { position:relative; z-index:1; display:grid; width:30px; height:30px; place-items:center; border:2px solid var(--line-dark); border-radius:50%; background:white; }
.wizard-progress button.active { color:var(--blue); }
.wizard-progress button.active .step-number { color:white; border-color:var(--blue); background:var(--blue); }
.wizard-progress button.done { color:#334155; cursor:pointer; }
.wizard-progress button.done .step-number { color:white; border-color:var(--green); background:var(--green); }
.wizard-progress button.done::after { background:var(--green); }
.wizard-step { display:none; padding:26px; }
.wizard-step.active { display:block; animation:wizard-in .2s ease; }
@keyframes wizard-in { from { opacity:.25; transform:translateX(8px); } to { opacity:1; transform:none; } }
.wizard-step-kicker { color:var(--blue); font-size:11px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.wizard-step h2 { margin:5px 0; font-size:22px; }
.wizard-step > p { color:var(--ink-soft); }
.wizard-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.wizard-actions .right-actions { display:flex; gap:10px; margin-left:auto; }
.wizard-review { display:grid; gap:12px; }
.review-block { padding:16px; border:1px solid var(--line); border-radius:12px; background:#fbfcfe; }
.review-block span { color:var(--ink-soft); font-size:11px; text-transform:uppercase; }
.review-block strong { display:block; margin-top:4px; }
.legal-notice { padding:15px; border:1px solid #f1d28a; border-radius:12px; color:#734c09; background:#fff8e6; }
.field-group { padding:17px; border:1px solid var(--line); border-radius:13px; background:#fbfcfe; }
.field-group h3 { margin-bottom:12px; }

/* Document views */
.document-header { display: flex; justify-content: space-between; gap: 20px; padding: 24px; border-bottom: 1px solid var(--line); }
.document-party { display: grid; gap: 3px; }
.document-party span { color: var(--ink-soft); font-size: 11px; text-transform: uppercase; }
.document-party strong { font-size: 16px; }
.document-meta { display: grid; gap: 7px; min-width: 190px; }
.document-meta div { display: flex; justify-content: space-between; gap: 18px; }
.document-meta span { color: var(--ink-soft); font-size: 12px; }
.document-totals { width: min(100%, 350px); margin: 0 22px 22px auto; }
.callout {
    padding: 16px;
    border: 1px solid #cfe0ff;
    border-radius: 13px;
    color: #254171;
    background: #f2f6ff;
}
.callout-success { color: #176448; border-color: #bae9d5; background: var(--green-soft); }
.callout-warning { color: #7e5008; border-color: #f6dc9d; background: var(--amber-soft); }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 11px; padding-bottom: 18px; }
.timeline-item::before { content:""; position:absolute; top:18px; bottom:-2px; left:6px; width:1px; background:var(--line); }
.timeline-item:last-child::before { display:none; }
.timeline-dot { position:relative; z-index:1; width:13px; height:13px; margin-top:4px; border:3px solid white; border-radius:50%; background:var(--blue); box-shadow:0 0 0 1px var(--line-dark); }
.timeline-item b { display:block; font-size:12px; }
.timeline-item small { color:var(--ink-soft); }

/* Alerts */
.alert {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 12px;
}
.alert > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; font-weight: 900; }
.alert p { margin: 0; }
.alert button { border: 0; color: inherit; background: transparent; font-size: 20px; cursor: pointer; }
.alert-success { color: #176448; border-color: #bce8d6; background: var(--green-soft); }
.alert-success > span { color: white; background: var(--green); }
.alert-error { color: #8c2431; border-color: #f2c4ca; background: var(--red-soft); }
.alert-error > span { color: white; background: var(--red); }
.alert-info { color:#254171; border-color:#cfe0ff; background:#f2f6ff; }
.alert-info > span { color:white; background:var(--blue); }

/* Quote workflow improvements */
.autosave-status { align-self:end; padding:7px 11px; border:1px solid var(--line); border-radius:999px; color:var(--ink-soft); background:white; font-size:11px; font-weight:700; }
.template-strip,.draft-recovery { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; padding:14px 17px; border:1px solid #cfe0ff; border-radius:14px; background:#f2f6ff; }
.template-strip > div,.draft-recovery > div:first-child { display:grid; gap:2px; }
.template-strip span,.draft-recovery span { color:var(--ink-soft); font-size:12px; }
.template-strip form { min-width:240px; }
.client-picker-action { display:flex; align-items:center; gap:12px; padding-top:22px; }
.client-picker-action span { color:var(--ink-soft); font-size:11px; }
.client-summary { margin-top:15px; }
.item-row { grid-template-columns:minmax(210px,1fr) 76px 105px 130px 112px 40px 42px 42px; padding:12px; border:1px solid var(--line); border-radius:13px; background:#fbfcfe; }
.item-description { display:grid; gap:3px; }
.item-description label { display:grid; gap:5px; }
.save-concept-row { justify-self:start; padding:2px 0; border:0; color:var(--blue); background:transparent; font-size:10px; font-weight:750; cursor:pointer; }
.save-concept-row:disabled { opacity:.55; cursor:wait; }
.item-line-total { display:grid; min-height:44px; align-content:center; gap:1px; padding:5px 9px; border:1px solid var(--line); border-radius:10px; background:#fbfcfe; }
.item-line-total span { color:var(--ink-soft); font-size:9px; text-transform:uppercase; }
.item-line-total b { font-size:11px; white-space:nowrap; }
.item-duplicate { display:grid; width:42px; height:44px; place-items:center; border:1px solid var(--line); border-radius:10px; color:var(--blue); background:white; cursor:pointer; }
.item-duplicate:hover { background:var(--blue-soft); }
.item-order { display:grid; grid-template-rows:1fr 1fr; height:44px; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:white; }
.item-order button { border:0; color:var(--ink-soft); background:transparent; line-height:1; cursor:pointer; }
.item-order button + button { border-top:1px solid var(--line); }
.item-order button:hover { color:var(--blue); background:var(--blue-soft); }
.items-footer { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-top:12px; }
.items-footer > div:last-child { display:grid; text-align:right; }
.items-footer > div:last-child span { color:var(--ink-soft); font-size:10px; text-transform:uppercase; }
.items-footer > div:last-child strong { font-size:18px; }
.items-add-actions { display:flex; align-items:center; gap:7px; }
.quick-pills { display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.quick-pills button { padding:4px 7px; border:1px solid var(--line); border-radius:999px; color:var(--ink-soft); background:white; font-size:9px; font-weight:750; cursor:pointer; }
.quick-pills button:hover { color:var(--blue); border-color:#a9c0ff; background:var(--blue-soft); }
.field-error { color:var(--red); font-weight:700; }
.review-section { padding:16px; border:1px solid var(--line); border-radius:12px; background:#fbfcfe; }
.review-section > div:first-child { display:flex; justify-content:space-between; gap:15px; margin-bottom:8px; }
.review-section > div:first-child > span { color:var(--ink-soft); font-size:10px; font-weight:800; text-transform:uppercase; }
.review-section button { border:0; color:var(--blue); background:transparent; font-size:11px; font-weight:750; cursor:pointer; }
.review-section > strong,.review-section > small { display:block; }
.review-items { display:grid; gap:7px; }
.review-items > div { display:grid; grid-template-columns:1fr auto; gap:2px 18px; padding-top:7px; border-top:1px solid var(--line); }
.review-items > div:first-child { border-top:0; }
.review-items small { color:var(--ink-soft); }
.review-items b { grid-column:2; grid-row:1/3; align-self:center; }
.review-section dl { display:grid; gap:8px; margin:0; }
.review-section dl > div { display:grid; grid-template-columns:110px 1fr; gap:12px; }
.review-section dt { color:var(--ink-soft); font-size:11px; }
.review-section dd { margin:0; white-space:pre-line; }
.review-totals { padding:16px; border-radius:12px; background:var(--blue-soft); }
.quick-client-dialog,.response-dialog,.concept-catalog-dialog { width:min(100% - 28px,620px); padding:0; border:0; border-radius:18px; box-shadow:0 30px 90px rgba(15,23,42,.25); }
.quick-client-dialog::backdrop,.response-dialog::backdrop,.concept-catalog-dialog::backdrop { background:rgba(9,16,29,.6); backdrop-filter:blur(2px); }
.quick-client-dialog form,.response-dialog form { display:grid; gap:14px; padding:24px; }
.catalog-shell { display:grid; gap:14px; padding:24px; }
.catalog-shell > p { margin:0; color:var(--ink-soft); }
.catalog-list { display:grid; max-height:380px; gap:7px; overflow:auto; }
.catalog-list article { display:flex; align-items:center; justify-content:space-between; gap:15px; padding:11px 12px; border:1px solid var(--line); border-radius:11px; }
.catalog-list article > div { display:grid; }
.catalog-list article > div:last-child { display:flex; grid-auto-flow:column; align-items:center; gap:5px; }
.catalog-list article span { color:var(--ink-soft); font-size:11px; }
.catalog-delete { width:30px; height:30px; border:0; border-radius:8px; color:var(--red); background:transparent; font-size:18px; cursor:pointer; }
.catalog-delete:hover { background:var(--red-soft); }
.catalog-empty { display:grid; gap:3px; padding:26px; border:1px dashed var(--line-dark); border-radius:12px; color:var(--ink-soft); text-align:center; }
.dialog-head { display:flex; justify-content:space-between; gap:20px; }
.dialog-head h2 { margin:4px 0 0; }
.dialog-head > button { width:38px; height:38px; border:1px solid var(--line); border-radius:50%; background:white; font-size:22px; cursor:pointer; }
.dialog-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:5px; }
.form-error { min-height:18px; margin:0; color:var(--red); font-size:12px; font-weight:700; }
.document-conditions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.document-conditions p { margin:5px 0 0; color:var(--ink-soft); white-space:pre-line; }
.insights-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:-6px 0 20px; }
.insight-card { display:grid; gap:4px; padding:16px 18px; border:1px solid var(--line); border-radius:14px; background:white; box-shadow:var(--shadow-sm); }
.insight-card span,.insight-card small { color:var(--ink-soft); font-size:11px; }
.insight-card strong { font-size:20px; letter-spacing:-.03em; }

/* Public quote */
.public-quote-body { min-height:100vh; background:radial-gradient(circle at 10% 0,color-mix(in srgb,var(--public-brand) 12%,transparent),transparent 35%),#f3f6fa; }
.public-quote-shell { width:min(100% - 32px,980px); margin:auto; padding:28px 0 45px; }
.public-quote-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:26px; }
.public-business { display:flex; align-items:center; gap:12px; }
.public-business img,.public-business-mark { display:grid; width:50px; height:50px; place-items:center; object-fit:contain; border-radius:12px; background:white; box-shadow:var(--shadow-sm); }
.public-business-mark { color:white; background:var(--public-brand); font-size:22px; font-weight:850; }
.public-business > div { display:grid; }
.public-business strong { font-size:17px; }
.public-business span { color:var(--ink-soft); font-size:12px; }
.public-quote-intro { display:flex; align-items:end; justify-content:space-between; gap:28px; margin-bottom:20px; }
.public-quote-intro h1 { max-width:650px; margin:6px 0; font-size:clamp(28px,4vw,44px); letter-spacing:-.045em; }
.public-quote-intro p { color:var(--ink-soft); }
.public-status { display:grid; min-width:190px; gap:3px; padding:13px 16px; border-radius:13px; color:#176448; background:var(--green-soft); }
.public-status span { font-size:10px; font-weight:800; text-transform:uppercase; }
.public-status.status-rejected,.public-status.status-expired { color:#7c4550; background:#fff0f1; }
.public-document { overflow:hidden; border:1px solid var(--line); border-radius:20px; background:white; box-shadow:var(--shadow); }
.public-meta-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px; border-bottom:1px solid var(--line); background:var(--line); }
.public-meta-grid > div { display:grid; gap:3px; padding:17px; background:#fbfcfe; }
.public-meta-grid span { color:var(--ink-soft); font-size:10px; text-transform:uppercase; }
.public-items th:first-child,.public-items td:first-child { width:50%; }
.public-summary { width:min(100%,420px); margin-left:auto; padding:22px 24px; }
.public-summary > div { display:flex; justify-content:space-between; gap:20px; padding:6px 0; color:var(--ink-soft); }
.public-summary b { color:var(--ink); }
.public-summary .public-total { margin-top:7px; padding-top:15px; border-top:1px solid var(--line); color:var(--ink); font-size:18px; }
.public-conditions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; padding:22px 24px; border-top:1px solid var(--line); background:#fbfcfe; }
.public-conditions span { color:var(--ink-soft); font-size:10px; font-weight:800; text-transform:uppercase; }
.public-conditions p { margin:5px 0 0; white-space:pre-line; }
.public-response { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-top:18px; padding:24px; border:1px solid color-mix(in srgb,var(--public-brand) 25%,white); border-radius:18px; background:white; box-shadow:var(--shadow-sm); }
.public-response h2 { margin:4px 0; }
.public-response p { margin:0; color:var(--ink-soft); }
.public-response-actions { display:flex; gap:8px; flex-shrink:0; }
.public-response-success { border-color:#bae9d5; background:var(--green-soft); }
.public-quote-footer { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:22px 4px; color:var(--ink-soft); font-size:12px; }
.public-quote-footer > div { display:grid; }
.public-quote-footer a { color:var(--public-brand); font-weight:750; }
.checkbox-field { display:grid!important; grid-template-columns:20px 1fr!important; align-items:start; gap:9px!important; font-weight:500!important; }
.checkbox-field input { width:18px; min-height:18px; margin-top:2px; }

/* Authentication */
.auth-body { min-height: 100vh; background: radial-gradient(circle at 10% 0, #e9f1ff, transparent 32%), #f7f9fc; }
.auth-header {
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    width: min(100% - 40px, 1120px);
    margin: auto;
}
.auth-header .app-logo { color: var(--navy); }
.auth-header > a:last-child { color: #475569; font-size: 13px; font-weight: 700; text-decoration: none; }
.auth-main { display: grid; min-height: calc(100vh - 74px); place-items: center; padding: 30px 20px 70px; }
.auth-card { width: min(100%, 470px); padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { text-align: center; }
.auth-card > p { text-align: center; color: var(--ink-soft); }
.auth-form { display: grid; gap: 14px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: #94a3b8; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content:""; flex:1; height:1px; background:var(--line); }
.google-button { width:100%; color:#334155; border-color:var(--line-dark); background:white; }
.google-dot { display:inline-grid; width:22px; height:22px; place-items:center; border-radius:50%; color:white; background:linear-gradient(135deg,#4285f4 0 25%,#34a853 25% 50%,#fbbc05 50% 75%,#ea4335 75%); font-size:10px; }
.auth-footer { margin: 20px 0 0; text-align: center; font-size: 13px; }
.checkbox-label { display:flex; grid-template-columns:none; align-items:center; gap:8px; font-weight:500; }
.checkbox-label input { width:16px; min-height:16px; }

/* Responsive */
@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .layout-main-aside { grid-template-columns: 1fr; }
    .item-row { grid-template-columns:minmax(180px,1fr) 76px 105px 125px 105px 40px 42px 42px; }
}
@media (max-width: 820px) {
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { position: fixed; inset: 0; z-index: 70; display: block; background: rgba(9,16,29,.55); }
    .sidebar-close { display: block; }
    .app-main { margin-left: 0; }
    .menu-toggle { display: block; }
    .topbar { padding: 11px 18px; }
    .content-wrap { width: min(100% - 30px, 720px); padding-top: 24px; }
    .item-row { grid-template-columns:86px 110px minmax(140px,1fr) 40px 42px 42px; }
    .item-description { grid-column:1/-1; }
    .item-row > label:nth-of-type(1) { grid-column:1; }
    .item-row > label:nth-of-type(2) { grid-column:2; }
    .item-price { grid-column:3; }
    .item-line-total { grid-column:1/4; }
    .item-order { grid-column:4; }
    .document-item-row { grid-template-columns:minmax(0,1fr) 170px 120px 42px; }
    .public-meta-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .public-quote-intro,.public-response { align-items:stretch; flex-direction:column; }
    .public-status { min-width:0; }
}
@media (max-width: 620px) {
    .topbar-context { display: none; }
    .quick-create { width: 40px; height: 40px; padding: 0; overflow: hidden; white-space: nowrap; font-size: 0; }
    .quick-create span { font-size: 20px; }
    .page-heading { display: grid; }
    .page-actions { width: 100%; }
    .page-actions .button { flex: 1; }
    .stats-grid, .grid, .grid-3, .insights-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 116px; }
    .card-pad, .form-section { padding: 18px; }
    .card-head { padding: 18px 18px 0; }
    th, td { padding: 12px 14px; }
    .mobile-hide { display: none; }
    .item-row { grid-template-columns:minmax(0,1fr) 42px 42px; padding:12px; }
    .item-description { grid-column: 1 / -1; }
    .item-row > label:not(.item-description) { grid-column:1/-1; }
    .item-line-total { grid-column:1/-1; }
    .item-order { grid-column:1; grid-row:auto; grid-template-columns:1fr 1fr; grid-template-rows:none; width:86px; }
    .item-order button + button { border-top:0; border-left:1px solid var(--line); }
    .document-item-row { grid-template-columns:minmax(0,1fr) 42px; }
    .document-item-row .item-description,
    .document-item-row .item-quantity-group,
    .document-item-row .item-price { grid-column:1 / -1; }
    .form-actions { display: grid; }
    .document-header { display: grid; padding: 18px; }
    .filter-bar { flex-wrap: wrap; }
    .filter-bar input { max-width: none; }
    .filter-bar select { flex: 1; }
    .auth-card { padding: 25px 20px; }
    .brand-settings { grid-template-columns:1fr; }
    .brand-settings > div:first-child { grid-column:auto; }
    .wizard-progress { padding:14px 8px; }
    .wizard-progress button { font-size:9px; }
    .wizard-progress button::after { left:calc(50% + 15px); width:calc(100% - 30px); }
    .wizard-step { padding:20px 16px; }
    .wizard-actions { position:sticky; bottom:0; margin-inline:-16px; padding:14px 16px; background:white; box-shadow:0 -8px 22px rgba(15,23,42,.06); }
    .template-strip,.draft-recovery,.items-footer,.public-quote-header,.public-quote-footer { align-items:stretch; flex-direction:column; }
    .items-add-actions { display:grid; grid-template-columns:1fr 1fr; }
    .template-strip form { min-width:0; }
    .client-picker-action { align-items:flex-start; flex-direction:column; padding-top:0; }
    .dialog-actions,.public-response-actions { display:grid; grid-template-columns:1fr; }
    .dialog-actions .button,.public-response-actions .button { width:100%; }
    .public-quote-shell { width:min(100% - 20px,980px); padding-top:14px; }
    .public-meta-grid,.public-conditions,.document-conditions { grid-template-columns:1fr; }
    .public-items th:nth-child(2),.public-items td:nth-child(2),.public-items th:nth-child(3),.public-items td:nth-child(3) { display:none; }
    .public-summary { padding:18px; }
}
