:root {
    --brand-purple: #7F77DD;
    --brand-coral: #D85A30;
    --brand-amber: #BA7517;
    --brand-blue: #378ADD;
    --brand-navy: #26215C;
    --brand-indigo: #534AB7;
    --brand-lavender: #AFA9EC;
    --font-heading: "Sora", "Avenir Next", "Segoe UI", sans-serif;
    --font-interface: "Figtree", "Avenir Next", "Segoe UI", Arial, sans-serif;
    --plum: var(--brand-indigo);
    --plum-deep: var(--brand-navy);
    --lavender: var(--brand-purple);
    --lavender-light: #f0eefb;
    --ink: #28263a;
    --muted: #6d6982;
    --line: #dedbec;
    --surface: #ffffff;
    --background: #f8f7fc;
    --danger: #b43c4d;
    --danger-light: #fff0f2;
    --success: #2f6f54;
    --success-light: #ecf8f2;
    --warning: var(--brand-amber);
    --shadow: 0 18px 50px rgba(38, 33, 92, 0.12);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font-family: var(--font-interface); color: var(--ink); background: var(--background); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(circle at top left, rgba(168,138,181,.22), transparent 38%), linear-gradient(145deg,#fbf9fc 0%,#f2edf5 100%); }
.login-shell { width: min(100%,470px); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 38px; text-align: center; box-shadow: var(--shadow); }
.brand-logo { width: 154px; height: 154px; object-fit: contain; margin-bottom: 14px; }
.login-card h1 { margin: 0; font-family: var(--font-heading); font-size: clamp(1.8rem,5vw,2.35rem); color: var(--plum-deep); }
.subtitle { margin: 8px 0 28px; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
.google-button,.secondary-button,.primary-button,.danger-button,.ghost-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 9px 14px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 1px solid transparent; }
.google-button { width: 100%; min-height: 50px; color: #fff; background: var(--plum); border-color: var(--plum); }
.google-button:hover,.primary-button:hover { background: var(--plum-deep); }
.google-g { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--plum-deep); font-weight: 800; }
.primary-button { background: var(--plum); color: #fff; border-color: var(--plum); }
.secondary-button { background: #fff; color: var(--plum); border-color: var(--plum); }
.secondary-button:hover { background: var(--lavender-light); }
.danger-button { background: var(--danger); color: #fff; border-color: var(--danger); }
.ghost-button { background: transparent; color: var(--muted); border-color: var(--line); }
.help-text,.authorized-use,.muted-text,.helper-text { color: var(--muted); }
.help-text { margin: 20px 0 0; font-size: .93rem; line-height: 1.55; }
.authorized-use { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: .8rem; }

.topbar { min-height: 76px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 24px; position: sticky; top: 0; z-index: 900; }
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.topbar-brand > div { display: flex; flex-direction: column; gap: 2px; }
.topbar-brand span { font-size: .8rem; color: var(--muted); }
.topbar-logo { width: 48px; height: 48px; object-fit: contain; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-user-area { position: relative; }
.notification-menu { position: relative; }
.notification-menu > summary { list-style: none; cursor: pointer; }
.notification-menu > summary::-webkit-details-marker { display: none; }
.notification-summary { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--plum); }
.notification-summary:hover,.notification-menu[open] > .notification-summary { background: var(--lavender-light); }
.notification-bell-icon { width: 21px; height: 21px; }
.notification-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; border: 2px solid #fff; font-size: .7rem; font-weight: 900; line-height: 1; }
.notification-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(92vw,420px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 14px; z-index: 61; }
.notification-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 2px 12px; border-bottom: 1px solid var(--line); }
.notification-panel-heading > div { display: grid; gap: 3px; }
.notification-panel-heading strong { color: var(--plum-deep); }
.notification-panel-heading span { color: var(--muted); font-size: .8rem; }
.notification-total { min-width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: var(--plum); color: #fff !important; font-size: .78rem !important; font-weight: 900; }
.notification-list { display: grid; gap: 7px; padding-top: 10px; }
.notification-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 10px; border-radius: 10px; text-decoration: none; border: 1px solid transparent; }
.notification-item:hover { background: var(--lavender-light); border-color: var(--line); }
.notification-item-copy { min-width: 0; display: grid; gap: 3px; }
.notification-item-copy strong { color: var(--plum-deep); font-size: .9rem; }
.notification-item-copy span { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.notification-item-count { flex: 0 0 auto; min-width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0 7px; border-radius: 999px; background: var(--lavender-light); color: var(--plum-deep); font-size: .78rem; font-weight: 900; }
.notification-empty { display: grid; gap: 5px; padding: 20px 10px 10px; text-align: center; }
.notification-empty strong { color: var(--plum-deep); }
.notification-empty span { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 12px; padding: 6px 10px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] > summary { background: var(--lavender-light); }
.user-name-block { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.user-name-block > span { font-size: .78rem; color: var(--muted); }
.auth-badge { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 4px; color: var(--success) !important; font-weight: 800; font-size: .72rem !important; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(92vw,360px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; z-index: 60; }
.auth-detail-box { padding: 12px; border-radius: 10px; background: var(--success-light); border: 1px solid #cce6d8; }
.auth-detail-box p,.menu-section p { margin: 6px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.menu-section { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.menu-link { display: block; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--plum); font-weight: 700; text-decoration: none; }
.preview-banner { position: sticky; top: 76px; z-index: 35; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 9px 16px; background: #fff4d6; border-bottom: 1px solid #e6c66f; color: #674910; font-size: .9rem; }
.preview-banner form { display: inline; }
.preview-banner button { border: 0; background: none; text-decoration: underline; font-weight: 800; color: inherit; }

.app-shell {
    min-height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: 240px minmax(0,1fr);
    align-items: start;
}
.sidebar {
    position: sticky;
    top: 76px;
    align-self: start;
    display: flex;
    flex-direction: column;
    width: 240px;
    height: calc(100vh - 76px);
    min-height: calc(100vh - 76px);
    overflow: hidden;
    background: var(--plum-deep);
    color: #fff;
    padding: 14px 14px 12px;
    z-index: 24;
}
.preview-banner + .app-shell .sidebar {
    top: 112px;
    height: calc(100vh - 112px);
    min-height: calc(100vh - 112px);
}
.sidebar-main-nav {
    flex: 0 1 auto;
    min-height: 0;
}
.sidebar-footer {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 4px;
    padding-bottom: 4px;
}
.nav-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-decoration: none; padding: 10px 14px; margin-bottom: 3px; border-radius: 9px; font-weight: 600; font-size: .93rem; }
.nav-item:hover,.nav-item.active { background: rgba(255,255,255,.13); }
.nav-badge { min-width: 25px; text-align: center; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: .75rem; }
.nav-divider { height: 1px; flex: 0 0 1px; background: rgba(255,255,255,.18); margin: 11px 8px; }
.nav-system-divider { margin-top: 0; margin-bottom: 8px; }
.nav-system-status {
    justify-content: flex-start;
    margin-bottom: 0;
    padding-top: 8px;
    padding-bottom: 8px;
}
.nav-system-status-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}
.nav-system-status-copy strong {
    color: #fff;
    font-size: .9rem;
    line-height: 1.2;
}
.nav-system-status-copy small {
    color: rgba(255,255,255,.72);
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.2;
}
.nav-system-status.active .nav-system-status-copy small,
.nav-system-status:hover .nav-system-status-copy small {
    color: rgba(255,255,255,.92);
}
.content { min-width: 0; padding: 32px; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.split-heading { align-items: flex-start; }
.page-heading h1,.panel h2,.dashboard-card h2 { margin: 6px 0; color: var(--plum-deep); font-family: var(--font-heading); }
.page-heading h1 { font-size: clamp(1.8rem,3vw,2.45rem); }
.page-heading p,.panel p { color: var(--muted); }
.eyebrow,.card-label { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; color: var(--lavender); }
.heading-actions,.inline-actions,.form-actions,.modal-actions,.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.flash { margin-bottom: 18px; border-radius: 10px; padding: 12px 14px; font-weight: 650; }
.flash-success { background: var(--success-light); color: var(--success); border: 1px solid #cce6d8; }
.flash-error { background: var(--danger-light); color: var(--danger); border: 1px solid #f0c7cf; }

.segmented-control { display: inline-flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.segmented-control a { text-decoration: none; padding: 8px 13px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.segmented-control a.active { background: var(--plum); color: #fff; }
.overdue-login-alert { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 22px; padding: 16px 18px; border-radius: 14px; border: 1px solid #e6aab4; background: var(--danger-light); }
.overdue-login-alert > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.overdue-login-alert span { color: #6d3b44; font-size: .9rem; }

.dashboard-summary-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.compact-summary { grid-template-columns: repeat(4,minmax(0,1fr)); }
.summary-card-link { display: flex; flex-direction: column; text-decoration: none; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 6px 22px rgba(64,35,78,.05); }
.summary-card-link span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.summary-card-link strong { color: var(--plum-deep); font-size: 2rem; margin-top: 5px; }
.overdue-card { border-color: #e6aab4; background: #fffafb; }
.overdue-card strong { color: var(--danger); }
.dashboard-two-column,.two-column-panels,.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.detail-grid { grid-template-columns: minmax(0,2fr) minmax(280px,.75fr); }
.dashboard-card,.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 7px 28px rgba(64,35,78,.06); }
.panel { margin-bottom: 20px; }
.panel-heading-row,.card-heading-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.panel-heading-row h2,.card-heading-row h2 { margin: 4px 0; }
.quick-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.quick-action { padding: 13px; border-radius: 10px; background: var(--lavender-light); color: var(--plum-deep); text-decoration: none; font-weight: 750; }
.muted-action { color: var(--muted); background: #f4f2f5; }

.task-form,.report-builder-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.report-builder-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span,.checkbox-field span { font-size: .86rem; font-weight: 750; color: var(--ink); }
.field input,.field select,.field textarea,.advanced-filter-row input,.advanced-filter-row select,.approval-actions input,.stack-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); padding: 10px 11px; min-height: 42px; }
.field textarea { resize: vertical; }
.field-span-2 { grid-column: span 2; }
.checkbox-field { display: flex; align-items: center; gap: 8px; }
.checkbox-field input { width: auto; }
.stack-form { display: flex; flex-direction: column; gap: 12px; }
.client-picker-row { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 8px; }

.quick-filter-row { display: flex; gap: 7px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.quick-filter { text-decoration: none; padding: 8px 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: .82rem; font-weight: 750; }
.quick-filter.active { background: var(--plum); color: #fff; border-color: var(--plum); }
.quick-filter.overdue-filter:not(.active) { color: var(--danger); border-color: #e7b2bb; }
.advanced-filter-row { display: grid; grid-template-columns: 160px minmax(180px,1fr) 150px 160px 180px auto; gap: 9px; margin: 16px 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.task-table,.report-table { width: 100%; border-collapse: collapse; }
.task-table th,.task-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; font-size: .84rem; }
.task-table th { background: #f5f1f6; color: var(--plum-deep); position: sticky; top: 0; z-index: 1; }
.task-table th a { text-decoration: none; }
.task-table td:first-child { min-width: 230px; white-space: normal; }
.task-title-link { color: var(--plum-deep); font-weight: 800; text-decoration: none; }
.row-overdue { background: #fff8f9; }
.overdue-label { display: inline-block; margin-left: 7px; padding: 2px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.priority-chip,.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: #f2eef4; }
.priority-urgent { color: var(--danger); background: var(--danger-light); }
.priority-high { color: #8a4c12; background: #fff3df; }
.priority-normal { color: var(--plum); background: var(--lavender-light); }
.priority-low { color: var(--muted); background: #f1f1f1; }
.empty-table,.empty-state { text-align: center !important; padding: 28px !important; color: var(--muted); }

.detail-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.detail-list > div { padding: 12px; background: #faf8fb; border: 1px solid var(--line); border-radius: 10px; }
.detail-list dt { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.detail-list dd { margin: 5px 0 0; font-weight: 650; }
.description-box { margin-top: 16px; padding: 14px; border-radius: 10px; background: #faf8fb; border: 1px solid var(--line); }
.description-box p { margin-bottom: 0; white-space: normal; }
.completion-box { background: var(--success-light); border-color: #cce6d8; }
.text-danger { color: var(--danger); }
.text-link,.text-danger-link { border: 0; background: transparent; text-decoration: underline; color: var(--plum); padding: 0; font-weight: 700; }
.text-danger-link { color: var(--danger); }
.timeline-list,.attachment-list,.activity-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.timeline-item,.attachment-row,.activity-row { border-top: 1px solid var(--line); padding-top: 11px; }
.timeline-meta { color: var(--muted); font-size: .76rem; font-weight: 700; }
.timeline-item p { color: var(--ink); }
.attachment-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.attachment-row > div { display: flex; flex-direction: column; gap: 3px; }
.attachment-row small { color: var(--muted); }
.activity-row { display: grid; grid-template-columns: minmax(180px,1fr) 180px minmax(140px,1fr); gap: 12px; font-size: .82rem; }
.activity-row span { color: var(--muted); }
.danger-zone { border-color: #e4b0ba; background: #fffafb; }

.approval-card { padding: 16px 0; border-bottom: 1px solid var(--line); }
.approval-card:last-child { border-bottom: 0; }
.approval-change-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 12px 0; }
.approval-change-grid > div { padding: 10px; border-radius: 8px; background: #f8f6f9; display: flex; flex-direction: column; gap: 3px; }
.approval-change-grid strong { font-size: .76rem; text-transform: uppercase; color: var(--muted); }
.approval-change-grid span { overflow-wrap: anywhere; }
.approval-actions { display: grid; grid-template-columns: minmax(200px,1fr) auto auto; gap: 8px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(31,20,36,.52); display: grid; place-items: center; padding: 20px; z-index: 100; }
.modal-card { width: min(100%,500px); background: #fff; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; }
.modal-card h2 { color: var(--plum-deep); margin-top: 0; font-family: var(--font-heading); }
.client-search-modal { width: min(100%,620px); }
.client-search-modal > input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.client-search-results { max-height: 330px; overflow: auto; margin-top: 12px; }
.client-result-button { width: 100%; text-align: left; padding: 11px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); }
.client-result-button:hover { background: var(--lavender-light); }

/* Printer-friendly generated task report */
.report-page { background: #ececec; padding: 20px; }
.report-toolbar { width: min(100%,11in); margin: 0 auto 14px; display: flex; gap: 10px; justify-content: flex-end; }
.report-document { width: min(100%,11in); margin: auto; }
.report-sheet { min-height: 8.5in; background: #fff; margin: 0 auto 18px; padding: .45in .45in .38in; display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,.10); page-break-after: always; }
.report-sheet:last-child { page-break-after: auto; }
.report-header { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; padding-bottom: 12px; border-bottom: 2px solid var(--plum); }
.report-header img { width: 70px; height: 70px; object-fit: contain; }
.report-header h1 { margin: 0; color: var(--plum-deep); font-family: var(--font-heading); font-size: 22px; }
.report-header p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.report-table { margin-top: 14px; font-size: 9px; }
.report-table th,.report-table td { padding: 6px 5px; border: 1px solid #d8d2da; text-align: left; vertical-align: top; }
.report-table th { background: #f2edf4; color: var(--plum-deep); }
.report-overdue { background: #fff4f5; }
.report-overdue-text { color: var(--danger); font-size: 8px; font-weight: 900; }
.report-note-row td { font-size: 8px; background: #fafafa; }
.report-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid #cfc8d2; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; font-size: 8px; color: #666; }
.report-footer span:nth-child(2) { text-align: center; }
.report-footer span:nth-child(3) { text-align: right; }

@media (max-width: 1150px) {
    .dashboard-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .advanced-filter-row { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .report-builder-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}


/* Pre-Calendar Build 5 — keep the desktop sidebar fully visible.
   The page content scrolls; the sidebar itself does not. */
@media (min-width: 821px) and (max-height: 800px) {
    .sidebar { padding-top: 10px; padding-bottom: 8px; }
    .nav-item { padding: 8px 12px; margin-bottom: 2px; font-size: .9rem; }
    .nav-divider { margin-top: 7px; margin-bottom: 7px; }
    .nav-system-status { padding-top: 6px; padding-bottom: 6px; }
    .nav-system-status-copy strong { font-size: .86rem; }
    .nav-system-status-copy small { font-size: .69rem; }
}

@media (min-width: 821px) and (max-height: 690px) {
    .sidebar { padding-top: 7px; padding-bottom: 6px; }
    .nav-item { padding: 6px 11px; margin-bottom: 1px; font-size: .86rem; }
    .nav-divider { margin-top: 5px; margin-bottom: 5px; }
    .sidebar-footer { padding-top: 0; padding-bottom: 0; }
    .nav-system-divider { margin-bottom: 4px; }
    .nav-system-status { padding-top: 4px; padding-bottom: 4px; }
}

@media (max-width: 820px) {
    .topbar { padding: 10px 14px; }
    .topbar-brand span { display: none; }
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 76px;
        z-index: 25;
        display: flex;
        flex-direction: row;
        gap: 6px;
        width: 100%;
        height: auto;
        min-height: 0;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 10px;
    }
    .preview-banner + .app-shell .sidebar { top: 112px; height: auto; min-height: 0; }
    .sidebar-main-nav,
    .sidebar-footer { display: contents; }
    .nav-item { white-space: nowrap; margin: 0; flex: 0 0 auto; }
    .nav-divider { display: none; }
    .nav-system-divider { margin-top: 0; }
    .nav-system-status-copy { display: flex; align-items: baseline; gap: 6px; }
    .nav-system-status-copy small { font-size: .7rem; }
    .content { padding: 20px 14px; }
    .dashboard-summary-grid,.compact-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-two-column,.two-column-panels,.detail-grid { grid-template-columns: 1fr; }
    .task-form,.report-builder-form { grid-template-columns: 1fr; }
    .field-span-2 { grid-column: span 1; }
    .advanced-filter-row { grid-template-columns: 1fr 1fr; }
    .approval-change-grid { grid-template-columns: 1fr 1fr; }
    .approval-actions { grid-template-columns: 1fr; }
    .page-heading { flex-direction: column; }
    .heading-actions { width: 100%; }
    .heading-actions > * { flex: 1; }
    .overdue-login-alert { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .login-card { padding: 28px 20px; }
    .user-name-block strong { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .dashboard-summary-grid,.compact-summary { grid-template-columns: 1fr 1fr; }
    .quick-action-grid,.detail-list,.advanced-filter-row,.approval-change-grid { grid-template-columns: 1fr; }
    .client-picker-row { grid-template-columns: 1fr; }
    .activity-row { grid-template-columns: 1fr; gap: 3px; }
    .attachment-row { align-items: flex-start; }
}

@media print {
    .no-print { display: none !important; }
    .report-page { padding: 0; background: #fff; }
    .report-document { width: 100%; }
    .report-sheet { width: 100%; min-height: 0; margin: 0; padding: .35in; box-shadow: none; }
    @page { size: landscape; margin: 0; }
}
.report-group-row td { background: #e8e0ec !important; color: var(--plum-deep); font-weight: 800; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }

/* ================================================================
   Dashboard visual correction — restores the approved Phase 2 feel
   while preserving Phase 3 task data, alerts, approvals, and role view.
   ================================================================ */
.dashboard-classic-page .content {
    padding: 32px;
}

.dashboard-classic-heading {
    align-items: flex-start;
    margin-bottom: 24px;
}

.dashboard-view-switch {
    align-self: flex-start;
}

.dashboard-classic-alert {
    margin-bottom: 18px;
}

.dashboard-classic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-classic-summary-card {
    display: block;
    min-height: 162px;
    text-decoration: none;
    padding: 22px;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.dashboard-classic-summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 30px rgba(64,35,78,.09);
    border-color: #cbbfd0;
}

.dashboard-classic-summary-card .big-number {
    display: block;
    margin: 8px 0;
    color: var(--plum-deep);
    font-size: 2.2rem !important;
}

.dashboard-classic-summary-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
    font-size: .9rem;
}

.dashboard-classic-overdue {
    border-color: #e6aab4;
    background: #fffafb;
}

.dashboard-classic-overdue .card-label,
.dashboard-classic-overdue .big-number {
    color: var(--danger);
}

.dashboard-classic-approval {
    grid-column: span 1;
}

.dashboard-classic-lower-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-classic-feature-card {
    min-height: 178px;
}

.dashboard-classic-feature-card h2 {
    margin: 6px 0;
}

.dashboard-classic-feature-card > p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.dashboard-classic-actions {
    margin-top: 14px;
}

@media (min-width: 1181px) {
    .dashboard-classic-grid > :nth-child(5) {
        grid-column: 1 / 2;
    }
}

@media (max-width: 1180px) {
    .dashboard-classic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .dashboard-classic-page .content {
        padding: 20px 14px;
    }

    .dashboard-classic-heading {
        flex-direction: column;
    }

    .dashboard-classic-grid,
    .dashboard-classic-lower-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-classic-summary-card {
        min-height: 0;
    }
}

@media (max-width: 640px) {
    .topbar-actions { gap: 6px; }
    .notification-summary { width: 40px; height: 40px; }
    .notification-panel { right: -4px; }
}

/* Phase 9C — informational notifications */
.notification-panel { max-height: min(78vh, 680px); overflow-y: auto; }
.notification-section { display: grid; gap: 8px; padding-top: 12px; }
.notification-section + .notification-section { margin-top: 10px; border-top: 1px solid var(--line); }
.notification-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 2px; }
.notification-section-heading > div { display: grid; gap: 2px; min-width: 0; }
.notification-section-heading strong { color: var(--plum-deep); font-size: .86rem; }
.notification-section-heading span { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.notification-section-count { flex: 0 0 auto; min-width: 25px; height: 25px; display: inline-grid; place-items: center; padding: 0 6px; border-radius: 999px; background: var(--lavender-light); color: var(--plum-deep) !important; font-weight: 900; }
.notification-section-empty { padding: 10px; color: var(--muted); font-size: .8rem; line-height: 1.45; border-radius: 9px; background: #faf9fb; }
.notification-information-list { display: grid; gap: 7px; }
.notification-info-item { border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; }
.notification-info-item.is-unread { border-color: rgba(91, 48, 101, .28); background: var(--lavender-light); }
.notification-info-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px; color: inherit; text-decoration: none; }
a.notification-info-main:hover { background: rgba(255,255,255,.62); }
.notification-info-copy { min-width: 0; display: grid; gap: 3px; }
.notification-info-copy strong { color: var(--plum-deep); font-size: .86rem; }
.notification-info-copy span { color: var(--text); font-size: .77rem; line-height: 1.4; }
.notification-info-copy small { color: var(--muted); font-size: .69rem; }
.notification-unread-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 5px; border-radius: 999px; background: var(--plum); }
.notification-info-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 0 8px 8px; }
.notification-info-actions button,.notification-clear-read { border: 0; background: transparent; color: var(--plum); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer; padding: 5px 7px; border-radius: 7px; }
.notification-info-actions button:hover,.notification-clear-read:hover { background: rgba(91,48,101,.09); }
.notification-clear-read { flex: 0 0 auto; white-space: nowrap; }

/* Pre-Build 6 — portal-wide CRITICAL system conditions */
.portal-critical-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 20px;
    border-bottom: 1px solid #b84d5b;
    background: #fff1f3;
    color: #6f1f2a;
}
.portal-critical-banner > div { min-width: 0; display: grid; gap: 2px; }
.portal-critical-banner strong { font-size: .88rem; letter-spacing: .01em; }
.portal-critical-banner span { font-size: .78rem; line-height: 1.35; }
.portal-critical-banner a {
    flex: 0 0 auto;
    color: #6f1f2a;
    font-size: .78rem;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.notification-critical-section {
    margin: 12px -2px 0;
    padding: 11px 10px 10px;
    border: 1px solid #efc0c7;
    border-radius: 11px;
    background: #fff7f8;
}
.notification-critical-section .notification-section-heading strong { color: #8b2634; }
.notification-section-count-critical,
.notification-critical-section .notification-section-count {
    background: #8b2634;
    color: #fff !important;
}
.notification-critical-list { display: grid; gap: 8px; }
.notification-critical-item {
    overflow: hidden;
    border: 1px solid #e6a8b1;
    border-radius: 10px;
    background: #fff;
}
.notification-critical-item.is-unacknowledged { box-shadow: inset 3px 0 0 #a63243; }
.notification-critical-item.is-acknowledged { opacity: .82; }
.notification-critical-main {
    display: block;
    padding: 10px;
    color: inherit;
    text-decoration: none;
}
.notification-critical-main:hover { background: #fff5f6; }
.notification-critical-copy { display: grid; gap: 3px; }
.notification-critical-copy strong { color: #7b2431; font-size: .86rem; }
.notification-critical-copy span { color: var(--text); font-size: .77rem; line-height: 1.4; }
.notification-critical-copy small { color: var(--muted); font-size: .69rem; }
.notification-critical-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    padding: 0 9px 9px;
}
.notification-critical-actions button,
.notification-critical-actions a,
.notification-critical-actions span {
    font: inherit;
    font-size: .71rem;
    font-weight: 850;
}
.notification-critical-actions button {
    border: 0;
    border-radius: 7px;
    background: #8b2634;
    color: #fff;
    cursor: pointer;
    padding: 6px 8px;
}
.notification-critical-actions button:hover { background: #6f1f2a; }
.notification-critical-actions a { color: #7b2431; text-decoration: none; }
.notification-critical-actions span { color: var(--muted); }

@media (max-width: 640px) {
    .portal-critical-banner { align-items: flex-start; flex-direction: column; padding: 10px 14px; gap: 7px; }
}

/* Build 12X — portal-wide incoming call screen-pop */
.incoming-call-popup {
    position: fixed;
    top: 86px;
    right: 24px;
    z-index: 1400;
    width: min(410px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid #ddd5e1;
    border-radius: 18px;
    background: #fff;
    color: #28242c;
    box-shadow: 0 18px 55px rgba(64,35,78,.20);
}
.incoming-call-popup-top { display:flex; align-items:center; gap:9px; margin-bottom:10px; }
.incoming-call-signal { width:10px; height:10px; border-radius:50%; background:#2f6f54; box-shadow:0 0 0 0 rgba(47,111,84,.34); animation:psn-incoming-call-pulse 1.5s infinite; }
.incoming-call-eyebrow { font-size:12px; font-weight:800; letter-spacing:.09em; color:#6f6874; }
.incoming-call-dismiss { margin-left:auto; border:0; background:transparent; color:#6f6874; font-size:26px; line-height:1; cursor:pointer; padding:0 2px; }
.incoming-call-dismiss:hover { color:#40234e; }
.incoming-call-name { margin:0; color:#40234e; font-size:25px; line-height:1.15; }
.incoming-call-phone { margin-top:5px; font-size:17px; font-weight:700; }
.incoming-call-route { margin-top:8px; color:#6f6874; font-size:13px; }
.incoming-call-purpose { margin-top:12px; padding:10px 12px; border:1px solid #e7deeb; border-radius:10px; background:#f8f5fa; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.incoming-call-purpose span { color:#6f6874; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.incoming-call-purpose strong { color:#40234e; font-size:15px; }
.incoming-call-case-box { margin-top:16px; padding:13px 14px; border:1px solid #eee8f1; border-radius:12px; background:#f7f4f8; display:grid; gap:3px; }
.incoming-call-case-label { color:#6f6874; font-size:10px; font-weight:800; letter-spacing:.10em; }
.incoming-call-case-box strong { font-size:15px; }
.incoming-call-case-box small { color:#6f6874; }
.incoming-call-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:16px; }
.incoming-call-action { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:8px 13px; border:1px solid #5b356b; border-radius:9px; color:#5b356b; background:#fff; font-weight:800; text-decoration:none; }
.incoming-call-action:hover { background:#eee8f1; }
.incoming-call-action-primary { color:#fff; background:#5b356b; }
.incoming-call-action-primary:hover { color:#fff; background:#40234e; }
.incoming-call-case-links { display:grid; gap:7px; margin-top:10px; }
.incoming-call-case-links .incoming-call-action { justify-content:flex-start; width:100%; }
@keyframes psn-incoming-call-pulse { 0% { box-shadow:0 0 0 0 rgba(47,111,84,.34); } 70% { box-shadow:0 0 0 9px rgba(47,111,84,0); } 100% { box-shadow:0 0 0 0 rgba(47,111,84,0); } }
@media (max-width: 680px) {
    .incoming-call-popup { top:auto; right:12px; bottom:12px; left:12px; width:auto; }
    .incoming-call-name { font-size:22px; }
}
@media (prefers-reduced-motion: reduce) { .incoming-call-signal { animation:none; } }


/* XANSETORI brand foundation */
.login-shell { display: grid; gap: 18px; }
.login-powered-by { margin: 0 auto; display: grid; justify-items: center; gap: 7px; }
.login-powered-by > span { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-powered-by img { display: block; width: min(250px, 72vw); height: auto; }
.topbar-brand-copy { min-width: 0; display: flex !important; flex-direction: column !important; align-items: flex-start !important; justify-content: center; gap: 3px !important; }
.topbar-powered-by { display: flex !important; align-items: center; justify-content: flex-start; gap: 5px; color: var(--muted); font-size: .69rem !important; line-height: 1; white-space: nowrap; }
.topbar-powered-label { color: var(--muted); }
.topbar-platform-symbol { display: block; width: 18px; height: 18px; object-fit: contain; flex: 0 0 18px; }
.topbar-platform-name { font-family: var(--font-heading); color: var(--brand-navy); font-size: .74rem; font-weight: 700; letter-spacing: .05em; line-height: 1; }
.sidebar-powered-by { margin: 8px 10px 2px; padding: 10px 10px 4px; border-top: 1px solid rgba(255,255,255,.12); color: rgba(255,255,255,.72); font-size: .68rem; font-weight: 600; letter-spacing: .01em; }
@media (max-width: 820px) {
    .topbar-powered-by { display: flex !important; }
    .topbar-powered-by .topbar-powered-label { display: inline !important; }
    .topbar-platform-name { display: inline !important; }
}
@media (max-width: 520px) {
    .topbar-powered-label { display: none !important; }
    .topbar-platform-symbol { width: 16px; height: 16px; flex-basis: 16px; }
    .topbar-platform-name { font-size: .68rem; }
}


/* Build 12ZV — readability normalization during portal stabilization.
   Keep emphasis meaningful instead of allowing bold labels to flow into controls. */
body.app-page { font-weight: 400; }
body.app-page .nav-item { font-weight: 500; }
body.app-page .nav-system-status-copy strong { font-weight: 500; }
body.app-page .nav-system-status-copy small { font-weight: 400; color: rgba(255,255,255,.82); }
body.app-page label { font-weight: 500 !important; }
body.app-page input:not([type="submit"]):not([type="button"]):not([type="reset"]),
body.app-page select,
body.app-page textarea,
body.app-page option {
    font-weight: 400 !important;
}
body.app-page .field > span,
body.app-page .checkbox-field span { font-weight: 600; }


/* Build 12ZY — Global Notifications footer spacing. */
.notification-panel-footer {
    display:flex;
    align-items:center;
    gap:18px;
    flex-wrap:wrap;
    margin-top:12px;
    padding:12px 2px 2px;
    border-top:1px solid var(--line);
}
.notification-panel-footer a {
    display:inline-flex;
    align-items:center;
    min-height:32px;
    color:var(--plum);
    font-size:.82rem;
    font-weight:600;
    text-decoration:none;
}
.notification-panel-footer a:hover { text-decoration:underline; }

/* Build 12ZZ — shared portal soft-view overlay */
.psn-soft-view-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    padding: 18px;
    background: rgba(28,20,38,.48);
    backdrop-filter: blur(2px);
}
.psn-soft-view {
    width: min(1180px,96vw);
    height: calc(100vh - 36px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(35,22,41,.30);
}
.psn-soft-view-head {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.psn-soft-view-title {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    color: var(--plum-deep);
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.psn-soft-view-actions { display: flex; align-items: center; gap: 8px; }
.psn-soft-view-newtab,
.psn-soft-view-close {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--plum);
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}
.psn-soft-view-newtab { padding: 8px 12px; }
.psn-soft-view-close { width: 40px; padding: 0; font-size: 24px; line-height: 1; }
.psn-soft-view-newtab:hover,
.psn-soft-view-close:hover { background: var(--lavender-light); }
.psn-soft-view-frame { width: 100%; height: 100%; flex: 1; border: 0; background: var(--background); }
body.psn-soft-view-open { overflow: hidden; }
body.embedded-record-page { min-height: 100vh; background: var(--background); }
body.embedded-record-page .embedded-content { width: 100%; min-height: 100vh; padding: 24px; }

/* Administration now lives in the account menu. */
.administration-menu-section .menu-link { margin-top: 0; padding-top: 0; border-top: 0; }
.menu-link-icon { display: flex; align-items: center; gap: 9px; }
.menu-link-icon-svg { width: 19px; height: 19px; flex: 0 0 19px; }

/* Keep incoming-call actions above surrounding portal UI and reliably clickable. */
.incoming-call-popup { pointer-events: auto; isolation: isolate; }
.incoming-call-action { position: relative; z-index: 1; cursor: pointer; pointer-events: auto; font: inherit; }

@media (max-width: 720px) {
    .psn-soft-view-backdrop { padding: 0; }
    .psn-soft-view { width: 100vw; height: 100vh; border-radius: 0; }
    .psn-soft-view-newtab span:first-child { display: none; }
    body.embedded-record-page .embedded-content { padding: 16px 12px; }
}
.incoming-call-case-primary { font-size: 18px; font-weight: 800; line-height: 1.2; color: #28242c; }
.incoming-call-assigned { margin-top: 4px; color: var(--muted); font-size: 13px; }
.incoming-call-contact-line { margin-top: 7px; color: #28242c; font-size: 14px; }

/* Build 12ZZ-HF3 — XANSETORI branded icon system + portal search */
.psn-icon-sprite { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
.psn-icon { width:1.2em; height:1.2em; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; display:block; flex:0 0 auto; }
.psn-icon-tile { --icon-tone:var(--brand-purple); display:inline-grid; place-items:center; flex:0 0 auto; border-radius:12px; background:var(--icon-tone); color:#fff; box-shadow:0 7px 18px color-mix(in srgb,var(--icon-tone) 20%, transparent); }
.psn-icon-tile .psn-icon, .psn-icon-tile .psn-icon use { color:#fff !important; stroke:#fff !important; fill:none !important; stroke-width:2.45; }
.psn-icon-tile .psn-icon { width:1.3em; height:1.3em; }
.psn-icon-tile.size-sm { width:34px; height:34px; border-radius:10px; font-size:16px; }
.psn-icon-tile.size-md { width:46px; height:46px; font-size:22px; }
.psn-icon-tile.size-lg { width:54px; height:54px; border-radius:14px; font-size:25px; }
.tone-purple { --icon-tone:var(--brand-purple); }
.tone-coral { --icon-tone:var(--brand-coral); }
.tone-amber { --icon-tone:var(--brand-amber); }
.tone-blue { --icon-tone:var(--brand-blue); }
.tone-navy { --icon-tone:var(--brand-navy); }
.tone-indigo { --icon-tone:var(--brand-indigo); }
.tone-lavender { --icon-tone:var(--brand-lavender); }
.tone-success { --icon-tone:#2fb67c; }

.topbar { display:grid; grid-template-columns:minmax(220px,1fr) minmax(320px,680px) minmax(220px,1fr); }
.topbar-brand { justify-self:start; min-width:0; }
.topbar-actions { justify-self:end; }
.global-search-shell { position:relative; width:100%; min-width:0; justify-self:center; z-index:1000; }
.global-search-field { height:46px; display:flex; align-items:center; gap:10px; padding:0 12px; border:1px solid var(--line); border-radius:14px; background:#fff; box-shadow:0 4px 18px rgba(38,33,92,.05); transition:border-color .16s ease,box-shadow .16s ease; }
.global-search-shell:focus-within .global-search-field { border-color:var(--brand-purple); box-shadow:0 0 0 3px rgba(127,119,221,.12),0 8px 26px rgba(38,33,92,.08); }
.global-search-icon { width:20px; height:20px; color:var(--brand-indigo); flex:0 0 auto; }
.global-search-field input { width:100%; min-width:0; border:0; outline:0; background:transparent; color:var(--ink); font-size:.94rem; }
.global-search-field input::placeholder { color:#9290a5; }
.global-search-shortcut { flex:0 0 auto; border:1px solid var(--line); border-bottom-width:2px; background:#faf9fd; color:var(--muted); border-radius:7px; padding:3px 7px; font-family:var(--font-interface); font-size:.68rem; white-space:nowrap; }
.global-search-panel { position:absolute; top:calc(100% + 8px); left:0; right:0; max-height:min(70vh,640px); overflow:auto; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 60px rgba(38,33,92,.2); padding:10px; z-index:1100; }
.global-search-state { padding:24px 16px; color:var(--muted); text-align:center; font-size:.9rem; }
.global-search-groups { display:grid; gap:7px; }
.global-search-group + .global-search-group { border-top:1px solid var(--line); padding-top:7px; }
.global-search-group-heading { display:flex; align-items:center; gap:8px; padding:7px 9px 5px; color:var(--brand-navy); }
.global-search-group-heading .global-search-result-icon { width:26px; height:26px; border-radius:8px; font-size:13px; }
.global-search-group-heading strong { font-family:var(--font-heading); font-size:.78rem; letter-spacing:.02em; }
.global-search-result-list { display:grid; gap:3px; }
.global-search-result { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; text-align:left; padding:9px 10px; border:0; border-radius:11px; background:transparent; color:var(--ink); }
.global-search-result:hover,.global-search-result:focus-visible { background:#f5f3ff; outline:0; }
.global-search-result-icon { --icon-tone:var(--brand-purple); display:grid; place-items:center; width:34px; height:34px; border-radius:10px; background:color-mix(in srgb,var(--icon-tone) 14%, white); color:var(--icon-tone); font-size:17px; }
.global-search-result-copy { min-width:0; display:grid; gap:2px; }
.global-search-result-copy strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--brand-navy); font-size:.88rem; }
.global-search-result-copy > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.75rem; }
.global-search-result mark { padding:0; background:#fff0b8; color:inherit; }
.global-search-result-arrow { color:var(--brand-indigo); font-size:1.35rem; line-height:1; }
.global-search-help { position:sticky; bottom:-10px; margin:8px -10px -10px; padding:9px 14px; border-top:1px solid var(--line); background:rgba(255,255,255,.97); color:var(--muted); font-size:.72rem; text-align:center; }
.global-search-help strong { color:var(--brand-indigo); }

.nav-item-main { min-width:0; display:flex; align-items:center; gap:11px; }
.nav-item-main > span:last-child { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-icon { --icon-tone:var(--brand-purple); width:30px; height:30px; display:grid; place-items:center; flex:0 0 30px; border-radius:9px; background:var(--icon-tone); color:#fff; font-size:18px; border:1px solid rgba(255,255,255,.16); box-shadow:0 5px 13px color-mix(in srgb,var(--icon-tone) 28%, transparent); transition:transform .14s ease,filter .14s ease,box-shadow .14s ease; }
.nav-icon .psn-icon,.nav-icon .psn-icon use { color:#fff !important; stroke:#fff !important; fill:none !important; stroke-width:2.35; }
.nav-icon .psn-icon { width:1.18em; height:1.18em; }
.nav-item:hover .nav-icon,.nav-item.active .nav-icon { filter:saturate(1.08) brightness(1.08); box-shadow:0 7px 16px color-mix(in srgb,var(--icon-tone) 36%, transparent); }
.nav-item:hover .nav-icon { transform:translateY(-1px); }

.page-heading-title-row { display:flex; align-items:flex-start; gap:14px; min-width:0; }
.page-heading-title-row > div { min-width:0; }
.page-heading-title-row .psn-icon-tile { margin-top:2px; }
.section-title-with-icon { display:flex; align-items:center; gap:11px; }
.visual-stat-card { position:relative; overflow:hidden; }
.visual-stat-card .stat-icon-row { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.visual-stat-card .stat-icon-row .card-label,.visual-stat-card .stat-icon-row > span:not(.psn-icon-tile) { margin:0; }
.summary-card-link.visual-stat-card { padding-top:14px; }
.quick-action.visual-action { display:flex; align-items:center; gap:9px; }
.quick-action.visual-action .psn-icon-tile { width:30px; height:30px; border-radius:8px; font-size:15px; }

@media (max-width:1180px) {
    .topbar { grid-template-columns:minmax(190px,.8fr) minmax(280px,1.4fr) minmax(190px,.8fr); gap:12px; padding-left:16px; padding-right:16px; }
    .global-search-shortcut { display:none; }
}
@media (max-width:900px) {
    .topbar { grid-template-columns:auto minmax(180px,1fr) auto; }
    .topbar-brand-copy > strong { display:none; }
    .topbar-powered-by { display:none !important; }
}
@media (max-width:680px) {
    .topbar { grid-template-columns:auto minmax(0,1fr) auto; gap:8px; }
    .topbar-logo { width:40px; height:40px; }
    .global-search-field { height:42px; padding:0 10px; }
    .global-search-field input { font-size:.84rem; }
    .global-search-field input::placeholder { color:transparent; }
    .global-search-panel { position:fixed; top:64px; left:8px; right:8px; max-height:72vh; }
    .user-name-block > strong,.user-name-block > span { display:none; }
    .page-heading-title-row .psn-icon-tile { display:none; }
}
.record-title-with-icon{display:flex;align-items:flex-start;gap:10px;min-width:0}
.record-title-copy{display:grid;gap:2px;min-width:0}
.record-title-copy .document-name-link{min-width:0}
.section-title-with-icon>div{min-width:0}

/* Build 12ZZ-HF5 — visual dashboard metrics and insight cards. */
.dashboard-visual-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:0 0 18px}
.dashboard-metric-card{display:block;min-height:154px;padding:18px;border:1px solid var(--line);border-radius:16px;background:#fff;text-decoration:none;color:inherit;box-shadow:0 8px 26px rgba(38,33,92,.045);transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease}
.dashboard-metric-card:hover{transform:translateY(-2px);border-color:var(--brand-lavender);box-shadow:0 14px 34px rgba(38,33,92,.09)}
.dashboard-metric-card .card-label{font-family:var(--font-heading);font-weight:800;color:var(--muted);font-size:.82rem;line-height:1.25}
.dashboard-metric-value-row{display:flex;align-items:flex-end;gap:12px;margin-top:18px}
.dashboard-metric-card .big-number{font-family:var(--font-heading);font-size:2.05rem;line-height:1;color:var(--brand-navy)}
.metric-trend{display:inline-flex;align-items:center;gap:3px;font-size:.8rem;font-weight:850;white-space:nowrap}
.metric-trend.trend-good{color:#219a68}.metric-trend.trend-bad{color:#d84f45}.metric-trend.trend-neutral{color:var(--muted)}
.metric-period{display:block;margin-top:5px;color:var(--muted);font-size:.72rem}
.dashboard-insight-grid{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1fr) minmax(0,1.12fr);gap:16px;margin:0 0 18px}
.dashboard-insight-card{min-height:300px;padding:20px;border:1px solid var(--line);border-radius:17px;background:#fff;box-shadow:0 8px 26px rgba(38,33,92,.04)}
.dashboard-insight-card .card-heading-row{align-items:flex-start;margin-bottom:16px}
.dashboard-insight-card .card-heading-row h2{margin:3px 0 0;color:var(--brand-navy);font-size:1.45rem}
.dashboard-insight-card .card-heading-row h2 small{font-family:var(--font-interface);font-size:.8rem;font-weight:700;color:var(--muted)}
.dashboard-insight-card .card-heading-row>a{font-size:.82rem;font-weight:800;color:var(--brand-indigo);text-decoration:none}
.task-completion-layout{display:grid;grid-template-columns:minmax(140px,.9fr) minmax(150px,1.1fr);align-items:center;gap:20px;min-height:210px}
.task-donut{--completion:0;width:min(170px,100%);aspect-ratio:1;margin:auto;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--brand-purple) calc(var(--completion)*1%),#ddd9fb 0);position:relative}
.task-donut::after{content:"";position:absolute;inset:26%;border-radius:50%;background:#fff;box-shadow:inset 0 0 0 1px rgba(38,33,92,.04)}
.task-donut span{position:relative;z-index:1;font-family:var(--font-heading);font-size:2rem;font-weight:850;color:var(--brand-navy)}
.task-completion-copy>strong{display:block;margin-bottom:12px;color:var(--brand-navy);font-size:.9rem}
.task-completion-copy dl{margin:0;display:grid;gap:0}
.task-completion-copy dl>div{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:8px 0;border-bottom:1px solid var(--line)}
.task-completion-copy dl>div:last-child{border-bottom:0}.task-completion-copy dt{display:flex;align-items:center;gap:8px;color:var(--muted)}.task-completion-copy dd{margin:0;font-weight:850;color:var(--brand-navy)}
.task-completion-copy .total dt,.task-completion-copy .total dd{color:var(--brand-navy);font-weight:850}.legend-dot{width:12px;height:12px;border-radius:50%;background:var(--brand-purple)}.legend-dot.remaining{background:#cbc6f4}
.caseload-bars{display:grid;gap:15px;margin-top:6px}.caseload-row{display:grid;grid-template-columns:minmax(115px,1fr) minmax(90px,1.5fr) 26px;align-items:center;gap:12px;font-size:.84rem}.caseload-row>span{color:var(--brand-navy);font-weight:700}.caseload-row>strong{text-align:right;color:var(--brand-navy)}.caseload-track{height:13px;border-radius:999px;background:#eef0f7;overflow:hidden}.caseload-track i{display:block;height:100%;border-radius:inherit;background:var(--brand-purple)}.caseload-row.tone-index-1 .caseload-track i{background:var(--brand-coral)}.caseload-row.tone-index-2 .caseload-track i{background:var(--brand-amber)}.caseload-row.tone-index-3 .caseload-track i{background:var(--brand-blue)}
.recent-activity-list{display:grid}.recent-activity-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;padding:10px 0;border-bottom:1px solid var(--line);text-decoration:none;color:inherit}.recent-activity-item:last-child{border-bottom:0}.recent-activity-item:hover .recent-activity-copy strong{color:var(--brand-indigo)}.recent-activity-copy{display:grid;gap:2px;min-width:0}.recent-activity-copy strong,.recent-activity-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.recent-activity-copy strong{font-size:.84rem;color:var(--brand-navy)}.recent-activity-copy small{font-size:.75rem;color:var(--muted)}.recent-activity-item time{font-size:.72rem;color:var(--muted);white-space:nowrap}.dashboard-empty-copy{color:var(--muted);font-size:.88rem;line-height:1.5}
@media(max-width:1280px){.dashboard-visual-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-insight-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.recent-activity-card{grid-column:1/-1}}
@media(max-width:820px){.dashboard-visual-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-insight-grid{grid-template-columns:1fr}.recent-activity-card{grid-column:auto}.task-completion-layout{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.dashboard-visual-summary-grid{grid-template-columns:1fr}.dashboard-metric-card{min-height:130px}.task-completion-layout{grid-template-columns:1fr}.task-donut{max-width:150px}.caseload-row{grid-template-columns:1fr 1.1fr 24px}}


/* Build 12ZZ-HF6 — stronger sidebar icon contrast. */
.sidebar .nav-icon { isolation:isolate; }
.sidebar .nav-item.active .nav-icon { outline:2px solid rgba(255,255,255,.18); outline-offset:1px; }

/* 12ZZ-HF9 - Dashboard employee self-service Time & PTO */
.dashboard-time-pto-card{display:grid;grid-template-columns:minmax(230px,1.05fr) minmax(320px,1.4fr) auto;gap:20px;align-items:center;margin:0 0 20px;padding:18px 20px;background:#fff;border:1px solid #dedaf0;border-radius:18px;box-shadow:0 12px 34px rgba(38,33,92,.06)}
.dashboard-time-status-block{display:flex;align-items:center;gap:14px}.dashboard-time-status-block>div:last-child{display:flex;flex-direction:column;gap:3px}.time-status{font-size:1.1rem;letter-spacing:.04em}.time-status.clocked-in{color:#16875d}.time-status.clocked-out{color:#625d76}.time-status.salary{color:#534AB7}.dashboard-time-hours{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.dashboard-time-hours span{padding:10px 12px;border:1px solid #e6e2f1;border-radius:12px;background:#faf9fd;display:flex;flex-direction:column;gap:3px}.dashboard-time-hours small{color:#716b86}.dashboard-time-hours strong{color:#26215c}.dashboard-time-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}.dashboard-time-actions form{margin:0}.count-badge{display:inline-flex;min-width:20px;height:20px;align-items:center;justify-content:center;border-radius:999px;background:#eeeafb;color:#26215c;margin-left:4px}.dashboard-hr-modal{width:min(1000px,calc(100vw - 28px));max-height:90vh;border:0;border-radius:22px;padding:0;box-shadow:0 30px 90px rgba(38,33,92,.28)}.dashboard-hr-modal::backdrop{background:rgba(38,33,55,.35);backdrop-filter:blur(2px)}.dashboard-hr-modal .soft-record-shell{background:#fff;max-height:90vh;overflow:auto}.dashboard-hr-modal header{position:sticky;top:0;z-index:3;display:flex;justify-content:space-between;align-items:center;padding:18px 22px;border-bottom:1px solid #e3dff0;background:rgba(255,255,255,.97)}.dashboard-hr-modal header h2{margin:2px 0 0}.dashboard-hr-panel{padding:22px}.timecard-summary-inline{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:16px}.timecard-summary-inline span{padding:10px 14px;border-radius:12px;background:#f6f4fc}.dashboard-timecard-approval{display:flex;gap:18px;flex-wrap:wrap;margin:16px 0;padding:12px 14px;background:#f7f5fc;border-radius:12px}.dashboard-correction-form{margin-top:20px;border-top:1px solid #e5e1ef;padding-top:14px}.dashboard-supervisor-list{display:grid;gap:12px}.dashboard-supervisor-card{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,.8fr) auto;gap:12px;align-items:center;border:1px solid #e1ddef;border-radius:14px;padding:14px}.dashboard-supervisor-card>div{display:flex;flex-direction:column}.dashboard-supervisor-card small{color:#716b86}.hrp-status-pill{display:inline-flex;border-radius:999px;padding:5px 9px;font-weight:800;font-size:.78rem;background:#eeeafb;color:#534ab7}.hrp-status-pill.status-paid{background:#e8f7ef;color:#176d4c}.hrp-status-pill.status-failed,.hrp-status-pill.status-reversed{background:#fdebea;color:#aa2b2b}.hrp-status-pill.status-submitted_to_gusto{background:#eaf4fd;color:#226b9b}.hrp-gusto-confirm-box form{margin-top:12px}
@media(max-width:1050px){.dashboard-time-pto-card{grid-template-columns:1fr}.dashboard-time-actions{justify-content:flex-start}}@media(max-width:700px){.dashboard-time-hours{grid-template-columns:1fr}.dashboard-supervisor-card{grid-template-columns:1fr}}

/* Build 12ZZ-HF17 — Dashboard Time & PTO Rebuild Stage 4 */
.dashboard-time-hours{grid-template-columns:repeat(4,minmax(0,1fr))}
.dashboard-hr-alert-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin:0 0 20px}
.dashboard-hr-alert{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 16px;border:1px solid #e1ddef;border-radius:16px;background:#fff;box-shadow:0 8px 26px rgba(38,33,92,.045)}
.dashboard-hr-alert>div{display:flex;flex-direction:column;gap:2px;min-width:0}.dashboard-hr-alert strong{color:#26215c}.dashboard-hr-alert span{color:#716b86;font-size:.9rem}
.dashboard-hr-alert.tone-coral{border-left:4px solid #D85A30}.dashboard-hr-alert.tone-amber{border-left:4px solid #BA7517}.dashboard-hr-alert.tone-blue{border-left:4px solid #378ADD}.dashboard-hr-alert.tone-purple{border-left:4px solid #7F77DD}
.dashboard-holiday-strip{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:0 0 14px;padding:12px 14px;border:1px solid #dedaf0;border-radius:13px;background:#f7f5fc}.dashboard-holiday-strip strong{color:#26215c}.dashboard-holiday-strip span{display:inline-flex;padding:5px 9px;border-radius:999px;background:#fff;color:#534AB7;font-weight:700;font-size:.82rem;border:1px solid #e2def2}
.hrp-table tr.is-paid-holiday td{background:#fbf8ea}.hrp-table tr.is-paid-holiday td:first-child{box-shadow:inset 3px 0 0 #BA7517}
@media(max-width:1180px){.dashboard-time-hours{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.dashboard-time-hours{grid-template-columns:1fr}.dashboard-hr-alert{grid-template-columns:auto 1fr}.dashboard-hr-alert .ghost-button{grid-column:1/-1;justify-self:start}}

/* Build 17.1 — production page-header cleanup and reusable collapsible panels. */
.page-heading h1 + p { display: none; }

[data-collapsible-panel] [data-collapsible-summary] {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.psn-collapse-toggle {
    appearance: none;
    border: 1px solid var(--border, #ddd7e3);
    border-radius: 999px;
    background: var(--panel, #fff);
    color: var(--plum-deep, #2f2440);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 6px 11px;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
}
.psn-collapse-toggle:hover,
.psn-collapse-toggle:focus-visible {
    border-color: var(--plum, #5d416d);
    outline: none;
}
.psn-collapse-toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(93, 65, 109, .16);
}
.psn-collapse-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    font-size: 1rem;
}
[data-collapsible-content][hidden] { display: none !important; }
[data-collapsible-panel].is-collapsed { padding-bottom: 12px; }
@media (max-width: 640px) {
    [data-collapsible-panel] [data-collapsible-summary] { gap: 10px; }
    .psn-collapse-toggle-label { display: none; }
    .psn-collapse-toggle { padding-inline: 9px; }
}
