@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* ============================================================
   TOKENS — light default. A [data-theme="dark"] block further
   down flips every semantic token. The signature "thread"
   gradient (iris → teal → amber) stays the same in both themes.
   ============================================================ */
* { box-sizing: border-box; }
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #fafafc;
  --surface-3: #f0f1f5;
  --ink: #15171c;
  --ink-2: #62687a;
  --ink-3: #9aa0ae;
  --line: #e7e9ef;
  --line-2: #f0f1f5;

  --iris: #545ad8;
  --iris-deep: #4046ba;
  --iris-soft: #eeeffc;
  --iris-line: #d9dbf7;

  --emerald: #12805c;      --emerald-bg: #e3f4ec;
  --amber: #a4640c;        --amber-bg: #fcf1de;
  --rose: #c93b57;         --rose-bg: #fbe9ed;
  --sky: #0b7290;          --sky-bg: #e2f2f8;
  --violet: #7a4fd0;       --violet-bg: #f1ebfc;

  --thread: linear-gradient(120deg, #545ad8, #1a9e8f 55%, #d9932f);

  --shadow-1: 0 1px 2px rgba(21,23,28,.05), 0 1px 1px rgba(21,23,28,.03);
  --shadow-2: 0 10px 28px -10px rgba(21,23,28,.14), 0 3px 8px rgba(21,23,28,.05);
  --shadow-pop: 0 24px 64px -16px rgba(21,23,28,.28);

  /* Elevated floating surface — a hair cooler than sidebar white so the
     popover reads as "above" it, not the same layer. */
  --popover-bg: #f6f7fc;
  --popover-line: #dfe1ee;

  --r-lg: 18px; --r-md: 12px; --r-sm: 9px;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-ui: 'Inter', -apple-system, 'Segoe UI', sans-serif;

  /* Legacy aliases so untouched templates keep rendering correctly */
  --black: #15171c; --near-black: #22242b; --gray-900: #1c1e24;
  --gray-700: #4a4f5e; --gray-500: #757b8a; --gray-300: #d5d7df;
  --gray-200: #e7e9ef; --gray-100: #f0f1f5; --white: #ffffff;
  --radius: 12px; --radius-sm: 9px;
}
.contract-native-preview{padding:0;overflow:auto;background:var(--surface-2)}.contract-native-preview .contract-preview-head{background:var(--surface);position:sticky;top:0;z-index:2}.contract-native-preview .contract-preview-head span{padding:3px 7px;border-radius:5px;background:var(--surface-3);color:var(--ink-3);font-size:.62rem;font-weight:800}.contract-document-readonly{width:min(760px,calc(100% - 32px));min-height:900px;margin:18px auto;padding:64px 70px}.pdf-unavailable-note{padding:11px;margin:16px 0;border:1px solid var(--line);border-radius:9px;background:var(--surface-2)}.pdf-unavailable-note strong{font-size:.76rem}.pdf-unavailable-note p{color:var(--ink-3);font-size:.7rem;line-height:1.5;margin:4px 0 0}
.portal-invoice-wrap{width:min(680px,calc(100% - 32px));margin:50px auto}.portal-invoice-wrap>.card{padding:28px}.portal-invoice-amount{font-family:var(--font-display);font-size:2.2rem;font-weight:800;margin:14px 0 20px}
.admin-contract-layout{display:grid;grid-template-columns:360px minmax(0,1fr);gap:18px;align-items:start}.contract-admin-list{display:flex;flex-direction:column}.contract-admin-list article{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:12px;align-items:center;padding:13px 0;border-top:1px solid var(--line)}.contract-admin-list img{width:72px;height:54px;object-fit:cover;border-radius:8px}.contract-admin-list h3{margin:5px 0 2px}.contract-admin-list p,.contract-admin-list small{color:var(--ink-3);font-size:.74rem;margin:0}.contract-category-filter{display:flex;gap:6px;flex-wrap:wrap;margin:-8px 0 18px}.contract-category-filter button{padding:6px 11px;background:var(--surface);border:1px solid var(--line);color:var(--ink-2);box-shadow:none}.contract-category-filter button.active{background:var(--iris-soft);border-color:var(--iris);color:var(--iris-deep)}.contract-meta-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}.contract-meta-grid label,.contract-merge-field{margin:0}.contract-fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}.contract-merge-field{position:relative;padding:11px;border:1px solid #e7c56f;border-radius:10px;background:#fff9e8}.contract-merge-field>span{display:block;margin-bottom:6px;font-weight:700;font-size:.78rem}.contract-merge-field textarea{background:var(--surface);margin:0}.contract-merge-field small{display:block;color:#9a6b00;margin-top:4px;font-family:monospace}.contract-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px}.contract-preview-card{padding:0;overflow:hidden}.contract-preview-head{display:flex;justify-content:space-between;padding:12px 15px;border-bottom:1px solid var(--line)}.contract-preview-head small{color:var(--ink-3)}.contract-preview-card iframe{display:block;width:100%;height:75vh;border:0;background:#e9ebf0}@media(max-width:850px){.admin-contract-layout,.contract-detail-grid{grid-template-columns:1fr}.contract-meta-grid,.contract-fields-grid{grid-template-columns:1fr}.contract-admin-list article{grid-template-columns:1fr auto}.contract-admin-list img{display:none}}
.contract-upload-panel{margin-bottom:16px}.contract-upload-panel[hidden]{display:none}.contract-upload-grid,.contract-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.contract-upload-grid label,.contract-edit-grid label{margin:0}.contract-upload-grid .wide,.contract-edit-grid .wide{grid-column:1/-1}.admin-contract-library{padding:0;overflow:hidden}.contract-library-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 18px;border-bottom:1px solid var(--line)}.contract-library-toolbar .template-search{margin:0;flex:1}.contract-status-tabs{display:flex;gap:4px}.contract-status-tabs button{padding:7px 10px;background:transparent;border:0;color:var(--ink-3);box-shadow:none;font-size:.74rem}.contract-status-tabs button.active{background:var(--iris-soft);color:var(--iris-deep)}.contract-status-tabs span{margin-left:4px}.admin-contract-table-head,.admin-contract-row{display:grid;grid-template-columns:minmax(250px,1.4fr) minmax(130px,.6fr) 100px 100px minmax(280px,auto);align-items:center;gap:12px}.admin-contract-table-head{padding:10px 18px;background:var(--surface-2);color:var(--ink-3);font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.admin-contract-row{padding:12px 18px;border-top:1px solid var(--line-2)}.contract-row-main{display:flex;align-items:center;gap:11px;min-width:0}.contract-row-main>span:last-child,.admin-contract-row>span:nth-child(3){display:flex;flex-direction:column;min-width:0}.contract-row-main small,.admin-contract-row small{color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contract-row-thumb{width:58px;height:44px;display:grid;place-items:center;flex:0 0 auto;border:1px solid var(--line);border-radius:7px;background:var(--surface-2);color:var(--ink-3);font-size:.58rem;font-weight:800}.contract-row-thumb img{width:100%;height:100%;object-fit:cover;border-radius:6px}.contract-row-actions{display:flex;justify-content:flex-end;gap:5px}.contract-row-actions form{margin:0}.contract-row-editor{padding:16px 18px;background:var(--surface-2);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}.contract-row-editor[hidden]{display:none}.contract-field-summary{padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}.contract-field-summary>div{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}.contract-field-summary code{padding:3px 6px;border-radius:5px;background:var(--iris-soft);color:var(--iris-deep);font-size:.65rem}@media(max-width:1100px){.admin-contract-table-head{display:none}.admin-contract-row{grid-template-columns:1fr auto}.admin-contract-row>span:nth-child(2),.admin-contract-row>span:nth-child(3),.admin-contract-row>span:nth-child(4){display:none}.contract-row-actions{grid-column:2}.contract-library-toolbar{align-items:stretch;flex-direction:column}.contract-upload-grid,.contract-edit-grid{grid-template-columns:1fr}.contract-upload-grid .wide,.contract-edit-grid .wide{grid-column:auto}}

[data-theme="dark"] {
  --bg: #0e1015;
  --surface: #14161d;
  --surface-2: #191c25;
  --surface-3: #1e212b;
  --ink: #f3f4f8;
  --ink-2: #c8ccd8;
  --ink-3: #8b90a0;
  --line: #22252f;
  --line-2: #1c1f28;

  --iris: #7278e7;
  --iris-deep: #9fa4ff;
  --iris-soft: rgba(84,90,216,.18);
  --iris-line: rgba(84,90,216,.35);

  --emerald: #3ecf9a;      --emerald-bg: rgba(24,138,99,.16);
  --amber: #e8b35c;        --amber-bg: rgba(217,147,47,.14);
  --rose: #f07a92;         --rose-bg: rgba(201,59,87,.16);
  --sky: #5cc2df;          --sky-bg: rgba(11,114,144,.18);
  --violet: #b799ee;       --violet-bg: rgba(122,79,208,.18);

  --shadow-1: 0 1px 2px rgba(0,0,0,.35);
  --shadow-2: 0 12px 30px -12px rgba(0,0,0,.55), 0 3px 8px rgba(0,0,0,.3);
  --shadow-pop: 0 30px 80px -20px rgba(0,0,0,.7);

  /* Elevated floating surface — lighter than sidebar (#14161d) so the
     popover reads as "above" it in the dark theme. */
  --popover-bg: #1f232f;
  --popover-line: #2a2e3b;

  --white: var(--surface);
  --gray-100: var(--line-2); --gray-200: var(--line); --gray-300: var(--ink-3);
  --gray-500: var(--ink-3); --gray-700: var(--ink-2); --gray-900: var(--ink);
  --black: var(--ink); --near-black: var(--ink);
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  margin: 0; padding: 0;
  font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -0.02em; }
h1 { font-size: 1.62rem; font-weight: 800; margin: 0 0 4px; }
h2 { font-size: 1.02rem; font-weight: 700; margin: 0 0 12px; }
.subtitle { color: var(--ink-2); margin: 0 0 18px; font-size: 0.9rem; }
.money, .num, .kpi-value, .stat-value { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--iris); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   APP SHELL + SIDEBAR
   ============================================================ */
.app-shell { display: flex; gap: 20px; min-height: 100vh; padding: 16px; align-items: flex-start; position: relative; }
.main-content {
  flex: 1; min-width: 0; max-width: 1180px;
  padding: 70px 10px 48px;
  /* fill-mode intentionally omitted: with fill-mode:both/forwards, some
     browsers keep reporting a non-"none" transform (an identity matrix)
     even after the animation ends, which silently makes this element a
     CSS containing block for any position:fixed descendant (e.g. the
     client drawer) — breaking its viewport-relative positioning once the
     page is scrolled. The end keyframe already matches this element's
     resting state, so no fill-mode is needed to hold it. */
  animation: pageIn .32s cubic-bezier(.22,.9,.3,1);
}
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sidebar {
  width: 254px; flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: var(--ink-2);
  padding: 16px 10px 10px;
  display: flex; flex-direction: column;
  position: sticky; top: 16px; height: calc(100vh - 32px);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: width .2s ease;
}
.sidebar.collapsed { width: 70px; }

.sidebar-top { display: flex; align-items: center; justify-content: center; min-height: 112px; margin-bottom: 30px; padding: 10px 4px; }
.product-logo { display: inline-flex; align-items: center; justify-content: center; gap: 14px; color: var(--iris-deep); font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.product-logo svg { flex: 0 0 auto; color: var(--iris); width: 72px; height: 72px; }
/* Workspace brand (icon + business name) — lives in the persistent
   .workspace-topbar now, not the sidebar, so it stays visible across every
   page instead of scrolling away with the nav. */
.workspace-topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
/* Signature: the workspace mark carries the thread as a halo ring */
.workspace-topbar .brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative; isolation: isolate;
}
.workspace-topbar .brand-mark::after {
  content: ''; position: absolute; inset: -2px; border-radius: 12px;
  background: var(--thread); z-index: -1; opacity: .9;
}
.workspace-topbar .brand-text { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.workspace-topbar .brand-text .brand-name {
  color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 0.92rem;
  letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.workspace-topbar .brand-text small { color: var(--ink-3); font-weight: 500; font-size: 0.66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .label, .sidebar.collapsed .soon-tag,
.sidebar.collapsed .search-trigger, .sidebar.collapsed .quick-add,
.sidebar.collapsed .profile-meta, .sidebar.collapsed .recent-block { display: none; }

/* Collapse/expand toggle — its own full-width row styled like a nav item
   (not squeezed into the brand row) so it never eats into the workspace
   name, and in the collapsed rail its icon lands in the exact same column
   as every other nav icon below it. */
.collapse-btn {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%;
  padding: 5px 9px; margin: 1px 0 6px; border-radius: 8px;
  background: none; border: none; color: var(--ink-2);
  font-size: 0.78rem; font-weight: 500; font-family: var(--font-ui);
  cursor: pointer; transition: background .13s, color .13s;
}
.collapse-btn:hover { background: var(--line-2); color: var(--ink); }
.sidebar.collapsed .collapse-btn svg { transform: rotate(180deg); }

/* Search trigger (opens ⌘K palette) */
.search-trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; margin: 2px 0 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 9px; padding: 6px 9px;
  color: var(--ink-3); font-size: 0.76rem; font-family: var(--font-ui);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.search-trigger:hover { border-color: var(--iris-line); background: #fff; color: var(--ink-2); }
.search-trigger kbd {
  margin-left: auto; font-family: var(--font-ui); font-size: 0.66rem; font-weight: 600;
  color: var(--ink-3); background: #fff; border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}

.sidebar nav { flex: 1; }
.sidebar .nav-group { margin-bottom: 7px; }
.sidebar .nav-group-label {
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); padding: 0 9px; margin-bottom: 2px;
  display: flex; align-items: center; gap: 8px;
}
.sidebar .nav-group-label::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.sidebar a.nav-item, .sidebar-footer a {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 9px; margin: 0;
  border-radius: 8px; text-decoration: none;
  color: var(--ink-2); font-size: 0.78rem; font-weight: 500;
  position: relative; transition: background .13s, color .13s;
}
.sidebar a.nav-item:hover, .sidebar-footer a:hover { background: var(--line-2); color: var(--ink); }
.sidebar a.nav-item.active { background: var(--iris-soft); color: var(--iris-deep); font-weight: 600; }
/* Active pill dot carries the thread */
.sidebar a.nav-item.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3.5px; height: 20px; border-radius: 0 4px 4px 0; background: var(--thread);
}
.sidebar .nav-icon { flex-shrink: 0; opacity: .85; }
.sidebar a.nav-item.active .nav-icon { opacity: 1; }
.sidebar .soon-tag {
  margin-left: auto; font-size: 0.58rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-3); background: var(--line-2); border-radius: 5px; padding: 1.5px 6px;
  text-transform: uppercase;
}

/* Quick add button */
.quick-add {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin: 2px 0 12px;
  background: var(--ink); color: #fff; border: none;
  border-radius: 10px; padding: 9px 10px;
  font-size: 0.84rem; font-weight: 600; font-family: var(--font-ui); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.quick-add:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }

/* Recent items (client-side, localStorage) */
.recent-block { margin-bottom: 12px; }
.recent-block a { font-size: 0.8rem; padding: 5.5px 10px; }
.recent-block .nav-icon { opacity: .6; }
.recent-block:empty { display: none; }

.workspace-topbar {
  position: absolute; z-index: 75; top: 16px; left: 272px; right: 16px; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 8px; border-bottom: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.sidebar.collapsed + .workspace-topbar { left: 98px; }
.topbar-profile { position: relative; }
.profile-chip {
  display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px;
  background: transparent; border: 1px solid transparent; cursor: pointer; text-align: left;
  font-family: var(--font-ui); color: var(--ink); margin: 0;
  transition: background .13s;
}
.profile-chip:hover, .profile-chip[aria-expanded="true"] { background: var(--surface-3); border-color: var(--line); transform: none; box-shadow: none; }
.profile-chip .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--iris-soft); color: var(--iris-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}
.profile-meta { min-width: 0; flex: 1; }
.profile-meta .p-name { font-size: 0.78rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-meta .p-role { font-size: 0.68rem; color: var(--ink-3); text-transform: capitalize; }
.profile-caret { color: var(--ink-3); flex-shrink: 0; margin-right: 3px; transition: transform .15s; }
.profile-chip[aria-expanded="true"] .profile-caret { transform: rotate(180deg); color: var(--ink); }

/* Profile popover — floats above the sidebar footer */
.profile-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(320px, calc(100vw - 28px));
  background: var(--popover-bg); border: 1px solid var(--popover-line); border-radius: 14px;
  box-shadow: var(--shadow-pop);
  padding: 14px 14px 12px;
  z-index: 90;
  display: none;
  animation: popIn .16s cubic-bezier(.22,.9,.3,1) both;
}
.profile-popover.open { display: block; }
@keyframes popIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.profile-popover .pp-head {
  display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 6px;
  border-bottom: 1px solid var(--popover-line);
}
.profile-popover .pp-head .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--iris-soft); color: var(--iris-deep); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.82rem; }
.profile-popover .pp-head .pp-title { font-family: var(--font-display); font-weight: 700; font-size: 0.88rem; color: var(--ink); }
.profile-popover .pp-head .pp-sub { font-size: 0.72rem; color: var(--ink-3); }
.profile-popover label { margin: 10px 0 4px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: .06em; }
/* Inputs on tinted popover — need surface bg to stay legible */
.profile-popover input, .profile-popover select { padding: 7px 10px; font-size: 0.83rem; background: var(--surface); }
.profile-popover .pp-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--popover-line); }
.profile-popover .pp-actions button { margin: 0; flex: 1; padding: 7px 10px; font-size: 0.8rem; }
.profile-popover .pp-actions a { flex: 1; padding: 7px 10px; font-size: 0.8rem; margin: 0; }
.profile-popover .pp-readonly { display: block; font-size: 0.82rem; color: var(--ink-2); padding: 7px 10px; background: var(--surface); border: 1px solid var(--popover-line); border-radius: 10px; }
.profile-popover .pp-readonly small { display: block; font-size: 0.66rem; color: var(--ink-3); margin-top: 2px; }

/* Theme toggle — pill switch in sidebar and admin topbar */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 0;
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px; margin: 0;
  font-family: var(--font-ui); cursor: default;
}
.theme-toggle button {
  background: transparent; border: none; color: var(--ink-3);
  width: 26px; height: 22px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; margin: 0;
  transition: background .15s, color .15s;
}
.theme-toggle button:hover { color: var(--ink); transform: none; box-shadow: none; }
.theme-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.theme-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0 4px; font-size: 0.72rem; color: var(--ink-3); font-weight: 600;
}
.sidebar.collapsed .theme-toggle-row { justify-content: center; }
.theme-toggle-row .theme-label { font-size: 0.72rem; }
.sidebar.collapsed .theme-toggle-row .theme-label { display: none; }
.theme-toggle.billing-toggle button {
  width: auto; height: auto; padding: 6px 13px; font-size: 0.8rem; font-weight: 600; border-radius: 8px;
}
.logout-icon-btn { color: var(--ink-3); display: flex; padding: 6px; border-radius: 8px; }
.logout-icon-btn:hover { background: var(--surface-3); color: var(--ink); }

/* ============================================================
   PAGE HEADER PATTERN
   ============================================================ */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .eyebrow {
  font-size: 0.66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--iris); margin-bottom: 5px; display: block;
}
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-link {
  color: var(--ink-3); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; margin-bottom: 12px;
  transition: color .13s;
}
.back-link:hover { color: var(--ink); }

/* ============================================================
   BUTTONS / INPUTS
   ============================================================ */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  border-radius: 10px; padding: 9px 16px;
  font-size: 0.85rem; font-weight: 600; font-family: var(--font-ui);
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
  margin-top: 12px;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
button:active, .btn:active { transform: none; }
button.secondary, .btn.secondary {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
button.secondary:hover, .btn.secondary:hover { border-color: var(--ink-3); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
button.primary-accent, .btn.primary-accent { background: var(--iris); border-color: var(--iris); }
button.danger, .btn.danger { background: var(--rose); border-color: var(--rose); }
.btn.sm, button.sm { padding: 6px 12px; font-size: 0.78rem; margin: 0; border-radius: 8px; }

label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-2); margin: 14px 0 5px; }
input, textarea, select {
  width: 100%; font-family: var(--font-ui); font-size: 0.88rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px;
  transition: border-color .14s, box-shadow .14s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--iris);
  box-shadow: 0 0 0 3px var(--iris-soft);
}
textarea { min-height: 84px; resize: vertical; }
input[type="checkbox"] { width: auto; }
input[type="file"] { padding: 8px; background: var(--surface-2); font-size: 0.8rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.error { color: var(--rose); font-size: 0.83rem; margin: 10px 0 0; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.card.hoverable { transition: transform .16s ease, box-shadow .16s ease, border-color .16s; }

/* Expanding "drawer" cards — Home's Urgent tasks / New leads / Projects /
   Invoices stack. Built on <details>/<summary> so expand/collapse needs no
   JS; padding moves from .card onto the summary/body so the whole header
   stays clickable edge to edge. */
.drawer-card { padding: 0; }
.drawer-card > summary.drawer-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; cursor: pointer; list-style: none;
}
.drawer-card > summary.drawer-summary::-webkit-details-marker { display: none; }
.drawer-summary-title { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; font-weight: 700; color: var(--ink); }
.drawer-caret { color: var(--ink-3); transition: transform .15s ease; flex-shrink: 0; }
.drawer-card[open] > summary .drawer-caret { transform: rotate(180deg); }
.drawer-card-body { padding: 0 22px 18px; }
.drawer-view-all { display: block; text-align: center; margin-top: 8px; font-size: 0.78rem; font-weight: 700; color: var(--iris-deep); text-decoration: none; }
.card.hoverable:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--iris-line); }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 18px; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease;
  display: block; text-decoration: none; color: inherit;
}
.kpi-card[href]:hover { border-color: var(--iris-line); }
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.kpi-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi-value { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.kpi-hint, .kpi-delta { font-size: 0.74rem; color: var(--ink-2); margin-top: 5px; }
.kpi-delta.up { color: var(--emerald); font-weight: 600; }
.kpi-delta.down { color: var(--rose); font-weight: 600; }
.kpi-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--iris-soft); color: var(--iris-deep);
}
.kpi-card.tone-emerald .kpi-icon { background: var(--emerald-bg); color: var(--emerald); }
.kpi-card.tone-amber .kpi-icon { background: var(--amber-bg); color: var(--amber); }
.kpi-card.tone-rose .kpi-icon { background: var(--rose-bg); color: var(--rose); }
.kpi-card.tone-sky .kpi-icon { background: var(--sky-bg); color: var(--sky); }

/* Status pills */
.status-badge, .pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; padding: 3.5px 10px;
  background: var(--line-2); color: var(--ink-2);
  text-transform: capitalize; white-space: nowrap;
}
.status-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.status-badge.paid, .status-badge.active, .status-badge.signed { background: var(--emerald-bg); color: var(--emerald); }
.status-badge.sent, .status-badge.trialing, .status-badge.in_progress { background: var(--amber-bg); color: var(--amber); }
.status-badge.past_due, .status-badge.suspended, .status-badge.overdue { background: var(--rose-bg); color: var(--rose); }
.status-badge.new, .status-badge.info { background: var(--sky-bg); color: var(--sky); }
.status-badge.draft { background: var(--line-2); color: var(--ink-2); }
.pill.disconnected { background: var(--amber-bg); color: var(--amber); }
.pill::before { display: none; }

/* Tag chips */
.chip { display: inline-flex; align-items: center; font-size: 0.7rem; font-weight: 600; color: var(--ink-2); background: var(--line-2); border-radius: 7px; padding: 2.5px 8px; }

/* ============================================================
   HEALTH INDICATOR (client-list-row status dot)
   ============================================================ */
.health-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; }
.health-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; }
.health-dot.good { color: var(--emerald); } .health-dot.good::before { background: var(--emerald); box-shadow: 0 0 0 3px var(--emerald-bg); }
.health-dot.watch { color: var(--amber); } .health-dot.watch::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.health-dot.risk { color: var(--rose); } .health-dot.risk::before { background: var(--rose); box-shadow: 0 0 0 3px var(--rose-bg); }

/* ============================================================
   LIST ROWS / TABLES
   ============================================================ */
.client-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 6px; border-bottom: 1px solid var(--line-2);
  text-decoration: none; color: inherit; border-radius: 8px;
  transition: background .12s;
}
.client-row:last-child { border-bottom: none; }
a.client-row:hover { background: var(--surface-2); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
  text-align: left; font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { text-align: right; }
.row-link { font-weight: 600; color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--iris-deep); }

/* Progress */
.progress-track { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--thread); transition: width .5s cubic-bezier(.22,.9,.3,1); }
.progress-ring { --pct: 0; width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--iris) calc(var(--pct) * 1%), var(--line-2) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.progress-ring::before { content: ''; position: absolute; inset: 5px; background: var(--surface); border-radius: 50%; }
.progress-ring span { position: relative; font-size: 0.62rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Bar chart (real data) */
.bar-chart { display: flex; align-items: flex-end; gap: 12px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #6d72e2, var(--iris)); min-height: 3px; transition: height .6s cubic-bezier(.22,.9,.3,1); position: relative; }
.bar:hover { background: linear-gradient(180deg, var(--iris), var(--iris-deep)); }
.bar-label { font-size: 0.68rem; color: var(--ink-3); font-weight: 600; }
.bar-value { font-size: 0.64rem; color: var(--ink-2); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Activity feed */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line-2); align-items: flex-start; text-decoration: none; color: inherit; }
.activity-item:last-child { border-bottom: none; }
.activity-item:hover .a-title { color: var(--iris-deep); }
.a-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--line-2); color: var(--ink-2); }
.a-icon.invoice { background: var(--emerald-bg); color: var(--emerald); }
.a-icon.file { background: var(--sky-bg); color: var(--sky); }
.a-icon.project { background: var(--violet-bg); color: var(--violet); }
.a-body { min-width: 0; flex: 1; overflow: hidden; }
.a-title { display: block; font-size: 0.83rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-meta { display: block; font-size: 0.72rem; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-value { font-size: 0.78rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; flex-shrink: 0; align-self: center; }

/* Empty states */
.empty-state { text-align: center; padding: 42px 20px; color: var(--ink-2); }
.empty-state .es-art {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--iris-soft); color: var(--iris);
  display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { margin: 0 0 4px; font-size: 0.98rem; color: var(--ink); }
.empty-state p { margin: 0 0 6px; font-size: 0.83rem; }
.empty-hint { color: var(--ink-3); font-size: 0.8rem; }

/* Preview banner (sample-data screens) */
.preview-banner {
  display: flex; align-items: center; gap: 9px;
  background: var(--amber-bg); color: var(--amber); border: 1px solid #f2ddb4;
  font-size: 0.79rem; font-weight: 600; border-radius: var(--r-md);
  padding: 10px 14px; margin-bottom: 16px;
}
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Proposal template gallery */
.template-search {
  display: flex; align-items: center; gap: 10px; max-width: 420px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px 14px; margin-bottom: 20px; color: var(--ink-3);
}
.template-search svg { flex-shrink: 0; }
.template-search input { border: none; padding: 0; flex: 1; font-size: 0.88rem; background: transparent; color: var(--ink); }
.template-search input:focus { outline: none; box-shadow: none; }
.template-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.template-card { display: flex; flex-direction: column; margin: 0; }
.template-card-preview {
  display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3;
  border-radius: var(--r-md); border: 1px solid var(--line); color: #fff; cursor: pointer;
  margin: 0 0 10px; padding: 0; box-shadow: var(--shadow-1);
  transition: transform .16s ease, box-shadow .16s ease;
}
.template-card-preview:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.template-card-preview.has-thumbnail { background-size: cover; background-position: center; background-repeat: no-repeat; }
.template-card-preview-icon { opacity: .9; }
.template-card-name { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: var(--ink); }
.template-card-desc { font-size: 0.76rem; color: var(--ink-3); margin: 3px 0 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.template-card-use {
  margin: auto 0 0; background: none; border: none; padding: 0; box-shadow: none;
  color: var(--iris-deep); font-weight: 700; font-size: 0.8rem; text-align: left; align-self: flex-start;
}
.template-card-use:hover { text-decoration: underline; transform: none; box-shadow: none; }

/* Platform admin proposal templates */
.admin-template-upload-card { max-width: 560px; }
.admin-template-list-card { padding: 8px 20px; margin-top: 18px; overflow: hidden; }
.admin-table-scroll { width: 100%; overflow-x: auto; }
.admin-template-table { width: 100%; table-layout: fixed; }
.admin-template-table th:nth-child(1) { width: 90px; }
.admin-template-table th:nth-child(2) { width: 20%; }
.admin-template-table th:nth-child(3) { width: auto; }
.admin-template-table th:nth-child(4) { width: 110px; }
.admin-template-table th:nth-child(5) { width: 150px; }
.admin-template-table td { overflow-wrap: anywhere; }
.template-edit-row[hidden] { display: none; }
.template-edit-row > td { padding: 0 12px 18px !important; border-top: 0 !important; }
.template-edit-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.template-edit-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 16px; }
.template-edit-heading p { color: var(--ink-3); font-size: .8rem; margin: 4px 0 0; }
.template-edit-close { background: transparent; border: 0; box-shadow: none; color: var(--ink-3); padding: 0; font-size: 1.5rem; line-height: 1; }
.template-edit-close:hover { transform: none; box-shadow: none; color: var(--ink); }
.template-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-edit-grid label { margin-top: 0; }
.template-file-editor { min-width: 0; }
.current-file { min-height: 42px; display: flex; align-items: center; gap: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: .78rem; color: var(--ink-2); }
.current-file > span:first-child { flex: 0 0 auto; color: var(--ink-3); font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.current-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-thumbnail { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.current-thumbnail img { width: 38px; height: 28px; border-radius: 4px; object-fit: cover; }
.replacement-label { margin: 10px 0 6px !important; font-size: .76rem; }
.replacement-label small { color: var(--ink-3); font-weight: 400; }
.template-file-editor input[type="file"] { width: 100%; font-size: .78rem; }
.template-edit-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.template-edit-actions .template-edit-close { font-size: .8rem; line-height: normal; }
@media (max-width: 800px) {
  .template-edit-grid { grid-template-columns: 1fr; }
  .admin-template-table { min-width: 720px; }
}

/* Proposal document editor (TipTap) */
.editor-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.editor-toolbar button {
  background: none; border: 1px solid transparent; color: var(--ink-2);
  width: 30px; height: 30px; border-radius: 7px; padding: 0; margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700; box-shadow: none; cursor: pointer;
  transition: background .13s, color .13s;
}
.editor-toolbar button:hover { background: var(--line-2); color: var(--ink); transform: none; box-shadow: none; }
.editor-toolbar button.is-active { background: var(--iris-soft); color: var(--iris-deep); }
.editor-toolbar-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; flex-shrink: 0; }
.editor-save-status { margin-left: auto; font-size: 0.74rem; color: var(--ink-3); white-space: nowrap; padding-left: 10px; }

.editor-surface { padding: 28px 40px 60px; min-height: 500px; }
.editor-surface .ProseMirror { outline: none; font-size: 0.92rem; color: var(--ink); line-height: 1.65; }
.editor-surface .ProseMirror h1 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin: 0 0 14px; letter-spacing: -0.01em; }
.editor-surface .ProseMirror h2 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin: 22px 0 10px; }
.editor-surface .ProseMirror h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 18px 0 8px; }
.editor-surface .ProseMirror p { margin: 0 0 12px; }
.editor-surface .ProseMirror ul, .editor-surface .ProseMirror ol { margin: 0 0 12px; padding-left: 22px; }
.editor-surface .ProseMirror li { margin-bottom: 4px; }
.editor-surface .ProseMirror blockquote { border-left: 3px solid var(--line); margin: 0 0 12px; padding: 4px 0 4px 14px; color: var(--ink-2); }
.editor-surface .ProseMirror table { border-collapse: collapse; width: 100%; margin: 0 0 16px; }
.editor-surface .ProseMirror th, .editor-surface .ProseMirror td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; font-size: 0.88rem; vertical-align: top; }
.editor-surface .ProseMirror th { background: var(--surface-2); font-weight: 700; }
.editor-surface .ProseMirror td p, .editor-surface .ProseMirror th p { margin: 0; }
.flash-banner {
  display: flex; align-items: center; gap: 9px; background: var(--emerald-bg); color: var(--emerald);
  border: 1px solid #cdeadd; font-size: 0.82rem; font-weight: 600;
  border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 16px;
}
.flash-banner.error { background: var(--rose-bg); color: var(--rose); border-color: #f4cdd6; }
.flash-banner code { background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 0.85rem; }
.suspend-banner {
  background: var(--rose-bg); color: var(--rose); border: 1px solid #f4cdd6;
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; font-size: 0.84rem;
}
.link-box {
  background: var(--surface); border: 1px dashed var(--iris-line); color: var(--iris-deep);
  border-radius: var(--r-md); padding: 10px 14px; font-size: 0.8rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 4px;
  cursor: copy;
}

/* ============================================================
   CLIENT DETAIL / TABS
   ============================================================ */
.client-detail-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; margin-top: 8px; align-items: start; }
.client-avatar {
  width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; color: #fff;
}
.info-field { margin-top: 14px; }
.info-field label { margin: 0 0 2px; font-size: 0.66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.info-field p { margin: 0; font-size: 0.85rem; }
.contact-stack { display: flex; margin-top: 6px; }
.contact-avatar-lg {
  width: 34px; height: 34px; border-radius: 50%; background: var(--iris-soft); color: var(--iris-deep);
  border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; margin-left: -8px; box-shadow: var(--shadow-1);
}
.contact-stack .contact-avatar-lg:first-child { margin-left: 0; }
.contact-add-btn { background: var(--line-2); color: var(--ink-2); cursor: pointer; transition: background .13s; }
.contact-add-btn:hover { background: var(--iris-soft); color: var(--iris-deep); }
.contact-name-list { margin-top: 10px; }
.contact-name-row { padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 0.82rem; }
.contact-name-row:last-child { border-bottom: none; }

.tab-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab-link {
  text-decoration: none; color: var(--ink-2); font-size: 0.84rem; font-weight: 600;
  padding: 8px 14px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .13s;
}
.tab-link:hover { color: var(--ink); }
.tab-link.active { color: var(--iris-deep); border-bottom-color: var(--iris); }

.project-table-card { padding: 6px 12px; }
.project-table-header { display: flex; justify-content: space-between; padding: 10px 8px; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); border-bottom: 1px solid var(--line-2); }
.project-table-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px; border-bottom: 1px solid var(--line-2); font-size: 0.86rem; transition: background .12s; border-radius: 8px; }
.project-table-row:hover { background: var(--surface-2); }
.project-name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.project-mini-logo { width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.6rem; font-weight: 700; }
.project-due { color: var(--ink-3); font-size: 0.78rem; }
.project-table-footer { display: flex; justify-content: space-between; align-items: center; padding: 11px 8px 9px; font-size: 0.76rem; color: var(--ink-3); }
.project-footer-arrow { color: var(--ink-2); display: flex; padding: 5px; border-radius: 7px; }
.project-footer-arrow:hover { background: var(--line-2); }

/* ============================================================
   PROJECT DETAIL
   ============================================================ */
.project-layout { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-top: 10px; align-items: start; }
.project-main { min-width: 0; }
.project-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.side-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.side-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 0.84rem; font-family: var(--font-display); }
.side-panel-body { padding: 8px 12px 12px; max-height: 260px; overflow-y: auto; }
.icon-upload-btn { background: var(--line-2); border: none; color: var(--ink-2); width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; padding: 0; transition: background .13s, color .13s; }
.icon-upload-btn:hover { background: var(--iris-soft); color: var(--iris-deep); transform: none; box-shadow: none; }

.milestone-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line-2); }
.milestone-row:last-of-type { border-bottom: none; }
.milestone-check {
  width: 22px; height: 22px; min-width: 22px; border-radius: 7px;
  border: 1.5px solid var(--line); background: var(--surface); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin: 0; padding: 0; transition: all .15s;
}
.milestone-check:hover { border-color: var(--iris); transform: none; box-shadow: none; }
.milestone-check.checked { background: var(--emerald); border-color: var(--emerald); }

.budget-burn { margin-top: 4px; }
.budget-burn .bb-row { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--ink-2); margin-bottom: 5px; font-weight: 600; }

/* Files */
.file-item-wrap { display: flex; align-items: center; gap: 4px; }
.file-item {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  background: none; border: none; padding: 9px 6px; margin: 0;
  font-family: var(--font-ui); font-size: 0.83rem; color: var(--ink);
  cursor: pointer; text-align: left; border-radius: 8px;
  transition: background .12s;
}
.file-item:hover { background: var(--surface-2); transform: none; box-shadow: none; }
.file-icon {
  width: 34px; height: 34px; min-width: 34px; border-radius: 9px;
  background: var(--sky-bg); color: var(--sky);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.56rem; font-weight: 800; letter-spacing: .02em;
  overflow: hidden;
}
.file-icon.thumb { padding: 0; background: var(--surface-3); }
.file-icon.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.file-delete-btn { background: none; border: none; color: var(--ink-3); padding: 7px; margin: 0; cursor: pointer; border-radius: 7px; display: flex; }
.file-delete-btn:hover { background: var(--rose-bg); color: var(--rose); transform: none; box-shadow: none; }
.icon-btn { background: none; border: none; color: var(--ink-3); padding: 7px; margin: 0; cursor: pointer; border-radius: 7px; display: flex; }
.icon-btn:hover { background: var(--iris-soft); color: var(--iris-deep); transform: none; box-shadow: none; }

/* Drag-drop zone (progressive enhancement) */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--r-md);
  padding: 18px; text-align: center; color: var(--ink-3); font-size: 0.8rem;
  transition: border-color .15s, background .15s; margin-top: 12px;
}
.dropzone.dragover { border-color: var(--iris); background: var(--iris-soft); color: var(--iris-deep); }

/* File preview modal */
.file-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(21,23,28,.5); backdrop-filter: blur(4px); z-index: 200; align-items: center; justify-content: center; padding: 24px; }
.file-modal-overlay.open { display: flex; animation: pageIn .2s ease; }
.file-modal { background: var(--surface); border-radius: var(--r-lg); width: min(880px, 100%); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-pop); }
.file-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 0.9rem; font-family: var(--font-display); }
.file-modal-body { overflow: auto; padding: 0; min-height: 200px; max-height: 72vh; }
.file-modal-body iframe, .file-modal-body img { width: 100%; border: none; display: block; }
.file-modal-body iframe { height: 72vh; }
.file-modal-body img { object-fit: contain; max-height: 72vh; background: var(--surface-3); }
.file-modal-body .doc-render, .file-modal-body pre { padding: 24px; font-size: 0.85rem; }
.file-modal-body table { border-collapse: collapse; width: 100%; font-size: 0.8rem; }
.file-modal-body table td, .file-modal-body table th { border: 1px solid var(--line); padding: 5px 9px; }
/* PDF pages rendered via pdf.js as a scrollable stack of canvases */
.pdf-preview { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 20px; background: var(--surface-3); }
.pdf-preview canvas { box-shadow: var(--shadow-2); border-radius: 3px; max-width: 100%; height: auto; }

/* ============================================================
   INVOICE DOCUMENT
   ============================================================ */
.invoice-doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-2); margin-top: 14px; }
.invoice-banner img { width: 100%; max-height: 140px; object-fit: cover; display: block; }
.invoice-body { padding: 34px 40px; }
.invoice-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.invoice-brand { display: flex; gap: 14px; }
.invoice-logo { width: 54px; height: 54px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); }
.invoice-logo-placeholder { width: 54px; height: 54px; border-radius: 12px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 800; }
.invoice-biz-name { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.invoice-muted { color: var(--ink-3); font-size: 0.78rem; }
.invoice-meta { text-align: right; }
.invoice-title { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: .12em; color: var(--ink); }
.invoice-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); display: inline-block; min-width: 52px; }
.invoice-parties { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); margin-bottom: 8px; font-size: 0.86rem; }
.invoice-dates div { margin-bottom: 3px; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 10px; }
.invoice-table th { text-align: left; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 9px 8px; border-bottom: 1px solid var(--line); }
.invoice-table td { padding: 11px 8px; border-bottom: 1px solid var(--line-2); }
.invoice-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-table input { padding: 7px 10px; }
.invoice-totals { margin-left: auto; max-width: 280px; margin-top: 16px; }
.invoice-total-row { display: flex; justify-content: space-between; padding: 6px 8px; font-size: 0.87rem; color: var(--ink-2); }
.invoice-total-row.grand { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: var(--ink); border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 10px; }
.invoice-notes { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 0.83rem; color: var(--ink-2); }
.row-remove { background: none; border: none; color: var(--ink-3); font-size: 1.1rem; cursor: pointer; padding: 4px 8px; margin: 0; border-radius: 7px; }
.row-remove:hover { background: var(--rose-bg); color: var(--rose); transform: none; box-shadow: none; }
/* Payment status timeline */
.pay-timeline { display: flex; align-items: center; gap: 0; margin: 18px 0 6px; }
.pay-step { display: flex; align-items: center; gap: 8px; font-size: 0.74rem; font-weight: 600; color: var(--ink-3); }
.pay-step .p-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: center; color: #fff; }
.pay-step.done { color: var(--emerald); }
.pay-step.done .p-dot { background: var(--emerald); border-color: var(--emerald); }
.pay-step.current { color: var(--iris-deep); }
.pay-step.current .p-dot { border-color: var(--iris); }
.pay-line { flex: 1; height: 2px; background: var(--line); margin: 0 10px; min-width: 30px; }
.pay-line.done { background: var(--emerald); }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.settings-row:last-child { border-bottom: none; }
.s-label { font-weight: 600; font-size: 0.88rem; }
.s-desc { color: var(--ink-3); font-size: 0.77rem; }

/* ============================================================
   COMMAND PALETTE (⌘K)
   ============================================================ */
.cmdk-overlay { display: none; position: fixed; inset: 0; background: rgba(21,23,28,.42); backdrop-filter: blur(5px); z-index: 300; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px; }
.cmdk-overlay.open { display: flex; }
.cmdk {
  background: var(--surface); border-radius: 16px; width: min(600px, 100%);
  box-shadow: var(--shadow-pop); overflow: hidden;
  animation: cmdkIn .18s cubic-bezier(.22,.9,.3,1) both;
  border: 1px solid var(--line);
}
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); color: var(--ink-3); }
.cmdk-input-row input { border: none; box-shadow: none; padding: 0; font-size: 1rem; background: transparent; }
.cmdk-input-row input:focus { box-shadow: none; }
.cmdk-list { max-height: 44vh; overflow-y: auto; padding: 8px; }
.cmdk-group-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 10px 12px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 10px; cursor: pointer; text-decoration: none; color: var(--ink);
  font-size: 0.88rem;
}
.cmdk-item .ck-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cmdk-item small { color: var(--ink-3); margin-left: auto; font-size: 0.72rem; }
.cmdk-item.selected, .cmdk-item:hover { background: var(--iris-soft); }
.cmdk-item.selected .ck-icon { background: #fff; color: var(--iris-deep); }
.cmdk-empty { padding: 26px; text-align: center; color: var(--ink-3); font-size: 0.85rem; }
.cmdk-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 0.68rem; font-weight: 600; }
.cmdk-foot kbd { background: var(--line-2); border-radius: 4px; padding: 1px 5px; font-family: var(--font-ui); }

/* ============================================================
   ADMIN — same design system as the app, with a slightly
   different topbar identity. Colors come from theme tokens, so
   the theme switcher affects admin exactly like the rest.
   ============================================================ */
.admin-shell { min-height: 100vh; background: var(--bg); color: var(--ink); padding-bottom: 60px; }
.admin-topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 13px 28px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.admin-brand { display: flex; align-items: center; gap: 11px; color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 0.92rem; }
.admin-brand small { display: block; color: var(--ink-3); font-family: var(--font-ui); font-weight: 500; font-size: 0.66rem; letter-spacing: 0; }
.admin-brand .badge-mark {
  width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: var(--surface);
  display: flex; align-items: center; justify-content: center; position: relative; isolation: isolate;
}
.admin-brand .badge-mark::after { content: ''; position: absolute; inset: -2px; border-radius: 12px; background: var(--thread); z-index: -1; }
.admin-topbar nav { display: flex; gap: 4px; flex: 1; }
.admin-topbar nav a {
  color: var(--ink-3); text-decoration: none; font-size: 0.83rem; font-weight: 600;
  padding: 7px 13px; border-radius: 9px; transition: color .13s, background .13s;
}
.admin-topbar nav a:hover { color: var(--ink); background: var(--surface-3); }
.admin-topbar nav a.active { color: var(--ink); background: var(--surface-3); }
.admin-who { display: flex; align-items: center; gap: 12px; font-size: 0.78rem; color: var(--ink-3); }
.admin-who a { color: var(--ink); text-decoration: none; font-weight: 600; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); }
.admin-who a:hover { background: var(--surface-3); }
.admin-content { max-width: 1180px; margin: 0 auto; padding: 30px 28px 0; }

.admin-shell .admin-filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-shell .admin-filters input { max-width: 320px; }
.admin-shell .admin-filters select { width: auto; }
.admin-shell .admin-filters button { margin: 0; }
.admin-shell .health-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 0.84rem; }
.admin-shell .health-row:last-child { border-bottom: none; }
.admin-shell .health-row .h-label { color: var(--ink-3); }
.admin-shell .health-row .h-value { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.admin-shell .tenant-meta { display: flex; gap: 34px; margin: 4px 0 22px; }
.admin-shell .tenant-meta div { font-size: 0.76rem; color: var(--ink-3); }
.admin-shell .tenant-meta strong { display: block; font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.admin-shell .action-row { display: flex; gap: 10px; align-items: center; }
.admin-shell .action-row select, .admin-shell .action-row input { width: auto; flex: 1; }
.admin-shell .action-row button { margin: 0; white-space: nowrap; }
.panel-grid { display: grid; gap: 16px; }
.admin-section-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.admin-section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); }
.stat-value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; }
.stat-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { text-align: left; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background .12s; }
.admin-table tbody tr:hover { background: var(--surface-2); }
.admin-table .row-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.admin-table .row-link:hover { color: var(--iris-deep); }

/* ============================================================
   AUTH + PUBLIC PAGES
   ============================================================ */
.wrap { max-width: 560px; margin: 0 auto; padding: 60px 24px; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-pane { display: flex; flex-direction: column; justify-content: center; padding: 60px 8vw; }
.auth-side {
  background: #0e1015; color: #c8ccd8; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px 48px;
}
.auth-side::before {
  content: ''; position: absolute; inset: -40%;
  background:
    radial-gradient(600px 420px at 20% 15%, rgba(84,90,216,.35), transparent 60%),
    radial-gradient(520px 420px at 85% 80%, rgba(26,158,143,.22), transparent 60%),
    radial-gradient(420px 320px at 70% 20%, rgba(217,147,47,.14), transparent 60%);
  filter: blur(6px);
}
.auth-side > * { position: relative; }
.auth-side .quote { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: #f3f4f8; line-height: 1.4; letter-spacing: -0.015em; max-width: 26ch; }
.auth-side .aside-brand { display: flex; align-items: center; gap: 10px; color: #f3f4f8; font-family: var(--font-display); font-weight: 800; }
.auth-side .aside-foot { color: #8b90a0; font-size: 0.78rem; }
/* Login rail photo rotation — sourced from whatever's in public/images
   (see listLoginImages() in server.js); the decorative gradient blur
   above is dropped in favor of the photos + a legibility scrim. */
.auth-side.has-photos::before { display: none; }
.auth-side-bg { position: absolute; inset: 0; overflow: hidden; }
.auth-side-photo { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity 1.4s ease-in-out; }
.auth-side-photo.active { opacity: 1; }
.auth-side-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,16,21,.35) 0%, rgba(14,16,21,.55) 55%, rgba(14,16,21,.85) 100%); }

/* Landing */
.landing { background: var(--bg); }
.landing-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1080px; margin: 0 auto; padding: 22px 28px; }
.landing-nav .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1rem; }
.landing-nav .brand .brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; position: relative; isolation: isolate; }
.landing-nav .brand .brand-mark::after { content: ''; position: absolute; inset: -2px; border-radius: 12px; background: var(--thread); z-index: -1; }
.login-link { text-decoration: none; font-weight: 600; font-size: 0.87rem; color: var(--ink); border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 16px; box-shadow: var(--shadow-1); transition: transform .12s, box-shadow .12s; }
.login-link:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.hero { max-width: 760px; margin: 0 auto; text-align: center; padding: 72px 24px 46px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 0.72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--iris-deep); background: var(--iris-soft); border: 1px solid var(--iris-line); border-radius: 999px; padding: 5px 13px; margin-bottom: 20px; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08; letter-spacing: -0.035em; margin-bottom: 16px; }
.hero h1 em { font-style: normal; background: var(--thread); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: var(--ink-2); font-size: 1.02rem; max-width: 56ch; margin: 0 auto 26px; }
.cta-row { display: flex; gap: 10px; justify-content: center; }
.cta-row .btn { margin: 0; padding: 11px 22px; }
.cta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 1080px; margin: 26px auto 90px; padding: 0 28px; }
.feature-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); transition: transform .16s ease, box-shadow .16s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.feature-card h3 { margin: 12px 0 6px; font-size: 0.95rem; }
.feature-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 0.82rem; }
.f-icon { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--iris-soft); color: var(--iris-deep); }
.f-status { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; border-radius: 999px; padding: 3px 10px; }
.f-status.live { background: var(--emerald-bg); color: var(--emerald); }
.f-status.soon { background: var(--line-2); color: var(--ink-3); }

/* Coming soon */
.coming-soon { text-align: center; padding: 60px 30px; }
.coming-soon .icon { font-size: 2rem; margin-bottom: 12px; }

/* Skeletons + reveal micro-interactions */
.skeleton { background: linear-gradient(90deg, var(--line-2) 25%, var(--surface-2) 50%, var(--line-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.reveal { opacity: 0; transform: translateY(8px); animation: pageIn .4s cubic-bezier(.22,.9,.3,1) forwards; }
.reveal.d1 { animation-delay: .04s; } .reveal.d2 { animation-delay: .09s; }
.reveal.d3 { animation-delay: .14s; } .reveal.d4 { animation-delay: .19s; }

/* ============================================================
   CLIENT LIST (compact rows — replaces card grid on the dashboard)
   ============================================================ */
.dashboard-split { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.client-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.client-list-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; transition: background .12s;
}
.client-list-row:last-child { border-bottom: none; }
.client-list-row:hover, .client-list-row:focus-visible { background: var(--surface-2); }
.client-list-row.static { cursor: default; }
.client-list-row.static:hover { background: none; }
.client-list-row:focus-visible { outline: none; box-shadow: inset 2px 0 0 var(--iris); }
.clr-avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.78rem; color: #fff;
}
.clr-id { min-width: 0; width: 180px; flex-shrink: 0; }
.clr-name { display: block; font-weight: 700; font-size: 0.87rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clr-contact { display: block; font-size: 0.74rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clr-stats { display: flex; gap: 28px; flex: 1; min-width: 0; }
.clr-stat { min-width: 0; }
.clr-stat .cs-label { display: block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.clr-stat .cs-value { display: block; font-size: 0.83rem; font-weight: 700; margin-top: 1px; white-space: nowrap; }
.clr-chevron { color: var(--ink-3); flex-shrink: 0; }
.client-list-row .status-badge { flex-shrink: 0; }
.client-list-row .health-dot { flex-shrink: 0; }
.client-list-row .warmth-chip { flex-shrink: 0; }
/* Leads/Projects/Invoices/Proposals rows are <details> now (inline expand
   instead of a slide-in drawer) — summary carries the row's look, the
   wrapping <details> carries the row-separator border. The Clients list
   keeps its plain-div + side-drawer pattern, unaffected by this. */
.client-list > details.client-list-row-wrap { border-bottom: 1px solid var(--line-2); }
.client-list > details.client-list-row-wrap:last-child { border-bottom: none; }
summary.client-list-row { cursor: pointer; list-style: none; border-bottom: none; }
summary.client-list-row::-webkit-details-marker { display: none; }
.client-list-row-wrap[open] .drawer-caret { transform: rotate(180deg); }
.list-row-expand { padding: 4px 18px 18px; }
.clr-details-link {
  flex-shrink: 0; font-size: 0.76rem; font-weight: 700; color: var(--iris-deep);
  text-decoration: none; padding: 4px 2px;
}
.clr-details-link:hover { text-decoration: underline; }
.drawer-section-title { margin: 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.drawer-section-link { font-size: 0.74rem; font-weight: 700; color: var(--iris-deep); text-decoration: none; }
.drawer-section-link:hover { text-decoration: underline; }
@media (max-width: 1100px) {
  .clr-stats { display: none; }
}

/* ============================================================
   DRAWER — slides in from the right, used for quick-look summaries
   without navigating away from the current list.
   ============================================================ */
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 250;
  background: rgba(21,23,28,.4); backdrop-filter: blur(3px);
}
.drawer-overlay.open { display: block; animation: pageIn .15s ease; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(400px, 92vw);
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(.22,.9,.3,1);
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line-2); }
.drawer-close { background: var(--surface-3); border: none; color: var(--ink-2); width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; padding: 0; flex-shrink: 0; }
.drawer-close:hover { background: var(--line); transform: none; box-shadow: none; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-2); }
.drawer-foot a { flex: 1; margin: 0; text-align: center; }

/* Inline list drawers: quick-look content expands beneath the selected row. */
.client-list > .drawer-overlay {
  position: static; inset: auto; width: 100%; z-index: auto;
  background: transparent; backdrop-filter: none; padding: 0 16px 18px;
}
.client-list > .drawer-overlay.open { display: block; }
.client-list > .drawer-overlay .drawer {
  position: static; top: auto; right: auto; width: 100%; height: auto;
  max-height: none; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: none; transform: none;
}
.client-list > .drawer-overlay.open .drawer { transform: none; }
.client-list > .drawer-overlay .drawer-body { overflow: visible; }
.client-list > .drawer-overlay .drawer-foot a { flex: 0 1 auto; margin-left: auto; }
.client-list > .drawer-overlay .drawer-head .drawer-close { display: none; }
.client-list > .drawer-overlay .drawer-head { display: none; }
@media (min-width: 900px) {
  .client-list > .drawer-overlay .drawer-body > .kpi-grid { max-width: 620px; }
}

/* Email workspace */
.messages-main { max-width: none; }
.messages-page-head { margin-bottom: 14px; }
.mail-shell { min-height: 690px; display: grid; grid-template-columns: 210px 340px minmax(360px, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.mail-folders { padding: 18px 12px; background: var(--surface-2); border-right: 1px solid var(--line); }
.mail-compose-button { display: block; width: 100%; text-align: center; margin-bottom: 26px; text-decoration: none; }
.mail-folders nav { display: flex; flex-direction: column; gap: 4px; }
.mail-folders nav a { display: flex; justify-content: space-between; padding: 9px 11px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .84rem; }
.mail-folders nav a.active, .mail-folders nav a:hover { background: var(--iris-soft); color: var(--iris-deep); font-weight: 700; }
.mail-folders nav small { color: var(--ink-3); }
.mail-client-filter { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.mail-client-filter strong { padding: 0 10px 8px; color: var(--ink-3); font-size: .67rem; text-transform: uppercase; letter-spacing: .05em; }
.mail-client-filter a { padding: 7px 10px; color: var(--ink-2); font-size: .78rem; text-decoration: none; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-client-filter a.active, .mail-client-filter a:hover { background: var(--surface); color: var(--ink); font-weight: 700; }
.mail-list-pane { border-right: 1px solid var(--line); overflow-y: auto; max-height: 690px; }
.mail-list-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; padding: 18px; background: var(--surface); border-bottom: 1px solid var(--line); }
.mail-list-head span { color: var(--ink-3); font-size: .74rem; }
.mail-list-item { display: block; padding: 15px 18px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.mail-list-item:hover, .mail-list-item.active { background: var(--iris-soft); }
.mail-list-item.unread { box-shadow: inset 3px 0 var(--iris); }
.mail-list-item > div { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.mail-list-item strong { font-size: .8rem; }
.mail-list-item time { color: var(--ink-3); font-size: .65rem; }
.mail-list-item b { display: block; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-list-item p { color: var(--ink-3); font-size: .73rem; margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-reading-pane { display: flex; flex-direction: column; min-width: 0; }
.mail-reading-pane > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.mail-reading-pane h2 { margin: 4px 0 0; font-size: 1.1rem; }
.mail-message-meta { display: flex; align-items: center; gap: 10px; padding: 18px 24px 0; }
.mail-message-meta > div { display: flex; flex-direction: column; font-size: .78rem; }
.mail-message-meta small { color: var(--ink-3); }
.mail-message-body { padding: 24px; white-space: pre-wrap; line-height: 1.65; font-size: .88rem; }
.email-compose-window { position: fixed; right: 24px; bottom: 20px; z-index: 400; width: min(620px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-pop); }
.email-compose-window > header { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.email-compose-window > header a { color: var(--ink-2); font-size: 1.4rem; text-decoration: none; }
.email-compose-window form { display: flex; flex-direction: column; }
.email-compose-window label { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; margin: 0; padding: 7px 14px; border-bottom: 1px solid var(--line); color: var(--ink-3); font-size: .76rem; }
.email-compose-window select, .email-compose-window input { border: 0; border-radius: 0; box-shadow: none; }
.email-compose-window > form > input { border-bottom: 1px solid var(--line); }
.email-compose-window textarea { min-height: 270px; border: 0; border-radius: 0; resize: vertical; box-shadow: none; padding: 16px; }
.email-compose-window footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.email-compose-window footer small { color: var(--ink-3); }
.quick-email-overlay { display: none; position: fixed; inset: 0; z-index: 500; pointer-events: none; }
.quick-email-overlay.open { display: block; }
.quick-email-window { position: absolute; right: 24px; bottom: 20px; width: min(640px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-pop); pointer-events: auto; animation: pageIn .16s ease; }
.quick-email-window > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.quick-email-window > header button { border: 0; background: transparent; box-shadow: none; color: var(--ink-3); font-size: 1.4rem; line-height: 1; padding: 0; }
.quick-email-window > header button:hover { color: var(--ink); transform: none; }
.quick-email-window form { display: flex; flex-direction: column; }
.quick-email-recipient { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: .78rem; }
.quick-email-recipient span { color: var(--ink-3); }
.quick-email-window input { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; }
.quick-email-window textarea { min-height: 280px; padding: 16px; border: 0; border-radius: 0; resize: vertical; box-shadow: none; }
.quick-email-window footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; padding: 11px 14px; border-top: 1px solid var(--line); }
.quick-email-window footer span { color: var(--ink-3); font-size: .75rem; }
.quick-email-window footer span.success { color: var(--emerald); }
.quick-email-window footer span.error { color: var(--rose); }
.client-quick-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.client-summary-section { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); box-shadow: none; }
.client-summary-section.project-section,
.client-summary-section.invoice-section,
.client-summary-section.task-section,
.client-summary-section.contacts-section { border-top: 1px solid var(--line-2); }
.client-edit-form { padding: 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-1); }
.client-edit-form[hidden], .profile-client-edit[hidden] { display: none; }
.client-edit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.client-edit-grid label { margin: 0; }
.profile-client-edit { display: grid; gap: 8px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.profile-client-edit label { margin: 0; }
.client-summary-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.client-summary-section-head h3 { margin: 0; color: var(--ink-2); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.client-summary-section-head button { border: 0; background: transparent; box-shadow: none; padding: 0; }
.client-contact-list { display: flex; flex-direction: column; gap: 7px; }
.client-contact-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto auto; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: var(--surface-2); }
.client-contact-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--iris-soft); color: var(--iris-deep); font-size: .7rem; font-weight: 800; }
.client-contact-row > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.client-contact-row strong { font-size: .8rem; }
.client-contact-row strong small { color: var(--iris-deep); font-size: .6rem; text-transform: uppercase; }
.client-contact-row a:not(.btn) { color: var(--ink-3); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
.drawer-contact-form { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto; gap: 7px; margin-top: 10px; }
.drawer-contact-form[hidden] { display: none; }
.client-list > .drawer-overlay .drawer-body { padding: 12px 16px 14px; }
.client-list > .drawer-overlay .drawer-body > div:first-child { margin-bottom: 10px !important; }
.client-list > .drawer-overlay .drawer-body > .kpi-grid { gap: 10px; margin-bottom: 10px !important; max-width: 560px; }
.client-list > .drawer-overlay .drawer-body > .kpi-grid .kpi-card { min-height: 0; padding: 12px 14px; border-radius: 10px; box-shadow: none; }
.client-list > .drawer-overlay .drawer-body > .kpi-grid .kpi-label { margin-bottom: 5px; font-size: .65rem; }
.client-list > .drawer-overlay .drawer-body > .kpi-grid .kpi-value { font-size: 1rem !important; }
.client-summary-section .activity-item { padding: 8px 2px; }
.client-summary-section .empty-hint { margin: 6px 0; }
.contact-editor-panel { margin-bottom: 16px; }
.contact-form-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)) auto; align-items: end; gap: 10px; }
.contact-form-grid label, .contact-inline-edit label { margin: 0; }
.contact-directory { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.contact-directory-row { display: grid; grid-template-columns: 42px minmax(200px,1fr) minmax(150px,.6fr) auto auto; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.contact-directory-person { display: flex; flex-direction: column; min-width: 0; }
.contact-directory-person span { color: var(--ink-3); font-size: .75rem; }
.contact-client-link { color: var(--iris-deep); font-size: .8rem; font-weight: 700; }
.contact-inline-edit { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)) auto auto auto; align-items: end; gap: 10px; padding: 14px 72px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.contact-inline-edit[hidden] { display: none; }
.checkbox-label { display: flex; align-items: center; gap: 6px; padding-bottom: 10px; }
.checkbox-label input { width: auto; }
@media (max-width: 850px) { .contact-form-grid, .contact-inline-edit { grid-template-columns: 1fr 1fr; } .contact-directory-row { grid-template-columns: 42px 1fr auto; } .contact-client-link { grid-column: 2; } }
@media (max-width: 1050px) { .mail-shell { grid-template-columns: 180px 300px minmax(320px, 1fr); } }
@media (max-width: 820px) { .mail-shell { grid-template-columns: 160px 1fr; } .mail-reading-pane { grid-column: 1 / -1; min-height: 380px; border-top: 1px solid var(--line); } }

/* Secure client project portal */
.portal-page { min-height: 100vh; background: var(--surface-2); }
.portal-topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px max(20px,calc((100vw - 1180px)/2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-topbar > div { display:flex;align-items:center;gap:10px; }.portal-topbar > span{color:var(--ink-3);font-size:.78rem}
.portal-wrap { width:min(1180px,calc(100% - 32px)); margin:24px auto 60px; }
.portal-welcome { padding:24px; margin-bottom:18px; border-radius:var(--r-lg); background:linear-gradient(135deg,var(--iris-soft),var(--surface)); border:1px solid var(--line); }
.portal-welcome h1 { margin:5px 0; }.portal-welcome p{color:var(--ink-2)}.portal-welcome ol{margin-bottom:0;color:var(--ink-2);font-size:.84rem;line-height:1.7}
.portal-project-tabs { display:flex;gap:7px;overflow-x:auto;margin-bottom:14px }.portal-project-tabs a{padding:9px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink-2);text-decoration:none;font-weight:700;font-size:.8rem}.portal-project-tabs a.active{background:var(--iris);color:white;border-color:var(--iris)}
.portal-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px }.portal-main-card{grid-column:1/-1}.portal-main-card h2{margin:4px 0}.portal-project-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.portal-project-meta span{display:flex;flex-direction:column;padding:12px;background:var(--surface-2);border-radius:8px}.portal-project-meta small{color:var(--ink-3);text-transform:uppercase;font-weight:700;font-size:.62rem}
.portal-upload{display:flex;gap:8px;align-items:center}.portal-list{display:flex;flex-direction:column;margin-top:10px}.portal-list>div{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--line-2)}.portal-list span,.portal-list a:not(.btn){display:flex;flex-direction:column}.portal-list small{color:var(--ink-3)}
.portal-message-list{max-height:260px;overflow-y:auto;display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.portal-message-list>div{max-width:85%;padding:9px 11px;border-radius:9px;background:var(--surface-2)}.portal-message-list>div.inbound{align-self:flex-end;background:var(--iris-soft)}.portal-message-list p{margin:3px 0;white-space:pre-wrap;font-size:.8rem}
@media(max-width:760px){.portal-grid{grid-template-columns:1fr}.portal-main-card{grid-column:auto}.portal-topbar>span{display:none}.portal-project-meta{grid-template-columns:1fr}.portal-upload{align-items:stretch;flex-direction:column}}
.portal-contact-add{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:8px}.portal-chat-launch,.portal-chat-widget{display:none!important}.portal-notification-banner{display:flex;align-items:center;gap:12px;padding:13px 16px;margin-bottom:16px;border:1px solid #f0d28d;border-radius:var(--r-md);background:var(--amber-bg);color:var(--ink);text-decoration:none}.portal-notification-banner>span:nth-child(2){display:flex;flex:1;flex-direction:column}.portal-notification-banner small{color:var(--ink-3)}.portal-notification-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--surface);color:var(--amber)}

/* Today's follow-ups — the proactive nudge at the top of the page */
.followup-panel {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 18px 20px 16px;
  margin-bottom: 18px;
}
.followup-panel .fp-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.followup-panel .fp-head svg { color: var(--iris-deep); }
.followup-panel h2 { margin: 0; }
.followup-panel .subtitle { margin: 0 0 14px; }
.followup-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.followup-card {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 14px; text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
}
.followup-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--iris-line); }
.followup-card .fc-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; color: #fff;
}
.followup-card .fc-name { font-weight: 700; font-size: 0.87rem; color: var(--ink); }
.followup-card .fc-reason { font-size: 0.74rem; color: var(--ink-3); margin-top: 1px; }
.followup-card .fc-reason.overdue { color: var(--rose); font-weight: 600; }
.followup-card .fc-value { margin-left: auto; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.followup-empty { display: flex; align-items: center; gap: 12px; padding: 6px 2px; color: var(--ink-2); font-size: 0.87rem; }
.followup-empty .fe-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--emerald-bg); color: var(--emerald); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Pinned — richer "plan card" style cards in a horizontally scrollable
   carousel, with left/right arrows for when there are more than fit. */
.pinned-carousel-wrap { position: relative; }
.pinned-carousel {
  display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth;
  scroll-snap-type: x proximity; padding: 2px 2px 6px; margin: 0 -2px;
  scrollbar-width: none;
}
.pinned-carousel::-webkit-scrollbar { display: none; }
.pinned-card-v2 {
  flex: 0 0 280px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px; text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
}
.pinned-card-v2:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--iris-line); }
.pinned-card-v2-head { display: flex; align-items: center; gap: 9px; min-height: 58px; padding: 12px 14px; margin: -16px -18px 14px; border-radius: var(--r-lg) var(--r-lg) 0 0; font-weight: 700; font-size: 0.92rem; color: #fff; }
.pinned-card-v2-head > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pinned-card-v2-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; background: rgba(255,255,255,.16) !important; border: 1px solid rgba(255,255,255,.18); }
.pinned-card-client .pinned-card-v2-head { background: linear-gradient(135deg, #37378d, #545ad8); }
.pinned-card-project .pinned-card-v2-head { background: linear-gradient(135deg, #07566d, #0b7290); }
.pinned-card-invoice .pinned-card-v2-head { background: linear-gradient(135deg, #0a6248, #12805c); }
.pinned-stats-row { display: flex; margin-bottom: 12px; }
.pinned-stat { flex: 1; min-width: 0; padding: 0 8px; }
.pinned-stat:first-child { padding-left: 0; }
.pinned-stat + .pinned-stat { border-left: 1px solid var(--line-2); }
.pinned-stat-label { font-size: 0.62rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; }
.pinned-stat-value { font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned-divider { height: 1px; background: var(--line-2); margin: 0 0 10px; }
.pinned-notes-title { font-size: 0.74rem; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.pinned-note { display: flex; align-items: flex-start; gap: 6px; font-size: 0.78rem; color: var(--ink-2); margin-bottom: 6px; line-height: 1.35; }
.pinned-note:last-child { margin-bottom: 0; }
.pinned-note svg { flex-shrink: 0; margin-top: 2px; color: var(--emerald); }
.pinned-carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 2;
  padding: 0; margin: 0; color: var(--ink-2);
}
.pinned-carousel-arrow:hover { border-color: var(--iris-line); color: var(--iris-deep); transform: translateY(-50%); box-shadow: var(--shadow-2); }
.pinned-carousel-arrow.prev { left: -14px; }
.pinned-carousel-arrow.next { right: -14px; }
.pinned-carousel-arrow:disabled { opacity: .3; cursor: default; pointer-events: none; }

/* Home utility footer — a calm visual reset after the operational dashboard. */
.home-utility-footer { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(440px,.85fr); gap: 16px; margin: 30px 0 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.home-tip-card { position: relative; display: grid; grid-template-columns: 112px minmax(0,1fr) auto; gap: 16px; align-items: center; min-height: 146px; padding: 18px 20px; overflow: hidden; color: var(--ink); border: 1px solid var(--iris-line); border-radius: var(--r-lg); background: linear-gradient(135deg, var(--iris-soft), var(--surface)); }
.home-tip-card .eyebrow { margin-bottom: 5px; }
.home-tip-card h3 { margin: 0 0 5px; font-size: 1rem; }
.home-tip-card p { max-width: 410px; margin: 0; color: var(--ink-2); font-size: .76rem; line-height: 1.55; }
.home-tip-art { display: grid; place-items: center; color: var(--iris); }
.home-tip-art svg { width: 108px; height: 82px; }
.home-tip-link { align-self: end; color: var(--iris-deep); font-size: .75rem; font-weight: 750; text-decoration: none; white-space: nowrap; }
.home-tip-link:hover { text-decoration: underline; }
.home-footer-links { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 16px; padding: 16px 4px; }
.home-footer-links > div { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.home-footer-links strong { color: var(--ink); font-size: .72rem; }
.home-footer-links a { color: var(--ink-3); font-size: .72rem; text-decoration: none; }
.home-footer-links a:hover { color: var(--iris-deep); }
.home-footer-support { position: relative; padding-left: 34px; }
.home-footer-support p { margin: 0; color: var(--ink-3); font-size: .68rem; line-height: 1.45; }
.home-support-art { position: absolute; left: 0; top: -2px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: var(--emerald); background: var(--emerald-bg); }
.home-support-art svg { width: 16px; height: 16px; }

/* Home: "Needs your attention" / "Upcoming" / "Recent" — three equal-height
   cards side by side, each with its own scrollable body so a busy list
   never stretches the row. */
.tri-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.tri-card { display: flex; flex-direction: column; height: 420px; margin-bottom: 0; }
.tri-card > h2, .tri-card .fp-head { flex-shrink: 0; }
.tri-card .tri-card-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.tri-card .tri-card-body::-webkit-scrollbar { width: 6px; }
.tri-card .tri-card-body::-webkit-scrollbar-track { background: transparent; }
.tri-card .tri-card-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.tri-card .tri-card-body::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }
.tri-card .followup-list { grid-template-columns: 1fr; }
.tri-card-foot { flex-shrink: 0; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); text-align: center; }
.tri-card-foot a { font-size: 0.78rem; font-weight: 700; color: var(--iris-deep); text-decoration: none; }
@media (max-width: 980px) {
  .tri-row { grid-template-columns: 1fr; }
  .tri-card { height: auto; max-height: 420px; }
}

/* Pipeline strip */
.pipeline-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.pipeline-stage {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 15px; cursor: pointer; text-align: left;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s;
  font-family: var(--font-ui);
}
.pipeline-stage:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.pipeline-stage.active { border-color: var(--iris); box-shadow: 0 0 0 3px var(--iris-soft); }
.pipeline-stage .ps-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.pipeline-stage .ps-count { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin-top: 4px; }
.pipeline-stage .ps-value { font-size: 0.76rem; color: var(--ink-3); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ps-dot { width: 7px; height: 7px; border-radius: 50%; }
.ps-dot.inbox { background: var(--sky); } .ps-dot.contacted { background: var(--amber); }
.ps-dot.qualified { background: var(--violet); } .ps-dot.proposal_sent { background: var(--emerald); }

/* Lead avatar + warmth indicator — reused by the Leads list row/drawer,
   lead detail header, and Home's New Leads card. */
.lead-avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: #fff;
}
.warmth-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 700; }
.warmth-chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.warmth-chip.warmth-hot { color: var(--rose); } .warmth-chip.warmth-hot::before { background: var(--rose); box-shadow: 0 0 0 3px var(--rose-bg); }
.warmth-chip.warmth-warm { color: var(--amber); } .warmth-chip.warmth-warm::before { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.warmth-chip.warmth-cold { color: var(--ink-3); } .warmth-chip.warmth-cold::before { background: var(--ink-3); box-shadow: 0 0 0 3px var(--line-2); }

/* Lead detail */
.lead-detail-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; margin-top: 8px; align-items: start; }
.lead-timeline { display: flex; flex-direction: column; }
.lt-item { display: flex; gap: 12px; padding: 0 0 20px; position: relative; }
.lt-item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: 0; width: 1px; background: var(--line); }
.lt-item:last-child::before { display: none; }
.lt-icon {
  width: 31px; height: 31px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line);
}
.lt-icon.system { background: var(--sky-bg); color: var(--sky); border-color: transparent; }
.lt-icon.call { background: var(--emerald-bg); color: var(--emerald); border-color: transparent; }
.lt-icon.email { background: var(--violet-bg); color: var(--violet); border-color: transparent; }
.lt-icon.meeting { background: var(--amber-bg); color: var(--amber); border-color: transparent; }
.lt-body { flex: 1; padding-top: 3px; }
.lt-kind { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.lt-text { font-size: 0.87rem; color: var(--ink); margin: 3px 0 4px; line-height: 1.5; white-space: pre-wrap; }
.lt-time { font-size: 0.72rem; color: var(--ink-3); }
.lead-side-card { margin-bottom: 14px; }
.lead-side-card .ls-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); font-size: 0.83rem; }
.lead-side-card .ls-row:last-child { border-bottom: none; }
.lead-side-card .ls-label { color: var(--ink-3); font-size: 0.76rem; }
.stage-pill-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.stage-pill {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 99px; padding: 5px 11px; font-size: 0.74rem; font-weight: 600;
  cursor: pointer; margin: 0; transition: all .13s;
}
.stage-pill:hover { border-color: var(--iris-line); transform: none; box-shadow: none; }
.stage-pill.active { background: var(--iris); border-color: var(--iris); color: #fff; }

/* ============================================================
   PIN STAR — instant toggle, appears on list rows/cards and detail headers
   ============================================================ */
.pin-star {
  background: none; border: none; padding: 4px; margin: 0; cursor: pointer;
  color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center;
  border-radius: 7px; transition: color .13s, background .13s, transform .13s;
  flex-shrink: 0;
}
.pin-star:hover { background: var(--surface-3); color: var(--ink-2); transform: none; box-shadow: none; }
.pin-star.pinned { color: #d9932f; }
.pin-star.pinned:hover { color: #c07f1f; }
.pin-star svg { transition: transform .15s; }
.pin-star.pinned svg { transform: scale(1.08); }

/* ============================================================
   TASKS — quick-add form + two-column board + urgency chips
   ============================================================ */
.task-quick-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-quick-add input, .task-quick-add select { margin: 0; }
.task-board { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.task-column-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display); font-weight: 700; font-size: 0.92rem;
  padding: 4px 4px 12px;
}
.task-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 12px 12px 13px; margin-bottom: 10px;
  border-left: 3px solid var(--line);
}
.task-card.urgency-high { border-left-color: var(--rose); }
.task-card.urgency-medium { border-left-color: var(--amber); }
.task-card.urgency-low { border-left-color: var(--sky); }
.task-card.done { opacity: .68; }
/* Task cards are <details> now (inline expand to edit, no side drawer) —
   the row itself is the <summary>, reusing the flex layout the row div
   used to have, with the native marker stripped. */
.task-card > summary {
  display: flex; align-items: flex-start; gap: 10px; list-style: none; cursor: pointer;
}
.task-card > summary::-webkit-details-marker { display: none; }
.task-card .task-caret { align-self: center; margin-left: 2px; }
.task-card[open] .task-caret { transform: rotate(180deg); }
.task-card .task-inline-form { margin: 0; }
.task-edit-inline { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.task-edit-inline .form-row { margin-top: 10px; }
.task-title { font-size: 0.87rem; font-weight: 600; color: var(--ink); }
.task-notes { font-size: 0.78rem; color: var(--ink-2); margin-top: 3px; }
.task-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 7px; font-size: 0.73rem; color: var(--ink-3); }
.task-meta a { color: var(--ink-3); text-decoration: none; font-weight: 600; }
.task-meta a:hover { color: var(--iris-deep); }
.urgency-chip { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 5px; padding: 2px 7px; }
.urgency-chip.urgency-high { background: var(--rose-bg); color: var(--rose); }
.urgency-chip.urgency-medium { background: var(--amber-bg); color: var(--amber); }
.urgency-chip.urgency-low { background: var(--sky-bg); color: var(--sky); }
@media (max-width: 900px) { .task-board { grid-template-columns: 1fr; } }

/* ============================================================
   EVENTS — agenda list grouped by date
   ============================================================ */
.agenda-date-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--ink);
  margin: 22px 2px 8px; display: flex; align-items: center; gap: 10px;
}
.agenda-date-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.agenda-row { display: flex; gap: 14px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid var(--line-2); }
.agenda-row:last-child { border-bottom: none; }
.agenda-time { width: 76px; flex-shrink: 0; font-size: 0.8rem; font-weight: 700; color: var(--ink); padding-top: 1px; }
.agenda-time small { display: block; font-weight: 500; color: var(--ink-3); font-size: 0.68rem; }
.agenda-body { flex: 1; min-width: 0; }
.agenda-title { font-size: 0.87rem; font-weight: 600; color: var(--ink); }
.agenda-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.76rem; color: var(--ink-3); flex-wrap: wrap; }
.agenda-desc { font-size: 0.79rem; color: var(--ink-2); margin-top: 6px; }

@media (max-width: 1020px) {
  .client-detail-layout, .project-layout, .lead-detail-layout, .dashboard-split { grid-template-columns: 1fr; }
  .project-side { position: static; }
  .pipeline-strip { grid-template-columns: repeat(2, 1fr); }
  .auth-split { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}
@media (max-width: 920px) {
  .home-utility-footer { grid-template-columns: 1fr; }
  .home-footer-links { padding: 4px; }
}
@media (max-width: 760px) {
  .app-shell { flex-direction: column; padding: 10px; gap: 12px; }
  .workspace-topbar, .sidebar.collapsed + .workspace-topbar { position: absolute; top: 16px; left: auto; right: 14px; width: auto; height: 48px; padding: 0; border: 0; background: transparent; }
  .workspace-topbar .brand { display: none; }
  .main-content { padding-top: 16px; }
  .clr-id { width: auto; }
  .sidebar { position: static; width: 100% !important; height: auto; flex-direction: column; }
  .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
  .collapse-btn { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .invoice-body { padding: 22px; }
  .admin-topbar { flex-wrap: wrap; gap: 12px; padding: 12px 16px; }
  .admin-content { padding: 20px 16px 0; }
  .admin-shell .tenant-meta { flex-wrap: wrap; gap: 18px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .home-tip-card { grid-template-columns: 76px 1fr; gap: 10px; padding: 16px; }
  .home-tip-art svg { width: 72px; height: 62px; }
  .home-tip-link { grid-column: 2; justify-self: start; }
  .home-footer-links { grid-template-columns: 1fr 1fr; gap: 18px; }
  .home-footer-support { grid-column: 1 / -1; }
}
@media (max-height: 760px) and (min-width: 761px) {
  .sidebar { padding-top: 8px; padding-bottom: 8px; }
  .sidebar-top { min-height: 112px; margin-bottom: 8px; }
  .product-logo { font-size: 1.7rem; }
  .product-logo svg { width: 72px; height: 72px; }
  .sidebar .nav-group-label { display: none; }
  .collapse-btn { margin-bottom: 3px; }
  .search-trigger { margin-bottom: 4px; padding: 5px 8px; }
  .sidebar .nav-group { margin-bottom: 3px; }
  .sidebar a.nav-item { padding-top: 4px; padding-bottom: 4px; }
}
.contract-editor-page{max-width:none}.contract-editor-toolbar{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:2fr 1fr 1fr auto;align-items:end;gap:10px;padding:12px 14px;margin-bottom:14px;border:1px solid var(--line);border-radius:var(--r-md);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(10px);box-shadow:var(--shadow-1)}.contract-editor-toolbar label{margin:0}.contract-editor-toolbar>div{display:flex;align-items:center;gap:10px;white-space:nowrap}.contract-editor-toolbar>div span{color:var(--ink-3);font-size:.7rem}.contract-document-shell{display:grid;grid-template-columns:minmax(0,820px) 230px;justify-content:center;gap:16px;align-items:start}.contract-document-page{min-height:1050px;padding:76px 80px;background:#fff;color:#1c2029;border:1px solid #d9dce3;border-radius:3px;box-shadow:0 12px 35px rgba(30,35,50,.12);font-family:Georgia,'Times New Roman',serif;font-size:15px;line-height:1.7}.contract-document-page p{margin:0 0 14px}.contract-document-page h2{margin:24px 0 12px;font-family:Georgia,'Times New Roman',serif;color:#111827}.contract-doc-spacer{height:12px}.contract-inline-field{display:inline;position:relative;padding:2px 5px;border:1px dashed #d39b20;border-radius:4px;background:#fff3c4;color:#5f4300;cursor:text;box-decoration-break:clone;-webkit-box-decoration-break:clone}.contract-inline-field:hover,.contract-inline-field.editing{border-style:solid;background:#ffe99a;outline:2px solid rgba(211,155,32,.16)}.contract-inline-value{min-width:34px;outline:none}.contract-inline-placeholder{font-family:var(--font-ui);font-size:.78em;font-weight:700;color:#9a6b00}.contract-inline-field.has-value .contract-inline-placeholder{display:none}.contract-inline-field:not(.has-value) .contract-inline-value{display:none}.contract-inline-field.editing .contract-inline-value{display:inline}.contract-inline-field.editing .contract-inline-placeholder{display:none}.contract-editor-help{position:sticky;top:86px;padding:14px;border:1px solid var(--line);border-radius:var(--r-md);background:var(--surface);font-size:.78rem}.contract-editor-help p{color:var(--ink-3);line-height:1.5}.contract-missing-field{display:block;width:100%;margin:5px 0;padding:7px 9px;text-align:left;background:#fff9e8;border:1px solid #e7c56f;color:#7a5700;box-shadow:none;font-size:.72rem}.contract-missing-field:hover{transform:none;background:#fff3c4}.contract-library-search{display:grid;grid-template-columns:minmax(260px,1fr) minmax(240px,360px);gap:12px;align-items:end;margin-bottom:18px}.contract-library-search .template-search{max-width:none;margin:0}.contract-library-search label{margin:0;color:var(--ink-3);font-size:.7rem}.contract-library-search select{margin-top:5px}@media(max-width:980px){.contract-editor-toolbar{position:static;grid-template-columns:1fr 1fr}.contract-document-shell{grid-template-columns:1fr}.contract-editor-help{position:static;order:-1}.contract-document-page{padding:42px 34px}.contract-library-search{grid-template-columns:1fr}}
.proposal-editor-toolbar{grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto}.contract-native-preview{padding:0;overflow:auto;max-height:80vh}.contract-native-preview>.contract-document-page{margin:18px;min-width:650px}.pdf-unavailable-note{margin-top:14px;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);font-size:.76rem;color:var(--ink-3)}.pdf-unavailable-note strong{color:var(--ink-2)}.pdf-unavailable-note p{margin:5px 0 0;line-height:1.45}@media(max-width:980px){.proposal-editor-toolbar{grid-template-columns:1fr}.contract-native-preview>.contract-document-page{min-width:0;margin:10px}}

/* App-native confirmation and text-entry dialogs */
.app-dialog-overlay{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(17,24,39,.48);backdrop-filter:blur(4px)}
.app-dialog-overlay.open{display:flex;animation:pageIn .16s ease}
.app-dialog{width:min(440px,100%);overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--surface);box-shadow:var(--shadow-pop);color:var(--ink)}
.app-dialog-header{padding:20px 22px 8px}.app-dialog-header h2{margin:0;font-size:1.08rem}
.app-dialog-body{padding:8px 22px 20px;color:var(--ink-2);line-height:1.55}.app-dialog-body p{margin:0}.app-dialog-body label{display:block;margin:2px 0 7px;color:var(--ink-2);font-size:.78rem;font-weight:700}.app-dialog-body input{width:100%;margin:0}
.app-dialog-actions{display:flex;justify-content:flex-end;gap:9px;padding:14px 22px;border-top:1px solid var(--line);background:var(--surface-2)}
.app-dialog-confirm.danger{background:#c9364b;border-color:#c9364b;color:#fff}.app-dialog-confirm.danger:hover{background:#ad293d}
body.app-dialog-open{overflow:hidden}

/* Word-aware contextual document preview */
.contract-document-page{font-family:Aptos,Arial,sans-serif;font-size:12pt;line-height:1.2}
.contract-document-page .contract-doc-content p{margin:0 0 8pt}.contract-document-page .contract-doc-content h2{font-family:inherit;margin:14pt 0 8pt}
.contract-field-list{display:flex;flex-direction:column;gap:7px;margin-top:12px;max-height:52vh;overflow:auto}
.contract-field-entry{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:2px;padding:9px 11px;text-align:left;background:var(--surface-2);border:1px solid var(--line);color:var(--ink-2);box-shadow:none}
.contract-field-entry:hover{transform:none;border-color:var(--iris);background:var(--iris-soft)}.contract-field-entry span{font-size:.72rem;font-weight:750}.contract-field-entry small{display:block;width:100%;overflow:hidden;color:var(--ink-3);font-size:.68rem;font-weight:500;text-overflow:ellipsis;white-space:nowrap}.contract-field-entry.completed small{color:var(--ink-2)}

/* Project list drawers + comprehensive project workspace */
.project-summary-drawer{padding:0!important}.project-quick-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:14px 18px;border-bottom:1px solid var(--line);background:var(--surface)}.project-quick-actions form{margin:0 0 0 auto}.project-drawer-kpis{grid-template-columns:repeat(4,minmax(0,1fr));padding:16px 18px 0;margin:0}.project-drawer-kpis .kpi-card{margin:0}.project-drawer-meta{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin:14px 18px 0;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2)}.project-drawer-meta small,.project-drawer-meta b,.project-drawer-meta a{display:block}.project-drawer-meta small{color:var(--ink-3);font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.project-drawer-meta b,.project-drawer-meta a{margin-top:3px;color:var(--ink-2);font-size:.78rem;text-decoration:none}.project-drawer-sections{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:14px 18px 18px}.project-drawer-sections .client-summary-section{margin:0;min-height:132px}.project-drawer-sections .drawer-lead-section{grid-column:1/-1;min-height:auto}.drawer-lead-body strong{font-size:.78rem}.drawer-lead-body p{margin:5px 0 0;color:var(--ink-2);font-size:.72rem;line-height:1.55}.project-drawer-sections .activity-item{padding:8px 3px}
.project-detail-page{padding-bottom:70px}.project-detail-head{display:flex;justify-content:space-between;gap:24px;align-items:center;margin:14px 0 22px}.project-title-block{display:flex;gap:15px;align-items:center;min-width:0}.project-title-block h1{display:flex;align-items:center;gap:8px;margin:2px 0 4px;font-size:1.65rem}.project-title-block .eyebrow a{text-decoration:none}.project-head-meta{display:flex;align-items:center;gap:10px;color:var(--ink-3);font-size:.72rem}.project-head-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;justify-content:flex-end}.project-detail-tabs{display:flex;gap:4px;overflow-x:auto;margin-bottom:22px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.project-detail-tabs a{display:flex;align-items:center;gap:7px;flex:0 0 auto;padding:8px 14px;border-radius:8px;color:var(--ink-2);font-size:.78rem;font-weight:700;text-decoration:none}.project-detail-tabs a:hover{background:var(--surface-2);color:var(--ink)}.project-detail-tabs a.active{background:var(--iris-soft);color:var(--iris-deep)}.project-detail-tabs a span{min-width:19px;padding:1px 5px;border-radius:99px;background:var(--line);color:var(--ink-3);font-size:.6rem;text-align:center}.project-detail-tabs a.active span{background:var(--surface);color:var(--iris-deep)}.project-tab-panel{animation:pageIn .22s ease}.project-overview-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.project-overview-kpis .kpi-card{margin:0}.project-overview-kpis .kpi-value{font-size:1.18rem}.project-activity-layout{display:grid;grid-template-columns:1.1fr .9fr;gap:16px;align-items:start}.project-description-card{margin:0}.project-description-card>p{color:var(--ink-2);line-height:1.7}.project-date-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}.project-date-row small,.project-date-row b{display:block}.project-date-row small{color:var(--ink-3);font-size:.65rem;text-transform:uppercase;font-weight:700;letter-spacing:.05em}.project-date-row b{margin-top:4px;font-size:.78rem}.overdue-text{color:var(--rose)!important}.project-panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.project-panel-head h2{font-size:1.22rem;margin:0 0 3px}.project-panel-head p{margin:0;color:var(--ink-3);font-size:.78rem}.project-upload-row{margin-bottom:15px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.project-upload-row form{display:grid;grid-template-columns:180px minmax(0,1fr) auto;align-items:center;gap:10px}.project-upload-row input,.project-upload-row select{margin:0}.project-file-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.project-file-card{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px;border:1px solid var(--line);border-radius:11px;background:var(--surface)}.project-file-preview{display:flex;align-items:center;gap:11px;min-width:0;flex:1;padding:0;border:0;background:none;color:var(--ink);text-align:left;box-shadow:none}.project-file-preview>span:last-child{min-width:0}.project-file-preview strong,.project-file-preview small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-file-preview strong{font-size:.76rem}.project-file-preview small{margin-top:3px;color:var(--ink-3);font-size:.64rem}.project-file-card>div{display:flex;align-items:center;gap:7px}.project-file-card form{margin:0}.project-inline-form{margin-bottom:14px}.project-task-form-grid{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px}.project-inline-form label{margin:0}.project-task-list{padding:0;overflow:hidden}.project-task-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:13px 16px;border-bottom:1px solid var(--line-2)}.project-task-row:last-child{border-bottom:0}.project-task-row form{margin:0}.project-task-row strong,.project-task-row small{display:block}.project-task-row strong{font-size:.82rem}.project-task-row small{margin-top:3px;color:var(--ink-3);font-size:.68rem}.project-task-row.done strong{text-decoration:line-through;color:var(--ink-3)}.financial-kpis{margin-bottom:24px}.project-financial-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;align-items:start}.project-financial-grid .client-summary-section-head>span{color:var(--ink-3);font-size:.7rem}.project-invoice-list,.project-milestones-card{margin:0;padding:8px 12px}.project-milestone-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:9px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line-2)}.project-milestone-row form{margin:0}.project-milestone-row strong,.project-milestone-row small{display:block}.project-milestone-row strong{font-size:.75rem}.project-milestone-row small{color:var(--ink-3);font-size:.64rem}.project-milestone-row>b{font-size:.72rem}.project-milestone-add{display:grid;grid-template-columns:1.5fr .7fr 1fr auto;gap:7px;margin-top:13px}.project-milestone-add input{margin:0}.project-notes-layout{max-width:820px}.project-note-form{margin-bottom:14px}.project-note-form label{margin:0}.project-note-form textarea{margin-bottom:12px}.project-notes-list{display:flex;flex-direction:column;gap:10px}.project-note{margin:0}.project-note header{display:flex;justify-content:space-between;gap:12px}.project-note time{color:var(--ink-3);font-size:.68rem}.project-note p{margin:12px 0 0;white-space:pre-wrap;color:var(--ink-2);line-height:1.7}.project-details-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:14px;align-items:start}.project-details-grid>.card{margin:0}.project-details-grid hr{height:1px;margin:22px 0;border:0;background:var(--line)}.project-detail-list{margin:0}.project-detail-list>div{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:11px 0;border-bottom:1px solid var(--line-2)}.project-detail-list dt{color:var(--ink-3);font-size:.7rem;font-weight:700;text-transform:uppercase}.project-detail-list dd{margin:0;color:var(--ink-2);font-size:.78rem}.project-detail-list dd a{color:var(--iris-deep);font-weight:700;text-decoration:none}.project-lead-card{grid-column:1/-1}.project-lead-card>p{color:var(--ink-2)}.project-lead-card>small{color:var(--ink-3)}
@media(max-width:980px){.project-drawer-kpis,.project-overview-kpis{grid-template-columns:repeat(2,1fr)}.project-drawer-sections,.project-activity-layout,.project-financial-grid,.project-details-grid{grid-template-columns:1fr}.project-lead-card{grid-column:auto}.project-detail-head{align-items:flex-start;flex-direction:column}.project-head-actions{justify-content:flex-start}.project-file-grid{grid-template-columns:1fr}}

/* Time tracking */
.time-page{max-width:1180px;padding-bottom:72px}.time-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:16px}.time-kpis .kpi-card{margin:0}.timer-card{margin-bottom:24px;padding:22px;border:1px solid var(--line);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-sm)}.timer-running{border-color:color-mix(in srgb,var(--iris) 30%,var(--line));background:linear-gradient(135deg,var(--surface),var(--iris-soft))}.timer-top{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:18px}.timer-state{display:flex;align-items:center;gap:7px;color:var(--emerald);font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.timer-state i{width:8px;height:8px;border-radius:50%;background:currentColor;box-shadow:0 0 0 4px color-mix(in srgb,currentColor 13%,transparent)}.timer-state.idle{color:var(--ink-3)}.timer-clock{margin-top:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:2.6rem;font-weight:650;letter-spacing:.02em;line-height:1}.timer-start,.timer-stop{min-width:150px;padding:12px 20px}.timer-stop{background:var(--rose);color:white}.timer-context{display:flex;align-items:center;gap:18px;padding-top:15px;border-top:1px solid var(--line);color:var(--ink-3);font-size:.75rem}.timer-context strong{color:var(--ink);font-size:.88rem}.timer-form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;padding-top:18px;border-top:1px solid var(--line)}.timer-form-grid label{margin:0}.timer-description{grid-column:1/3}.rate-input{display:grid;grid-template-columns:auto 1fr auto;align-items:center;border:1px solid var(--line);border-radius:9px;background:var(--surface);overflow:hidden}.rate-input span{padding-left:12px;font-weight:700}.rate-input input{margin:0;border:0;box-shadow:none}.rate-input small{padding-right:11px;color:var(--ink-3);font-size:.64rem}.time-entry-section{margin-top:10px}.time-entry-section .client-summary-section-head{margin-bottom:11px}.time-entry-section .client-summary-section-head p{margin:3px 0 0;color:var(--ink-3);font-size:.72rem}.time-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.time-table{width:100%;border-collapse:collapse;min-width:880px}.time-table th{padding:11px 13px;background:var(--surface-2);color:var(--ink-3);font-size:.62rem;text-align:left;text-transform:uppercase;letter-spacing:.05em}.time-table td{padding:13px;border-top:1px solid var(--line-2);font-size:.75rem;vertical-align:middle}.time-table td strong,.time-table td small{display:block}.time-table td small{margin-top:3px;color:var(--ink-3);font-size:.64rem}.time-table .check-col{width:36px;text-align:center}.time-table .check-col input{width:15px;height:15px}.time-duration{font-weight:800;font-variant-numeric:tabular-nums}.time-table .status-badge{text-decoration:none}.time-invoice-bar{display:flex;align-items:center;justify-content:flex-end;gap:16px;padding:13px 0}.time-invoice-bar span{color:var(--ink-3);font-size:.7rem}.time-invoice-bar button:disabled{opacity:.45;cursor:not-allowed}.native-modal{display:none;position:fixed;inset:0;z-index:650;align-items:center;justify-content:center;padding:24px;background:rgba(15,23,42,.48);backdrop-filter:blur(4px)}.native-modal.open{display:flex}.native-modal-card{width:min(760px,100%);max-height:calc(100vh - 48px);overflow:auto;border:1px solid var(--line);border-radius:17px;background:var(--surface);box-shadow:var(--shadow-pop);animation:pageIn .18s ease}.native-modal-card>header{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;border-bottom:1px solid var(--line)}.native-modal-card>header h2{margin:3px 0 0}.native-modal-close{padding:3px 8px;border:0;background:transparent;color:var(--ink-3);font-size:1.7rem;box-shadow:none}.native-modal-close:hover{color:var(--ink);transform:none}.time-manual-card form{padding:22px}.manual-duration{display:flex;align-items:end;gap:10px;margin-bottom:20px;padding:17px;border-radius:12px;background:var(--surface-2)}.manual-duration label{flex:0 0 100px;margin:0}.manual-duration label:last-child{flex:1;margin-left:14px}.manual-duration input{margin:0;font-size:1.12rem}.manual-duration>span{padding-bottom:12px;color:var(--ink-3)}.manual-assignment,.manual-billing{display:grid;grid-template-columns:1fr 1fr;gap:12px}.time-manual-card footer{display:flex;justify-content:flex-end;gap:9px;margin:20px -22px -22px;padding:15px 22px;border-top:1px solid var(--line);background:var(--surface-2)}
@media(max-width:820px){.time-kpis,.timer-form-grid{grid-template-columns:1fr}.timer-description{grid-column:auto}.timer-top{align-items:flex-start}.timer-clock{font-size:2rem}.timer-context{align-items:flex-start;flex-direction:column;gap:6px}.manual-assignment,.manual-billing{grid-template-columns:1fr}.manual-duration{flex-wrap:wrap}.manual-duration label:last-child{flex-basis:100%;margin-left:0}}

/* Expenses and expense reports */
.expense-page,.expense-report-page{max-width:1180px;padding-bottom:72px}.expense-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px}.expense-kpis .kpi-card{margin:0}.expense-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 190px 210px;gap:10px;margin-bottom:12px}.expense-toolbar .template-search,.expense-toolbar select{margin:0}.expense-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.expense-table{width:100%;min-width:940px;border-collapse:collapse}.expense-table th{padding:11px 13px;background:var(--surface-2);color:var(--ink-3);font-size:.62rem;text-align:left;text-transform:uppercase;letter-spacing:.05em}.expense-table td{padding:13px;border-top:1px solid var(--line-2);font-size:.73rem;vertical-align:middle}.expense-table td>strong,.expense-table td>small{display:block}.expense-table td>small{margin-top:3px;color:var(--ink-3);font-size:.63rem}.expense-table td:first-child,.expense-table th:first-child{width:38px;text-align:center}.expense-table input[type=checkbox]{width:15px;height:15px}.expense-table tfoot td{font-size:.82rem;font-weight:800;background:var(--surface-2)}.expense-reports-section{margin-top:30px}.expense-report-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.expense-report-card{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:0;padding:15px;text-decoration:none}.expense-report-card>span,.expense-report-card strong,.expense-report-card small{display:block}.expense-report-card small{margin-top:4px;color:var(--ink-3);font-size:.66rem}.expense-report-card>span:last-child{text-align:right}.expense-report-card b{margin-bottom:5px}.expense-modal-card{width:min(880px,100%)}.expense-modal-card form{padding:22px}.expense-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px 18px}.expense-form-grid label{margin:0}.expense-amount{display:grid;grid-template-columns:1fr 105px;gap:8px}.check-field{display:flex;align-items:center;gap:9px;padding-top:25px}.check-field input{width:18px;height:18px;margin:0}.expense-assignment{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:19px;padding:15px;border-radius:12px;background:var(--surface-2)}.expense-assignment label{margin:0}.expense-more{margin-top:18px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0}.expense-more summary{cursor:pointer;color:var(--ink-2);font-size:.75rem;font-weight:750}.expense-more>div{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.expense-more>div label:last-child{grid-column:1/-1}.receipt-upload{display:block;margin-top:17px;padding:15px;border:1px dashed var(--line);border-radius:10px}.receipt-upload input{margin:7px 0 0}.expense-modal-card footer,.report-modal-card>footer{display:flex;justify-content:flex-end;gap:9px;margin:20px -22px -22px;padding:15px 22px;border-top:1px solid var(--line);background:var(--surface-2)}.report-modal-card{width:min(570px,100%)}.report-modal-body{padding:22px}.report-modal-body>p{margin:0 0 17px;color:var(--ink-3);font-size:.75rem}.report-modal-card>footer{margin:0}.expense-report-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:17px}.expense-report-summary>div{padding:16px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}.expense-report-summary small,.expense-report-summary strong{display:block}.expense-report-summary small{margin-bottom:7px;color:var(--ink-3);font-size:.64rem;text-transform:uppercase;font-weight:800}.expense-report-summary strong{font-size:1.12rem}.expense-report-delete{display:flex;justify-content:flex-end;margin-top:18px}
@media(max-width:850px){.expense-kpis,.expense-report-summary{grid-template-columns:repeat(2,1fr)}.expense-toolbar,.expense-form-grid,.expense-assignment,.expense-more>div{grid-template-columns:1fr}.expense-report-grid{grid-template-columns:1fr}.expense-more>div label:last-child{grid-column:auto}}

/* Scalable native form builder */
.forms-page{max-width:1120px}.form-list-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-bottom:16px}.form-list-kpis .kpi-card{margin:0}.form-search{max-width:440px;margin-bottom:12px}.custom-form-list{display:flex;flex-direction:column;gap:8px}.custom-form-row{display:grid;grid-template-columns:minmax(0,1fr) auto 110px auto auto;align-items:center;gap:14px;margin:0;padding:12px 14px}.custom-form-main{display:flex;align-items:center;gap:12px;min-width:0;text-decoration:none}.form-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--iris-soft);color:var(--iris-deep);font-size:1.15rem}.custom-form-main strong,.custom-form-main small,.form-response-count b,.form-response-count small{display:block}.custom-form-main small,.form-response-count small{margin-top:3px;color:var(--ink-3);font-size:.64rem}.form-response-count{text-decoration:none}.form-builder-page{max-width:none;padding:0 20px 40px}.form-builder-head{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:82px;border-bottom:1px solid var(--line)}.form-builder-head>div:first-child{display:grid;grid-template-columns:auto minmax(220px,420px);align-items:center;gap:2px 12px}.form-builder-head .back-link{grid-row:1/3;margin:0}.builder-title,.builder-description{margin:0;padding:2px 4px;border:0;background:transparent;box-shadow:none}.builder-title{font-family:var(--font-display);font-size:1.15rem;font-weight:800}.builder-description{font-size:.7rem;color:var(--ink-3)}.form-builder-actions{display:flex;align-items:center;gap:7px}.form-builder-layout{display:grid;grid-template-columns:230px minmax(420px,1fr) 270px;gap:14px;align-items:start;padding-top:14px}.form-toolbox,.form-properties,.form-canvas-shell{border:1px solid var(--line);border-radius:13px;background:var(--surface)}.form-toolbox,.form-properties{position:sticky;top:12px;padding:15px}.form-toolbox>strong,.form-properties strong{font-size:.77rem}.form-toolbox>p{margin:3px 0 12px;color:var(--ink-3);font-size:.65rem}.form-toolbox hr{height:1px;margin:17px 0;border:0;background:var(--line)}.form-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.form-tool-grid button{display:flex;align-items:center;gap:6px;padding:8px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);color:var(--ink-2);font-size:.62rem;text-align:left;box-shadow:none}.form-tool-grid button:hover{border-color:var(--iris);color:var(--iris-deep);transform:none}.form-tool-grid button span{display:grid;place-items:center;width:19px;height:19px;border-radius:5px;background:var(--surface);font-weight:800}.form-toolbox label,.form-properties label{margin-top:11px;font-size:.64rem}.form-toolbox select,.form-properties input,.form-properties select,.form-properties textarea{margin:4px 0 0;font-size:.7rem}.form-canvas-shell{min-height:700px;background:var(--surface-2)}.form-canvas-head{display:flex;align-items:center;justify-content:space-between;padding:11px 15px;border-bottom:1px solid var(--line);background:var(--surface);border-radius:13px 13px 0 0;color:var(--ink-2);font-size:.7rem;font-weight:750}.form-canvas-head small{color:var(--ink-3);font-size:.6rem;font-weight:500}.form-canvas{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:24px}.builder-empty{grid-column:1/-1;padding:100px 20px;text-align:center;color:var(--ink-3)}.builder-empty p{font-size:.72rem}.builder-field{position:relative;grid-column:1/-1;padding:16px 16px 16px 36px;border:1px solid var(--line);border-radius:11px;background:var(--surface);cursor:pointer}.builder-field.half{grid-column:auto}.builder-field.selected{border-color:var(--iris);box-shadow:0 0 0 2px var(--iris-soft)}.builder-field.dragging{opacity:.45}.drag-handle{position:absolute;left:12px;top:18px;color:var(--ink-3);cursor:grab}.builder-field label,.builder-field small{display:block}.builder-field label{margin:0 0 7px;font-size:.72rem}.builder-field small{margin:-3px 0 8px;color:var(--ink-3);font-size:.62rem}.builder-field input,.builder-field textarea,.builder-field select{margin:0;background:var(--surface-2)}.builder-field h2{margin:0}.builder-field p{margin:0;color:var(--ink-2);line-height:1.6}.builder-options{display:flex;flex-direction:column;gap:5px;color:var(--ink-2);font-size:.7rem}.builder-file{padding:12px;border:1px dashed var(--line);border-radius:8px;color:var(--ink-3);font-size:.68rem}.property-head{display:flex;align-items:center;justify-content:space-between}.property-head button{padding:0;border:0;background:transparent;color:var(--rose);font-size:.64rem;box-shadow:none}.property-head button:hover{transform:none}.builder-link-box{margin-top:18px;padding:10px;border-radius:9px;background:var(--surface-2)}.builder-link-box small{display:block;color:var(--ink-3);font-size:.6rem}.builder-link-box input{font-family:monospace}.submission-list{padding:0;overflow:hidden}.submission-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;align-items:center;gap:12px;padding:13px 16px;border-bottom:1px solid var(--line-2);text-decoration:none}.submission-row:last-child{border-bottom:0}.submission-avatar{display:grid;place-items:center;width:35px;height:35px;border-radius:50%;background:var(--iris-soft);color:var(--iris-deep);font-size:.65rem;font-weight:800}.submission-row strong,.submission-row small{display:block}.submission-row small{margin-top:3px;color:var(--ink-3);font-size:.64rem}.submission-row time{color:var(--ink-3);font-size:.67rem}.submission-detail-page{max-width:1000px}.submission-layout{display:grid;grid-template-columns:1fr 310px;gap:14px;align-items:start}.submission-answers{margin:0}.submission-answers>div{padding:14px 0;border-bottom:1px solid var(--line-2)}.submission-answers>div:last-child{border:0}.submission-answers small,.submission-answers strong{display:block}.submission-answers small{margin-bottom:6px;color:var(--ink-3);font-size:.65rem;text-transform:uppercase;font-weight:750}.submission-answers strong{white-space:pre-wrap}.submission-meta{margin:0}.public-form-body{min-height:100vh;background:linear-gradient(150deg,#f8f9ff,#f1f3f9);padding:50px 20px;color:#111827}.public-form-wrap{width:min(760px,100%);margin:0 auto;padding:38px;border:1px solid #e2e5ee;border-radius:20px;background:#fff;box-shadow:0 18px 55px rgba(28,37,64,.09)}.public-form-wrap>header{margin-bottom:28px}.public-form-brand{display:flex;align-items:center;gap:8px;color:#545ad8;font-size:.72rem;font-weight:800}.public-form-brand i{width:9px;height:9px;border-radius:3px;background:#545ad8;transform:rotate(45deg)}.public-form-wrap h1{margin:15px 0 8px;font-size:2rem}.public-form-wrap>header p{margin:0;color:#687087;line-height:1.65}.public-dynamic-form hr{height:1px;margin:24px 0;border:0;background:#e6e8ef}.public-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.public-form-grid>label,.public-form-heading,.public-form-paragraph{grid-column:1/-1}.public-form-grid>label.half{grid-column:auto}.public-form-grid label{margin:0;color:#252b3a;font-size:.76rem;font-weight:750}.public-form-grid label>small{display:block;margin:4px 0 8px;color:#7b8296;font-size:.65rem;font-weight:400}.public-form-grid input,.public-form-grid textarea,.public-form-grid select{margin:7px 0 0;border-color:#dfe2ea;background:#fff}.public-form-heading{padding-top:10px}.public-form-heading h2{margin:0}.public-form-heading p,.public-form-paragraph p{color:#687087;line-height:1.65}.public-choice-list{display:flex;flex-direction:column;gap:8px;margin-top:10px}.public-choice-list label{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid #e2e5ee;border-radius:9px;font-weight:500}.public-choice-list input{width:16px;height:16px;margin:0}.public-form-submit{width:100%;margin-top:28px;padding:13px}.public-form-wrap>footer{margin-top:24px;color:#9aa0b1;font-size:.62rem;text-align:center}.public-form-success{text-align:center}.success-check{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 20px;border-radius:50%;background:#e8f8f0;color:#159567;font-size:1.6rem}.public-form-success .public-form-brand{justify-content:center}.public-form-success p{color:#687087}.public-form-success small{color:#9aa0b1}
@media(max-width:1050px){.form-builder-layout{grid-template-columns:190px 1fr}.form-properties{position:static;grid-column:1/-1}.form-builder-head{align-items:flex-start;flex-direction:column;padding:14px 0}.custom-form-row{grid-template-columns:minmax(0,1fr) auto auto}.form-response-count{display:none}}@media(max-width:700px){.form-list-kpis,.public-form-grid,.submission-layout{grid-template-columns:1fr}.form-builder-layout{grid-template-columns:1fr}.form-toolbox{position:static}.form-canvas-shell{min-height:500px}.form-canvas{padding:12px}.builder-field.half{grid-column:1/-1}.public-form-wrap{padding:24px}.custom-form-row{grid-template-columns:minmax(0,1fr) auto}.custom-form-row>.status-badge,.custom-form-row>.btn{display:none}}

/* Live reporting hub */
.reports-page{max-width:1240px;padding-bottom:72px}.report-date-filter{display:flex;align-items:center;gap:7px}.report-date-filter select,.report-date-filter input{width:auto;min-width:135px;margin:0;padding:7px 9px;font-size:.68rem}.report-date-filter span{color:var(--ink-3);font-size:.65rem}.report-tabs{display:flex;align-items:center;gap:3px;margin-bottom:18px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow-x:auto}.report-tabs a{flex:0 0 auto;padding:8px 14px;border-radius:8px;color:var(--ink-2);font-size:.72rem;font-weight:750;text-decoration:none}.report-tabs a.active{background:var(--iris-soft);color:var(--iris-deep)}.report-tabs .report-export{margin-left:auto;color:var(--iris-deep)}.report-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:11px;margin-bottom:14px}.report-kpis .kpi-card{margin:0}.report-overview-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(260px,.7fr);gap:13px;align-items:stretch}.report-overview-grid.lower{grid-template-columns:1fr 1fr;margin-top:13px}.report-overview-grid>.card{margin:0}.report-chart-card{min-height:360px}.report-chart-card .client-summary-section-head p{margin:3px 0 0;color:var(--ink-3);font-size:.65rem}.report-chart-card .client-summary-section-head>span{color:var(--ink-3);font-size:.64rem}.report-chart-legend{display:flex;justify-content:flex-end;gap:16px;margin:7px 0 4px}.report-chart-legend span{display:flex;align-items:center;gap:6px;color:var(--ink-3);font-size:.61rem}.report-chart-legend span:before{content:'';width:8px;height:8px;border-radius:2px;background:currentColor}.report-chart-legend .invoiced{color:var(--iris)}.report-chart-legend .paid{color:var(--emerald)}.report-chart-legend .expense{color:var(--amber)}.report-bar-chart{display:flex;align-items:stretch;gap:10px;height:245px;padding:20px 4px 0;border-bottom:1px solid var(--line)}.report-month{display:flex;flex:1;min-width:30px;flex-direction:column;justify-content:flex-end;height:100%;text-align:center}.report-bars{display:flex;align-items:flex-end;justify-content:center;gap:3px;height:calc(100% - 27px)}.report-bars i{display:block;width:min(15px,28%);min-height:2px;border-radius:3px 3px 0 0}.report-bars .invoiced{background:var(--iris)}.report-bars .paid{background:var(--emerald)}.report-bars .expense{background:var(--amber)}.report-month small{height:27px;padding-top:8px;color:var(--ink-3);font-size:.56rem;white-space:nowrap}.report-health-card h2,.report-ranking h2,.report-activity h2{margin-top:0}.report-health-card>div{display:flex;justify-content:space-between;gap:12px;padding:14px 0;border-bottom:1px solid var(--line-2)}.report-health-card>div span{color:var(--ink-3);font-size:.7rem}.report-health-card>div strong{font-size:.82rem}.report-ranking>a{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:11px 0;border-bottom:1px solid var(--line-2);text-decoration:none}.report-ranking>a:last-child{border:0}.report-ranking strong,.report-ranking small,.report-ranking b{display:block}.report-ranking small{margin-top:3px;color:var(--ink-3);font-size:.62rem}.report-ranking>a>span:last-child{text-align:right}.report-mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.report-mini-grid span{padding:13px;border-radius:9px;background:var(--surface-2);text-align:center}.report-mini-grid b,.report-mini-grid small{display:block}.report-mini-grid b{font-size:1.12rem}.report-mini-grid small{margin-top:4px;color:var(--ink-3);font-size:.58rem}.report-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin:6px 0 13px}.report-section-head h2{margin:0}.report-section-head p{margin:4px 0 0;color:var(--ink-3);font-size:.72rem}.report-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.report-table{width:100%;min-width:900px;border-collapse:collapse}.report-table th{padding:11px 13px;background:var(--surface-2);color:var(--ink-3);font-size:.6rem;text-align:left;text-transform:uppercase;letter-spacing:.05em}.report-table td{padding:13px;border-top:1px solid var(--line-2);font-size:.72rem}.report-table td strong,.report-table td small{display:block}.report-table td small{margin-top:3px;color:var(--ink-3);font-size:.61rem}.report-table td a{text-decoration:none}.report-table .positive{color:var(--emerald);font-weight:750}.report-table .negative{color:var(--rose);font-weight:750}.report-margin{display:inline-block;width:54px;height:5px;margin-right:7px;border-radius:9px;background:var(--line);vertical-align:middle;overflow:hidden}.report-margin i{display:block;height:100%;background:var(--emerald)}
@media(max-width:950px){.reports-page .page-head{align-items:flex-start;flex-direction:column}.report-date-filter{flex-wrap:wrap}.report-kpis{grid-template-columns:repeat(2,1fr)}.report-overview-grid,.report-overview-grid.lower{grid-template-columns:1fr}}@media(max-width:600px){.report-kpis{grid-template-columns:1fr}.report-date-filter select,.report-date-filter input{min-width:120px}.report-chart-card{padding:14px}.report-bar-chart{gap:4px}}
@media(max-width:680px){.project-drawer-kpis,.project-overview-kpis{grid-template-columns:1fr 1fr}.project-drawer-meta{grid-template-columns:1fr}.project-drawer-sections{grid-template-columns:1fr}.project-drawer-sections .drawer-lead-section{grid-column:auto}.project-quick-actions form{margin-left:0}.project-date-row{grid-template-columns:1fr}.project-upload-row form,.project-task-form-grid,.project-milestone-add{grid-template-columns:1fr}.project-milestone-row{grid-template-columns:auto minmax(0,1fr)}.project-milestone-row>b,.project-milestone-row>a,.project-milestone-row>form:last-child{grid-column:2}.project-detail-list>div{grid-template-columns:1fr;gap:3px}}
