:root {
    --crm-primary: #2563eb;
    --crm-primary-dark: #1e40af;
    --crm-accent: #2563eb;
    --crm-success: #16836b;
    --crm-warning: #b7791f;
    --crm-bg: #f5f7fa;
    --crm-surface: #fff;
    --crm-support-gray: #64748b;
    --ui-ink: #172b43;
    --ui-muted: #64748b;
    --ui-border: #e3e9f0;
    --ui-action: #2563eb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--crm-bg); color: var(--ui-ink); font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: .9rem; line-height: 1.55; }
a { color: #245dcc; text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { color: var(--ui-ink); font-weight: 650; letter-spacing: -.025em; }
h5 { font-size: 1.06rem; }
h6 { font-size: .94rem; }
.text-muted { color: var(--ui-muted) !important; }
.app-wrapper { display: flex; min-height: 100vh; }
.content-area { min-width: 0; flex: 1; }
.app-topbar { min-height: 76px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border-bottom: 1px solid var(--ui-border); }
.topbar-location { display: flex; align-items: center; gap: 14px; color: var(--ui-muted); font-size: .8rem; min-width: 0; }
.topbar-location > span:first-of-type { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-location strong { color: #334155; font-weight: 500; }
.breadcrumb-divider { color: #c5ceda; }
.topbar-account { display: flex; align-items: center; gap: 10px; }
.topbar-account strong { display: block; font-size: .8rem; font-weight: 600; }
.topbar-account small { display: block; color: var(--ui-muted); font-size: .7rem; }
.account-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #eef3fd; color: #41628f; flex-shrink: 0; }
.page-content { max-width: 1720px; margin: 0 auto; padding: 30px 32px 20px; }
.page-content:focus { outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-eyebrow { font-size: .66rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 700; color: #59738f; margin-bottom: 6px; }
.page-heading h1 { font-size: clamp(1.45rem, 2vw, 1.9rem); margin: 0 0 6px; letter-spacing: -.035em; }
.page-heading p { color: var(--ui-muted); margin: 0; font-size: .86rem; }
.page-footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--ui-border); display: flex; justify-content: space-between; color: #718198; font-size: .72rem; }
.card { border: 1px solid var(--ui-border); border-radius: 12px; background: var(--crm-surface); box-shadow: 0 2px 4px rgba(18, 42, 66, .025); }
.card-body { padding: 22px; }
.card-header { border-bottom: 1px solid var(--ui-border); padding: 18px 22px; background: transparent; }
.card > .table-responsive { border-radius: 12px; }
.card-body > h5, .card-body > h6 { margin-bottom: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-title h2, .panel-title h6 { margin: 0; font-size: .97rem; }
.panel-title a { font-size: .78rem; font-weight: 600; text-decoration: none; }
.panel-subtitle { color: var(--ui-muted); font-size: .8rem; margin: -10px 0 18px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; }
.toolbar form { flex: 1; max-width: 680px; }
.filter-search { flex: 1; min-width: 170px; }
.filter-search input { width: 100%; }
.btn { font-weight: 600; font-size: .82rem; border-radius: 8px; padding: .58rem .95rem; display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.btn-sm { font-size: .75rem; padding: .34rem .65rem; }
.btn-primary { --bs-btn-bg: var(--ui-action); --bs-btn-border-color: var(--ui-action); --bs-btn-hover-bg: #1d4ed8; --bs-btn-hover-border-color: #1d4ed8; --bs-btn-active-bg: #1e40af; --bs-btn-active-border-color: #1e40af; --bs-btn-disabled-bg: #93ade5; --bs-btn-disabled-border-color: #93ade5; box-shadow: 0 2px 3px #2563eb15; }
.btn-outline-primary { --bs-btn-color: #245dcc; --bs-btn-border-color: #cad9ef; --bs-btn-hover-bg: #edf3ff; --bs-btn-hover-color: #1d4ed8; --bs-btn-hover-border-color: #b6caeb; --bs-btn-active-bg: #e8effc; --bs-btn-active-color: #1d4ed8; --bs-btn-active-border-color: #b6caeb; }
.btn-light, .btn-outline-secondary, .btn-outline-dark { --bs-btn-color: #475569; --bs-btn-bg: #fff; --bs-btn-border-color: #dce3ec; --bs-btn-hover-bg: #f1f5f9; --bs-btn-hover-color: #172b43; --bs-btn-hover-border-color: #c4ceda; --bs-btn-active-bg: #e8eef6; --bs-btn-active-color: #172b43; --bs-btn-active-border-color: #cad5e3; }
.btn-group .btn { box-shadow: none; }
.form-label { display: block; font-weight: 600; font-size: .79rem; color: #40516a; margin-bottom: 7px; }
.form-control, .form-select { font-size: .86rem; color: var(--ui-ink); border: 1px solid #d8e1ec; border-radius: 8px; min-height: 41px; padding: .55rem .75rem; }
.form-select { padding-right: 2.25rem; }
.form-select[multiple] { min-height: 112px; }
.form-control::placeholder { color: #8290a3; opacity: 1; }
.form-control:focus, .form-select:focus { border-color: #7ba4ee; box-shadow: 0 0 0 3px #2563eb14; }
.form-control:disabled, .form-control[readonly], .form-select:disabled { background: #f3f6fa; color: #64748b; }
.form-text { font-size: .74rem; color: #718198; line-height: 1.5; }
.field-required::after { content: " *"; color: #b84b4b; }
.form-section-heading { padding-bottom: 16px; margin-bottom: 20px; border-bottom: 1px solid var(--ui-border); }
.form-section-heading h2 { font-size: 1rem; margin: 0 0 4px; }
.form-section-heading p { font-size: .8rem; color: var(--ui-muted); margin: 0; }
.section-number { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; color: #245dcc; background: #edf3ff; font-size: .75rem; margin-right: 9px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 20px; margin-top: 8px; border-top: 1px solid var(--ui-border); }
.form-check { margin-bottom: 8px; }
.table { --bs-table-bg: transparent; --bs-table-border-color: #edf1f6; --bs-table-color: var(--ui-ink); margin-bottom: 0; font-size: .83rem; }
.table > :not(caption) > * > * { padding: 14px 17px; vertical-align: middle; }
.table thead th { font-size: .71rem; font-weight: 600; letter-spacing: .025em; color: #63758d; background: #f8fafc; white-space: nowrap; border-bottom: 1px solid var(--ui-border); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { --bs-table-bg: #f9fbff; }
.table td.text-end { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td .btn-group { white-space: nowrap; }
.table-responsive { scrollbar-width: thin; }
.badge { font-weight: 500; font-size: .7rem; padding: .4em .65em; border-radius: 6px; line-height: 1.45; white-space: normal; }
.badge.text-bg-primary, .badge.text-bg-info { background: #eaf1fc !important; color: #2b60a6 !important; }
.badge.text-bg-success { background: #e6f5ee !important; color: #1d7657 !important; }
.badge.text-bg-warning { background: #fff3dc !important; color: #956117 !important; }
.badge.text-bg-danger { background: #fcebea !important; color: #b03d37 !important; }
.badge.text-bg-secondary { background: #edf0f5 !important; color: #56657a !important; }
.badge.text-bg-light { background: #f4f6f9 !important; color: #536278 !important; border-color: #e3e9f0 !important; }
.pagination { flex-wrap: wrap; gap: 5px; margin-bottom: 0; }
.page-link { border-radius: 7px !important; border-color: #e1e7ef; font-size: .8rem; color: #4a607d; }
.page-item.active .page-link { background: #245dcc; border-color: #245dcc; }
.empty-state { padding: 44px 20px; text-align: center; color: var(--ui-muted); }
.empty-state strong { display: block; font-size: .94rem; color: #415672; margin-bottom: 6px; }
.empty-state p { margin: 0; font-size: .8rem; }
.metric-card { height: 100%; position: relative; }
.metric-card .card-body { padding: 23px; }
.metric-label { font-size: .78rem; color: #64748b; display: flex; justify-content: space-between; align-items: center; }
.metric-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #426baf; background: #eef3fb; }
.metric-value { font-size: clamp(1.5rem, 2.1vw, 2rem); font-weight: 650; letter-spacing: -.04em; margin: 7px 0; color: #213a57; font-variant-numeric: tabular-nums; }
.metric-note { font-size: .73rem; color: #7a899c; }
.metric-card.success .metric-value { color: #167b64; }
.quick-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.quick-actions > span { font-size: .78rem; color: var(--ui-muted); margin-right: 6px; }
.dashboard-chart { height: 265px; position: relative; max-width: 420px; margin: auto; }
.recent-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 14px 0; border-bottom: 1px solid #edf1f6; }
.recent-row:last-child { border-bottom: 0; }
.recent-row a { font-weight: 600; text-decoration: none; }
.recent-row small { display: block; margin-top: 3px; color: var(--ui-muted); font-size: .76rem; }
.recent-row strong { font-variant-numeric: tabular-nums; font-size: .87rem; }
.quotes-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.quote-kpi .kpi-label { color: var(--ui-muted); font-size: .73rem; margin-bottom: 10px; }
.quote-kpi .kpi-value { color: #24405f; font-size: 1.3rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.quote-kpi .kpi-sm { font-size: .9rem; line-height: 1.5; }
.quote-card-v2 { border-top: 3px solid #93b5e9; }
.quote-card-v2 .quote-number, .quote-detail-number { font-weight: 650; color: #234363; }
.quote-detail-number { font-size: 1.35rem; }
.quote-meta { color: var(--ui-muted); }
.quote-value, .quote-total-box strong { color: #245dcc; font-size: 1.25rem; font-weight: 650; }
.quote-pre { white-space: pre-wrap; line-height: 1.7; }
.quote-save-bar { position: sticky; bottom: 12px; z-index: 15; box-shadow: 0 5px 30px #14223512; }
.quote-save-bar .card-body { padding: 16px 22px; }
.catalog-picker { border: 1px solid var(--ui-border); border-radius: 9px; background: #f9fbfe; padding: 12px 16px; margin: 16px 0 20px; }
.catalog-picker summary { font-size: .81rem; font-weight: 600; color: #496586; cursor: pointer; }
.catalog-picker[open] summary { margin-bottom: 16px; }
#quote-form .table td { min-width: 105px; vertical-align: top; padding: 10px 7px; }
#quote-form .table td:first-child { min-width: 220px; width: 24%; }
#quote-form .table td:nth-child(2) { min-width: 200px; }
#quote-form .table td:last-child { min-width: 44px; }
#quote-form .product-suggestions { position: static !important; margin-top: 5px; max-height: 220px; overflow-y: auto; box-shadow: none !important; border: 1px solid var(--ui-border); border-radius: 8px; }
.product-suggestions button { text-align: left; white-space: normal; font-size: .8rem; }
#quote-client-results { width: calc(100% - 24px) !important; max-height: 260px; overflow-y: auto; }
/* One palette per stage, shared by board columns and quote indicators. */
[data-pipeline-stage] { --stage-color: #64748b; --stage-bg: #e8edf3; --stage-badge: #e2e8f0; --stage-ink: #334155; --stage-border: #c3cedc; }
[data-pipeline-stage="Solicitacao"] { --stage-color: #3b82f6; --stage-bg: #e7f0ff; --stage-badge: #dbeafe; --stage-ink: #1e40af; --stage-border: #b4cdf9; }
[data-pipeline-stage="Aguardando cotacao compras"] { --stage-color: #d99516; --stage-bg: #fff4d6; --stage-badge: #fef3c7; --stage-ink: #854d0e; --stage-border: #e9c66e; }
[data-pipeline-stage="Aguardando enviar para o cliente"] { --stage-color: #8b5cf6; --stage-bg: #f0e7ff; --stage-badge: #ede9fe; --stage-ink: #5b21b6; --stage-border: #cdb5f4; }
[data-pipeline-stage="Negociando"] { --stage-color: #10a779; --stage-bg: #def6eb; --stage-badge: #d1fae5; --stage-ink: #065f46; --stage-border: #99d8bd; }
[data-pipeline-stage="Cotacao encerrada"] { --stage-color: #64748b; --stage-bg: #e8edf3; --stage-badge: #e2e8f0; --stage-ink: #334155; --stage-border: #c3cedc; }
.badge.pipeline-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--stage-badge); color: var(--stage-ink); border: 1px solid var(--stage-border); font-weight: 600; padding: 6px 10px; text-align: left; line-height: 1.45; }
.pipeline-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; background: var(--stage-color); }
.quote-card-v2[data-pipeline-stage] { border-top-color: var(--stage-color); }
.pipeline-board { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 16px; overflow-x: auto; padding: 2px 0 16px; align-items: stretch; scrollbar-width: thin; }
.pipeline-column { display: flex; flex-direction: column; background: var(--stage-bg); border: 1px solid var(--stage-border); border-radius: 12px; min-height: 380px; border-top: 4px solid var(--stage-color); }
.pipeline-column header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 13px; background: var(--stage-badge); border-bottom: 1px solid var(--stage-border); border-radius: 8px 8px 0 0; }
.pipeline-column h6 { font-size: .82rem; margin: 0; line-height: 1.5; color: var(--stage-ink); }
.pipeline-count { background: #fff; color: var(--stage-ink); border: 1px solid var(--stage-border); min-width: 28px; font-weight: 700; }
.pipeline-list { display: grid; align-content: start; flex: 1; gap: 10px; padding: 12px 10px; }
.pipeline-card { display: block; text-decoration: none; color: inherit; border: 1px solid var(--stage-border); border-left: 3px solid var(--stage-color); padding: 15px; border-radius: 9px; background: #fff; transition: border-color .15s; }
.pipeline-card:hover { border-color: var(--stage-color); color: inherit; }
.pipeline-title { font-weight: 650; font-size: .82rem; }
.pipeline-client { margin: 6px 0; font-size: .81rem; }
.pipeline-meta { color: #75859a; font-size: .72rem; }
.pipeline-total { font-weight: 650; color: #356488; font-size: .87rem; padding-top: 12px; margin-top: 12px; border-top: 1px solid #edf1f6; }
.pipeline-empty { color: var(--stage-ink); font-size: .8rem; padding: 32px 10px; text-align: center; }
.pipeline-card.dragging { opacity: .5; }
.pipeline-list.drop-target { background: var(--stage-badge); outline: 2px dashed var(--stage-color); outline-offset: -5px; border-radius: 0 0 10px 10px; }
.permission-toolbar { background: #f8fafc; padding: 16px; border: 1px solid var(--ui-border); border-radius: 9px; }
.permission-checkbox { width: 1.1rem; height: 1.1rem; cursor: pointer; accent-color: #2563eb; }
.list-group-item { border-color: #edf1f6; }
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 24px 70px #172b4330; }
.modal-header, .modal-footer { border-color: var(--ui-border); padding: 18px 22px; }
.modal-body { padding: 22px; }
.notification-menu { width: 340px; max-width: calc(100vw - 32px); }
.alert { font-size: .84rem; border-radius: 9px; }
#tasks-calendar .fc-toolbar-title { font-size: 1.1rem; }
#tasks-calendar .fc-button-primary { background: #245dcc; border-color: #245dcc; font-size: .8rem; }
#tasks-calendar .fc-event { cursor: pointer; }
.reports-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 14px; margin-top: 24px; }
.report-link-card { display: block; padding: 20px; background: white; border: 1px solid var(--ui-border); border-radius: 10px; text-decoration: none; transition: border-color .15s; }
.report-link-card:hover { border-color: #9bb9e3; }
.report-link-card strong { display: block; margin-bottom: 7px; font-size: .9rem; }
.report-link-card small { display: block; color: var(--ui-muted); font-size: .77rem; }
.skip-link { position: fixed; top: -100px; left: 20px; background: #fff; padding: 12px; z-index: 2000; }
.skip-link:focus { top: 10px; }
.menu-toggle, .menu-close { display: none; }
.sidebar-backdrop[hidden] { display: none; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 36px; background: #edf2f8; }
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; width: min(1040px, 100%); min-height: 630px; border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 24px 70px #14223510; }
.auth-intro { background: #142235; color: #b7c9df; padding: 42px; display: flex; flex-direction: column; justify-content: space-between; gap: 42px; }
.auth-brand { font-size: 1.1rem; font-weight: 650; color: #fff; }
.auth-intro .page-eyebrow { color: #8ab4ec; }
.auth-intro h1 { color: #fff; font-size: clamp(2rem, 3vw, 2.8rem); line-height: 1.15; margin: 14px 0 20px; }
.auth-intro p { max-width: 300px; font-size: .9rem; line-height: 1.8; }
.auth-intro > small { font-size: .7rem; color: #90a5bf; }
.auth-features { display: grid; gap: 16px; margin-top: 32px; font-size: .77rem; color: #7e9abe; }
.auth-features strong { color: #d8e4f4; font-weight: 500; padding-left: 14px; }
.auth-form-panel { display: grid; place-items: center; padding: 42px; }
.auth-form-wrap { width: 100%; max-width: 340px; }
.auth-form-wrap h2 { font-size: 1.65rem; margin: 8px 0 12px; }
@media (max-width: 700px) {
    .auth-page { padding: 18px; }
    .auth-shell { grid-template-columns: 1fr; min-height: auto; }
    .auth-intro { padding: 24px; gap: 16px; }
    .auth-intro > div:nth-child(2), .auth-intro > small { display: none; }
    .auth-form-panel { padding: 30px 24px 38px; }
}

/* Sidebar: one layout, with a scrolling navigation and persistent account footer. */
.sidebar {
    box-sizing: border-box;
    flex: 0 0 252px;
    width: 252px;
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    color: #e5eaf3;
    background: #142235;
    border-right: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 4px 0 20px rgba(17, 24, 39, .06);
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 23px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-brand-symbol {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 12px;
}
.sidebar-logo { width: 42px; max-height: 44px; object-fit: contain; }
.sidebar-brand-text, .sidebar-account > div { min-width: 0; }
.sidebar-brand-text strong, .sidebar-account strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: .92rem;
    line-height: 1.4;
    color: #fff;
}
.sidebar-brand-text small, .sidebar-account small {
    display: block;
    margin-top: 3px;
    color: #b9c3d4;
    font-size: .73rem;
}
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #64748b transparent;
    padding: 18px 12px;
}
.sidebar-section + .sidebar-section { margin-top: 22px; }
.sidebar-section-title {
    margin: 0 12px 8px;
    color: #aab6ca;
    font-size: .65rem;
    line-height: 1.4;
    letter-spacing: .12em;
    font-weight: 600;
    text-transform: uppercase;
}
.sidebar .sidebar-link {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 42px;
    margin: 3px 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #d5ddeb;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
.sidebar .sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .sidebar-link.is-active {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: inset 3px 0 0 #7dd3fc;
    color: #fff;
}
.sidebar a:focus-visible, .sidebar summary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -2px;
}
.nav-icon { width: 19px; height: 19px; flex-shrink: 0; }
.nav-chevron { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; transition: transform .15s ease; }
.sidebar-reports > summary { list-style: none; }
.sidebar-reports > summary::-webkit-details-marker { display: none; }
.sidebar-reports[open] > summary .nav-chevron { transform: rotate(90deg); }
.sidebar-report-links {
    margin: 7px 8px 5px 21px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 255, 255, .18);
}
.sidebar .sidebar-report-link {
    display: block;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 6px;
    color: #b9c3d4;
    text-decoration: none;
    font-size: .8rem;
    line-height: 1.45;
}
.sidebar .sidebar-report-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .sidebar-report-link.is-active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; }
.sidebar-footer {
    flex-shrink: 0;
    padding: 14px 12px 12px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-account { display: flex; align-items: center; gap: 11px; padding: 0 12px 10px; }
.sidebar-account strong { font-size: .8rem; }
.sidebar .sidebar-logout { color: #f5c9c9; margin-bottom: 0; min-height: 36px; padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 900px) {
    .sidebar { width: 100%; flex: 0 0 auto; height: auto; position: relative; }
    .sidebar-brand { padding: 16px 20px; }
    .sidebar-nav { max-height: 42vh; max-height: 42dvh; flex: 0 1 auto; padding: 14px 12px; }
    .sidebar-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; }
    .sidebar-account { padding: 0; flex: 1; min-width: 0; }
    .sidebar .sidebar-logout { width: auto; margin: 0; flex-shrink: 0; }
    .content-area > header { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar .sidebar-link, .nav-chevron { transition: none; }
}

/* Mobile navigation becomes a drawer only once its controls are connected. */
@media (max-width: 1100px) {
    .page-content { padding: 24px 20px; }
    .app-topbar { padding: 16px 20px; }
    .sidebar { flex-basis: 236px; width: 236px; }
}
@media (max-width: 900px) {
    .app-wrapper { flex-direction: column; }
    .sidebar { width: 100%; flex-basis: auto; }
    .ui-ready .sidebar { position: fixed; top: 0; left: 0; width: min(290px, 88vw); height: 100dvh; z-index: 1050; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
    .ui-ready .sidebar-nav { max-height: none; flex: 1; }
    .ui-ready .sidebar-footer { display: block; }
    .ui-ready .sidebar-account { padding: 0 12px 10px; }
    .ui-ready .sidebar .sidebar-logout { width: 100%; }
    .ui-ready .menu-toggle, .ui-ready .menu-close { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid #dce3ec; border-radius: 8px; width: 36px; height: 36px; flex-shrink: 0; color: #425977; }
    .ui-ready .menu-close { margin-left: auto; color: #fff; border-color: #ffffff30; font-size: 1.3rem; }
    .menu-open { overflow: hidden; }
    .menu-open .sidebar { transform: translateX(0); visibility: visible; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1040; background: #101e3299; border: 0; }
    .app-topbar { min-height: 66px; }
    .page-content { padding: 22px 16px; }
    .topbar-location > span:first-of-type, .breadcrumb-divider { display: none; }
}
@media (max-width: 600px) {
    .card-body { padding: 17px; }
    .page-heading { margin-bottom: 20px; }
    .topbar-account > div { display: none; }
    .app-topbar { padding: 12px 16px; }
    .toolbar { align-items: stretch; }
    .toolbar form { width: 100%; flex-basis: 100%; flex-wrap: wrap; }
    .toolbar > .btn { width: 100%; }
    .quote-save-bar { bottom: 5px; }
    .quote-save-bar .card-body { gap: 12px !important; }
    .quote-save-bar .card-body > div { width: 100%; }
    .quote-save-bar .btn { flex: 1; }
    .table > :not(caption) > * > * { padding: 12px; }
    .page-footer { gap: 12px; flex-wrap: wrap; }
    .panel-title { flex-wrap: wrap; }
    #tasks-calendar .fc-toolbar { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
