/* Workspace refresh. Loaded after the functional component styles. */
:root {
  color-scheme: light;
  --brand: #202124;
  --brand-dark: #101114;
  --brand-light: #414349;
  --brand-tint: #F4F4F5;
  --card: #FFFFFF;
  --line-strong: #C8C9CD;
  --subtle: #6D6F76;
  --bg: #FFFFFF;
  --text: #202124;
  --muted: #63666D;
  --line: #E7E8EB;
  --radius: 14px;
  --shadow: 0 2px 4px #20212403, 0 6px 20px #20212403;
}

/* White navigation, dark type and restrained selection states. */
@media screen {
  .sidebar { background: #FFFFFF; border-right-color: var(--line); color: var(--text); }
  .brand { padding: 24px 22px 20px; border-bottom-color: #E7E8EB; }
  .brand img { padding: 0; background: #fff; border-radius: 0; }
  .brand-caption { color: #63666D; margin-top: 15px; }
  .nav-group { color: #72757C; letter-spacing: .13em; padding-top: 23px; }
  .nav-item { color: #45474D; font-weight: 400; border: 1px solid transparent; }
  .nav-item:hover { background: #F7F7F8; color: var(--text); }
  .nav-item.active { background: #F1F1F2; color: #18191C; border-color: #E8E8EB; box-shadow: inset 3px 0 0 #202124; font-weight: 700; }
  .nav-item.active .nav-icon { color: #202124; }
  .sidebar-foot { border-top-color: #E7E8EB; padding: 16px 22px; }
  .sidebar-foot .btn { color: #45474D; border-color: #DADCE0; background: transparent; }
  .sidebar-foot .btn:hover { background: #F7F7F8; }
  .partner-label { color: #72757C; font-size: 10px; }
  .partner-label::before { background: #202124; }
  .sidebar .drawer-close { color: #202124; }
  .drawer-user { border-color: #DADCE0; }
  .drawer-user strong { color: #202124; }
  .drawer-user span:not(.avatar) { color: #63666D; }
}
.topbar { background: #FFFFFFF5; min-height: 76px; }
.topbar h1 { font-weight: 400; color: var(--muted); }
.topbar .bell { background: var(--bg); border: 1px solid var(--line); border-radius: 50%; }
.avatar { border-radius: 12px; background: #F3F3F4; }
.avatar { border-color: var(--line); }
.brand img, .login-logo, .topbar-mark, .story-mark { filter: grayscale(1) contrast(1.2); }
.story-mark { width: 30px; height: 30px; object-fit: contain; flex: none; }
main#main { gap: 24px; padding-top: 32px; }
.page-head h2 { letter-spacing: -.035em; }
.card { box-shadow: var(--shadow); }
.card-head h3 { font-size: 17px; }
.card-head > a { font-weight: 700; }
.btn { border-radius: 8px; }
.btn-primary { background: #202124; border-color: #202124; box-shadow: 0 2px 3px #20212410; }
.btn-primary:hover { background: #101114; border-color: #101114; }
.btn-primary:hover { box-shadow: 0 4px 12px #20212418; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline-color: #62656D; }
.input:focus { border-color: #62656D; outline-color: #20212426; }
.input::placeholder { color: #73767D; }
.form label, .wf-label { color: #45474D; }
.tile.sel { box-shadow: 0 0 0 3px #20212412; }
.stepper li.now span { box-shadow: 0 0 0 4px #20212412; }
.hero-cta { background: #202124; }
.hero-cta small { color: #E3E4E7; }
.bn-fab-btn { box-shadow: 0 5px 15px #20212426; }
.selling .bn-fab-btn { box-shadow: none; }
.quick-links a:hover, .ct-row:hover, .ct-row:focus-visible { background: #FAFAFB; }
.col-chart { background-image: repeating-linear-gradient(to top, transparent 0, transparent 44px, #E7E8EB80 45px, transparent 46px); }
.push-prompt { background: #FFFFFF; border-color: var(--line); }
.input { border-color: #C5C7CC; }
.filter-bar { background: #FFFFFF; border-color: var(--line); border-radius: 12px; }
.data-table th { background: #F7F7F8; color: #63666D; font-size: 10px; }
.data-table tbody tr:hover td { background-color: #FAFAFB; }
.data-table td { border-bottom-color: #ECEDEF; }
.data-table .num { font-variant-numeric: tabular-nums; }
.pill { padding: 3px 9px; }
.progress { height: 6px; background: #EEEFF1; }
.bar-track { background: #F2F3F4; border-radius: 5px; }
.bar-fill, .col-bar { background: #4A4D55; }
.tabs { gap: 4px; }
.tab.active { color: var(--brand); font-weight: 700; }
.health-row { padding: 13px 4px; }
.health-row strong { font-variant-numeric: tabular-nums; }
.health-dot { width: 7px; height: 7px; }
.setup-list li { background: #FFFFFF; border-radius: 10px; }

/* A quiet overview with one primary action, followed by scannable metrics. */
.dashboard-head { padding: 30px; box-shadow: 0 3px 16px #20212404; background: #FFFFFF; border-color: #E7E8EB; border-radius: 16px; }
.dashboard-head::after { display: none; }
.dashboard-head h2 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.12; }
.dashboard-head .eyebrow { color: #63666D; font-size: 10px; }
.dashboard-head p { color: #63666D; max-width: 520px; }
.dashboard-head .actions { gap: 10px; }
.dashboard-head .btn:not(.btn-primary) { background: #FFFFFFB3; }
.kpi { border: 1px solid var(--line); border-top: 1px solid var(--line); padding: 22px; gap: 12px; }
.kpi-value { font-size: 34px; letter-spacing: -.04em; }
.kpi-label { color: #63666D; font-size: 11px; letter-spacing: .045em; }
.kpi-sub { font-size: 12px; }
.kpi-sub a { text-decoration: underline; text-underline-offset: 3px; }
.table-wrap:focus-visible, .col-chart:focus-visible { outline: 2px solid #62656D; outline-offset: 3px; }
.kpi-ok { border-bottom: 3px solid var(--ok); }
.kpi-warn { border-bottom: 3px solid #C28A3D; }
.kpi-bad { border-bottom: 3px solid var(--bad); }
.kpi-accent { border-bottom: 3px solid var(--brand); background: #FAFAFB; }
.kpi-icon { width: 36px; height: 36px; background: #F4F4F5; border-radius: 10px; }
.admin-kpis .kpi-sub { margin-top: auto; }
.admin-kpis .kpi-heading .kpi-label { font-size: 13px; }
.admin-kpis .kpi-warn .kpi-icon { color: #8C611F; background: #FCF3E2; }
.quick-links a { border-radius: 10px; box-shadow: 0 2px 5px #20212402; }
.quick-links a:hover { border-color: #9B9EA5; box-shadow: 0 4px 12px #20212406; }

/* Sign-in: editorial brand panel with a compact, familiar form. */
.login-page { background: #FFFFFF; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.login-story { padding: clamp(36px, 5vw, 80px); gap: 32px; background: #FFFFFF; color: var(--text); border-right: 1px solid var(--line); }
.login-story::before { display: none; }
.login-story::after { display: none; }
.story-label { display: flex; align-items: center; gap: 10px; font-size: 12px; color: #252629; letter-spacing: .13em; }
.story-label > .ui-icon { width: 24px; height: 24px; color: #252629; }
.story-edition { font-size: 8px; letter-spacing: .12em; color: #63666D; margin-left: auto; padding: 5px 8px; border: 1px solid #DADCE0; border-radius: 4px; }
.story-copy { margin-top: 20px; }
.story-eyebrow { color: #63666D; font-size: 12px; }
.story-copy h1 { font-size: clamp(34px, 3.9vw, 60px); line-height: 1.08; letter-spacing: -.045em; }
.story-copy h1 span { color: #64676E; }
.story-copy p { max-width: 390px; font-size: 16px; color: #63666D; line-height: 1.6; margin-top: 22px; }
.story-workflow { padding: 20px 24px; border: 1px solid #E7E8EB; background: #FFFFFF; border-radius: 14px; max-width: 460px; }
.story-workflow-head { display: flex; align-items: center; justify-content: space-between; color: #63666D; font-size: 9px; font-weight: 700; letter-spacing: .14em; padding-bottom: 12px; }
.story-workflow-head .ui-icon { width: 17px; height: 17px; }
.story-step { display: flex; align-items: center; gap: 14px; padding: 15px 0; }
.story-step + .story-step { border-top: 1px solid #ECEDEF; }
.story-step-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; background: #F7F7F8; border: 1px solid #E7E8EB; border-radius: 10px; color: #64676E; }
.story-step-icon .ui-icon { width: 19px; height: 19px; }
.story-step strong, .story-step small { display: block; }
.story-step strong { font-size: 14px; font-weight: 700; color: #202124; }
.story-step small { margin-top: 3px; font-size: 12px; color: #63666D; }
.story-step-number { margin-left: auto; color: #72757C; font-size: 10px; font-variant-numeric: tabular-nums; }
.story-features { margin-top: 0; padding-top: 20px; gap: 12px; }
.story-features { border-top-color: var(--line); }
.story-features span { font-size: 11px; color: var(--muted); }
.story-footer { color: #63666D; }
.login-main { padding: 40px clamp(24px, 4vw, 64px); }
.login-card { padding: 14px 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; max-width: 380px; gap: 30px; }
.login-logo { max-width: 230px; margin-bottom: 10px; }
.login-card h2 { font-size: 40px; }
.login-card .input { border-color: #9A9DA4; border-radius: 8px; }
.login-card .input:hover { border-color: #62656D; }
.login-card .input[readonly] { background: #F7F7F8; }
.login-card .btn-primary:disabled { background: #5D6067; border-color: #5D6067; }
.login-card .btn-primary { border-radius: 8px; }
.login-help { font-size: 12px; }
.login-help strong { font-size: 13px; }
.login-foot { text-align: left; max-width: 380px; font-size: 11px; margin-top: 28px; }

@media (min-width: 1101px) {
  .admin-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .login-story { padding: 32px; }
  .story-edition { display: none; }
  .story-workflow { padding: 16px; }
  .story-step { gap: 10px; }
  .story-step-number { display: none; }
}
@media (max-width: 820px) {
  .topbar { min-height: 64px; }
  main#main { padding-top: 22px; gap: 18px; }
  .dashboard-head { padding: 24px 20px; }
  .dashboard-head h2 { font-size: 29px; }
  .kpi { padding: 16px; gap: 9px; }
  .kpi-value { font-size: 28px; }
  .admin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-story { padding: max(24px, env(safe-area-inset-top, 0px)) 24px 28px; gap: 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .story-copy { margin-top: 0; }
  .story-copy h1 { font-size: 32px; max-width: 540px; }
  .story-copy h1 br { display: block; }
  .story-workflow { display: none; }
  .story-label { font-size: 10px; }
  .story-edition { font-size: 7px; }
  .login-main { padding: 30px max(24px, env(safe-area-inset-right, 0px)) calc(24px + var(--safe-b)) max(24px, env(safe-area-inset-left, 0px)); }
  .login-card { padding: 0; gap: 24px; }
  .login-logo { max-width: 200px; margin: 0; }
  .login-card h2 { font-size: 32px; }
  .login-foot { margin-top: 24px; }
}
@media (max-width: 420px) {
  .story-copy h1 { font-size: 28px; }
  .story-edition { display: none; }
  .login-story { gap: 18px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 26px; }
  .admin-kpis .kpi-heading .kpi-label { min-height: 36px; }
  .dashboard-head .actions .btn { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Agent workspace: daily tasks first; longer reports are available on demand. */
.agent-welcome .agent-place { display: flex; align-items: center; gap: 7px; font-size: 15px; }
.agent-place .ui-icon { width: 17px; height: 17px; flex: none; }
.agent-welcome .agent-team { font-size: 12px; margin-top: 4px; }
.agent-day-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 18px; }
.agent-day-stats > div { display: flex; flex-direction: column; gap: 2px; }
.agent-day-stats > div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.agent-day-stats strong { font-size: 32px; color: var(--brand); line-height: 1.2; font-variant-numeric: tabular-nums; }
.agent-day-stats span { font-size: 12px; color: var(--muted); }
.agent-today > p { margin-top: 10px; }
.agent-today .card-head { margin-bottom: 8px; }
.agent-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.agent-tools a { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 14px 16px; border: 1px solid var(--line); background: white; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px; }
.agent-tools a:hover { border-color: #9B9EA5; background: #FAFAFB; }
.role-agent .ct-dash-link { text-decoration: none; }
.role-agent .ct-dash-link:hover { border-color: #9B9EA5; background: #FAFAFB; }
.agent-tools .ui-icon { width: 20px; height: 20px; color: var(--brand); }
.agent-tools .ui-icon:last-child { width: 14px; margin-left: auto; color: var(--muted); }
.agent-month-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.agent-month-stats > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.agent-month-stats > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.agent-month-stats span, .agent-month-stats small { color: var(--muted); font-size: 12px; font-weight: 400; }
.agent-month-stats strong { font-size: 26px; line-height: 1.2; color: var(--brand); overflow-wrap: anywhere; }
.agent-month > p { margin-top: 16px; }
.agent-breakdown { border: 1px solid var(--line); border-radius: 14px; background: #FFFFFF; }
.agent-breakdown > summary, .agent-filters > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px; list-style: none; cursor: pointer; font-weight: 700; font-size: 14px; }
.agent-breakdown > summary::-webkit-details-marker, .agent-filters > summary::-webkit-details-marker { display: none; }
.agent-breakdown > summary > span { display: flex; align-items: center; gap: 10px; }
.agent-breakdown > summary .ui-icon, .agent-filters > summary .ui-icon { width: 18px; height: 18px; color: var(--brand); }
.agent-breakdown[open] > summary > .ui-icon, .agent-filters[open] > summary > .ui-icon { transform: rotate(180deg); }
.agent-breakdown-body { display: flex; flex-direction: column; gap: 16px; padding: 0 16px 16px; }
.agent-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 12px; text-align: center; }
.agent-empty > .ui-icon { width: 28px; height: 28px; color: var(--brand); margin-bottom: 6px; }
.agent-empty p { color: var(--muted); font-size: 13px; }
.sale-cards { display: flex; flex-direction: column; gap: 10px; }
.sale-preview { display: flex; flex-direction: column; gap: 9px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.sale-preview:hover { background: #FAFAFB; border-color: #9B9EA5; text-decoration: none; }
.sale-preview-top, .sale-preview-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sale-preview-top { align-items: flex-start; }
.sale-preview-top > strong { min-width: 0; font-size: 15px; }
.sale-preview-top .pill { flex: none; }
.sale-preview-plan { font-size: 13px; line-height: 1.45; color: #63666D; }
.sale-preview-meta { font-size: 11px; color: var(--muted); }
.sale-preview-meta .ui-icon { width: 16px; height: 16px; flex: none; }
.sale-preview-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.mobile-sale-cards { display: none; }
.agent-filters { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.agent-filters .filter-bar { border: 0; margin: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.agent-filter-count { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.agent-sale-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agent-sale-summary .summary-cell { min-width: 0; }
.wiz-step-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.wiz-step-caption strong { color: var(--brand); font-size: 14px; }
.stepper li { color: var(--muted); }
.stepper button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: transparent; color: inherit; font: inherit; width: 100%; min-height: 48px; cursor: pointer; border-radius: 6px; }
.stepper button:hover { background: var(--brand-tint); }
.stepper button em { max-width: 100%; }
.wiz-errors:focus { outline: 2px solid var(--bad); outline-offset: 3px; }
.hero-go .ui-icon { width: 22px; height: 22px; }
.geo-ico > .ui-icon { width: 23px; height: 23px; }

@media (max-width: 820px) {
  .role-agent main#main { gap: 14px; }
  .role-agent main[data-view="dashboard"] { max-width: 620px; }
  .role-agent .agent-welcome { padding: 22px 20px; }
  .role-agent .agent-welcome h2 { font-size: 29px; }
  .role-agent .hero-cta { background: #202124; border-radius: 14px; padding: 18px 16px; box-shadow: 0 4px 10px #20212412; }
  .role-agent .hero-cta strong { font-size: 18px; }
  .role-agent .hero-ico { width: 42px; height: 42px; border-radius: 12px; }
  .agent-day-stats strong { font-size: 30px; }
  .role-agent .ct-dash-link { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .role-agent .ct-dash-link > .ui-icon { color: var(--brand); flex: none; }
  .agent-tools a { padding: 12px; font-size: 13px; gap: 8px; }
  .agent-month .card-head { align-items: center; gap: 12px; }
  .agent-month .inline-label { display: flex; justify-content: space-between; gap: 12px; width: 100%; }
  .agent-month .input { flex: 1; max-width: 200px; }
  .agent-month-stats strong { font-size: 24px; }
  .agent-month-stats strong small { display: block; margin-top: 5px; }
  .agent-breakdown-body { padding: 0 10px 10px; gap: 12px; }
  .agent-breakdown .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-breakdown .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .role-agent .wiz-head { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
  .role-agent .wiz-title { display: flex; justify-content: space-between; gap: 12px; }
  .role-agent .wiz-title h2 { display: block; font-size: 24px; }
  .role-agent .wiz-head .eyebrow { font-size: 9px; }
  .role-agent .stepper { gap: 2px; }
  .role-agent .stepper li:not(.done) { padding-top: 2px; }
  .role-agent .stepper em { font-size: 10px; }
  .role-agent .stepper li::before { top: 15px; }
  .role-agent .wiz-body { padding: 18px 14px; gap: 18px; }
  .role-agent .wiz-q { font-size: 17px; }
  .role-agent .tile { min-height: 130px; padding: 14px; border-radius: 12px; }
  .role-agent .tile small { font-size: 12px; }
  .role-agent .wiz-foot { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 -4px 16px #20212408; }
  .role-agent .wiz-foot .btn { padding: 12px; font-size: 14px; }
  .role-agent .wiz-ctx { max-width: 34%; white-space: normal; font-size: 11px; overflow-wrap: anywhere; }
  .role-agent .wiz-foot .btn-primary { max-width: none; }
  .role-agent .wf-row { flex-wrap: wrap; }
  .role-agent .wf-row .input { flex: 1 1 170px; }
  .role-agent .wf-row .btn { flex: 0 0 auto; }
  .role-agent .pslot { padding: 14px; }
  .role-agent .pslot-head { flex-wrap: wrap; }
  .role-agent .pslot-head > .btn { margin-left: 38px; }
  .role-agent .ct-quick button { min-height: 44px; }
  .role-agent .ct-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-agent .ct-fu-list { grid-template-columns: minmax(0, 1fr); }
  .role-agent .ct-follow { grid-template-columns: minmax(0, 1fr); }
  .role-agent .ct-shift-btns { width: 100%; }
  .role-agent .ct-shift-btns .btn { flex: 1; }
  .role-agent .ct-actions { position: sticky; bottom: calc(var(--bottom-nav-h) + var(--safe-b)); padding: 10px 0; background: var(--bg); z-index: 10; }
  .keyboard-open .role-agent .ct-actions { position: static; }
  .role-agent .bottom-nav { box-shadow: 0 -4px 20px #20212408; }
}
@media (max-width: 640px) {
  .mobile-sale-cards { display: flex; }
  .has-mobile-cards { display: none; }
  .role-agent main[data-view="sales"] > #tbl { padding: 14px; }
  .role-agent main[data-view="sales"] .table-toolbar { gap: 12px; }
  .role-agent main[data-view="sales"] .search { max-width: none; width: 100%; }
  .agent-sale-summary { gap: 6px; }
  .agent-sale-summary .summary-cell { padding: 10px 8px; }
  .agent-sale-summary .summary-cell span { font-size: 9px; white-space: normal; }
  .agent-sale-summary .summary-cell strong { font-size: 24px; }
}
@media (max-width: 360px) {
  .agent-tools { gap: 8px; }
  .agent-tools .ui-icon:last-child { display: none; }
  .agent-day-stats { gap: 6px; }
  .agent-day-stats > div + div { padding-left: 10px; }
  .agent-day-stats span { font-size: 11px; }
  .sale-preview { padding: 12px; }
  .sale-preview-top { flex-wrap: wrap; }
  .role-agent .wiz-head { padding: 14px 10px; }
  .role-agent .tile { padding: 12px; }
}
@media print {
  .mobile-sale-cards { display: none; }
  .has-mobile-cards { display: block; }
  .dashboard-head { background: white; border: 0; padding: 0; }
  .kpi, .card { box-shadow: none; }
}
