:root {
  --ink: #07090c;
  --slate: #1c2633;
  --blue: #2f6dd4;
  --yellow: #f1ee00;
  --orange: #ff9d0a;
  --green: #4ebd43;
  --red: #ff3150;
  --paper: #f5f4ee;
  --cloud: #e7e9e6;
  --muted: #667078;
  --line: rgba(7, 9, 12, .14);
  --display: "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--cloud); font-family: var(--sans); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.portal-shell { width: min(1440px, 100%); min-height: 100vh; margin: auto; background: var(--paper); }
.portal-top { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 0 32px; color: white; background: var(--ink); }
.portal-brand { width: 145px; line-height: 0; }
.portal-brand img { width: 100%; height: auto; }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.back-link:hover { color: var(--yellow); }
.demo-bar { display: flex; align-items: center; gap: 12px; padding: 9px 32px; color: #554b00; background: var(--yellow); font-size: 11px; line-height: 1.35; }
.demo-bar b { flex: 0 0 auto; color: var(--ink); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.local-link { margin-left: auto; padding: 5px 8px; border: 1px solid rgba(7,9,12,.26); color: var(--ink); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.local-link:hover { color: white; background: var(--ink); }
.demo-control { margin-left: auto; border: 0; padding: 7px 10px; color: white; background: var(--ink); font-size: 9px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.demo-control:hover { color: var(--ink); background: white; }

/* Keep sign-in hidden until session restoration has completed. */
.portal-loading { min-height: calc(100vh - 110px); display: grid; place-content: center; padding: 48px 24px; text-align: center; }
.portal-loading h1 { margin: 20px 0 12px; font: 800 clamp(24px, 4vw, 34px)/1.15 var(--sans); letter-spacing: -.025em; }
.portal-loading p { max-width: 430px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.6; }
.portal-loading-spinner { display: block; width: 36px; height: 36px; margin: auto; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: portal-loading-spin .8s linear infinite; }
@keyframes portal-loading-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .portal-loading-spinner { animation: none; } }

/* Sign in */
.auth-view { min-height: calc(100vh - 110px); display: grid; grid-template-columns: 1.08fr .92fr; }
.auth-intro { position: relative; display: flex; align-items: end; min-height: 580px; padding: 74px clamp(35px, 7vw, 105px); overflow: hidden; color: white; background: var(--slate); }
.auth-intro::before { content: ""; position: absolute; width: 570px; height: 570px; top: -91px; right: -242px; border: 57px solid var(--blue); border-radius: 50%; box-shadow: 0 0 0 57px rgba(78,189,67,.28), 0 0 0 114px rgba(255,157,10,.14); }
.auth-intro::after { content: ""; position: absolute; width: 175px; height: 175px; right: 17%; bottom: -60px; border: 25px solid var(--yellow); transform: rotate(45deg); }
.auth-intro-inner { position: relative; z-index: 1; max-width: 600px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 10px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 25px; height: 3px; background: var(--yellow); }
.auth-intro h1 { margin: 0; font: 900 clamp(56px, 7vw, 97px)/.81 var(--display); letter-spacing: -.065em; text-transform: uppercase; }
.auth-intro h1 span { color: var(--yellow); }
.auth-intro p { max-width: 440px; margin: 25px 0 0; color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.6; }
.auth-panel { display: grid; place-items: center; padding: 50px 44px; background: var(--paper); }
.auth-card { width: min(100%, 407px); }
.auth-card h2 { margin: 0; font: 900 44px/.86 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
.auth-card > p { margin: 15px 0 32px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.form-field { position: relative; margin-bottom: 26px; }
.form-field label { display: block; margin-bottom: 8px; font-size: 9px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.form-field input, .form-field textarea, .form-field select { width: 100%; border: 0; border-bottom: 1px solid var(--line); outline: 0; padding: 11px 0; color: var(--ink); background: transparent; border-radius: 0; font-size: 14px; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus { border-color: var(--blue); }
.form-field textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.text-button { border: 0; padding: 4px 0; color: var(--muted); background: none; border-bottom: 1px solid currentColor; font-size: 10px; font-weight: 800; letter-spacing: .07em; }
.text-button:hover { color: var(--blue); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 48px; padding: 10px 13px 10px 18px; border: 1px solid var(--ink); color: white; background: var(--ink); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; transition: transform .16s, background .16s, color .16s; }
.primary-button:hover { color: var(--ink); background: var(--yellow); border-color: var(--yellow); transform: translateY(-2px); }
.primary-button i { display: grid; place-items: center; width: 25px; height: 25px; color: var(--ink); background: var(--yellow); border-radius: 50%; font-size: 16px; font-style: normal; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; padding: 10px 13px; border: 1px solid var(--line); color: var(--ink); background: transparent; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.secondary-button:hover { border-color: var(--blue); color: var(--blue); }
.auth-note { display: flex; align-items: start; gap: 9px; margin-top: 31px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.auth-note b { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; color: white; background: var(--green); border-radius: 50%; font-size: 11px; }
.auth-message { min-height: 18px; margin: 17px 0 -7px; color: #b42318; font-size: 11px; line-height: 1.45; }
.auth-message.success { color: #276714; }
.mfa-code { display: flex; gap: 9px; }
.mfa-code input { width: 44px; height: 51px; padding: 0; border: 1px solid var(--line); text-align: center; font: 900 23px/1 var(--display); background: white; }
.mfa-qr { display: block; width: 196px; height: 196px; margin: -8px 0 26px; padding: 12px; border: 1px solid var(--line); background: white; }

/* App framework */
.app-view { min-height: calc(100vh - 110px); background: #eff1ee; }
.app-nav { min-height: 78px; display: flex; align-items: center; gap: 26px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--paper); }
.account-menu { position: relative; margin-left: auto; }
.account-menu-toggle { display: flex; align-items: center; gap: 10px; border: 0; padding: 8px 0 8px 10px; color: var(--ink); background: transparent; font-size: 11px; font-weight: 800; }
.account-menu-toggle:hover .avatar { box-shadow: 0 0 0 3px rgba(47,109,212,.17); }
.account-menu-popover { position: absolute; z-index: 10; top: calc(100% + 8px); right: 0; min-width: 158px; padding: 6px; border: 1px solid var(--line); background: white; box-shadow: 0 13px 30px rgba(7,9,12,.14); }
.account-menu-item { display: block; width: 100%; padding: 11px 12px; border: 0; color: var(--ink); background: transparent; text-align: left; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.account-menu-item:hover { color: var(--ink); background: var(--yellow); }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: white; background: var(--blue); background-position: center; background-size: cover; font-size: 11px; font-weight: 850; overflow: hidden; }
.avatar--photo { color: transparent; }
.nav-tab { position: relative; padding: 31px 0 28px; color: var(--muted); border: 0; background: transparent; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.nav-tab::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: var(--blue); transform: scaleX(0); transition: transform .16s; }
.nav-tab.active, .nav-tab:hover { color: var(--ink); }
.nav-tab.active::after { transform: scaleX(1); }
.app-main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 47px 0 66px; }
.page-title-row { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 34px; }
.page-title-row h1 { margin: 0; font: 900 52px/.85 var(--display); letter-spacing: -.06em; text-transform: uppercase; }
#client-view .page-title-row h1 { font: 900 49px/.84 var(--display); letter-spacing: -.055em; }
.page-title-row p { max-width: 400px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.48; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 8px; color: #3a690d; background: #e9f7ca; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill--blue { color: #1c52a8; background: #d8e6ff; }
.status-pill--orange { color: #8c5000; background: #ffebc9; }
.status-pill--gray { color: #535b62; background: #e1e4e1; }
.status-pill--red { color: #9e2633; background: #ffe0e4; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 30px; }
.metric { padding: 18px; background: white; border: 1px solid rgba(7,9,12,.08); }
.metric span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.metric b { display: block; margin-top: 9px; font: 900 30px/.9 var(--display); letter-spacing: -.04em; }
.dashboard-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 17px; }
.surface { border: 1px solid rgba(7,9,12,.1); background: white; }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 22px; border-bottom: 1px solid var(--line); }
.surface-heading h2 { margin: 0; font: 900 25px/.9 var(--display); letter-spacing: -.045em; text-transform: uppercase; }
.surface-heading a { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.project-card { padding: 23px; border-bottom: 1px solid var(--line); }
.project-card:last-child { border-bottom: 0; }
.project-card-top { display: flex; justify-content: space-between; gap: 15px; align-items: start; }
.project-code { color: var(--blue); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.project-card h3 { margin: 7px 0 8px; font: 900 31px/.92 var(--display); letter-spacing: -.045em; text-transform: uppercase; }
.project-card p { max-width: 500px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.52; }
.project-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 21px; padding-top: 16px; border-top: 1px solid var(--line); }
.project-meta span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.project-meta b { display: block; margin-top: 5px; font-size: 12px; }
.project-card-action { margin-top: 18px; }
.timeline { padding: 7px 22px 19px; }
.timeline-item { display: grid; grid-template-columns: 16px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #eaf7de; }
.timeline-item.pending .timeline-dot { background: var(--orange); box-shadow: 0 0 0 4px #fff2de; }
.timeline-item h3 { margin: 0; font-size: 12px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.timeline-item time { display: block; margin-top: 5px; color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.file-list { padding: 0 22px 14px; }
.file-row { display: flex; align-items: center; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.file-row:last-child { border-bottom: 0; }
.file-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; color: var(--blue); background: #e7efff; font: 900 10px/1 var(--display); }
.file-row b { display: block; font-size: 11px; }
.file-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.file-row button { border: 0; color: var(--blue); background: none; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.file-row > button { margin-left: auto; }
.file-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.file-actions .file-delete { display: grid; place-items: center; width: 27px; height: 27px; padding: 0; color: #a72737; border: 1px solid #f0c4cb; background: #fff6f7; font-size: 13px; letter-spacing: 0; }
.file-actions .file-delete:hover { color: white; border-color: #a72737; background: #a72737; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; gap: 17px; }
.admin-side { align-self: start; padding: 12px; background: var(--ink); color: white; }
.admin-side button { width: 100%; padding: 13px 12px; border: 0; text-align: left; color: rgba(255,255,255,.68); background: transparent; font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.admin-side button.active, .admin-side button:hover { color: var(--ink); background: var(--yellow); }
.admin-content { min-width: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font: 900 49px/.84 var(--display); letter-spacing: -.055em; text-transform: uppercase; }
.admin-head p { margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.admin-head .eyebrow { margin-bottom: 13px; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.project-table { overflow: hidden; border: 1px solid var(--line); background: white; }
.list-controls { display: grid; grid-template-columns: minmax(180px, 1.75fr) repeat(4, minmax(110px, .8fr)) auto; gap: 11px; align-items: end; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #f7f8f6; }
.list-controls--clients { grid-template-columns: minmax(190px, 1.6fr) minmax(130px, .8fr) minmax(130px, .8fr) auto; }
.filter-field label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.filter-field input, .filter-field select { width: 100%; min-height: 34px; padding: 8px 9px; border: 1px solid var(--line); color: var(--ink); background: white; font: 700 11px/1 var(--sans); }
.filter-clear { min-height: 34px; white-space: nowrap; }
.table-row { display: grid; grid-template-columns: 1.25fr .9fr .8fr .7fr .78fr .45fr; gap: 15px; align-items: center; padding: 17px 18px; border-bottom: 1px solid var(--line); }
.table-row:last-child { border-bottom: 0; }
.table-row.table-head { color: var(--muted); background: #f7f8f6; font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.table-row b { font-size: 12px; }
.table-row span { color: var(--muted); font-size: 11px; }
.table-status-mobile { display: none; }
.table-actions { display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; white-space: nowrap; }
.row-action { border: 0; padding: 6px 0; color: var(--blue); background: none; font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.row-action--delete { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid #f0c4cb; color: #a72737; background: #fff6f7; font-size: 12px; letter-spacing: 0; }
.row-action--delete:hover { border-color: #a72737; color: white; background: #a72737; text-decoration: none; }
.row-action--delete:disabled { cursor: not-allowed; color: #a6abad; text-decoration: none; }
.admin-form { display: none; margin-top: 18px; padding: 23px; border: 1px solid var(--line); background: white; }
.admin-form.show { display: block; }
.admin-form h2 { margin: 0 0 24px; font: 900 31px/.9 var(--display); letter-spacing: -.05em; text-transform: uppercase; }
.form-help { margin: -11px 0 22px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.form-foot--split { justify-content: space-between; align-items: center; }
.form-foot-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.delete-client-button { border: 0; padding: 8px 0; color: #b42318; background: transparent; font: 850 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.delete-client-button:hover { color: #7a1510; text-decoration: underline; }
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 25px; overflow-y: auto; background: rgba(8, 12, 15, .58); }
.modal-dialog { position: relative; width: min(100%, 650px); max-height: calc(100vh - 50px); overflow-y: auto; border: 1px solid var(--line); background: white; box-shadow: 0 28px 70px rgba(0, 0, 0, .28); }
.modal-dialog--wide { width: min(100%, 920px); }
.modal-backdrop .admin-form { display: block; margin: 0; padding: 31px; border: 0; }
.modal-close { position: absolute; z-index: 1; top: 12px; right: 13px; width: 34px; height: 34px; border: 1px solid var(--line); color: var(--ink); background: white; font: 400 24px/1 var(--sans); }
.modal-close:hover { border-color: var(--blue); color: var(--blue); }
.inline-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.inline-actions .secondary-button { min-height: 34px; padding: 7px 10px; }
.client-picker-results { position: absolute; z-index: 5; top: calc(100% - 20px); right: 0; left: 0; max-height: 223px; overflow-y: auto; border: 1px solid var(--line); background: white; box-shadow: 0 14px 28px rgba(7,9,12,.12); }
.client-picker-result { display: block; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); background: white; text-align: left; }
.client-picker-result:last-child { border-bottom: 0; }
.client-picker-result:hover, .client-picker-result:focus { background: #f7f8f6; outline: 0; }
.client-picker-result b { display: block; font-size: 11px; }
.client-picker-result span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.client-picker-empty { padding: 12px; color: var(--muted); font-size: 11px; }
.upload-zone { padding: 23px; border: 1px dashed #a6adb0; text-align: center; background: #fafbf9; }
.upload-zone input { max-width: 100%; font-size: 11px; }
.upload-list { display: grid; gap: 8px; margin-top: 15px; }
.upload-list span { padding: 8px 10px; color: var(--muted); background: var(--cloud); font-size: 11px; }
.file-project-link { padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 2px; }
.file-project-link:hover { color: #174c9a; }
.project-detail, .client-directory { margin-top: 18px; border: 1px solid var(--line); background: white; }
.project-detail > p { margin: 0; padding: 21px 22px 23px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.detail-grid div { padding: 16px 18px; background: white; }
.detail-grid span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.detail-grid b { display: block; margin-top: 6px; font-size: 12px; }
.client-directory { overflow: hidden; }
.client-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 17px 21px; border-bottom: 1px solid var(--line); }
.client-row:last-child { border-bottom: 0; }
.client-row b { display: block; font-size: 12px; }
.client-row span { color: var(--muted); font-size: 11px; }
.client-row .client-phone { display: inline; font-size: 10px; }
.client-actions { justify-content: flex-end; }
.readonly-client-record input[readonly] { border-color: #dbe0df; color: #6c7679; background: #eef1ef; cursor: not-allowed; }
.empty-state { padding: 42px 21px; color: var(--muted); text-align: center; font-size: 13px; }
.pagination-controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 21px; border-top: 1px solid var(--line); color: var(--muted); background: #fafbf9; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pagination-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pagination-actions label { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.pagination-actions select { min-height: 31px; padding: 4px 24px 4px 8px; border: 1px solid var(--line); background: white; color: var(--ink); font: 800 10px var(--sans); }
.pagination-actions .row-action { min-height: 31px; }
.pagination-actions .row-action:disabled { cursor: not-allowed; border-color: #e2e5e5; color: #a5acad; background: #f4f5f4; }

/* Account settings */
.settings-title { margin-bottom: 27px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); gap: 17px; align-items: start; }
.settings-stack { display: grid; gap: 17px; }
.settings-card { padding: 0 23px 23px; border: 1px solid var(--line); background: white; }
.settings-card > .surface-heading { margin: 0 -23px 23px; }
.settings-card h2 { margin: 0; font: 900 25px/.9 var(--display); letter-spacing: -.045em; text-transform: uppercase; }
.settings-card--signout { padding-top: 23px; }
.settings-card--signout h2 { margin-bottom: 10px; }
.settings-hint { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.settings-copy { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-photo-row { display: flex; align-items: center; gap: 16px; margin: -2px 0 26px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.settings-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%; color: white; background: var(--blue); background-position: center; background-size: cover; font-size: 22px; font-weight: 850; overflow: hidden; }
.settings-avatar--photo { color: transparent; }
.profile-photo-row b { display: block; font-size: 12px; }
.profile-photo-row p { margin: 5px 0 11px; color: var(--muted); font-size: 10px; }
.file-picker { min-height: 34px; padding: 8px 10px; }
.settings-card .auth-message { margin: 14px 0 -5px; }
.hidden { display: none !important; }

@media (max-width: 930px) {
  .auth-view { grid-template-columns: 1fr; }
  .auth-intro { min-height: 395px; padding: 75px 38px 49px; }
  .auth-panel { padding: 55px 36px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .dashboard-grid, .admin-layout, .settings-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .list-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .list-controls--clients { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-field--search { grid-column: 1 / -1; }
  .filter-clear { justify-self: start; }
  .pagination-controls { align-items: flex-start; flex-direction: column; }
  .pagination-actions { justify-content: flex-start; }
  .admin-side { display: flex; overflow-x: auto; }
  .admin-side button { min-width: 155px; }
}
@media (max-width: 640px) {
  .portal-top { height: 69px; padding: 0 17px; }
  .portal-brand { width: 129px; }
  .back-link { font-size: 9px; }
  .demo-bar { padding: 9px 17px; align-items: start; }
  .demo-control { margin-left: 0; }
  .local-link { margin-left: 0; }
  .auth-intro { min-height: 355px; padding: 59px 25px 39px; }
  .auth-intro h1 { font-size: 57px; }
  .auth-intro::before { width: 390px; height: 390px; top: -75px; right: -235px; border-width: 37px; }
  .auth-panel { padding: 43px 25px; }
  .auth-card h2 { font-size: 39px; }
  .app-nav { gap: 17px; overflow-x: auto; padding: 0 17px; }
  .nav-tab { padding: 27px 0 24px; white-space: nowrap; }
  .account-menu { margin-left: auto; }
  .account-menu-toggle > span:first-child { display: none; }
  .app-main { width: min(100% - 32px, 540px); padding: 33px 0 50px; }
  .page-title-row, .admin-head { align-items: start; flex-direction: column; }
  .page-title-row h1, .admin-head h1 { font-size: 42px; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric { padding: 14px; }
  .project-meta { grid-template-columns: 1fr; gap: 9px; }
  .table-row { grid-template-columns: 1.1fr .85fr .6fr; gap: 10px; }
  .table-row > :nth-child(3), .table-row > :nth-child(4), .table-row > :nth-child(5) { display: none; }
  .table-row.table-head > :nth-child(3), .table-row.table-head > :nth-child(4), .table-row.table-head > :nth-child(5) { display: none; }
  .table-status-mobile { display: inline-flex; margin-top: 8px; }
  .table-actions { flex-direction: row; gap: 5px; }
  .list-controls, .list-controls--clients { grid-template-columns: 1fr 1fr; padding: 15px; }
  .filter-field--search { grid-column: 1 / -1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .admin-actions { justify-content: flex-start; }
  .modal-backdrop { padding: 12px; }
  .modal-dialog { max-height: calc(100vh - 24px); }
  .modal-backdrop .admin-form { padding: 25px 19px; }
  .form-foot--split { align-items: flex-start; flex-direction: column; }
  .form-foot-actions { width: 100%; justify-content: flex-end; }
  .detail-grid { grid-template-columns: 1fr; }
  .client-row { grid-template-columns: 1fr; gap: 5px; }
  .client-actions { justify-content: flex-start; }
  .pagination-controls { padding: 14px 15px; }
  .pagination-actions { width: 100%; gap: 7px; }
  .pagination-actions label { width: 100%; }
  .settings-card { padding: 0 17px 18px; }
  .settings-card > .surface-heading { margin: 0 -17px 20px; padding: 18px 17px; }
  .profile-photo-row { align-items: start; }
}
