:root {
  --ink: #282522;
  --muted: #7d7972;
  --line: #e9e5df;
  --paper: #fbfaf8;
  --white: #fff;
  --accent: #d66e4d;
  --accent-dark: #b9573b;
  --accent-soft: #f8e9e3;
  --sage: #668276;
  --sage-soft: #e8f0ec;
  --gold: #b78a3f;
  --gold-soft: #f7f0df;
  --blue: #648093;
  --blue-soft: #e8f0f4;
  --shadow: 0 12px 35px rgba(40, 37, 34, .08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "DM Sans", sans-serif; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.login-screen { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 20%,#f1ddd4,transparent 38%),linear-gradient(135deg,#f8f5f0,#e8efeb); }
.login-card { width: min(440px,100%); padding: 38px; border: 1px solid rgba(255,255,255,.8); border-radius: 18px; background: rgba(255,255,255,.94); box-shadow: 0 24px 70px rgba(40,37,34,.14); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; font: 700 23px "Playfair Display"; }
.login-brand span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px 11px 11px 3px; background: var(--accent); color: white; font: 700 15px "DM Sans"; }
.login-card h1 { font-size: 38px; }
.login-card p { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card .field label { font-size: 10px; }
.login-card .field input { padding: 13px; font-size: 14px; }
.login-card .primary-button { width: 100%; margin-top: 5px; padding: 13px; font-size: 14px; }
.login-card small { display: block; margin-top: 16px; color: var(--muted); font-size: 10px; text-align: center; }
.login-error { margin-bottom: 16px; padding: 10px; border: 1px solid #f0cccc; border-radius: 7px; background: #fff4f4; color: #a44e4e; font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: #272825; color: #eee9e2; padding: 25px 16px 18px; display: flex; flex-direction: column; z-index: 20; }
.brand { font-family: "Playfair Display", serif; font-size: 23px; display: flex; align-items: center; gap: 11px; padding: 0 9px; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px 10px 10px 3px; background: var(--accent); font-family: "DM Sans"; font-weight: 700; font-size: 16px; }
.create-button { margin: 29px 4px 20px; border: 0; color: white; background: var(--accent); padding: 12px 15px; border-radius: 9px; display: flex; justify-content: center; gap: 8px; font-weight: 600; }
.create-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
/* flex:1 + min-height:0 lets the nav scroll on short viewports while the brand,
   create button, and footer stay pinned. */
nav { display: grid; gap: 4px; flex: 1; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.nav-label { margin: 19px 12px 6px; color: #8f908c; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 700; }
.nav-item { color: #bdbdb7; background: transparent; border: 0; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14px; }
.nav-item span:first-child { width: 20px; text-align: center; opacity: .85; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.08); }
.nav-item.active { box-shadow: inset 2px 0 var(--accent); }
.nav-badge { margin-left: auto; background: var(--accent); color: white; border-radius: 20px; font-size: 10px; padding: 2px 6px; }
.sidebar-foot { margin-top: auto; padding: 15px 8px 2px; border-top: 1px solid rgba(255,255,255,.11); display: flex; align-items: center; gap: 9px; }
.sidebar-foot strong, .sidebar-foot span { display: block; font-size: 12px; }
.sidebar-foot span { color: #969690; margin-top: 2px; font-size: 10px; }
.workspace-avatar, .avatar-button { border: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #f1cdbc; color: #683b2d; font-weight: 700; font-size: 11px; }
.icon-button { border: 0; background: transparent; color: inherit; }
.sidebar-foot .icon-button { margin-left: auto; color: #9b9b96; }
.inline-field-action { margin-top: 7px; padding: 5px 0; }
.selection-list { display: grid; gap: 8px; max-height: 330px; overflow: auto; }
.selection-list label { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 8px; }
.selection-list strong, .selection-list small { display: block; }
.selection-list small { color: var(--muted); margin-top: 3px; }
.document-preview { display: grid; gap: 16px; }
.main { grid-column: 2; min-width: 0; }
.topbar { height: 72px; padding: 0 31px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); }
.search-wrap { width: min(430px, 52vw); height: 39px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; display: flex; align-items: center; gap: 9px; padding: 0 11px; color: #aaa59e; }
.search-wrap input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; color: var(--ink); }
kbd { font-size: 9px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: white; }
.top-actions { display: flex; align-items: center; gap: 10px; color: #6e6a64; }
.top-select { border: 1px solid var(--line); background: white; color: var(--ink); border-radius: 7px; padding: 6px 7px; font-size: 10px; font-weight: 700; outline: none; }
.top-actions .icon-button { width: 32px; height: 32px; border-radius: 50%; }
.top-actions .icon-button:hover { background: var(--paper); }
.notification { position: relative; }
.notification i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); top: 5px; right: 4px; }
#top-popover-root { position: absolute; top: 67px; right: 24px; z-index: 80; }
.top-popover { width: 360px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: 0 18px 50px rgba(40,37,34,.16); overflow: hidden; color: var(--ink); animation: popover-in .16s ease; }
.popover-head { padding: 17px 18px 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; border-bottom: 1px solid var(--line); }
.popover-head strong, .popover-head span { display: block; }
.popover-head strong { font-size: 14px; }
.popover-head span { color: var(--muted); font-size: 11px; margin-top: 4px; }
.popover-head button { border: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--paper); color: var(--muted); }
.popover-search { height: 38px; margin: 13px 16px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; display: flex; align-items: center; gap: 7px; color: var(--muted); }
.popover-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 12px; }
.popover-section { padding: 1px 9px 10px; }
.popover-section > label, .workspace-switch > label { display: block; padding: 6px 9px; color: var(--muted); letter-spacing: .1em; font-size: 9px; font-weight: 700; }
.popover-section > button { width: 100%; padding: 10px 9px; display: grid; grid-template-columns: 27px 1fr auto; gap: 9px; align-items: center; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.popover-section > button:hover, .profile-links button:hover, .workspace-switch button:hover { background: var(--paper); }
.popover-section > button > span { width: 27px; height: 27px; border-radius: 6px; display: grid; place-items: center; color: var(--sage); background: var(--sage-soft); }
.popover-section strong, .popover-section small { display: block; font-size: 11px; }
.popover-section small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.popover-section kbd { font-size: 9px; }
.popover-footer { padding: 11px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; background: #fcfbf9; }
.popover-footer button { border: 0; background: transparent; color: var(--accent-dark); font-size: 10px; font-weight: 700; }
.popover-footer.single { justify-content: flex-end; }
.popover-tabs { padding: 9px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 4px; }
.popover-tabs button { border: 0; border-radius: 6px; padding: 6px 8px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 700; }
.popover-tabs button.active { color: var(--accent-dark); background: var(--accent-soft); }
.popover-tabs button:last-child { margin-left: auto; color: var(--accent); }
.popover-notifications { max-height: 360px; overflow: auto; }
.popover-notification { width: 100%; padding: 13px 16px; display: grid; grid-template-columns: 34px 1fr 7px; gap: 10px; align-items: start; border: 0; border-bottom: 1px solid var(--line); background: white; text-align: left; }
.popover-notification:hover, .popover-notification.unread { background: #fdfaf8; }
.popover-notification strong { font-size: 11px; }
.popover-notification p { margin: 3px 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.popover-notification small { color: #aaa49c; font-size: 8px; }
.popover-notification > i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-top: 4px; }
.profile-summary { padding: 18px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.profile-summary .workspace-avatar { width: 42px; height: 42px; }
.profile-summary strong, .profile-summary span { display: block; font-size: 12px; }
.profile-summary span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.workspace-switch { padding: 9px; border-bottom: 1px solid var(--line); }
.workspace-switch button { width: 100%; display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; padding: 9px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
.workspace-switch span strong, .workspace-switch span small { display: block; font-size: 11px; }
.workspace-switch span small { color: var(--muted); font-size: 9px; margin-top: 3px; }
.workspace-switch b { color: var(--sage); }
.profile-links { padding: 8px; border-bottom: 1px solid var(--line); }
.profile-links.bottom { border-bottom: 0; }
.profile-links button { width: 100%; border: 0; border-radius: 7px; background: transparent; padding: 10px; display: flex; align-items: center; gap: 10px; text-align: left; font-size: 11px; color: var(--ink); }
.profile-links button span { width: 21px; color: var(--muted); text-align: center; }
@keyframes popover-in { from { opacity: 0; transform: translateY(-5px); } }
.mobile-menu { display: none; }
.content { max-width: 1510px; padding: 35px 36px 55px; margin: 0 auto; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; font-size: 10px; margin-bottom: 7px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-family: "Playfair Display", serif; font-size: clamp(28px, 3vw, 39px); line-height: 1.15; letter-spacing: -.025em; margin-bottom: 8px; }
h2 { font-family: "Playfair Display", serif; font-size: 23px; }
.subtext { color: var(--muted); font-size: 13px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.button-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.primary-button, .secondary-button, .quiet-button, .danger-button { border-radius: 8px; padding: 10px 14px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.primary-button { color: white; background: var(--accent); }
.primary-button:hover { background: var(--accent-dark); }
.secondary-button { background: white; border-color: var(--line); color: var(--ink); }
.secondary-button:hover, .quiet-button:hover { border-color: #cbc5bd; background: var(--paper); }
.quiet-button { background: transparent; border-color: var(--line); color: var(--muted); }
.danger-button { color: #b34d4d; background: #fff2f2; border-color: #f6d5d5; }
.grid { display: grid; gap: 17px; }
.metric-grid { grid-template-columns: repeat(4, 1fr); margin-bottom: 25px; }
.metric-card, .card { border: 1px solid var(--line); background: white; border-radius: 12px; box-shadow: 0 2px 4px rgba(40,37,34,.02); }
.metric-card { padding: 19px; position: relative; overflow: hidden; }
.metric-card[data-action="weighted-forecast"] { cursor: pointer; transition: transform .16s, border-color .16s, box-shadow .16s; }
.metric-card[data-action="weighted-forecast"]:hover, .metric-card[data-action="weighted-forecast"]:focus { transform: translateY(-2px); border-color: var(--sage); box-shadow: 0 8px 22px rgba(50,65,58,.1); outline: none; }
.metric-card:after { content: ""; position: absolute; width: 70px; height: 70px; background: var(--accent-soft); border-radius: 50%; right: -30px; top: -32px; }
.active-timer-banner { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; margin-bottom: 22px; padding: 17px 19px; border: 1px solid #cfe0d8; border-radius: 12px; background: linear-gradient(120deg,#f3f8f5,#fff); box-shadow: 0 6px 18px rgba(70,100,86,.08); }
.active-timer-banner span, .active-timer-banner strong, .active-timer-banner small { display: block; }
.active-timer-banner span { color: var(--sage); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.active-timer-banner strong { margin: 4px 0; font-size: 14px; }
.active-timer-banner small { color: var(--muted); font-size: 10px; }
.active-timer-banner > b { font-family: "DM Sans"; font-size: 25px; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.timer-pulse { width: 11px; height: 11px; border-radius: 50%; background: #5e947c; box-shadow: 0 0 0 6px rgba(94,148,124,.13); animation: timer-pulse 1.8s infinite; }
.timer-stop-button { padding: 10px 14px; border: 1px solid #e7c9c5; border-radius: 8px; background: #fff5f4; color: #a85048; font-size: 12px; font-weight: 700; }
.timer-stop-button:hover { background: #fceae8; }
.timer-modal-intro { display: flex; gap: 12px; align-items: center; margin: -5px 0 18px; padding: 13px; border-radius: 9px; background: var(--sage-soft); }
.timer-modal-intro > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: white; color: var(--sage); font-size: 16px; }
.timer-modal-intro strong, .timer-modal-intro p { display: block; margin: 0; }
.timer-modal-intro p { margin-top: 3px; color: var(--muted); font-size: 10px; }
@keyframes timer-pulse { 50% { box-shadow: 0 0 0 10px rgba(94,148,124,.05); } }
@media (max-width: 900px) {
  .active-timer-banner { grid-template-columns: auto 1fr auto; }
  .active-timer-banner .button-row { grid-column: 1 / -1; justify-content: stretch; }
  .active-timer-banner .button-row button { flex: 1; }
}
.metric-label { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.metric-value { font-family: "Playfair Display", serif; font-size: 28px; margin: 11px 0 5px; }
.metric-detail { color: var(--sage); font-size: 11px; }
.dashboard-grid { grid-template-columns: 1.55fr .85fr; align-items: start; }
.card { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 17px; }
.card-head h2, .card-head h3 { margin: 0; font-family: "DM Sans"; font-size: 14px; }
.card-head button { color: var(--accent); border: 0; background: transparent; font-size: 11px; font-weight: 700; }
.activity-list, .task-list, .list { display: grid; }
.activity-item { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-item.activity-link { cursor: pointer; border-radius: 9px; transition: background .12s; }
.activity-item.activity-link:hover { background: var(--sage-soft); }
.activity-item.activity-link:hover time { color: var(--sage); }
.activity-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; color: var(--accent-dark); background: var(--accent-soft); }
.activity-item strong, .activity-item span { display: block; font-size: 11px; }
.activity-item span, .activity-item time { color: var(--muted); font-size: 10px; margin-top: 3px; }
.activity-history-card { max-width: 920px; }
.activity-history-list .activity-item { padding: 18px 2px; }
.activity-history-list .activity-item small { display: inline-block; margin-top: 7px; padding: 4px 7px; border-radius: 20px; background: var(--sage-soft); color: var(--sage); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.task { display: grid; grid-template-columns: 18px 1fr auto; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); align-items: start; }
.task:first-child { border-top: 0; }
.task input { accent-color: var(--accent); }
.task.completed strong { text-decoration: line-through; color: var(--muted); }
.task strong, .task span { display: block; font-size: 11px; }
.task span { color: var(--muted); margin-top: 4px; }
.date-chip { background: var(--gold-soft); color: var(--gold); padding: 4px 6px; border-radius: 5px; font-size: 9px; font-weight: 700; white-space: nowrap; }
.pipeline { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 8px; }
.deals-pipeline { grid-template-columns: repeat(5, minmax(220px, 1fr)); }
.pipeline-column { border: 1px solid var(--line); background: #f6f4f1; border-radius: 11px; padding: 11px; min-height: 380px; }
.pipeline-head { display: flex; justify-content: space-between; align-items: center; padding: 3px 2px 12px; text-transform: uppercase; font-size: 9px; letter-spacing: .1em; font-weight: 700; color: var(--muted); }
.pipeline-head span:last-child { background: white; border: 1px solid var(--line); border-radius: 20px; padding: 2px 6px; }
.pipeline-subtotal { margin: 0 0 11px; padding: 9px 10px; border: 1px solid #dfe8e3; border-radius: 7px; background: var(--sage-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pipeline-subtotal span { color: var(--sage); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.pipeline-subtotal strong { color: #456458; font-size: 11px; white-space: nowrap; }
.deal-card-list { min-height: 90px; }
.deal-card { position: relative; cursor: grab; }
.deal-card:active { cursor: grabbing; }
.deal-drag-handle { position: absolute; top: 8px; right: 9px; color: #bbb5ad; font-size: 11px; letter-spacing: -2px; opacity: 0; transition: .15s; }
.deal-card:hover .deal-drag-handle { opacity: 1; }
.deal-card.dragging { opacity: .38; transform: rotate(1deg) scale(.98); }
.deal-dropzone { transition: border-color .16s, background .16s, box-shadow .16s; }
.deal-dropzone.drag-active { border-style: dashed; }
.deal-dropzone.drag-over { border-color: var(--sage); background: #edf4f0; box-shadow: inset 0 0 0 2px rgba(102,130,118,.12); }
.deal-drop-hint { display: none; margin: 8px 0 0; padding: 14px; border: 1px dashed var(--sage); border-radius: 8px; color: var(--sage); text-align: center; font-size: 9px; font-weight: 700; }
.deal-dropzone.drag-active .deal-drop-hint { display: block; }
.deal-dropzone.drag-over .deal-drop-hint { background: white; }
.project-card-list { min-height: 90px; }
.movable-project-card { position: relative; cursor: grab; }
.movable-project-card:active { cursor: grabbing; }
.movable-project-card:hover .deal-drag-handle { opacity: 1; }
.movable-project-card.dragging { opacity: .38; transform: rotate(1deg) scale(.98); }
.project-open-area { cursor: pointer; }
.project-dropzone { transition: border-color .16s,background .16s,box-shadow .16s; }
.project-dropzone.drag-active { border-style: dashed; }
.project-dropzone.drag-over { border-color: var(--sage); background: #edf4f0; box-shadow: inset 0 0 0 2px rgba(102,130,118,.12); }
.project-drop-hint { display: none; margin: 8px 0 0; padding: 14px; border: 1px dashed var(--sage); border-radius: 8px; color: var(--sage); text-align: center; font-size: 9px; font-weight: 700; }
.project-dropzone.drag-active .project-drop-hint { display: block; }
.project-dropzone.drag-over .project-drop-hint { background: white; }
.deal-move-actions { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.deal-move-actions span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.deal-move-actions button { width: 25px; height: 25px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--sage); font-size: 11px; }
.deal-move-actions button:hover:not(:disabled) { border-color: var(--sage); background: var(--sage-soft); }
.deal-move-actions button:disabled { opacity: .28; cursor: not-allowed; }
.deal-outcome-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.deal-outcome-actions button { min-height: 28px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 9px; font-weight: 700; }
.deal-outcome-actions .win-deal { color: #497162; border-color: #cfe0d8; background: #f2f8f5; }
.deal-outcome-actions .lose-deal { color: #a75b55; border-color: #ead4d1; background: #fff7f6; }
.lost-column { background: #f7f2f1; }
.lost-deal { opacity: .78; }
.lost-deal .tag { background: #f2e3e1; color: #9a5c56; }
.lost-deal .deal-outcome-actions, [data-deal-stage="Won"] .deal-outcome-actions { grid-template-columns: 1fr; }
.project-card { border: 1px solid var(--line); background: white; border-radius: 9px; padding: 13px; margin-bottom: 9px; cursor: pointer; transition: .2s; }
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card .avatar-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mini-avatar { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; color: #624136; background: #f1d6c8; font-size: 8px; font-weight: 700; }
.project-card h3 { margin: 0 0 4px; font-size: 12px; }
.project-card p { font-size: 10px; color: var(--muted); margin-bottom: 12px; }
.project-foot { border-top: 1px solid var(--line); padding-top: 9px; display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.tag, .status { display: inline-flex; align-items: center; width: fit-content; border-radius: 20px; padding: 4px 7px; font-size: 9px; font-weight: 700; }
.tag { background: var(--blue-soft); color: var(--blue); }
.status.paid, .status.completed, .status.active { background: var(--sage-soft); color: var(--sage); }
.status.overdue, .status.action { background: #f8e5e5; color: #b35c5c; }
.status.draft, .status.inactive { background: #efedea; color: #827e77; }
.status.sent, .status.pending { background: var(--gold-soft); color: var(--gold); }
.status.unbilled { background: var(--gold-soft); color: var(--gold); }
.status.billed { background: var(--sage-soft); color: var(--sage); }
.status.non-billable { background: #efedea; color: #827e77; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.filter { border: 1px solid var(--line); background: white; color: var(--muted); border-radius: 7px; padding: 7px 10px; font-size: 10px; }
.filter.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--paper); }
.data-table .empty-table-row { cursor: default; }
.data-table .empty-table-row:hover { background: transparent; }
.data-table .empty-table-row td { padding: 42px 14px; color: var(--muted); text-align: center; }
.invoice-link { border: 0; padding: 0; background: transparent; color: var(--accent-dark); }
.invoice-file-badge { display: block; width: max-content; margin-top: 5px; color: #497162; font-size: 8px; font-weight: 700; text-decoration: none; }
.invoice-actions { display: flex; gap: 6px; }
.invoice-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--muted); font-size: 9px; font-weight: 700; }
.invoice-actions .pay-action { border-color: #cfe0d8; background: var(--sage-soft); color: #497162; }
.invoice-detail-summary { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 15px; }
.invoice-detail-summary > div { padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.invoice-detail-summary span, .invoice-detail-summary strong, .invoice-detail-summary small { display: block; }
.invoice-detail-summary span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.invoice-detail-summary strong { margin: 7px 0 4px; font-size: 15px; }
.invoice-detail-summary small { color: var(--muted); font-size: 10px; }
.invoice-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; }
.invoice-detail-row span { color: var(--muted); }
.invoice-drive-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.invoice-drive-row span, .invoice-drive-row strong { display: block; }
.invoice-drive-row span { color: var(--muted); font-size: 9px; }
.invoice-drive-row strong { margin-top: 3px; font-size: 11px; }
.invoice-drive-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--sage-soft); color: #497162; font-size: 16px; }
.drive-modal-intro { display: flex; align-items: center; gap: 11px; padding: 13px; margin: -5px 0 16px; border-radius: 9px; background: var(--sage-soft); }
.drive-modal-intro strong, .drive-modal-intro p { display: block; margin: 0; }
.drive-modal-intro p { margin-top: 3px; color: var(--muted); font-size: 9px; }
.invoice-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.invoice-paid-note { width: 100%; padding: 13px; border-radius: 8px; background: var(--sage-soft); color: #497162; font-size: 12px; font-weight: 700; }
.client-cell { display: flex; align-items: center; gap: 9px; }
.client-cell strong, .client-cell span { display: block; }
.client-cell span { color: var(--muted); margin-top: 3px; font-size: 9px; }
.amount { font-weight: 700; }
.project-layout { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.project-aside { position: sticky; top: 94px; }
.contact-card { text-align: center; }
.large-avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: #f1d6c8; color: #624136; font-weight: 700; }
.contact-card h3 { margin-bottom: 4px; font-size: 14px; }
.contact-card p { color: var(--muted); font-size: 10px; margin-bottom: 16px; }
.contact-details { display: grid; gap: 11px; border-top: 1px solid var(--line); padding-top: 15px; text-align: left; }
.contact-details label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 700; display: block; margin-bottom: 3px; }
.contact-details span { font-size: 10px; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 17px; }
.tab { white-space: nowrap; border: 0; background: transparent; color: var(--muted); padding: 9px 11px; font-size: 10px; font-weight: 700; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent); border-color: var(--accent); }
.detail-grid { grid-template-columns: repeat(2, 1fr); }
.detail-card { border: 1px solid var(--line); border-radius: 9px; padding: 15px; }
.detail-card label { color: var(--muted); text-transform: uppercase; font-size: 8px; letter-spacing: .08em; font-weight: 700; display: block; margin-bottom: 7px; }
.detail-card strong { font-size: 12px; }
.progress { background: #eeeae5; height: 5px; border-radius: 10px; overflow: hidden; margin: 9px 0 4px; }
.progress i { display: block; background: var(--sage); height: 100%; border-radius: inherit; }
.document-row { padding: 13px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 34px 1fr auto; gap: 11px; align-items: center; }
.row-actions { display: flex; gap: 9px; align-items: center; white-space: nowrap; }
.document-row:first-child { border-top: 0; }
.doc-icon { width: 33px; height: 38px; border-radius: 5px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
.document-row strong, .document-row span { display: block; font-size: 10px; }
.document-row span { color: var(--muted); margin-top: 4px; font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.template-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-height: 145px; display: flex; flex-direction: column; }
.template-icon { width: 31px; height: 31px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 12px; margin-bottom: 17px; }
.template-card h3 { font-size: 12px; margin-bottom: 5px; }
.template-card p { color: var(--muted); font-size: 9px; }
.template-card .button-row { margin-top: auto; justify-content: space-between; }
.flow-step { display: grid; grid-template-columns: 25px 1fr auto; gap: 11px; align-items: center; padding: 13px; background: white; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 8px; }
.step-number { width: 25px; height: 25px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border-radius: 50%; font-size: 9px; font-weight: 700; }
.flow-step strong, .flow-step span { display: block; font-size: 10px; }
.flow-step span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.portal-shell { background: #f5efe9; padding: 26px; border-radius: 12px; min-height: 570px; }
.portal-bar { display: flex; justify-content: space-between; align-items: center; max-width: 850px; margin: auto; padding-bottom: 20px; }
.portal-brand { font-family: "Playfair Display"; font-size: 18px; }
.portal-content { max-width: 850px; margin: auto; }
.portal-hero { background: #29302e; color: white; border-radius: 13px; padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.portal-hero h2 { margin-bottom: 6px; font-size: 25px; }
.portal-hero p { color: #c5ccc8; font-size: 10px; margin: 0; }
.portal-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 14px; }
.portal-card { background: white; border: 1px solid #ebe4dc; border-radius: 11px; padding: 17px; }
.portal-card h3 { font-size: 11px; margin-bottom: 13px; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(25,25,23,.55); display: grid; place-items: center; padding: 18px; z-index: 100; backdrop-filter: blur(3px); }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: 13px; box-shadow: var(--shadow); padding: 24px; }
.modal-head { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.modal h2 { font-size: 21px; margin: 0; }
.modal-close { border: 0; background: var(--paper); border-radius: 50%; width: 27px; height: 27px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 13px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 10px; outline: none; font-size: 11px; background: white; }
.field small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.forecast-intro { margin: -8px 0 18px; }
.forecast-total { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; margin-bottom: 12px; border-radius: 9px; background: var(--sage-soft); color: var(--sage); }
.forecast-total span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.forecast-total strong { font-family: "Playfair Display", serif; color: var(--ink); font-size: 24px; }
.forecast-breakdown { display: grid; }
.forecast-row { display: grid; grid-template-columns: 1fr 76px 95px; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.forecast-row > span:first-child strong, .forecast-row small { display: block; }
.forecast-row small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.forecast-row > strong { text-align: right; font-size: 12px; }
.forecast-probability { position: relative; display: flex; align-items: center; }
.forecast-probability input { width: 100%; padding-right: 24px; }
.forecast-probability b { position: absolute; right: 8px; color: var(--muted); font-size: 11px; pointer-events: none; }
.toast { position: fixed; right: 22px; bottom: 22px; background: #292a27; color: white; border-radius: 8px; padding: 12px 16px; font-size: 11px; box-shadow: var(--shadow); z-index: 150; animation: toast-in .25s ease; }
.empty { padding: 40px; text-align: center; color: var(--muted); font-size: 11px; }
.workload-list { display: grid; }
.workload-row { display: grid; grid-template-columns: 190px 1fr 260px; gap: 20px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.workload-row:first-child { border-top: 0; }
.workload-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.workload-meta strong { color: var(--sage); }
.workload-rates { margin-top: 7px; color: var(--muted); font-size: 8px; }
.workload-schedule { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.workload-edit { white-space: nowrap; }
.client-cell small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.over { color: #b35c5c !important; }
.progress i.overbar { background: #c86d65; }
.capacity-cells { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.capacity-cells span { display: grid; place-items: center; gap: 3px; padding: 7px 3px; background: var(--sage-soft); color: var(--sage); border-radius: 5px; font-size: 8px; }
.capacity-cells span.busy { background: #f8e5e5; color: #b35c5c; }
.capacity-cells b { font-size: 7px; opacity: .75; }
.team-modal-person { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px; margin: -5px 0 16px; border-radius: 9px; background: var(--paper); }
.team-modal-person strong, .team-modal-person span { display: block; }
.team-modal-person span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.danger-text { color: #b35c5c; }
.schedule-inputs { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; }
.schedule-inputs label { display: grid; gap: 5px; text-align: center; }
.schedule-inputs label span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; }
.schedule-inputs input { text-align: center; padding: 9px 4px; }
.team-rates-list { display: grid; margin-top: 12px; }
.team-rate-row { display: grid; grid-template-columns: 1fr 92px 92px; gap: 10px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.team-rate-row label { display: grid; gap: 5px; }
.team-rate-row label span { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.team-rate-row input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 9px; font-size: 10px; }
.profit-row { display: grid; grid-template-columns: 1.4fr repeat(3, .6fr); gap: 15px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.profit-row:first-of-type { border-top: 0; }
.profit-row strong, .profit-row span { display: block; font-size: 10px; }
.profit-row span { color: var(--muted); font-size: 8px; margin-bottom: 4px; }
.base-currency-chip { display: inline-flex; align-items: center; padding: 8px 10px; border-radius: 7px; background: var(--sage-soft); color: var(--sage); font-size: 10px; font-weight: 700; }
.insights-scope { margin: -12px 0 20px; color: var(--muted); font-size: 10px; }
.insights-scope strong { color: var(--ink); }
.insight-card-action { width: 100%; margin-top: 12px; }
.insights-period-list { display: grid; gap: 8px; margin-top: 16px; }
.insights-period-list button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); text-align: left; font-size: 11px; font-weight: 700; }
.insights-period-list button.active { border-color: #a7c1b5; background: var(--sage-soft); color: #497162; }
.profitability-report { display: grid; }
.profitability-report article { padding: 14px 0; border-top: 1px solid var(--line); }
.profitability-report article:first-child { border-top: 0; padding-top: 0; }
.profitability-report article > div strong, .profitability-report article > div span { display: block; }
.profitability-report article > div span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.profitability-report dl { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin: 13px 0 0; }
.profitability-report dl div { padding: 8px; border-radius: 7px; background: var(--paper); }
.profitability-report dt { color: var(--muted); font-size: 7px; font-weight: 700; text-transform: uppercase; }
.profitability-report dd { margin: 5px 0 0; font-size: 10px; font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px; }
.rates-card { grid-column: 1 / -1; }
.rate-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.rate-grid label { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; }
.rate-grid input { width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: none; padding: 5px 0; font-weight: 700; color: var(--ink); }
.rate-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 9px; }
.currency-preview { display: grid; gap: 5px; margin-top: 15px; padding: 14px; background: var(--sage-soft); border-radius: 9px; }
.currency-preview span, .currency-preview small { font-size: 9px; color: var(--sage); }
.currency-preview strong { font-family: "Playfair Display"; font-size: 22px; }
.currency-row { display: grid; grid-template-columns: 50px 1fr auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: center; font-size: 10px; }
.currency-row:first-of-type { border-top: 0; }
.currency-row span { color: var(--muted); }
.timesheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 6px 0 22px; }
.timesheet-head > div:first-child > span { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; font-weight: 700; }
.timesheet-head h2 { margin: 6px 0; font-family: "DM Sans"; font-size: 20px; }
.timesheet-head p { margin: 0; color: var(--muted); font-size: 12px; }
.timesheet-summary { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); display: flex; align-items: center; gap: 13px; margin-bottom: 17px; }
.timesheet-ring { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--sage) 0 17%, #e4eae6 17% 100%); position: relative; }
.timesheet-ring:after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: white; }
.timesheet-ring span { position: relative; z-index: 1; font-size: 9px; font-weight: 700; }
.timesheet-summary strong, .timesheet-summary span { display: block; font-size: 11px; }
.timesheet-summary > div:nth-child(2) span { color: var(--muted); margin-top: 3px; font-size: 9px; }
.timesheet-legend { display: flex; gap: 15px; margin-left: auto; color: var(--muted); }
.timesheet-legend span { display: flex; align-items: center; gap: 5px; font-size: 9px; }
.timesheet-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.timesheet-legend span:last-child i { background: var(--gold); }
.timesheet-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.timesheet-table { min-width: 930px; width: 100%; border-collapse: collapse; background: white; }
.timesheet-table th, .timesheet-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; text-align: center; }
.timesheet-table th:last-child, .timesheet-table td:last-child { border-right: 0; }
.timesheet-table thead th { background: var(--paper); color: var(--muted); font-size: 9px; font-weight: 500; }
.timesheet-table thead th:first-child { width: 235px; text-align: left; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.timesheet-table th span, .timesheet-table th b, .timesheet-table th small { display: block; }
.timesheet-table th b { margin: 3px 0; color: var(--ink); font-size: 10px; }
.timesheet-table th small { color: var(--sage); font-size: 8px; }
.timesheet-table th.has-hours { background: var(--sage-soft); }
.timesheet-table td:first-child { text-align: left; }
.timesheet-table td:first-child strong, .timesheet-table td:first-child span { display: block; font-size: 10px; }
.timesheet-table td:first-child span { color: var(--muted); margin-top: 4px; font-size: 8px; }
.timesheet-table input { width: 49px; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 7px 2px; text-align: center; color: var(--ink); font-size: 10px; outline: none; }
.timesheet-table input:hover, .timesheet-table input:focus { border-color: var(--sage); background: white; box-shadow: 0 0 0 3px var(--sage-soft); }
.timesheet-total td { background: #f8f6f3; color: var(--muted); font-size: 9px; border-bottom: 0; }
.timesheet-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.timesheet-actions span { margin-left: auto; color: var(--muted); font-size: 9px; }
.timesheet-team { display: grid; }
.timesheet-team article { display: grid; grid-template-columns: 1.4fr repeat(3,.5fr) .6fr auto; gap: 15px; align-items: center; padding: 15px 0; border-top: 1px solid var(--line); }
.timesheet-team article:first-child { border-top: 0; }
.timesheet-team article > div:not(.client-cell) span, .timesheet-team article > div:not(.client-cell) strong { display: block; font-size: 10px; }
.timesheet-team article > div:not(.client-cell) span { color: var(--muted); margin-bottom: 4px; font-size: 8px; }
.status.submitted { background: var(--sage-soft); color: var(--sage); }

/* Full client portal preview */
.client-preview-mode .sidebar, .client-preview-mode .topbar { display: none; }
.client-preview-mode .app-shell { display: block; }
.client-preview-mode .main { width: 100%; }
.client-preview-mode .content { max-width: none; margin: 0; padding: 0; }
.client-app { min-height: 100vh; background: #f7f4ef; color: #2c2b28; }
.client-header { min-height: 76px; padding: 0 4vw; display: grid; grid-template-columns: 190px 1fr auto; align-items: center; gap: 20px; background: rgba(255,255,255,.96); border-bottom: 1px solid #eae5dc; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); }
.client-brand { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; font-family: "Playfair Display"; font-size: 19px; color: #252b29; font-weight: 700; }
.client-brand span { width: 31px; height: 31px; border-radius: 10px 10px 10px 3px; display: grid; place-items: center; background: #647c70; color: white; font: 700 12px "DM Sans"; }
.client-header nav { display: flex; justify-content: center; align-items: stretch; gap: 2px; height: 76px; overflow-x: auto; }
.client-nav-item { border: 0; border-bottom: 2px solid transparent; background: transparent; color: #77756f; padding: 0 10px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.client-nav-item span { display: none; }
.client-nav-item:hover, .client-nav-item.active { color: #526d60; border-color: #647c70; }
.client-header-actions { display: flex; align-items: center; gap: 8px; }
.client-header-actions select { border: 1px solid #e5e0d8; border-radius: 7px; padding: 7px; background: white; font-size: 9px; font-weight: 700; }
.client-user { border: 0; background: transparent; display: flex; align-items: center; gap: 7px; font-size: 9px; color: #4b4a46; }
.client-user span { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: #ead3c7; color: #754c3c; font-size: 8px; font-weight: 700; }
.exit-preview { border: 1px solid #e4ded5; border-radius: 7px; background: white; color: #827c75; padding: 8px 10px; font-size: 9px; font-weight: 700; }
.client-main { width: min(1120px, 92vw); min-height: calc(100vh - 145px); margin: auto; padding: 42px 0 65px; }
.client-hero { min-height: 225px; background: linear-gradient(130deg,#26312d,#536d60); border-radius: 18px; padding: 40px 43px; color: white; display: flex; align-items: center; justify-content: space-between; gap: 25px; overflow: hidden; position: relative; margin-bottom: 18px; }
.client-hero:after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; right: -60px; bottom: -190px; box-shadow: 0 0 0 45px rgba(255,255,255,.035),0 0 0 90px rgba(255,255,255,.025); }
.client-hero span { color: #cbd6d1; font-size: 11px; }
.client-hero h1 { color: white; font-size: 42px; margin: 3px 0 9px; }
.client-hero p { color: #d3ddd8; max-width: 500px; line-height: 1.6; font-size: 11px; margin: 0; }
.client-primary, .client-secondary { border-radius: 8px; padding: 10px 14px; font-size: 10px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.client-primary { background: #cf7355; color: white; position: relative; z-index: 1; }
.client-primary:hover { background: #b96045; }
.client-primary.small { padding: 7px 9px; font-size: 8px; }
.client-secondary { background: white; border-color: #e5dfd7; color: #526d60; }
.client-stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; margin-bottom: 18px; }
.client-stat-grid article { background: white; border: 1px solid #eae5dc; border-radius: 12px; padding: 17px; display: grid; gap: 7px; }
.client-stat-grid span { color: #8a857d; text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 700; }
.client-stat-grid strong { font: 700 22px "Playfair Display"; color: #2f3633; }
.client-stat-grid small { color: #8e8981; font-size: 8px; }
.client-progress { height: 5px; background: #e8ece9; border-radius: 10px; overflow: hidden; }
.client-progress i { display: block; height: 100%; background: #668276; border-radius: inherit; }
.client-progress.large { height: 7px; margin: 0 0 25px; }
.client-dashboard-grid { display: grid; grid-template-columns: 1.45fr .75fr; align-items: start; gap: 15px; margin-bottom: 16px; }
.client-panel { background: white; border: 1px solid #e9e4dc; border-radius: 13px; padding: 20px; box-shadow: 0 4px 14px rgba(49,44,38,.025); }
.client-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.client-panel-head.spaced { margin-top: 24px; }
.client-panel-head h2 { margin: 0; font: 700 13px "DM Sans"; }
.client-panel-head > span { min-width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #f2e9e4; color: #b25f47; font-size: 8px; font-weight: 700; }
.client-panel-head button { border: 0; background: transparent; color: #bf664c; font-size: 9px; font-weight: 700; }
.client-list-row { display: grid; grid-template-columns: 35px 1fr auto; gap: 11px; align-items: center; padding: 13px 0; border-top: 1px solid #eee9e2; }
.client-list-row:first-of-type { border-top: 0; }
.client-list-row strong, .client-list-row span { display: block; font-size: 10px; }
.client-list-row span { color: #8d8981; font-size: 8px; margin-top: 4px; }
.client-file-icon { width: 34px; height: 38px; border-radius: 6px; display: grid; place-items: center; background: #e7efeb; color: #668276; font-size: 11px; }
.client-file-icon.money-icon { background: #f5e9e4; color: #bf664c; }
.client-empty { padding: 30px; text-align: center; color: #7b8e84; font-size: 10px; }
.client-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.client-actions button { min-height: 78px; border: 1px solid #ebe6de; border-radius: 9px; background: #fcfbf9; display: grid; place-items: center; gap: 5px; color: #5f615d; font-size: 8px; font-weight: 700; }
.client-actions b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #e8efeb; color: #668276; font-size: 11px; }
.client-actions button:hover { border-color: #b8c8c0; background: white; }
.client-timeline { margin-top: 16px; }
.timeline { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; }
.timeline div { position: relative; display: grid; gap: 4px; padding: 0 12px; border-top: 2px solid #e8e4dd; }
.timeline i { width: 22px; height: 22px; margin-top: -12px; border-radius: 50%; display: grid; place-items: center; background: white; border: 2px solid #ddd8d0; color: #928c84; font-size: 8px; font-style: normal; }
.timeline strong { margin-top: 8px; font-size: 9px; }
.timeline span { color: #948f87; font-size: 8px; }
.timeline .done, .timeline .current { border-color: #718a7e; }
.timeline .done i, .timeline .current i { border-color: #718a7e; background: #718a7e; color: white; }
.client-page-head { margin-bottom: 25px; }
.client-page-head > span { color: #be684f; text-transform: uppercase; letter-spacing: .11em; font-size: 8px; font-weight: 700; }
.client-page-head h1 { margin: 7px 0; font-size: 34px; }
.client-page-head p { color: #837f78; font-size: 10px; }
.client-cover { min-height: 180px; border-radius: 10px; padding: 25px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(140deg,#e7ddd4,#bfcec7); color: #28312e; }
.client-cover span { width: fit-content; padding: 4px 7px; border-radius: 20px; background: white; color: #668276; font-size: 8px; font-weight: 700; }
.client-cover h2 { max-width: 440px; margin: 10px 0 7px; font-size: 22px; }
.client-cover p { max-width: 520px; margin: 0; color: #58625e; font-size: 9px; line-height: 1.6; }
.milestones { display: grid; gap: 6px; }
.milestones > div { display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid #eee9e2; border-radius: 8px; }
.milestones i { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #eeebe6; color: #928d85; font-style: normal; font-size: 8px; }
.milestones strong, .milestones span { font-size: 9px; }
.milestones span { color: #938e87; }
.milestones .complete i, .milestones .active i { background: #dfeae5; color: #668276; }
.milestones .active { border-color: #b8c9c0; background: #fafcfb; }
.client-person { display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center; padding: 9px 0; border-top: 1px solid #eee9e2; }
.client-person:first-of-type { border-top: 0; }
.client-person strong, .client-person span { display: block; font-size: 9px; }
.client-person span { color: #938e87; margin-top: 3px; font-size: 8px; }
.client-person button { border: 0; background: #eef3f0; color: #668276; border-radius: 50%; width: 25px; height: 25px; }
.client-note { margin-top: 14px; display: grid; gap: 6px; }
.client-note > span { color: #be684f; text-transform: uppercase; letter-spacing: .08em; font-size: 8px; font-weight: 700; }
.client-note strong { font-size: 11px; }
.client-note p { color: #8a857d; font-size: 9px; }
.client-task-tabs { display: flex; gap: 5px; border-bottom: 1px solid #ece7df; margin-bottom: 8px; }
.client-task-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 8px 9px; background: transparent; color: #8f8a82; font-size: 9px; font-weight: 700; }
.client-task-tabs button.active { color: #668276; border-color: #668276; }
.client-task { display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; padding: 16px 4px; border-bottom: 1px solid #eee9e2; align-items: center; }
.client-task input { accent-color: #668276; }
.client-task strong, .client-task small { display: block; font-size: 10px; }
.client-task small { color: #969188; font-size: 8px; margin-top: 4px; }
.client-task > b { color: #668276; }
.client-task.complete strong { color: #99958e; text-decoration: line-through; }
.client-panel > .client-secondary:last-child { margin-top: 16px; }
.client-file-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.client-file-toolbar span { color: #8c877f; font-size: 9px; }
.client-file-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.client-file-grid article { border: 1px solid #ebe6df; border-radius: 9px; padding: 10px; display: grid; gap: 5px; }
.client-file-preview { height: 120px; display: grid; place-items: center; border-radius: 6px; background: linear-gradient(135deg,#edf1ee,#e8ddd5); color: #668276; font: 700 15px "Playfair Display"; }
.client-file-grid strong { margin-top: 5px; font-size: 9px; }
.client-file-grid span { color: #928d85; font-size: 8px; }
.client-file-grid button { border: 0; background: transparent; color: #bd684f; padding: 5px 0; text-align: left; font-size: 8px; font-weight: 700; }
.client-message-layout { display: grid; grid-template-columns: 1fr 260px; gap: 15px; align-items: start; }
.client-thread { background: white; border: 1px solid #e9e4dc; border-radius: 13px; padding: 21px; }
.message { display: grid; grid-template-columns: 26px 1fr; gap: 10px; margin-bottom: 18px; }
.message.client { display: block; margin-left: 70px; }
.message > div:last-child { width: fit-content; max-width: 610px; background: #f4f1ec; border-radius: 4px 12px 12px; padding: 11px; }
.message.client > div { background: #e7efeb; border-radius: 12px 4px 12px 12px; margin-left: auto; }
.message strong, .message span { font-size: 8px; }
.message span { color: #98928a; font-weight: 400; margin-left: 5px; }
.message p { margin: 5px 0 0; font-size: 9px; line-height: 1.55; color: #565852; }
.client-composer { border-top: 1px solid #ebe6de; padding-top: 15px; }
.client-composer textarea { width: 100%; min-height: 75px; resize: vertical; border: 1px solid #e4dfd7; border-radius: 8px; padding: 10px; outline: none; font: 10px "DM Sans"; }
.client-composer > div { display: flex; justify-content: space-between; margin-top: 7px; }
.client-composer button:first-child { border: 0; background: transparent; color: #807c75; font-size: 9px; }
.payment-method { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.payment-method span, .payment-method strong, .payment-method small { display: block; font-size: 9px; }
.payment-method span, .payment-method small { color: #938e87; }
.payment-method strong { margin: 5px 0; }
.client-toggle { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid #eee9e2; }
.client-toggle:first-of-type { border-top: 0; }
.client-toggle strong, .client-toggle small { display: block; font-size: 9px; }
.client-toggle small { color: #958f88; margin-top: 4px; font-size: 8px; }
.client-toggle input { accent-color: #668276; }
.client-signout { width: 100%; margin-top: 14px; border: 1px solid #eed9d2; background: #fff8f5; color: #b65e46; border-radius: 8px; padding: 10px; font-size: 9px; font-weight: 700; }
.client-footer { padding: 22px 4vw; background: white; border-top: 1px solid #e9e4dc; display: flex; justify-content: space-between; gap: 15px; color: #938e87; font-size: 8px; }
.client-footer p { margin: 0; }
.portal-tour-link { border: 0; background: none; padding: 0; font: inherit; color: #647c70; font-weight: 700; cursor: pointer; }
.portal-tour-link:hover { text-decoration: underline; }

/* Readable admin interface type scale */
body:not(.client-preview-mode) { font-size: 15px; }
body:not(.client-preview-mode) .app-shell { grid-template-columns: 270px 1fr; }
body:not(.client-preview-mode) .sidebar { width: 270px; padding: 28px 18px 20px; }
body:not(.client-preview-mode) .brand { font-size: 26px; }
body:not(.client-preview-mode) .brand-mark { width: 38px; height: 38px; font-size: 18px; }
body:not(.client-preview-mode) .create-button { padding: 14px 17px; font-size: 14px; }
body:not(.client-preview-mode) .nav-label { margin-top: 22px; font-size: 11px; }
body:not(.client-preview-mode) .nav-item { padding: 12px 14px; font-size: 15px; }
body:not(.client-preview-mode) .nav-item span:first-child { width: 23px; }
body:not(.client-preview-mode) .nav-badge { font-size: 11px; padding: 3px 7px; }
body:not(.client-preview-mode) .sidebar-foot { padding-top: 18px; }
body:not(.client-preview-mode) .sidebar-foot strong { font-size: 13px; }
body:not(.client-preview-mode) .sidebar-foot span { font-size: 11px; }
body:not(.client-preview-mode) .workspace-avatar,
body:not(.client-preview-mode) .avatar-button { width: 38px; height: 38px; font-size: 12px; }
body:not(.client-preview-mode) .topbar { height: 80px; padding: 0 38px; }
body:not(.client-preview-mode) .search-wrap { height: 44px; width: min(500px,52vw); }
body:not(.client-preview-mode) .search-wrap input { font-size: 14px; }
body:not(.client-preview-mode) .top-select { padding: 8px 9px; font-size: 12px; }
body:not(.client-preview-mode) .content { padding: 42px 42px 65px; }
body:not(.client-preview-mode) .eyebrow { font-size: 11px; margin-bottom: 9px; }
body:not(.client-preview-mode) h1 { font-size: clamp(34px,3vw,44px); }
body:not(.client-preview-mode) h2 { font-size: 26px; }
body:not(.client-preview-mode) .subtext { font-size: 14px; line-height: 1.5; }
body:not(.client-preview-mode) .page-head { margin-bottom: 32px; }
body:not(.client-preview-mode) .primary-button,
body:not(.client-preview-mode) .secondary-button,
body:not(.client-preview-mode) .quiet-button,
body:not(.client-preview-mode) .danger-button { padding: 12px 16px; font-size: 13px; }
body:not(.client-preview-mode) .grid { gap: 20px; }
body:not(.client-preview-mode) .metric-grid { margin-bottom: 29px; }
body:not(.client-preview-mode) .metric-card { padding: 23px; }
body:not(.client-preview-mode) .metric-label { font-size: 12px; }
body:not(.client-preview-mode) .metric-value { font-size: 34px; margin: 13px 0 7px; }
body:not(.client-preview-mode) .metric-detail { font-size: 12px; }
body:not(.client-preview-mode) .card { padding: 24px; }
body:not(.client-preview-mode) .card-head { margin-bottom: 20px; }
body:not(.client-preview-mode) .card-head h2,
body:not(.client-preview-mode) .card-head h3 { font-size: 16px; }
body:not(.client-preview-mode) .card-head button { font-size: 12px; }
body:not(.client-preview-mode) .activity-item { grid-template-columns: 38px 1fr auto; gap: 13px; padding: 15px 0; }
body:not(.client-preview-mode) .activity-icon { width: 36px; height: 36px; font-size: 13px; }
body:not(.client-preview-mode) .activity-item strong,
body:not(.client-preview-mode) .activity-item span { font-size: 13px; }
body:not(.client-preview-mode) .activity-item span,
body:not(.client-preview-mode) .activity-item time { font-size: 11px; }
body:not(.client-preview-mode) .task { grid-template-columns: 20px 1fr auto; gap: 11px; padding: 14px 0; }
body:not(.client-preview-mode) .task strong,
body:not(.client-preview-mode) .task span { font-size: 13px; }
body:not(.client-preview-mode) .task span { font-size: 11px; }
body:not(.client-preview-mode) .date-chip { padding: 5px 8px; font-size: 10px; }
body:not(.client-preview-mode) .pipeline { gap: 16px; }
body:not(.client-preview-mode) .pipeline-column { padding: 14px; }
body:not(.client-preview-mode) .pipeline-head { font-size: 10px; padding-bottom: 14px; }
body:not(.client-preview-mode) .pipeline-subtotal { padding: 11px 12px; }
body:not(.client-preview-mode) .pipeline-subtotal span { font-size: 9px; }
body:not(.client-preview-mode) .pipeline-subtotal strong { font-size: 13px; }
body:not(.client-preview-mode) .deal-move-actions span { font-size: 9px; }
body:not(.client-preview-mode) .deal-move-actions button { width: 29px; height: 29px; font-size: 13px; }
body:not(.client-preview-mode) .project-card { padding: 16px; margin-bottom: 11px; }
body:not(.client-preview-mode) .mini-avatar { width: 30px; height: 30px; font-size: 10px; }
body:not(.client-preview-mode) .project-card h3 { font-size: 14px; }
body:not(.client-preview-mode) .project-card p { font-size: 12px; }
body:not(.client-preview-mode) .project-foot { font-size: 11px; }
body:not(.client-preview-mode) .tag,
body:not(.client-preview-mode) .status { padding: 5px 8px; font-size: 10px; }
body:not(.client-preview-mode) .toolbar { margin-bottom: 19px; }
body:not(.client-preview-mode) .filter { padding: 9px 12px; font-size: 11px; }
body:not(.client-preview-mode) .data-table { font-size: 13px; }
body:not(.client-preview-mode) .data-table th { padding: 12px 14px; font-size: 10px; }
body:not(.client-preview-mode) .data-table td { padding: 17px 14px; }
body:not(.client-preview-mode) .client-cell { gap: 11px; }
body:not(.client-preview-mode) .client-cell span { font-size: 11px; }
body:not(.client-preview-mode) .project-layout { grid-template-columns: 290px 1fr; gap: 22px; }
body:not(.client-preview-mode) .large-avatar { width: 70px; height: 70px; }
body:not(.client-preview-mode) .contact-card h3 { font-size: 17px; }
body:not(.client-preview-mode) .contact-card p { font-size: 12px; }
body:not(.client-preview-mode) .contact-details { gap: 14px; }
body:not(.client-preview-mode) .contact-details label { font-size: 10px; }
body:not(.client-preview-mode) .contact-details span { font-size: 12px; }
body:not(.client-preview-mode) .tab { padding: 11px 13px; font-size: 12px; }
body:not(.client-preview-mode) .detail-card { padding: 18px; }
body:not(.client-preview-mode) .detail-card label { font-size: 10px; }
body:not(.client-preview-mode) .detail-card strong { font-size: 14px; }
body:not(.client-preview-mode) .document-row { grid-template-columns: 40px 1fr auto; gap: 13px; padding: 16px 0; }
body:not(.client-preview-mode) .doc-icon { width: 39px; height: 44px; font-size: 13px; }
body:not(.client-preview-mode) .document-row strong { font-size: 13px; }
body:not(.client-preview-mode) .document-row span { font-size: 11px; }
body:not(.client-preview-mode) .form-grid { gap: 16px; }
body:not(.client-preview-mode) .template-card { padding: 20px; min-height: 175px; }
body:not(.client-preview-mode) .template-icon { width: 38px; height: 38px; font-size: 14px; }
body:not(.client-preview-mode) .template-card h3 { font-size: 14px; }
body:not(.client-preview-mode) .template-card p { font-size: 11px; line-height: 1.5; }
body:not(.client-preview-mode) .flow-step { grid-template-columns: 31px 1fr auto; gap: 13px; padding: 16px; }
body:not(.client-preview-mode) .step-number { width: 31px; height: 31px; font-size: 11px; }
body:not(.client-preview-mode) .flow-step strong { font-size: 13px; }
body:not(.client-preview-mode) .flow-step span { font-size: 11px; }
body:not(.client-preview-mode) .field label { font-size: 10px; }
body:not(.client-preview-mode) .field input,
body:not(.client-preview-mode) .field select,
body:not(.client-preview-mode) .field textarea { padding: 12px; font-size: 13px; }
body:not(.client-preview-mode) .workload-row { grid-template-columns: 215px 1fr 390px; padding: 18px 0; }
body:not(.client-preview-mode) .workload-meta { font-size: 11px; }
body:not(.client-preview-mode) .workload-rates,
body:not(.client-preview-mode) .client-cell small { font-size: 10px; }
body:not(.client-preview-mode) .capacity-cells span { padding: 9px 4px; font-size: 10px; }
body:not(.client-preview-mode) .capacity-cells b { font-size: 9px; }
body:not(.client-preview-mode) .profit-row strong { font-size: 12px; }
body:not(.client-preview-mode) .profit-row span { font-size: 10px; }
body:not(.client-preview-mode) .base-currency-chip { padding: 10px 12px; font-size: 11px; }
body:not(.client-preview-mode) .insights-scope { font-size: 12px; }
body:not(.client-preview-mode) .rate-grid label,
body:not(.client-preview-mode) .rate-status,
body:not(.client-preview-mode) .currency-row { font-size: 11px; }
body:not(.client-preview-mode) .currency-preview span,
body:not(.client-preview-mode) .currency-preview small { font-size: 11px; }
body:not(.client-preview-mode) .currency-preview strong { font-size: 26px; }
body:not(.client-preview-mode) .modal { padding: 28px; }
body:not(.client-preview-mode) .modal h2 { font-size: 25px; }
body:not(.client-preview-mode) .toast { font-size: 13px; }
body:not(.client-preview-mode) .timesheet-head h2 { font-size: 23px; }
body:not(.client-preview-mode) .timesheet-head p { font-size: 13px; }
body:not(.client-preview-mode) .timesheet-summary strong,
body:not(.client-preview-mode) .timesheet-summary span { font-size: 12px; }
body:not(.client-preview-mode) .timesheet-table th,
body:not(.client-preview-mode) .timesheet-table td { padding: 12px; }
body:not(.client-preview-mode) .timesheet-table thead th,
body:not(.client-preview-mode) .timesheet-table td:first-child strong,
body:not(.client-preview-mode) .timesheet-table input { font-size: 11px; }
body:not(.client-preview-mode) .timesheet-table td:first-child span { font-size: 10px; }
body:not(.client-preview-mode) .timesheet-team article > div:not(.client-cell) strong { font-size: 12px; }
body:not(.client-preview-mode) .timesheet-team article > div:not(.client-cell) span { font-size: 10px; }

/* Readable client portal type scale */
.client-app { font-size: 15px; }
.client-header { min-height: 84px; grid-template-columns: 210px 1fr auto; }
.client-brand { font-size: 22px; }
.client-brand span { width: 38px; height: 38px; font-size: 15px; }
.client-header nav { height: 84px; }
.client-nav-item { padding: 0 12px; font-size: 12px; }
.client-header-actions select { padding: 9px; font-size: 12px; }
.client-user { font-size: 12px; }
.client-user span { width: 36px; height: 36px; font-size: 11px; }
.exit-preview { padding: 10px 12px; font-size: 11px; }
.client-main { width: min(1200px, 92vw); padding-top: 48px; }
.client-hero { min-height: 265px; padding: 46px 50px; }
.client-hero span { font-size: 14px; }
.client-hero h1 { font-size: 50px; }
.client-hero p { max-width: 600px; font-size: 15px; line-height: 1.65; }
.client-primary, .client-secondary { padding: 12px 17px; font-size: 13px; }
.client-primary.small { padding: 9px 12px; font-size: 11px; }
.client-stat-grid { gap: 16px; margin-bottom: 22px; }
.client-stat-grid article { padding: 22px; gap: 9px; }
.client-stat-grid span { font-size: 11px; }
.client-stat-grid strong { font-size: 29px; }
.client-stat-grid small { font-size: 11px; }
.client-dashboard-grid { gap: 18px; margin-bottom: 20px; }
.client-panel { padding: 25px; }
.client-panel-head { margin-bottom: 18px; }
.client-panel-head h2 { font-size: 17px; }
.client-panel-head > span { min-width: 25px; height: 25px; font-size: 11px; }
.client-panel-head button { font-size: 12px; }
.client-list-row { grid-template-columns: 44px 1fr auto; gap: 14px; padding: 17px 0; }
.client-list-row strong { font-size: 14px; }
.client-list-row span { font-size: 12px; margin-top: 5px; }
.client-file-icon { width: 42px; height: 46px; font-size: 14px; }
.client-empty { padding: 36px; font-size: 13px; }
.client-actions { gap: 11px; }
.client-actions button { min-height: 98px; font-size: 12px; gap: 8px; }
.client-actions b { width: 34px; height: 34px; font-size: 15px; }
.client-timeline { margin-top: 20px; }
.timeline div { gap: 6px; padding: 0 16px; }
.timeline i { width: 28px; height: 28px; margin-top: -15px; font-size: 11px; }
.timeline strong { margin-top: 10px; font-size: 13px; }
.timeline span { font-size: 11px; }
.client-page-head { margin-bottom: 30px; }
.client-page-head > span { font-size: 11px; }
.client-page-head h1 { font-size: 42px; }
.client-page-head p { font-size: 14px; line-height: 1.5; }
.client-cover { min-height: 225px; padding: 32px; }
.client-cover span { padding: 6px 9px; font-size: 11px; }
.client-cover h2 { max-width: 560px; font-size: 28px; }
.client-cover p { max-width: 650px; font-size: 13px; }
.milestones { gap: 9px; }
.milestones > div { grid-template-columns: 32px 1fr auto; gap: 13px; padding: 14px; }
.milestones i { width: 31px; height: 31px; font-size: 11px; }
.milestones strong, .milestones span { font-size: 13px; }
.client-person { grid-template-columns: 34px 1fr auto; gap: 12px; padding: 13px 0; }
.client-person .mini-avatar { width: 32px; height: 32px; font-size: 10px; }
.client-person strong { font-size: 13px; }
.client-person span { font-size: 11px; margin-top: 4px; }
.client-person button { width: 32px; height: 32px; }
.client-note { gap: 8px; }
.client-note > span { font-size: 11px; }
.client-note strong { font-size: 15px; }
.client-note p { font-size: 12px; }
.client-task-tabs button { padding: 11px 13px; font-size: 12px; }
.client-task { grid-template-columns: 21px 1fr auto; padding: 20px 5px; }
.client-task input { width: 17px; height: 17px; }
.client-task strong { font-size: 14px; }
.client-task small { font-size: 11px; margin-top: 5px; }
.client-file-toolbar span { font-size: 12px; }
.client-file-grid { gap: 15px; }
.client-file-grid article { padding: 13px; gap: 7px; }
.client-file-preview { height: 145px; font-size: 20px; }
.client-file-grid strong { font-size: 13px; }
.client-file-grid span { font-size: 11px; }
.client-file-grid button { font-size: 11px; }
.client-message-layout { grid-template-columns: 1fr 310px; gap: 18px; }
.client-thread { padding: 27px; }
.message { grid-template-columns: 34px 1fr; gap: 13px; margin-bottom: 24px; }
.message .mini-avatar { width: 32px; height: 32px; font-size: 10px; }
.message > div:last-child { padding: 15px; }
.message strong { font-size: 12px; }
.message span { font-size: 10px; }
.message p { margin-top: 7px; font-size: 13px; line-height: 1.6; }
.client-composer textarea { min-height: 105px; padding: 14px; font-size: 13px; }
.client-composer button:first-child { font-size: 12px; }
.payment-method span, .payment-method small { font-size: 11px; }
.payment-method strong { font-size: 14px; }
.client-toggle { padding: 16px 0; }
.client-toggle strong { font-size: 13px; }
.client-toggle small { font-size: 11px; }
.client-toggle input { width: 18px; height: 18px; }
.client-signout { padding: 13px; font-size: 12px; }
.client-invoice-file { display: block; width: max-content; margin-top: 6px; color: var(--accent-dark); font-size: 10px; font-weight: 700; text-decoration: none; }
.client-footer { font-size: 11px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 800px) {
  .app-shell, body:not(.client-preview-mode) .app-shell { display: block; }
  .sidebar { transform: translateX(-100%); transition: .25s; }
  body:not(.client-preview-mode) .sidebar { width: 270px; }
  .sidebar.open { transform: translateX(0); }
  .main, body:not(.client-preview-mode) .main { width: 100%; grid-column: auto; }
  .mobile-menu { display: block; border: 0; background: transparent; font-size: 18px; }
  .topbar, body:not(.client-preview-mode) .topbar { height: 68px; padding: 0 15px; }
  .search-wrap { width: 55vw; }
  .search-wrap kbd { display: none; }
  .content, body:not(.client-preview-mode) .content { padding: 26px 16px 48px; }
  .page-head { display: block; }
  .page-head .button-row { margin-top: 15px; }
  .project-layout { grid-template-columns: 1fr; }
  body:not(.client-preview-mode) .project-layout { grid-template-columns: 1fr; }
  .project-aside { position: static; }
  .portal-grid, .detail-grid { grid-template-columns: 1fr; }
  .workload-row { grid-template-columns: 1fr; gap: 9px; }
  body:not(.client-preview-mode) .workload-row { grid-template-columns: 1fr; }
  .workload-schedule { grid-template-columns: 1fr; }
  .timesheet-head { display: block; }
  .timesheet-head .button-row { margin-top: 14px; }
  .timesheet-team article { grid-template-columns: 1fr repeat(3,.5fr); }
  .timesheet-team article .status, .timesheet-team article > button { display: none; }
  .profit-row { grid-template-columns: 1.2fr repeat(3, .7fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .rates-card { grid-column: auto; }
  .rate-grid { grid-template-columns: repeat(2,1fr); }
  .client-header { grid-template-columns: auto 1fr auto; padding: 0 15px; }
  .client-header nav { position: fixed; bottom: 0; left: 0; right: 0; height: 68px; background: white; border-top: 1px solid #e7e2da; z-index: 50; justify-content: space-around; }
  .client-nav-item { padding: 7px; display: grid; place-items: center; gap: 3px; font-size: 9px; border-bottom: 0; border-top: 2px solid transparent; }
  .client-nav-item span { display: block; font-size: 14px; }
  .client-header-actions .client-user b { display: none; }
  .exit-preview { width: 30px; height: 30px; padding: 0; font-size: 0; }
  .exit-preview:before { content: "←"; font-size: 12px; }
  .client-main { padding-top: 25px; padding-bottom: 85px; }
  .client-dashboard-grid, .client-message-layout { grid-template-columns: 1fr; }
  .client-file-grid { grid-template-columns: repeat(2,1fr); }
  .client-footer { display: none; }
}
@media (max-width: 550px) {
  .metric-grid, .form-grid, .field-grid { grid-template-columns: 1fr; }
  .schedule-inputs { grid-template-columns: repeat(2,1fr); }
  .team-rate-row { grid-template-columns: 1fr; align-items: stretch; }
  .invoice-drive-row { grid-template-columns: auto 1fr; }
  .invoice-drive-row .secondary-button, .invoice-drive-row .quiet-button { width: 100%; }
  .profitability-report dl { grid-template-columns: repeat(2,1fr); }
  .top-actions .icon-button { display: none; }
  .top-select { padding: 5px; }
  .portal-shell { padding: 13px; }
  .portal-hero { display: block; }
  .portal-hero .primary-button { margin-top: 15px; }
  .data-table th:nth-child(3), .data-table td:nth-child(3) { display: none; }
  .client-hero { padding: 25px; display: block; }
  .client-hero .client-primary { margin-top: 18px; }
  .client-stat-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; gap: 15px; }
  .timeline div { border-top: 0; border-left: 2px solid #e8e4dd; padding: 0 0 8px 18px; }
  .timeline i { margin: 0 0 0 -30px; }
  .client-file-grid { grid-template-columns: 1fr; }
  .client-brand { font-size: 0; }
  .client-brand span { font-size: 11px; }
  #top-popover-root { top: 62px; right: 8px; }
  .top-popover { width: min(360px, calc(100vw - 16px)); }
}
/* ─── Identity & empty-state helpers ─── */
.task-row-wrap { display: flex; align-items: center; gap: 4px; }
.task-row-wrap .task { flex: 1; min-width: 0; }
.task-delete-btn { flex-shrink: 0; opacity: 0; transition: opacity .15s; padding: 4px 6px !important; }
.task-row-wrap:hover .task-delete-btn { opacity: 1; }
.empty-workspace-banner { text-align: center; padding: 48px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.empty-workspace-icon { font-size: 36px; margin-bottom: 12px; opacity: .5; }
.empty-workspace-banner h2 { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.empty-workspace-banner p { color: var(--muted); max-width: 420px; margin: 0 auto; }

/* ─── Standalone client portal (served at /portal; clients use this, not the in-app preview) ─── */
.client-standalone { margin: 0; font-family: "DM Sans", system-ui, sans-serif; background: #f7f4ef; }
.client-standalone .client-main { padding: 46px 0 70px; }
.client-standalone .client-header { padding: 0 4vw; }
.client-standalone .client-nav-item { font-size: 12px; padding: 0 12px; }
.client-standalone .client-user { font-size: 11px; }
.client-standalone .client-hero h1 { font-size: clamp(30px, 4vw, 44px); }
.client-standalone .client-hero span,
.client-standalone .client-hero p { font-size: 13px; }
.client-standalone .client-primary,
.client-standalone .client-secondary { font-size: 12px; padding: 11px 16px; }
.client-standalone .client-primary.small,
.client-standalone .client-secondary.small { font-size: 11px; padding: 8px 12px; }
.client-standalone .client-stat-grid span { font-size: 10px; }
.client-standalone .client-stat-grid strong { font-size: 26px; }
.client-standalone .client-stat-grid small { font-size: 11px; }
.client-standalone .client-panel-head h2 { font-size: 16px; }
.client-standalone .client-panel-head button,
.client-standalone .client-panel-head > span { font-size: 11px; }
.client-standalone .client-list-row strong,
.client-standalone .client-list-row span { font-size: 12px; }
.client-standalone .client-list-row span { font-size: 11px; }
.client-standalone .client-actions button { font-size: 11px; min-height: 86px; }
.client-standalone .client-actions b { font-size: 13px; width: 30px; height: 30px; }
.client-standalone .client-page-head h1 { font-size: clamp(26px, 3vw, 34px); }
.client-standalone .client-page-head > span { font-size: 10px; }
.client-standalone .client-page-head p { font-size: 13px; }
.client-standalone .timeline strong { font-size: 11px; }
.client-standalone .timeline span { font-size: 10px; }
.client-standalone .milestones strong,
.client-standalone .milestones span { font-size: 11px; }
.client-standalone .client-cover h2 { font-size: 22px; }
.client-standalone .client-cover span,
.client-standalone .client-cover p { font-size: 11px; }
.client-standalone .client-person strong { font-size: 11px; }
.client-standalone .client-person span { font-size: 10px; }
.client-standalone .client-task strong { font-size: 13px; }
.client-standalone .client-task small { font-size: 11px; }
.client-standalone .client-file-grid strong { font-size: 11px; }
.client-standalone .client-file-grid span,
.client-standalone .client-file-grid button { font-size: 10px; }
.client-standalone .message strong,
.client-standalone .message span { font-size: 11px; }
.client-standalone .message p { font-size: 13px; }
.client-standalone .client-composer textarea { font-size: 13px; }
.client-standalone .client-composer button { font-size: 12px; }
.client-standalone .client-toggle strong { font-size: 12px; }
.client-standalone .client-toggle small { font-size: 11px; }
.client-standalone .client-footer { padding: 24px 4vw; font-size: 11px; }
.client-standalone .status { font-size: 11px; padding: 4px 8px; }

/* Magic-link / sign-in screen */
.portal-auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(150deg, #f7f4ef, #eef1ee); }
.portal-auth-card { width: min(440px, 94vw); background: white; border: 1px solid #e9e4dc; border-radius: 16px; padding: 38px 34px; box-shadow: 0 18px 50px rgba(49,44,38,.08); text-align: center; }
.portal-auth-brand { width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 12px 12px 12px 4px; display: grid; place-items: center; background: #647c70; color: white; font: 700 18px "DM Sans"; }
.portal-auth-card h1 { font: 700 24px "Playfair Display"; margin: 0 0 8px; color: #2c2b28; }
.portal-auth-card p { color: #837f78; font-size: 13px; line-height: 1.55; margin: 0 0 22px; }
.portal-auth-card form { display: grid; gap: 12px; text-align: left; }
.portal-auth-card label { font-size: 11px; font-weight: 700; color: #6b6760; text-transform: uppercase; letter-spacing: .06em; }
.portal-auth-card input { width: 100%; box-sizing: border-box; border: 1px solid #e1dbd2; border-radius: 9px; padding: 12px 13px; font: 14px "DM Sans"; outline: none; }
.portal-auth-card input:focus { border-color: #647c70; }
.portal-auth-card .client-primary { width: 100%; justify-content: center; padding: 13px; }
.portal-auth-note { margin-top: 18px; font-size: 12px; color: #7b8e84; }
.portal-auth-error { background: #fbeee9; border: 1px solid #f0d6cc; color: #b15639; border-radius: 9px; padding: 11px 13px; font-size: 12px; margin-bottom: 18px; text-align: left; }
.portal-auth-success { background: #ecf3ef; border: 1px solid #cfe0d7; color: #4d6a5b; border-radius: 9px; padding: 14px; font-size: 13px; line-height: 1.5; }
.portal-loading { min-height: 100vh; display: grid; place-items: center; color: #7b8e84; font-size: 13px; }

/* Payment-received banner */
.portal-banner { background: #ecf3ef; border: 1px solid #cfe0d7; color: #4d6a5b; border-radius: 11px; padding: 14px 18px; font-size: 13px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.portal-banner b { font-size: 16px; }
.portal-banner.warn { background: #fbf3e9; border-color: #f0e0cc; color: #97703f; }

/* ─── Pipeline stage rows (settings modal) ─── */
.pipeline-stage-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pipeline-stage-row .pipeline-remove-btn { flex-shrink: 0; font-size: 16px; padding: 6px 8px; line-height: 1; border: 0; background: none; }
.pipeline-drag-handle { flex-shrink: 0; color: #bbb5ad; font-size: 11px; letter-spacing: -2px; cursor: grab; user-select: none; padding: 4px 2px; }
.pipeline-drag-handle:active { cursor: grabbing; }
.pipeline-move-btn { flex-shrink: 0; padding: 4px 6px; font-size: 12px; line-height: 1; }
.pipeline-lock-icon { flex-shrink: 0; font-size: 12px; opacity: 0.45; }
.pipeline-stage-row.pipeline-row-dragging { opacity: 0.38; }
.pipeline-stage-row.pipeline-row-drag-over { border-top: 2px solid var(--sage); margin-top: -2px; }

/* ─── Projects list view ─── */
.table-progress { width: 120px; }

/* Theme toggle (admin topbar + portal header). Layout only — colors follow theme. */
.theme-toggle { font-size: 14px; line-height: 1; }
/* Keep the portal toggle a normal pill even at the mobile breakpoint, where bare
   .exit-preview collapses to a 30×30 "←" icon meant only for the Sign-out button. */
.exit-preview.theme-toggle { width: auto; height: auto; padding: 8px 10px; font-size: 14px; }
.exit-preview.theme-toggle::before { content: ""; }

/* ════════════════════════════════════════════════════════════════════════════
   DARK THEME — activated by <html data-theme="dark"> (set by theme.js).
   Light mode is the default above and is intentionally left untouched; every
   dark rule is isolated here. Redefining the palette variables flips everything
   that is variable-driven; the rest are targeted overrides of hard-coded colors.
   ════════════════════════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ece8e2;
  --muted: #9d978d;
  --line: #36332e;
  --paper: #201e1b;
  --white: #292723;
  --accent: #e08562;
  --accent-dark: #ef9879;
  --accent-soft: #3a2a23;
  --sage: #8bb09c;
  --sage-soft: #26332c;
  --gold: #cda75e;
  --gold-soft: #332b1c;
  --blue: #88a4b7;
  --blue-soft: #243038;
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
  /* dark-only surface tokens used by the overrides below */
  --surface: #292723;
  --surface-raised: #322f2a;
  --surface-sunken: #1b1a17;
}
html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }

/* ── Login screen ── */
html[data-theme="dark"] .login-screen { background: radial-gradient(circle at 20% 20%, #33231d, transparent 42%), linear-gradient(135deg, #1d1b18, #1a1d1b); }
html[data-theme="dark"] .login-card { background: rgba(41, 39, 35, .96); border-color: rgba(255, 255, 255, .06); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .login-error { background: #3a2622; border-color: #5a3b34; color: #e8a99a; }

/* ── Sidebar (already dark; deepen slightly to sit below the canvas) ── */
html[data-theme="dark"] .sidebar { background: #161512; color: #e7e2da; }
html[data-theme="dark"] .workspace-avatar, html[data-theme="dark"] .avatar-button { background: #4a342b; color: #f1cdbc; }

/* ── Topbar, search, selects ── */
html[data-theme="dark"] .topbar { background: rgba(32, 30, 27, .9); }
html[data-theme="dark"] .search-wrap { color: var(--muted); }
html[data-theme="dark"] kbd { background: var(--surface); }
html[data-theme="dark"] .top-select { background: var(--surface); }
html[data-theme="dark"] .top-actions .icon-button:hover { background: var(--surface-raised); }

/* ── Popovers ── */
html[data-theme="dark"] .top-popover { background: var(--surface); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
html[data-theme="dark"] .popover-head button, html[data-theme="dark"] .modal-close { background: var(--paper); }
html[data-theme="dark"] .popover-section > button:hover, html[data-theme="dark"] .profile-links button:hover, html[data-theme="dark"] .workspace-switch button:hover { background: var(--surface-raised); }
html[data-theme="dark"] .popover-footer { background: var(--surface-sunken); }
html[data-theme="dark"] .popover-notification { background: var(--surface); }
html[data-theme="dark"] .popover-notification:hover, html[data-theme="dark"] .popover-notification.unread { background: var(--surface-raised); }

/* ── Buttons ── */
html[data-theme="dark"] .secondary-button { background: var(--surface); }
html[data-theme="dark"] .secondary-button:hover, html[data-theme="dark"] .quiet-button:hover { background: var(--surface-raised); border-color: #4c473f; }
html[data-theme="dark"] .danger-button { background: #3a2422; border-color: #5a3530; color: #e8a298; }

/* ── Cards / surfaces ── */
html[data-theme="dark"] .metric-card, html[data-theme="dark"] .card { background: var(--surface); box-shadow: none; }
html[data-theme="dark"] .active-timer-banner { background: linear-gradient(120deg, #1f2a25, #262420); border-color: #324339; box-shadow: none; }
html[data-theme="dark"] .timer-stop-button { background: #3a2622; border-color: #5a3b34; color: #e8a99a; }
html[data-theme="dark"] .timer-stop-button:hover { background: #46302b; }
html[data-theme="dark"] .timer-modal-intro > span { background: var(--surface); }

/* ── Status pills (hard-coded variants) ── */
html[data-theme="dark"] .status.overdue, html[data-theme="dark"] .status.action { background: #3a2624; color: #e69a8e; }
html[data-theme="dark"] .status.draft, html[data-theme="dark"] .status.inactive, html[data-theme="dark"] .status.non-billable { background: #2e2c28; color: var(--muted); }
html[data-theme="dark"] .danger-text, html[data-theme="dark"] .over { color: #e08a7e; }

/* ── Pipeline / deals / projects ── */
html[data-theme="dark"] .pipeline-column { background: var(--surface-sunken); }
html[data-theme="dark"] .pipeline-head span:last-child { background: var(--surface); }
html[data-theme="dark"] .pipeline-subtotal { border-color: #324339; }
html[data-theme="dark"] .pipeline-subtotal strong { color: var(--sage); }
html[data-theme="dark"] .deal-move-actions button, html[data-theme="dark"] .deal-outcome-actions button { background: var(--surface); }
html[data-theme="dark"] .deal-outcome-actions .win-deal { color: var(--sage); border-color: #3a4a40; background: var(--sage-soft); }
html[data-theme="dark"] .deal-outcome-actions .lose-deal { color: #d99a8f; border-color: #4a3531; background: #33231f; }
html[data-theme="dark"] .lost-column { background: #241f1d; }
html[data-theme="dark"] .lost-deal .tag { background: #3a2a28; color: #d99a90; }
html[data-theme="dark"] .deal-dropzone.drag-over, html[data-theme="dark"] .project-dropzone.drag-over { background: #26332c; }
html[data-theme="dark"] .deal-dropzone.drag-over .deal-drop-hint, html[data-theme="dark"] .project-dropzone.drag-over .project-drop-hint { background: var(--surface); }
html[data-theme="dark"] .project-card, html[data-theme="dark"] .flow-step { background: var(--surface); }
html[data-theme="dark"] .mini-avatar { background: #4a342b; color: #f1cdbc; }
html[data-theme="dark"] .large-avatar { background: #4a342b; color: #f1cdbc; }
html[data-theme="dark"] .pipeline-stage-row.pipeline-row-drag-over { border-top-color: var(--sage); }

/* ── Tables / filters / invoices ── */
html[data-theme="dark"] .filter, html[data-theme="dark"] .invoice-actions button { background: var(--surface); }
html[data-theme="dark"] .invoice-actions .pay-action { border-color: #3a4a40; background: var(--sage-soft); color: var(--sage); }
html[data-theme="dark"] .invoice-file-badge, html[data-theme="dark"] .invoice-drive-icon, html[data-theme="dark"] .invoice-paid-note { color: var(--sage); }
html[data-theme="dark"] .invoice-detail-summary > div { background: var(--surface); }
html[data-theme="dark"] .progress { background: #34302b; }

/* ── Forms / modals ── */
html[data-theme="dark"] .modal { background: var(--surface); }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .field input, html[data-theme="dark"] .field select, html[data-theme="dark"] .field textarea { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .rate-grid input, html[data-theme="dark"] .team-rate-row input { color: var(--ink); }
html[data-theme="dark"] .insights-period-list button { background: var(--surface); }
html[data-theme="dark"] .insights-period-list button.active { border-color: #3a4a40; background: var(--sage-soft); color: var(--sage); }

/* ── Capacity / timesheets ── */
html[data-theme="dark"] .capacity-cells span.busy { background: #3a2624; color: #e69a8e; }
html[data-theme="dark"] .timesheet-table { background: var(--surface); }
html[data-theme="dark"] .timesheet-table input:hover, html[data-theme="dark"] .timesheet-table input:focus { background: var(--surface-raised); }
html[data-theme="dark"] .timesheet-total td { background: var(--surface-sunken); }
html[data-theme="dark"] .timesheet-ring:after { background: var(--surface); }
html[data-theme="dark"] .timesheet-ring { background: conic-gradient(var(--sage) 0 17%, #34322d 17% 100%); }

/* ── Empty-state helpers ── */
html[data-theme="dark"] .empty-workspace-banner { background: var(--surface); }

/* ════════════ Client portal (in-app preview + standalone) ════════════ */
html[data-theme="dark"] .client-app { background: var(--paper); color: var(--ink); }
html[data-theme="dark"] .client-standalone { background: var(--paper); }
html[data-theme="dark"] .portal-shell { background: var(--surface-sunken); }
html[data-theme="dark"] .portal-loading { color: var(--muted); }

html[data-theme="dark"] .client-header { background: rgba(32, 30, 27, .92); border-bottom-color: var(--line); }
html[data-theme="dark"] .client-brand { color: var(--ink); }
html[data-theme="dark"] .client-brand span, html[data-theme="dark"] .portal-auth-brand { background: var(--sage); color: #15201b; }
html[data-theme="dark"] .client-nav-item { color: var(--muted); }
html[data-theme="dark"] .client-nav-item:hover, html[data-theme="dark"] .client-nav-item.active { color: var(--sage); border-color: var(--sage); }
html[data-theme="dark"] .client-header-actions select, html[data-theme="dark"] .exit-preview { background: var(--surface); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .client-user { color: var(--ink); }
html[data-theme="dark"] .client-user span { background: #4a342b; color: #f1cdbc; }

html[data-theme="dark"] .client-hero { background: linear-gradient(130deg, #1c2622, #2c3a33); }
html[data-theme="dark"] .client-stat-grid article, html[data-theme="dark"] .client-panel, html[data-theme="dark"] .client-thread, html[data-theme="dark"] .portal-card { background: var(--surface); border-color: var(--line); }
html[data-theme="dark"] .client-secondary { background: var(--surface); border-color: var(--line); color: var(--sage); }
html[data-theme="dark"] .client-stat-grid strong { color: var(--ink); }
html[data-theme="dark"] .client-progress, html[data-theme="dark"] .client-progress.large { background: #34302b; }
html[data-theme="dark"] .client-panel-head button, html[data-theme="dark"] .client-file-grid button, html[data-theme="dark"] .client-note > span, html[data-theme="dark"] .client-page-head > span { color: var(--accent); }
html[data-theme="dark"] .client-panel-head > span { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .client-list-row, html[data-theme="dark"] .client-person, html[data-theme="dark"] .client-task, html[data-theme="dark"] .client-toggle { border-color: var(--line); }
html[data-theme="dark"] .client-list-row span, html[data-theme="dark"] .client-empty, html[data-theme="dark"] .client-file-toolbar span, html[data-theme="dark"] .client-file-grid span, html[data-theme="dark"] .client-note p, html[data-theme="dark"] .client-person span, html[data-theme="dark"] .client-cover p, html[data-theme="dark"] .milestones span, html[data-theme="dark"] .timeline span, html[data-theme="dark"] .client-page-head p, html[data-theme="dark"] .client-task small, html[data-theme="dark"] .payment-method span, html[data-theme="dark"] .payment-method small, html[data-theme="dark"] .client-toggle small, html[data-theme="dark"] .client-footer, html[data-theme="dark"] .message span, html[data-theme="dark"] .message p { color: var(--muted); }
html[data-theme="dark"] .client-file-icon { background: var(--sage-soft); color: var(--sage); }
html[data-theme="dark"] .client-file-icon.money-icon { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] .client-actions button { background: var(--surface); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .client-actions button:hover { background: var(--surface-raised); border-color: #3a4a40; }
html[data-theme="dark"] .client-actions b { background: var(--sage-soft); color: var(--sage); }

html[data-theme="dark"] .timeline div { border-top-color: #34302b; }
html[data-theme="dark"] .timeline i { background: var(--surface); border-color: #46423b; color: var(--muted); }
html[data-theme="dark"] .timeline .done i, html[data-theme="dark"] .timeline .current i, html[data-theme="dark"] .timeline .done, html[data-theme="dark"] .timeline .current { border-color: var(--sage); }
html[data-theme="dark"] .timeline .done i, html[data-theme="dark"] .timeline .current i { background: var(--sage); color: #15201b; }
html[data-theme="dark"] .client-cover { background: linear-gradient(140deg, #2a2620, #283732); color: var(--ink); }
html[data-theme="dark"] .client-cover span { background: var(--surface); color: var(--sage); }
html[data-theme="dark"] .client-cover h2, html[data-theme="dark"] .client-cover p { color: var(--ink); }
html[data-theme="dark"] .milestones > div { border-color: var(--line); }
html[data-theme="dark"] .milestones i { background: #34302b; color: var(--muted); }
html[data-theme="dark"] .milestones .complete i, html[data-theme="dark"] .milestones .active i { background: var(--sage-soft); color: var(--sage); }
html[data-theme="dark"] .milestones .active { border-color: #3a4a40; background: var(--surface); }
html[data-theme="dark"] .client-person button { background: var(--sage-soft); color: var(--sage); }
html[data-theme="dark"] .client-task-tabs { border-bottom-color: var(--line); }
html[data-theme="dark"] .client-task-tabs button { color: var(--muted); }
html[data-theme="dark"] .client-task-tabs button.active { color: var(--sage); border-color: var(--sage); }
html[data-theme="dark"] .client-task > b { color: var(--sage); }
html[data-theme="dark"] .client-file-grid article { border-color: var(--line); }
html[data-theme="dark"] .client-file-preview { background: linear-gradient(135deg, #2a302c, #2e2823); color: var(--sage); }

html[data-theme="dark"] .message > div:last-child { background: #2f2d29; }
html[data-theme="dark"] .message.client > div { background: var(--sage-soft); }
html[data-theme="dark"] .client-composer { border-top-color: var(--line); }
html[data-theme="dark"] .client-composer textarea { background: var(--surface); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .payment-method strong, html[data-theme="dark"] .client-toggle strong, html[data-theme="dark"] .client-list-row strong, html[data-theme="dark"] .client-person strong, html[data-theme="dark"] .client-task strong, html[data-theme="dark"] .client-note strong, html[data-theme="dark"] .client-file-grid strong, html[data-theme="dark"] .milestones strong, html[data-theme="dark"] .timeline strong { color: var(--ink); }
html[data-theme="dark"] .client-toggle input, html[data-theme="dark"] .client-task input { accent-color: var(--sage); }
html[data-theme="dark"] .client-signout { background: #3a2422; border-color: #5a3530; color: #e8a298; }
html[data-theme="dark"] .client-footer { background: var(--surface); border-top-color: var(--line); }
html[data-theme="dark"] .portal-tour-link { color: var(--sage); }

/* ── Portal sign-in / magic-link screen ── */
html[data-theme="dark"] .portal-auth { background: linear-gradient(150deg, #1d1b18, #1a1d1b); }
html[data-theme="dark"] .portal-auth-card { background: var(--surface); border-color: var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); }
html[data-theme="dark"] .portal-auth-card h1 { color: var(--ink); }
html[data-theme="dark"] .portal-auth-card p, html[data-theme="dark"] .portal-auth-note { color: var(--muted); }
html[data-theme="dark"] .portal-auth-card label { color: var(--muted); }
html[data-theme="dark"] .portal-auth-card input { background: var(--surface-sunken); border-color: var(--line); color: var(--ink); }
html[data-theme="dark"] .portal-auth-card input:focus { border-color: var(--sage); }
html[data-theme="dark"] .portal-auth-error { background: #3a2622; border-color: #5a3b34; color: #e8a99a; }
html[data-theme="dark"] .portal-auth-success, html[data-theme="dark"] .portal-banner { background: var(--sage-soft); border-color: #3a4a40; color: var(--sage); }
html[data-theme="dark"] .portal-banner.warn { background: var(--gold-soft); border-color: #4a3f28; color: var(--gold); }

/* ── Portal mobile bottom nav (matches the max-width:800px rule above) ── */
@media (max-width: 800px) {
  html[data-theme="dark"] .client-header nav { background: var(--surface); border-top-color: var(--line); }
}
