/* ADVSAT · Fase 2 · Etapa 15
   Rediseño integral UX/UI. Capa visual acumulativa sobre app.css. */

:root {
    --s15-bg: #f6f7f9;
    --s15-surface: #ffffff;
    --s15-surface-subtle: #fafafa;
    --s15-surface-hover: #f4f5f7;
    --s15-text: #18181b;
    --s15-text-2: #5f636b;
    --s15-text-3: #9297a1;
    --s15-border: #e6e7ea;
    --s15-border-strong: #d8dadd;
    --s15-primary: #4338ca;
    --s15-primary-hover: #3730a3;
    --s15-primary-soft: #eef2ff;
    --s15-brand: #ffd21a;
    --s15-danger: #b42318;
    --s15-danger-soft: #fff1f0;
    --s15-warning: #9a6700;
    --s15-warning-soft: #fff8e1;
    --s15-success: #18794e;
    --s15-success-soft: #edf9f2;
    --s15-info: #175cd3;
    --s15-info-soft: #eff6ff;
    --s15-sidebar: 244px;
    --s15-sidebar-collapsed: 72px;
    --s15-radius-sm: 7px;
    --s15-radius: 10px;
    --s15-radius-lg: 14px;
    --s15-shadow-float: 0 16px 48px rgba(15, 23, 42, .10), 0 2px 8px rgba(15, 23, 42, .05);
    --sidebar-width: var(--s15-sidebar);
    --bg: var(--s15-bg);
    --surface: var(--s15-surface);
    --surface-soft: var(--s15-surface-subtle);
    --text: var(--s15-text);
    --text-secondary: var(--s15-text-2);
    --text-muted: var(--s15-text-3);
    --border: var(--s15-border);
    --primary: var(--s15-primary);
    --primary-hover: var(--s15-primary-hover);
    --primary-soft: var(--s15-primary-soft);
    --radius: var(--s15-radius);
    --shadow: none;
}

html { scroll-behavior: smooth; }
body {
    background: var(--s15-bg);
    color: var(--s15-text);
    font-size: 14px;
}
body.sidebar-collapsed { --sidebar-width: var(--s15-sidebar-collapsed); }

::selection { background: #e4e7ff; }
:focus-visible { outline: 3px solid rgba(67, 56, 202, .22); outline-offset: 2px; }

.skip-link {
    position: fixed;
    top: 10px;
    left: 12px;
    z-index: 1000;
    transform: translateY(-140%);
    padding: 9px 12px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

/* ---- Shell / sidebar --------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    padding: 14px 12px 12px;
    background: #fbfbfc;
    border-right: 1px solid var(--s15-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: visible;
    transition: width .2s ease, transform .2s ease;
}
.sidebar-main {
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    padding-bottom: 10px;
}
.sidebar-brand-row {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.brand.brand-advansis {
    min-width: 0;
    flex: 1;
    margin: 0;
    padding: 6px 8px;
    gap: 9px;
}
.brand-logo {
    display: block;
    width: 90px;
    max-height: 30px;
    object-fit: contain;
    object-position: left center;
}
.brand-mark-logo {
    display: none;
    width: 34px;
    height: 34px;
    object-fit: contain;
}
.brand-product strong {
    font-size: 13px;
    letter-spacing: .02em;
}
.brand-product small {
    margin-top: 2px;
    color: var(--s15-text-3);
    font-size: 9.5px;
    white-space: nowrap;
}
.sidebar-collapse {
    display: inline-grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--s15-text-3);
}
.sidebar-collapse:hover { background: #f0f1f3; color: var(--s15-text); }
.sidebar-collapse .ui-icon { transition: transform .2s ease; }

.ui-icon { width: 18px; height: 18px; display: block; }
.nav-group { margin-top: 16px; }
.nav-label {
    padding: 0 9px;
    margin: 0 0 7px;
    color: #9a9ea7;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
}
.nav { gap: 2px; }
.nav-link {
    position: relative;
    min-height: 38px;
    padding: 0 9px;
    border-radius: 8px;
    color: #5c6068;
    gap: 10px;
    font-size: 13px;
    font-weight: 560;
}
.nav-link:hover { background: #f2f3f5; color: #22252a; }
.nav-link.active {
    background: #eceef2;
    color: #18181b;
    font-weight: 650;
}
.nav-link.active::before {
    content: "";
    position: absolute;
    left: -12px;
    width: 3px;
    height: 20px;
    border-radius: 0 4px 4px 0;
    background: var(--s15-brand);
}
.nav-icon {
    display: grid;
    place-items: center;
    width: 19px;
    flex: 0 0 19px;
    color: #7b8089;
}
.nav-link.active .nav-icon { color: #393d45; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
    margin-left: auto;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff0ed;
    color: #b42318;
    font-size: 10px;
    font-weight: 800;
}
.nav-admin { margin-top: 16px; }
.nav-admin-summary {
    list-style: none;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 8px;
    cursor: pointer;
    user-select: none;
}
.nav-admin-summary::-webkit-details-marker { display: none; }
.nav-label-summary { margin: 0; }
.nav-admin-chevron { color: #a0a4ac; transition: transform .15s ease; }
.nav-admin-chevron .ui-icon { width: 13px; height: 13px; }
.nav-admin[open] .nav-admin-chevron { transform: rotate(90deg); }
.nav-admin .nav { margin-top: 4px; }

.account-menu { position: relative; margin-top: 10px; }
.account-summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
}
.account-summary::-webkit-details-marker { display: none; }
.account-summary:hover,
.account-menu[open] .account-summary { background: #f2f3f5; border-color: #e8e9ec; }
.account-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #25262b;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
}
.account-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-copy strong { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.account-copy small { margin-top: 2px; color: var(--s15-text-3); font-size: 10px; }
.account-caret { margin-left: auto; color: #9a9ea6; font-size: 15px; }
.account-popover {
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 56px;
    z-index: 40;
    padding: 8px;
    border: 1px solid var(--s15-border);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--s15-shadow-float);
}
.account-popover-email { padding: 7px 8px 10px; color: var(--s15-text-2); font-size: 10.5px; overflow-wrap: anywhere; }
.account-logout {
    width: 100%;
    min-height: 36px;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    color: #444850;
    font-weight: 650;
}
.account-logout:hover { background: #f4f4f5; }

body.sidebar-collapsed .brand-logo,
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .account-copy,
body.sidebar-collapsed .account-caret { display: none; }
body.sidebar-collapsed .brand-mark-logo { display: block; }
body.sidebar-collapsed .sidebar-brand-row { justify-content: center; flex-direction: column; height: 86px; gap: 2px; }
body.sidebar-collapsed .brand { flex: 0; padding: 0; }
body.sidebar-collapsed .sidebar-collapse { transform: rotate(180deg); }
body.sidebar-collapsed .nav-group { margin-top: 10px; }
body.sidebar-collapsed .nav-admin { margin-top: 10px; }
body.sidebar-collapsed .nav-admin-summary { display: none; }
body.sidebar-collapsed .nav-admin .nav { margin-top: 0; }
body.sidebar-collapsed .nav-link { justify-content: center; padding: 0; width: 46px; margin: 0 auto; }
body.sidebar-collapsed .nav-link.active::before { left: -13px; }
body.sidebar-collapsed .account-summary { justify-content: center; padding: 7px; }
body.sidebar-collapsed .account-popover { left: 58px; right: auto; bottom: 0; width: 210px; }

.main-content {
    margin-left: var(--sidebar-width);
    padding: 34px 40px 64px;
    transition: margin-left .2s ease;
}
.content-container { max-width: 1320px; }
.mobile-appbar, .sidebar-backdrop { display: none; }

/* ---- Page chrome ------------------------------------------------------- */
.page-header {
    align-items: center;
    margin-bottom: 24px;
}
.page-title {
    font-size: clamp(24px, 2.2vw, 29px);
    font-weight: 680;
    letter-spacing: -.035em;
}
.page-subtitle { margin-top: 5px; color: var(--s15-text-2); font-size: 13.5px; }
.page-actions, .header-actions { align-items: center; gap: 8px; }

.btn {
    min-height: 38px;
    padding: 0 13px;
    border-color: var(--s15-border-strong);
    border-radius: var(--s15-radius-sm);
    box-shadow: none;
    font-size: 13px;
    font-weight: 650;
}
.btn:hover { background: #f5f6f7; border-color: #cfd2d7; }
.btn-primary {
    border-color: #35304e;
    background: #27242e;
    color: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.btn-primary:hover { background: #16151b; border-color: #16151b; }
.btn-danger-soft { border-color: #f0c8c5; background: #fff8f7; color: #a62b22; }
.btn-danger-soft:hover { background: #fff0ee; }
.text-link, .subtle-link { color: #4b46a8; font-weight: 650; }
.text-link:hover, .subtle-link:hover { color: #312e81; text-decoration: none; }

.card { border-color: var(--s15-border); box-shadow: none; border-radius: var(--s15-radius); }
.table-card { overflow: hidden; }
.section-header { margin-top: 30px; margin-bottom: 12px; align-items: center; }
.section-title { font-size: 15px; font-weight: 700; }
.section-description, .section-subtitle { color: var(--s15-text-2); font-size: 12px; }

.alert { border-radius: 9px; box-shadow: none; }
.alert-success { border-color: #ccebd8; background: #f1fbf5; color: #176b45; }
.alert-error { border-color: #f2c9c4; background: #fff5f4; color: #9f241b; }
.alert-warning { border-color: #f1dfaa; background: #fffaf0; color: #805500; }

.form-control {
    min-height: 40px;
    border-color: #d9dce1;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}
.form-control:hover { border-color: #c9ccd2; }
.form-control:focus {
    border-color: #7773bd;
    box-shadow: 0 0 0 3px rgba(67,56,202,.10);
}
.form-label { color: #3e4249; font-size: 12px; font-weight: 680; }
.field-error { color: #b42318; }
.form-card { border-radius: 12px; }
.form-section { padding-top: 24px; padding-bottom: 24px; }
.form-section-title { font-size: 15px; }
.form-section-help { color: var(--s15-text-2); }

/* ---- Tables / filters -------------------------------------------------- */
.opportunity-filters,
.report-filter-card {
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}
.opportunity-filters { padding: 14px; gap: 10px; }
.filter-label { font-size: 10.5px; color: #858a94; letter-spacing: .02em; }
.list-meta { margin: 13px 2px 9px; color: #7d828a; font-size: 11.5px; }
.table { font-size: 12.5px; }
.table thead th {
    height: 42px;
    background: #fbfbfc;
    color: #8a8f98;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.table tbody td { height: 54px; border-color: #eeeeef; }
.table tbody tr:hover { background: #fafafb; }
.table-primary { font-weight: 680; color: #25272b; }
.table-secondary { color: #6f747d; }
.table-money { font-variant-numeric: tabular-nums; font-weight: 650; }
.row-closed { opacity: .63; }
.owner-pill {
    border: 0;
    background: #f2f3f5;
    color: #535861;
    font-size: 10.5px;
    font-weight: 650;
}
.followup-missing { background: #fff7df; color: #8a5b00; border-color: #f0deaa; }

.badge {
    border-width: 1px;
    border-style: solid;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0;
}

.view-switch, .segmented-control {
    padding: 3px;
    border: 1px solid var(--s15-border);
    border-radius: 8px;
    background: #f7f7f8;
}
.view-switch-link, .segmented-item { min-height: 30px; border-radius: 6px; }
.view-switch-link.active, .segmented-item.active { background: #fff; box-shadow: 0 1px 2px rgba(17,24,39,.06); }

/* ---- Dashboard -------------------------------------------------------- */
.dashboard-header { margin-bottom: 22px; }
.dashboard-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: #777c85;
    font-size: 11px;
    font-weight: 700;
}
.dashboard-title { font-size: clamp(26px, 3vw, 34px); font-weight: 680; letter-spacing: -.045em; }
.dashboard-subtitle { max-width: 650px; font-size: 13.5px; }
.attention-grid.dashboard-attention {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 18px;
}
.dashboard-attention .attention-card {
    min-height: 104px;
    padding: 16px 17px;
    position: relative;
    overflow: hidden;
    border-color: var(--s15-border);
    background: #fff;
}
.dashboard-attention .attention-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: #d5d7dc;
}
.dashboard-attention .attention-danger::before { background: #e65950; }
.dashboard-attention .attention-primary::before { background: #6d6bd1; }
.dashboard-attention .attention-warning::before { background: #e0aa25; }
.dashboard-attention .attention-alert::before { background: #f1ca20; }
.dashboard-attention .attention-card strong { font-size: 27px; letter-spacing: -.04em; }
.dashboard-attention .attention-card span { color: #4f545c; font-size: 12px; font-weight: 670; }
.dashboard-attention .attention-card small { color: #8a8f98; font-size: 10.5px; }
.dashboard-attention a.attention-card:hover { border-color: #d3d5da; transform: translateY(-1px); }

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .65fr);
    gap: 16px;
    align-items: start;
}
.dashboard-actions-panel { min-width: 0; }
.dashboard-actions-panel .table-card { margin: 0; }
.dashboard-side { display: flex; flex-direction: column; gap: 12px; }
.dashboard-summary-card { padding: 18px; }
.dashboard-summary-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dashboard-summary-head h2 { margin: 0; font-size: 14px; }
.dashboard-summary-head a { color: #6864b6; font-size: 11px; font-weight: 700; }
.dashboard-metric-list { display: flex; flex-direction: column; gap: 4px; }
.dashboard-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 0 2px;
    border-bottom: 1px solid #f0f0f1;
}
.dashboard-metric:last-child { border-bottom: 0; }
.dashboard-metric span { color: #666b73; font-size: 11.5px; }
.dashboard-metric strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.dashboard-tip {
    padding: 14px 15px;
    border: 1px solid #ebe5c3;
    border-radius: 10px;
    background: #fffdf5;
}
.dashboard-tip strong { display: block; margin-bottom: 4px; font-size: 11.5px; }
.dashboard-tip p { margin: 0; color: #6f6a51; font-size: 10.5px; line-height: 1.5; }

/* ---- Record pages ------------------------------------------------------ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: #8a8f98;
    font-size: 11px;
}
.breadcrumbs a { color: #676c75; font-weight: 650; }
.breadcrumbs a:hover { color: #272a30; }
.breadcrumb-separator { color: #b4b7bd; }
.opportunity-header, .client-header { margin-bottom: 14px; }
.opportunity-title-line { gap: 10px; }
.opportunity-title-line .page-title { font-size: clamp(22px, 2.4vw, 28px); }

.record-tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 0 0 18px;
    padding: 7px 0;
    background: rgba(246,247,249,.94);
    backdrop-filter: blur(8px);
    scrollbar-width: none;
}
.record-tabs::-webkit-scrollbar { display: none; }
.record-tabs a {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    border-radius: 7px;
    color: #70757e;
    font-size: 11.5px;
    font-weight: 680;
}
.record-tabs a:hover { background: #eceef1; color: #292c32; }
.record-tabs a.active { background: #fff; color: #24272c; box-shadow: inset 0 0 0 1px #dedfe3, 0 1px 2px rgba(0,0,0,.04); }
.record-anchor { scroll-margin-top: 64px; }

.opportunity-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr);
    gap: 14px;
    margin-bottom: 16px;
}
.next-action-hero { padding: 18px 20px; }
.next-action-hero-label {
    margin-bottom: 9px;
    color: #8a8f98;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.next-action-hero h2 { margin: 0; font-size: 17px; line-height: 1.35; letter-spacing: -.015em; }
.next-action-hero-meta { display: flex; align-items: center; gap: 9px; margin-top: 10px; color: #777c85; font-size: 11px; flex-wrap: wrap; }
.next-action-hero-empty { color: #777c85; font-size: 12px; }
.record-facts { padding: 15px 17px; display: grid; grid-template-columns: 1fr; gap: 9px; }
.record-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.record-fact span { color: #888d96; font-size: 10.5px; }
.record-fact strong { color: #34373d; font-size: 11.5px; text-align: right; }

.quick-actions-card {
    padding: 13px 15px;
    border-style: dashed;
    border-color: #dedfe3;
    background: #fbfbfc;
}
.quick-actions-copy strong { font-size: 11.5px; }
.quick-actions-copy span { font-size: 10.5px; }
.quick-actions-buttons .btn { min-height: 32px; font-size: 10.5px; }
.opportunity-intelligence-card { border-color: #e0def7; background: #fbfaff; }
.next-action-panel { background: linear-gradient(180deg, #fff 0%, #fdfdff 100%); }
.memory-section { margin-top: 30px; }
.memory-section-heading { margin-bottom: 11px; }
.memory-card, .commercial-activity-card, .document-panel { box-shadow: none; }
.commercial-activity-item, .timeline-item, .note-item { border-color: #ececef; }

.client-stats-grid { gap: 10px; margin-bottom: 16px; }
.client-stats-grid .stat-card { min-height: 94px; padding: 15px 17px; }
.client-stats-grid .stat-card span { color: #777c85; font-size: 10.5px; }
.client-stats-grid .stat-card strong { margin-top: 7px; font-size: 23px; }
.client-related-section { scroll-margin-top: 60px; }
.contact-card { border-radius: 9px; }
.contact-card:hover { background: #fafafb; }

/* ---- Pipeline ---------------------------------------------------------- */
.pipeline-board { gap: 10px; }
.pipeline-column { border-radius: 10px; border-color: var(--s15-border); background: #f8f8f9; }
.pipeline-column-header { padding: 13px 13px 9px; }
.pipeline-card { border-radius: 9px; border-color: #e2e3e6; box-shadow: none; }
.pipeline-card:hover { border-color: #ced0d5; box-shadow: 0 4px 14px rgba(24,24,27,.05); }
.pipeline-column-body { gap: 8px; }

/* ---- Alerts / activities / documents ---------------------------------- */
.alerts-summary { gap: 10px; }
.automation-notice-list { overflow: hidden; }
.automation-notice { padding: 15px 17px; }
.automation-notice-title { font-weight: 690; }
.activity-type-icon { box-shadow: none; }
.document-item { border-color: #ececef; }
.document-name { font-weight: 680; }

/* ---- Reports / intelligence / admin ----------------------------------- */
.report-kpis { gap: 10px; }
.report-kpi { border-radius: 10px; }
.report-panel { border-radius: 10px; }
.report-bar-track { background: #eef0f2; }
.report-bar-fill { opacity: .9; }
.intelligence-card, .integration-card, .automation-card { box-shadow: none; }

/* ---- Auth -------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    padding: 32px 20px;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 15%, rgba(255,210,26,.14), transparent 25%),
        radial-gradient(circle at 80% 85%, rgba(67,56,202,.08), transparent 28%),
        #f6f7f9;
}
.auth-card {
    width: min(100%, 420px);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 16px 50px rgba(17,24,39,.08);
}
.auth-brand { justify-content: flex-start; margin-bottom: 28px; }
.auth-brand .brand-logo { width: 104px; }
.auth-heading h1 { font-size: 25px; letter-spacing: -.035em; }
.auth-heading p { color: #777c85; }

/* ---- Empty / loading-like states -------------------------------------- */
.empty-state { padding: 48px 24px; }
.empty-state h3 { font-size: 15px; }
.empty-state p { max-width: 460px; color: #777c85; }

/* ---- Responsive -------------------------------------------------------- */
@media (max-width: 1180px) {
    .main-content { padding-left: 28px; padding-right: 28px; }
    .dashboard-main-grid { grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); }
    .attention-grid.dashboard-attention { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    body, body.sidebar-collapsed { --sidebar-width: 0px; }
    .sidebar {
        width: min(286px, calc(100vw - 54px));
        transform: translateX(-102%);
        z-index: 90;
        box-shadow: var(--s15-shadow-float);
    }
    body.sidebar-mobile-open { overflow: hidden; }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); }
    .sidebar-collapse { display: none; }
    body.sidebar-collapsed .brand-logo { display: block; }
    body.sidebar-collapsed .brand-mark-logo { display: none; }
    body.sidebar-collapsed .brand-text,
    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-text,
    body.sidebar-collapsed .nav-count,
    body.sidebar-collapsed .account-copy,
    body.sidebar-collapsed .account-caret { display: initial; }
    body.sidebar-collapsed .sidebar-brand-row { height: auto; justify-content: flex-start; flex-direction: row; }
    body.sidebar-collapsed .nav-admin-summary { display: flex; }
    body.sidebar-collapsed .nav-link { justify-content: flex-start; padding: 0 9px; width: auto; margin: 0; }
    body.sidebar-collapsed .account-summary { justify-content: flex-start; padding: 7px 8px; }
    body.sidebar-collapsed .account-popover { left: 2px; right: 2px; bottom: 56px; width: auto; }
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 80;
        background: rgba(17,24,39,.28);
        backdrop-filter: blur(1px);
    }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; }
    .mobile-appbar {
        position: sticky;
        top: 0;
        z-index: 50;
        height: 54px;
        padding: 0 13px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--s15-border);
        background: rgba(255,255,255,.94);
        backdrop-filter: blur(10px);
    }
    .mobile-menu-button, .mobile-create {
        display: grid;
        place-items: center;
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #383b41;
    }
    .mobile-menu-button:hover, .mobile-create:hover { background: #f2f3f5; }
    .mobile-create { font-size: 23px; line-height: 1; font-weight: 400; }
    .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 12px; }
    .mobile-brand img { width: 24px; height: 24px; object-fit: contain; }
    .main-content { margin-left: 0; padding: 24px 18px 54px; }
    .dashboard-main-grid { grid-template-columns: 1fr; }
    .dashboard-side { display: grid; grid-template-columns: 1fr 1fr; }
    .record-tabs { top: 54px; }
    .opportunity-overview { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .main-content { padding-left: 14px; padding-right: 14px; }
    .page-header { align-items: flex-start; gap: 14px; }
    .page-header:not(.opportunity-header):not(.client-header) { flex-direction: column; }
    .page-actions, .header-actions { width: 100%; flex-wrap: wrap; }
    .page-actions .btn-primary, .header-actions .btn-primary { margin-left: auto; }
    .attention-grid.dashboard-attention { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-attention .attention-card { min-height: 92px; padding: 14px; }
    .dashboard-attention .attention-card strong { font-size: 24px; }
    .dashboard-side { grid-template-columns: 1fr; }
    .quick-actions-card { align-items: flex-start; flex-direction: column; }
    .quick-actions-buttons { width: 100%; }
    .record-tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
    .report-kpis { gap: 8px; }
}

@media (max-width: 480px) {
    .page-title { font-size: 23px; }
    .dashboard-title { font-size: 28px; }
    .attention-grid.dashboard-attention { grid-template-columns: 1fr 1fr; gap: 8px; }
    .dashboard-attention .attention-card { min-height: 88px; }
    .dashboard-attention .attention-card span { font-size: 11px; }
    .btn { min-height: 38px; }
    .auth-card { padding: 24px 20px; }
}

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

@media (max-width: 900px) {
    body.sidebar-collapsed .brand-text { display: flex; }
    body.sidebar-collapsed .nav-label { display: block; }
    body.sidebar-collapsed .nav-text { display: inline; }
    body.sidebar-collapsed .nav-count { display: inline-flex; }
    body.sidebar-collapsed .account-copy { display: flex; }
    body.sidebar-collapsed .account-caret { display: inline; }
}
