:root {
  color-scheme: light;
  --page: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #faf9f8;
  --surface-hover: #f7f7f6;
  --ink: #202321;
  --ink-soft: #434843;
  --muted: #81877f;
  --faint: #a5aaa3;
  --line: #eceeeb;
  --line-strong: #e0e4df;
  --green: #24684f;
  --green-dark: #1d5942;
  --green-pale: #e7f2eb;
  --serif: "Manrope", "DM Sans", sans-serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shadow-sm: 0 2px 5px rgb(34 43 36 / 3%), 0 8px 24px rgb(34 43 36 / 2%);
  --shadow-md: 0 16px 50px rgb(25 32 27 / 13%);
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #171a18;
  --surface: #202421;
  --surface-soft: #242925;
  --surface-hover: #292f2a;
  --ink: #e9eee9;
  --ink-soft: #c4ccc5;
  --muted: #9ba49c;
  --faint: #737e74;
  --line: #303832;
  --line-strong: #3a453c;
  --green: #91c4a5;
  --green-dark: #a4d7b7;
  --green-pale: #293b30;
  --shadow-sm: 0 2px 8px rgb(0 0 0 / 12%), 0 12px 28px rgb(0 0 0 / 7%);
  --shadow-md: 0 16px 50px rgb(0 0 0 / 35%);
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body { min-width: 0; min-height: 100vh; margin: 0; }
button, input, textarea, select { font: inherit; }
button, a, select, input[type="checkbox"] { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgb(62 133 99 / 38%);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 800; letter-spacing: -1.1px; white-space: nowrap; }
.brand-light { color: #829084; font-weight: 500; }
.brand-mark { width: 27px; height: 26px; position: relative; display: inline-flex; align-items: flex-end; gap: 3px; padding: 4px; overflow: hidden; border-radius: 8px; background: #285d46; }
.brand-mark span { width: 5px; border-radius: 4px 4px 1px 1px; background: #eaf1e9; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .62; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 11px; opacity: .8; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1.55px; line-height: 1.5; }
.muted { color: var(--muted); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 17px; border: 1px solid transparent; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0) scale(.985); }
.button:disabled { opacity: .65; cursor: wait; }
.button-primary { color: white; background: #285d46; box-shadow: 0 4px 11px rgb(31 87 62 / 15%); }
:root[data-theme="dark"] .button-primary { color: #12221a; background: #a4d7b7; }
.button-primary:hover:not(:disabled) { background: #204e3a; box-shadow: 0 7px 18px rgb(31 87 62 / 23%); }
.button-quiet { color: var(--ink-soft); background: var(--surface); border-color: var(--line-strong); }
.button-quiet:hover:not(:disabled) { background: var(--surface-hover); border-color: #c7cdc7; }
.button-danger { color: white; background: #ba4f45; }
.button-danger:hover { background: #a33d35; }
.button-full { width: 100%; }
.button-plus { font-size: 19px; font-weight: 400; line-height: 0; }
.button-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login is intentionally the only visible screen until the server validates a session. */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, .94fr) 1.06fr; background: var(--surface); }
.login-brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 46px clamp(36px, 6vw, 96px) 37px; overflow: hidden; color: #f3f5ed; background: #204c3a; }
.login-brand-panel::before, .login-brand-panel::after { position: absolute; right: -240px; bottom: -310px; width: 600px; height: 600px; border: 1px solid rgb(237 244 235 / 9%); border-radius: 50%; content: ""; }
.login-brand-panel::after { right: -175px; bottom: -245px; width: 470px; height: 470px; }
.login-brand-panel .brand { color: #f4f3ea; }
.login-brand-panel .brand-light { color: #aec4af; }
.login-brand-panel .brand-mark { background: #dbe8dc; }
.login-brand-panel .brand-mark span { background: #244f3b; }
.login-story { position: relative; z-index: 1; max-width: 510px; margin: auto 0; padding-bottom: 38px; }
.login-story .eyebrow { color: #a9c3b0; }
.login-story h1 { margin: 22px 0 17px; font-family: var(--serif); font-size: clamp(36px, 4.5vw, 62px); font-weight: 600; line-height: 1.12; letter-spacing: -2.9px; }
.login-story h1 span { color: #b8d0bd; font-weight: 400; }
.login-story p { max-width: 390px; margin: 0; color: #c5d3c6; font-size: 15px; line-height: 1.8; }
.login-side-note { position: relative; z-index: 1; color: #b9cbbb; font-size: 9px; font-weight: 700; letter-spacing: 1.4px; }
.sparkle { padding-right: 6px; font-size: 15px; vertical-align: -1px; }
.login-form-panel { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 72px 40px; background: var(--surface); }
.login-form-wrap { width: min(100%, 390px); }
.login-form-wrap > .eyebrow { color: #558267; }
.login-form-wrap h2 { margin: 12px 0 5px; font-family: var(--serif); font-size: 29px; font-weight: 650; letter-spacing: -1.1px; }
.login-intro { margin: 0 0 35px; font-size: 14px; }
.login-form-wrap form { display: grid; }
.field-label { margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.login-form-wrap input:not([type="checkbox"]) { width: 100%; height: 48px; margin-bottom: 21px; padding: 0 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.login-form-wrap input::placeholder { color: #a5aaa5; }
.login-form-wrap input:focus { border-color: #669378; box-shadow: 0 0 0 3px rgb(76 131 96 / 10%); outline: 0; }
.remember-row { display: flex; align-items: center; gap: 9px; min-height: 32px; margin: -4px 0 20px; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.remember-row input { width: 16px; height: 16px; accent-color: #285d46; }
.login-footnote { margin: 23px 0 0; color: var(--muted); text-align: center; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.tiny-lock { padding-right: 5px; color: #59826a; font-size: 13px; }
.login-copyright { position: absolute; bottom: 34px; left: 40px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: 1px; }
.login-copyright span { padding: 0 2px; }
.login-mobile-brand { display: none; }
.inline-error { color: #b4453f; font-size: 12px; line-height: 1.55; }
.login-form-wrap .inline-error { margin: -7px 0 16px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 245px; padding: 28px 17px 20px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-brand { margin: 0 0 48px 7px; }
.workspace-label { margin: 0 0 12px 13px; color: var(--faint); font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.side-nav { display: grid; gap: 4px; }
.nav-link { min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; color: #777e77; border: 0; border-radius: 7px; background: transparent; font-size: 12px; font-weight: 500; text-align: left; cursor: pointer; transition: color .16s ease, background .16s ease; }
:root[data-theme="dark"] .nav-link { color: var(--muted); }
.nav-link:hover { color: var(--ink); background: var(--surface-hover); }
.nav-link.active { color: #285d46; background: #edf3ee; font-weight: 700; }
:root[data-theme="dark"] .nav-link.active { color: #b6dfc4; background: #293a30; }
.nav-icon { width: 18px; font-size: 17px; text-align: center; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.sidebar-bottom { margin-top: auto; }
.sidebar-studio-card { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 7px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.studio-avatar, .profile-avatar { display: grid; place-items: center; width: 31px; height: 31px; color: #30593f; border-radius: 8px; background: #e5ebdc; font-family: var(--serif); font-size: 13px; font-weight: 700; }
.sidebar-studio-card strong, .sidebar-studio-card span:not(.online-dot) { display: block; }
.sidebar-studio-card strong { margin-bottom: 4px; font-size: 10px; font-weight: 600; }
.sidebar-studio-card div:nth-child(2) span { color: var(--muted); font-size: 9px; }
.online-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #4c9870; box-shadow: 0 0 0 3px rgb(76 152 112 / 13%); }
.sidebar-studio-card .online-dot { margin-left: auto; }
.logout-link { width: 100%; margin-top: 9px; }
.main-panel { min-height: 100vh; margin-left: 245px; }
.topbar { position: sticky; top: 0; z-index: 4; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 4.3vw, 66px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 93%, transparent); backdrop-filter: blur(14px); }
.breadcrumbs { color: var(--muted); font-size: 11px; }
.breadcrumbs span { padding: 0 9px; color: var(--faint); }
.breadcrumbs strong { color: var(--ink-soft); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 17px; }
.today-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .85px; }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 18px; cursor: pointer; transition: background .18s; }
.icon-button:hover { background: var(--surface-hover); }
.profile-chip { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 2px 0 0; border: 0; background: transparent; cursor: pointer; }
.profile-chip .profile-avatar { width: 29px; height: 29px; color: #fff; background: #718b75; border-radius: 50%; font-family: var(--sans); font-size: 10px; }
.profile-name { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.topbar-mobile-brand { display: none; }
.page-content { width: min(100%, 1440px); margin: 0 auto; padding: 42px clamp(24px, 4.3vw, 66px) 40px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 0 0 29px; }
.page-heading .eyebrow, .detail-hero .eyebrow { margin-bottom: 9px; color: #598269; }
.page-heading h1, .detail-hero h1, .client-profile h1 { margin: 0; font-family: var(--serif); font-size: clamp(27px, 2.6vw, 36px); font-weight: 650; line-height: 1.2; letter-spacing: -1.6px; }
.page-heading p, .detail-hero p { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { min-height: 137px; padding: 17px 17px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 10px; font-weight: 500; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 7px; font-size: 15px; }
.icon-indigo { color: #5f6d9b; background: #f0f1f8; }
.icon-amber { color: #b68746; background: #f8f2e9; }
.icon-green { color: #46836a; background: #edf4ee; }
.icon-rose { color: #a76f7b; background: #f8eff0; }
:root[data-theme="dark"] .icon-indigo { color: #b6c1eb; background: #303345; }
:root[data-theme="dark"] .icon-amber { color: #e2bd82; background: #3a3327; }
:root[data-theme="dark"] .icon-green { color: #9ed0ac; background: #283b30; }
:root[data-theme="dark"] .icon-rose { color: #ddb0ba; background: #3b2d32; }
.stat-value { margin-top: 14px; font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1; }
.stat-suffix { margin-left: 9px; color: #64816e; font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0; vertical-align: 5px; }
.stat-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.stat-caption { color: var(--muted); font-size: 9px; }
.stat-underline { width: 30px; height: 2px; border-radius: 2px; }
.underline-indigo { background: #929bb8; }
.underline-amber { background: #d6b680; }
.underline-green { background: #84a990; }
.underline-rose { background: #cb9da7; }
.section-block { margin-top: 42px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 17px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { margin: 0; font-family: var(--serif); font-size: 19px; font-weight: 650; letter-spacing: -.65px; }
.subtle-count { padding-left: 6px; color: var(--faint); font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.text-link { color: #446b50; font-size: 11px; font-weight: 600; transition: color .15s; }
:root[data-theme="dark"] .text-link { color: #b0d3b9; }
.text-link:hover { color: var(--green); }
.text-link span { padding-left: 4px; }
.project-list { display: grid; gap: 10px; }
.project-card { overflow: hidden; padding: 16px 18px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border .18s ease, transform .18s ease, box-shadow .18s ease; animation: fade-up .28s both; }
.project-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 7px 22px rgb(28 39 30 / 6%); }
@keyframes fade-up { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.project-card-top { display: flex; align-items: center; min-width: 0; gap: 11px; }
.project-client-mark, .client-avatar { flex: 0 0 auto; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; font-size: 10px; font-weight: 700; }
.lilac { color: #675682; background: #efebf6; }
.mint { color: #50765f; background: #e8f0e9; }
.peach { color: #9b6554; background: #f7ece5; }
.blue { color: #4e6b82; background: #e7eff3; }
:root[data-theme="dark"] .lilac { color: #d6c7f3; background: #3b3247; }
:root[data-theme="dark"] .mint { color: #b1d8b8; background: #2d4032; }
:root[data-theme="dark"] .peach { color: #eac0a9; background: #46372e; }
:root[data-theme="dark"] .blue { color: #bdd7eb; background: #2e3c45; }
.project-title-wrap { min-width: 0; flex: 1; }
.project-name { display: inline-block; max-width: 100%; overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.project-name:hover { color: #4b775b; }
.project-client { overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.project-client span { padding: 0 3px; }
.status-badge { flex: 0 0 auto; min-height: 24px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid transparent; border-radius: 20px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.status-badge i, .priority-label i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: currentColor; }
.status-lead { color: #667288; background: #eef0f5; }
.status-planning { color: #887048; background: #f5f1e8; }
.status-design { color: #816d99; background: #f0edf5; }
.status-development { color: #4b7188; background: #eaf1f5; }
.status-review { color: #a06c48; background: #f7efe7; }
.status-completed { color: #48795a; background: #eaf2ec; }
.status-cancelled { color: #9c625f; background: #f5ecea; }
:root[data-theme="dark"] .status-lead { color: #bdc6dd; background: #303441; }
:root[data-theme="dark"] .status-planning { color: #dec89e; background: #3c3529; }
:root[data-theme="dark"] .status-design { color: #d1bce7; background: #383143; }
:root[data-theme="dark"] .status-development { color: #afcfe1; background: #293943; }
:root[data-theme="dark"] .status-review { color: #edc39e; background: #403329; }
:root[data-theme="dark"] .status-completed { color: #b2d9bc; background: #2a3c30; }
:root[data-theme="dark"] .status-cancelled { color: #e5b4ae; background: #3e302f; }
.demo-tag { flex: 0 0 auto; padding: 5px 7px; color: #796644; border: 1px solid #eee8d9; border-radius: 4px; background: #faf7ef; font-size: 8px; font-weight: 700; letter-spacing: .8px; }
:root[data-theme="dark"] .demo-tag { color: #d9c18f; border-color: #514834; background: #393327; }
.project-card-details { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; margin: 16px 0 13px 47px; }
.project-card-details > div { min-width: 0; }
.detail-label { display: block; margin-bottom: 5px; color: var(--faint); font-size: 8px; font-weight: 600; letter-spacing: .85px; }
.project-card-details strong { color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.project-card-footer { min-height: 27px; display: flex; justify-content: space-between; align-items: center; padding-top: 9px; border-top: 1px solid var(--line); }
.priority-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.priority-high i { color: #c77b66; background: #c77b66; }
.priority-medium i { color: #bf9c55; background: #bf9c55; }
.priority-low i { color: #6b9b80; background: #6b9b80; }
.dashboard-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 9px; }
.dashboard-footer > span:first-child { display: flex; align-items: center; gap: 8px; }
.dashboard-footer > span:last-child { font-size: 8px; font-weight: 700; letter-spacing: 1.15px; }
.dashboard-footer b { padding-left: 3px; color: #74947d; font-size: 12px; }

.empty-state { display: grid; justify-items: center; min-height: 218px; align-content: center; padding: 28px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--surface); }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 12px; color: #668875; border-radius: 12px; background: var(--green-pale); font-size: 21px; }
.empty-state h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 650; }
.empty-state p { max-width: 350px; margin: 7px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.6; }

.filter-panel { display: grid; grid-template-columns: minmax(185px, 1.4fr) repeat(3, minmax(115px, .7fr)) minmax(130px, .8fr); gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.filter-panel select, .search-box { min-width: 0; height: 39px; display: flex; align-items: center; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.filter-panel select { padding: 0 9px; font-size: 10px; }
.search-box { gap: 7px; padding: 0 10px; }
.search-box span { color: var(--muted); font-size: 21px; }
.search-box input { width: 100%; min-width: 0; height: 100%; color: var(--ink); border: 0; outline: 0; background: transparent; font-size: 10px; }
.search-box input::placeholder { color: var(--faint); }
.results-caption { display: flex; justify-content: space-between; margin: 17px 2px 10px; color: var(--muted); font-size: 10px; }
.results-caption span:last-child { font-size: 8px; font-weight: 700; letter-spacing: .9px; }

.project-form { display: grid; grid-template-columns: minmax(0, 1fr) 245px; align-items: start; gap: 19px; }
.form-main-column { min-width: 0; display: grid; gap: 13px; }
.form-section { padding: 20px 21px 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); }
.form-section-heading { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.form-step { flex: 0 0 auto; min-width: 29px; height: 28px; display: inline-grid; place-items: center; color: #497255; border: 1px solid #e5ece4; border-radius: 7px; background: #f2f6f1; font-size: 9px; font-weight: 700; letter-spacing: .3px; }
:root[data-theme="dark"] .form-step { color: #b5d9bd; border-color: #394b3e; background: #29382d; }
.form-section-heading h2, .detail-section-heading h2 { margin: 1px 0 4px; font-family: var(--serif); font-size: 15px; font-weight: 700; letter-spacing: -.35px; }
.form-section-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 13px; }
.form-field { min-width: 0; display: grid; align-content: start; gap: 7px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.form-field > span { line-height: 1.4; }
.required-mark { color: #b76559; font-size: 11px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-width: 0; min-height: 41px; padding: 10px 11px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; background: var(--surface); font-size: 11px; font-weight: 400; transition: border-color .15s, box-shadow .15s; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #7b9b82; box-shadow: 0 0 0 3px rgb(76 131 96 / 9%); }
.form-field input::placeholder, .form-field textarea::placeholder { color: #a0a69e; }
.form-field textarea { min-height: 83px; resize: vertical; line-height: 1.6; }
.form-field small { color: var(--muted); font-size: 9px; font-weight: 400; }
.field-full { grid-column: 1 / -1; }
.calculated-value { min-height: 41px; display: flex; align-items: center; padding: 0 11px; color: #315c42; border: 1px solid #e4ebe2; border-radius: 6px; background: #f3f7f2; font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .calculated-value { color: #b9dfc1; border-color: #394a3b; background: #28372b; }
.form-aside-card { position: sticky; top: 86px; padding: 19px; border: 1px solid #e2e9e1; border-radius: 8px; background: #f1f5ef; }
:root[data-theme="dark"] .form-aside-card { border-color: #394a3b; background: #242d25; }
.form-aside-card .eyebrow { color: #668372; font-size: 8px; letter-spacing: 1.05px; }
.aside-sparkle { margin: 25px 0 7px; color: #75917a; font-size: 21px; }
.form-aside-card h3, .next-step-card h3 { margin: 0; font-family: var(--serif); font-size: 16px; font-weight: 650; letter-spacing: -.45px; line-height: 1.35; }
.form-aside-card p, .next-step-card p { margin: 8px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.65; }
.aside-divider { height: 1px; margin: 13px 0; background: #e0e8de; }
:root[data-theme="dark"] .aside-divider { background: #39453a; }
.aside-check { display: inline-grid; width: 17px; height: 17px; margin-right: 6px; place-items: center; color: #467053; border-radius: 50%; background: #dfebde; font-size: 10px; }
.form-aside-card > span:last-child { color: var(--muted); font-size: 9px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 5px 0 1px; }
.form-error { margin: 0; padding: 10px 12px; border: 1px solid #f0d1ca; border-radius: 6px; background: #fff5f2; }
:root[data-theme="dark"] .form-error { border-color: #5a3c36; background: #392925; }

.detail-back-row { display: flex; align-items: center; justify-content: space-between; min-height: 27px; margin-bottom: 17px; }
.back-link { color: var(--muted); font-size: 11px; font-weight: 500; }
.back-link:hover { color: var(--ink); }
.demo-tag-large { padding: 7px 9px; }
.detail-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.detail-hero h1 { font-size: clamp(25px, 3vw, 35px); }
.detail-hero p span { padding: 0 4px; }
.detail-actions { display: flex; gap: 8px; }
.detail-status-banner { min-height: 49px; display: flex; align-items: center; gap: 10px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.detail-status-spacer { flex: 1; }
.updated-caption { color: var(--faint); font-size: 8px; font-weight: 700; letter-spacing: .8px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; align-items: start; gap: 16px; margin-top: 16px; }
.detail-main { display: grid; gap: 12px; }
.detail-section { padding: 17px 18px 19px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.detail-section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; }
.detail-section-heading h2 { margin: 0; }
.detail-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; padding-left: 39px; }
.detail-item { min-width: 0; display: grid; gap: 5px; }
.detail-item > span { color: var(--muted); font-size: 9px; }
.detail-item > strong { overflow-wrap: anywhere; color: var(--ink-soft); font-size: 10px; font-weight: 600; line-height: 1.6; }
.detail-item > strong a { color: #4d795a; }
:root[data-theme="dark"] .detail-item > strong a { color: #acd3b6; }
.value-muted { color: var(--faint); font-weight: 400; }
.detail-full { grid-column: 1 / -1; }
.notes-block { min-height: 55px; padding: 12px; color: var(--ink-soft); border-radius: 6px; background: var(--surface-soft); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }
.detail-aside { display: grid; gap: 12px; }
.financial-card, .next-step-card { padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.financial-card .eyebrow, .next-step-card .eyebrow { font-size: 8px; }
.financial-total { margin: 12px 0; font-family: var(--serif); font-size: 28px; font-weight: 650; letter-spacing: -1px; }
.financial-divider { height: 1px; margin-bottom: 12px; background: var(--line); }
.financial-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; color: var(--muted); font-size: 10px; }
.financial-row strong { color: var(--ink-soft); font-size: 11px; }
.financial-progress { width: 100%; height: 5px; display: block; overflow: hidden; margin: 11px 0; border: 0; border-radius: 6px; background: var(--line); color: #5d9671; }
.financial-progress::-webkit-progress-bar { border-radius: 6px; background: var(--line); }
.financial-progress::-webkit-progress-value { border-radius: 6px; background: #5d9671; }
.financial-progress::-moz-progress-bar { border-radius: 6px; background: #5d9671; }
.remaining-row { padding-top: 10px; border-top: 1px solid var(--line); }
.payment-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 9px; }
.payment-dot { width: 7px; height: 7px; border-radius: 50%; background: #aaa; }
.payment-dot.status-paid { background: #5d9a71; }
.payment-dot.status-partially-paid { background: #c49a55; }
.payment-dot.status-unpaid { background: #bd7867; }
.next-step-card { padding: 17px; background: var(--surface-soft); }
.next-step-card h3 { margin-top: 12px; font-size: 14px; }
.next-step-card p { margin: 6px 0 13px; }
.button-complete { width: 100%; min-height: 39px; color: #386749; border: 1px solid #dbe8dd; background: #edf5ee; font-size: 10px; }
:root[data-theme="dark"] .button-complete { color: #b8dfc0; border-color: #3d5141; background: #293b2e; }
.button-complete:disabled { opacity: .75; }
.client-history-link { display: flex; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.client-history-link .profile-avatar { flex: 0 0 auto; }
.client-history-link > span:nth-child(2) { flex: 1; }
.client-history-link strong, .client-history-link small { display: block; }
.client-history-link strong { font-size: 10px; }
.client-history-link small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.client-history-link > span:last-child { color: var(--muted); }

.client-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 19px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.client-summary > div { min-height: 76px; display: grid; align-content: center; gap: 5px; padding: 13px 19px; border-right: 1px solid var(--line); }
.client-summary > div:last-child { border-right: 0; }
.client-summary span { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .9px; }
.client-summary strong { font-family: var(--serif); font-size: 20px; font-weight: 650; letter-spacing: -.7px; }
.clients-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.client-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border .18s, transform .18s, box-shadow .18s; animation: fade-up .28s both; }
.client-card:hover { border-color: #bdcdbf; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.client-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.client-avatar { width: 40px; height: 40px; border-radius: 11px; font-size: 11px; }
.client-arrow { color: var(--faint); font-size: 14px; }
.client-card h2 { overflow: hidden; margin: 14px 0 3px; font-family: var(--serif); font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.client-card > p { margin: 0; color: var(--muted); font-size: 10px; }
.client-card-contact { display: grid; gap: 6px; min-height: 40px; margin: 15px 0 13px; color: var(--muted); font-size: 9px; }
.client-card-contact span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card-bottom { display: flex; align-items: center; gap: 8px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.client-card-bottom span:nth-child(2) { padding-left: 7px; border-left: 1px solid var(--line-strong); }
.client-card-bottom strong { margin-left: auto; color: var(--ink-soft); font-size: 10px; }
.client-profile { display: flex; align-items: center; gap: 15px; padding: 21px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.client-avatar-large { width: 57px; height: 57px; border-radius: 15px; font-size: 16px; }
.client-profile > div:nth-child(2) { flex: 1; }
.client-profile .eyebrow { margin-bottom: 4px; }
.client-profile h1 { font-size: 25px; }
.client-profile p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.client-contact-strip { display: flex; flex-wrap: wrap; gap: 19px; padding: 13px 5px; color: var(--muted); font-size: 10px; }
.client-contact-strip span:last-child { margin-left: auto; }
.client-history-heading { margin-top: 20px; }
.client-lifetime-value { color: var(--ink-soft); font-size: 13px; }
.client-lifetime-value small { padding-left: 4px; color: var(--muted); font-size: 9px; font-weight: 400; }

.settings-layout { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 13px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.settings-card > .eyebrow { margin-bottom: 9px; }
.settings-card h2 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 650; }
.settings-card > p { max-width: 490px; margin: 7px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.settings-info-row { display: flex; justify-content: space-between; gap: 15px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 10px; }
.settings-info-row span { color: var(--muted); }
.settings-info-row strong { font-weight: 600; }
.appearance-card { grid-row: span 2; }
.theme-choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-choice { display: grid; justify-items: start; gap: 5px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); text-align: left; cursor: pointer; }
.theme-choice.selected { border-color: #698f72; box-shadow: 0 0 0 2px rgb(91 143 104 / 10%); }
.theme-preview { width: 100%; height: 68px; display: grid; place-items: center; border-radius: 5px; font-size: 19px; }
.light-preview { color: #315e43; background: #f2f4f1; }
.dark-preview { color: #c9ddca; background: #252a27; }
.theme-choice strong { font-size: 10px; }
.theme-choice small { color: var(--muted); font-size: 9px; }
.settings-security { grid-column: 1 / -1; }

.mobile-nav, .mobile-more-menu { display: none; }
.toast-region { position: fixed; z-index: 20; right: 23px; bottom: 22px; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 0 16px; color: #f5f7f3; border-radius: 7px; background: #283c30; box-shadow: var(--shadow-md); font-size: 11px; animation: toast-in .2s ease both; }
.toast > span { color: #b4d9b9; }
.toast-error { background: #853d37; }
.toast-error > span { color: #f6cebb; }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.confirm-dialog { width: min(calc(100% - 30px), 410px); padding: 0; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-md); }
.confirm-dialog::backdrop { background: rgb(18 25 20 / 48%); backdrop-filter: blur(2px); }
.confirm-card { display: grid; justify-items: center; padding: 25px 24px 21px; text-align: center; }
.confirm-icon { width: 39px; height: 39px; display: grid; place-items: center; color: #a9564c; border-radius: 50%; background: #f7e9e6; font-family: var(--serif); font-size: 17px; font-weight: 700; }
.confirm-card h2 { margin: 14px 0 5px; font-family: var(--serif); font-size: 17px; }
.confirm-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 8px; margin-top: 22px; }

@media (min-width: 1600px) {
  .page-content { padding-right: 74px; padding-left: 74px; }
}

@media (max-width: 1120px) {
  .sidebar { width: 215px; }
  .main-panel { margin-left: 215px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-form { grid-template-columns: minmax(0, 1fr) 215px; }
  .filter-panel { grid-template-columns: minmax(170px, 1.3fr) repeat(2, minmax(115px, .7fr)); }
  .clients-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .login-screen { grid-template-columns: minmax(0, 1fr); }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 37px 24px 76px; }
  .login-mobile-brand { display: inline-flex; align-self: flex-start; margin-bottom: clamp(55px, 15vh, 105px); }
  .login-form-wrap { width: min(100%, 410px); margin: 0 auto; }
  .login-copyright { bottom: max(20px, env(safe-area-inset-bottom)); left: 24px; }
  .sidebar { display: none; }
  .main-panel { margin-left: 0; }
  .topbar { height: 57px; padding: 0 20px; }
  .topbar-mobile-brand { display: inline-flex; font-size: 17px; }
  .breadcrumbs { display: none; }
  .topbar-actions { gap: 12px; }
  .profile-name, .today-label { display: none; }
  .page-content { padding: 29px 21px calc(94px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: center; margin-bottom: 22px; }
  .page-heading h1 { font-size: 29px; }
  .page-heading p { font-size: 11px; }
  .section-block { margin-top: 33px; }
  .project-form { grid-template-columns: minmax(0, 1fr); }
  .form-aside { display: none; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 245px; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 8; min-height: calc(65px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch; padding: 6px 5px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(15px); }
  .mobile-nav a, .mobile-nav button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; color: var(--muted); border: 0; border-radius: 7px; background: transparent; font-size: 9px; font-weight: 500; cursor: pointer; }
  .mobile-nav a.active { color: #39724f; font-weight: 700; }
  :root[data-theme="dark"] .mobile-nav a.active { color: #b8dfc0; }
  .mobile-nav-icon { height: 20px; display: grid; place-items: center; font-size: 17px; }
  .mobile-nav .mobile-add-icon { width: 29px; height: 29px; display: grid; place-items: center; margin-top: -12px; color: white; border-radius: 10px; background: #285d46; box-shadow: 0 3px 10px rgb(31 87 62 / 22%); font-size: 21px; line-height: 1; }
  :root[data-theme="dark"] .mobile-nav .mobile-add-icon { color: #142319; background: #a4d7b7; }
  .mobile-nav a.mobile-add { color: var(--ink-soft); }
  .mobile-more-menu { position: fixed; right: 11px; bottom: calc(77px + env(safe-area-inset-bottom)); z-index: 10; width: min(205px, calc(100vw - 22px)); display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow-md); animation: fade-up .18s ease both; }
  .mobile-more-menu[hidden] { display: none; }
  .mobile-more-menu a, .mobile-more-menu button { min-height: 43px; display: flex; align-items: center; padding: 0 11px; color: var(--ink-soft); border: 0; border-radius: 6px; background: transparent; font-size: 12px; text-align: left; cursor: pointer; }
  .mobile-more-menu a:hover, .mobile-more-menu button:hover { background: var(--surface-hover); }
  .toast-region { right: 15px; bottom: calc(80px + env(safe-area-inset-bottom)); left: 15px; }
  .toast { min-height: 46px; }
}

@media (max-width: 600px) {
  .login-form-panel { padding-right: 24px; padding-left: 24px; }
  .login-mobile-brand { margin-bottom: clamp(44px, 13vh, 83px); }
  .login-form-wrap h2 { font-size: 26px; }
  .topbar { padding: 0 15px; }
  .page-content { padding: 25px 15px calc(91px + env(safe-area-inset-bottom)); }
  .page-heading { align-items: flex-start; gap: 10px; margin-bottom: 19px; }
  .page-heading h1 { max-width: 360px; font-size: clamp(24px, 7vw, 29px); }
  .page-heading p { max-width: 380px; margin-top: 6px; font-size: 10px; }
  .page-heading > .button { flex: 0 0 auto; min-height: 40px; gap: 5px; padding: 0 10px; font-size: 10px; white-space: nowrap; }
  .page-heading > .button .button-plus { font-size: 16px; }
  .desktop-back-label { display: none; }
  .stats-grid { gap: 9px; }
  .stat-card { min-height: 120px; padding: 12px 11px 11px; }
  .stat-top { font-size: 9px; }
  .stat-icon { width: 25px; height: 25px; font-size: 13px; }
  .stat-value { margin-top: 13px; font-size: 28px; }
  .stat-bottom { margin-top: 12px; }
  .stat-caption { font-size: 8px; }
  .section-block { margin-top: 28px; }
  .section-heading h2 { font-size: 17px; }
  .section-heading { margin-bottom: 13px; }
  .project-card { padding: 13px 12px 10px; }
  .project-card-top { gap: 8px; flex-wrap: wrap; }
  .project-client-mark { width: 32px; height: 32px; }
  .project-title-wrap { max-width: calc(100% - 49px); }
  .project-name { font-size: 11px; }
  .project-client { font-size: 9px; }
  .project-card-top > .status-badge { margin-left: 40px; }
  .project-card-top > .demo-tag { margin-left: auto; }
  .project-card-details { grid-template-columns: 1fr 1fr; gap: 12px 8px; margin: 14px 0 12px 40px; }
  .detail-label { font-size: 7px; }
  .project-card-details strong { font-size: 9px; }
  .project-card-footer { padding-top: 8px; }
  .dashboard-footer { align-items: flex-start; gap: 10px; margin-top: 23px; }
  .dashboard-footer > span:last-child { max-width: 130px; text-align: right; line-height: 1.6; }
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 9px; }
  .search-box { grid-column: 1 / -1; }
  .filter-panel select { height: 39px; font-size: 9px; }
  .results-caption { font-size: 9px; }
  .results-caption span:last-child { max-width: 155px; text-align: right; line-height: 1.5; }
  .form-section { padding: 16px 13px 17px; }
  .form-section-heading { gap: 9px; margin-bottom: 16px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .field-full { grid-column: auto; }
  .form-field input, .form-field select, .form-field textarea { min-height: 45px; font-size: 12px; }
  .form-field textarea { min-height: 88px; }
  .form-field { font-size: 11px; }
  .form-actions { position: sticky; bottom: calc(71px + env(safe-area-inset-bottom)); z-index: 3; margin: 0 -4px; padding: 8px 4px max(5px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--page) 94%, transparent); backdrop-filter: blur(8px); }
  .form-actions .button { flex: 1; min-height: 47px; }
  .detail-back-row { margin-bottom: 13px; }
  .demo-tag-large { max-width: 185px; font-size: 7px; text-align: center; }
  .detail-hero { align-items: flex-start; flex-direction: column; gap: 14px; }
  .detail-hero h1 { font-size: 27px; }
  .detail-actions { width: 100%; }
  .detail-actions .button { flex: 1; }
  .detail-status-banner { flex-wrap: wrap; gap: 7px; padding: 8px; }
  .detail-status-banner .status-badge { min-height: 23px; }
  .updated-caption { flex-basis: 100%; padding-left: 4px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-aside { grid-row: 1; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .financial-card, .next-step-card { padding: 13px; }
  .financial-total { font-size: 24px; }
  .next-step-card h3 { font-size: 12px; }
  .next-step-card p { font-size: 9px; }
  .detail-section { padding: 14px 12px 16px; }
  .detail-data-grid { gap: 14px 10px; padding-left: 0; }
  .detail-item > strong { font-size: 9px; }
  .detail-item > span { font-size: 8px; }
  .client-summary > div { min-height: 68px; padding: 10px 9px; }
  .client-summary span { font-size: 7px; letter-spacing: .55px; }
  .client-summary strong { font-size: 16px; }
  .clients-grid { grid-template-columns: 1fr; gap: 9px; }
  .client-card { padding: 13px; }
  .client-card h2 { margin-top: 10px; }
  .client-card-contact { min-height: 0; margin: 10px 0; }
  .client-profile { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .client-profile > div:nth-child(2) { min-width: 0; }
  .client-profile .button { flex-basis: 100%; }
  .client-profile h1 { font-size: 21px; }
  .client-avatar-large { width: 47px; height: 47px; }
  .client-contact-strip { gap: 10px 16px; }
  .client-contact-strip span:last-child { flex-basis: 100%; margin-left: 0; }
  .client-history-heading { margin-top: 14px; }
  .settings-layout { grid-template-columns: 1fr; }
  .appearance-card { grid-row: auto; }
  .settings-security { grid-column: auto; }
  .confirm-card { padding: 21px 15px 17px; }
  .confirm-actions { width: 100%; }
  .confirm-actions .button { flex: 1; padding: 0 9px; font-size: 11px; }
}

@media (max-width: 360px) {
  .brand { font-size: 16px; }
  .brand-mark { transform: scale(.92); }
  .page-heading > .button { padding: 0 8px; font-size: 9px; }
  .stat-card { padding-right: 9px; padding-left: 9px; }
  .stat-caption { font-size: 7px; }
  .detail-aside { grid-template-columns: 1fr; }
  .project-card-top > .status-badge { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
