@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:opsz,wght@6..96,400;6..96,600;6..96,700&family=Lato:wght@400;700;900&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap');

:root {
  --fb-sidebar: #1d2336;
  --fb-sidebar-2: #2a3048;
  --fb-bg: #f7f8fc;
  --fb-surface: #ffffff;
  --fb-soft: #f3f5fb;
  --fb-line: #e4e8f3;
  --fb-text: #202637;
  --fb-muted: #717a92;
  --fb-primary: #25b979;
  --fb-blue: #2f86ff;
  --fb-orange: #ff6333;
  --fb-danger: #d84d45;
  --fb-radius: 8px;
  --fb-shadow: 0 8px 24px rgba(29, 35, 54, 0.06);
}
.sidebar .product-tagline { color: #fff !important; opacity: 1 !important; }
.company-field-list { display: grid; gap: 8px; }
.company-field-row { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(180px, 1.2fr) auto; gap: 8px; align-items: center; }
.company-field-row select { min-height: 36px; border: 1px solid var(--fb-line); border-radius: 6px; background-color: #fff; color: var(--fb-text); font: inherit; }
.company-field-documents { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--fb-muted); font-size: 13px; }
.company-field-documents label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.company-field-documents input { width: 16px; height: 16px; }
.field-visibility { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--fb-line); border-radius: 6px; color: var(--fb-blue); background: #fff; }
.field-visibility input { position: absolute; opacity: 0; pointer-events: none; }
.field-visibility:has(input:not(:checked)) { color: #a3acbc; }
@media (max-width: 700px) { .company-field-row { grid-template-columns: 1fr; } .company-field-documents { padding: 2px 0 8px; } }

.price-history { display: grid; gap: 7px; }
.price-history p { margin: 0; color: var(--fb-muted); font-size: 13px; }
.classification-control,
.line-classification { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px !important; }
.classification-control button,
.line-classification button { min-height: 32px; padding-inline: 9px; color: var(--fb-blue); background: #fff; }
.line-classification { margin-top: 6px; }
.line-classification input { min-height: 30px; padding: 6px 8px; font-size: 12px; }
.line-classification button { border: 0; min-height: 30px; font-size: 12px; }
.classification-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px)); border: 1px solid rgba(255, 255, 255, 0.58); border-radius: 8px; padding: 0; overflow: hidden; background: rgba(246, 249, 255, 0.82); box-shadow: 0 30px 90px rgba(12, 24, 62, 0.36), 0 8px 28px rgba(42, 76, 190, 0.16); backdrop-filter: blur(24px) saturate(145%); -webkit-backdrop-filter: blur(24px) saturate(145%); }
.classification-dialog::backdrop { background: rgba(12, 19, 42, 0.52); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.classification-dialog-shell { display: grid; padding: 0; }
.classification-dialog header,
.classification-search-row,
.classification-result,
.classification-result span { display: flex; align-items: center; }
.classification-dialog-header { justify-content: space-between; gap: 20px; padding: 22px 24px; color: #fff; background: #2459e8; }
.classification-dialog-header > div { display: grid; gap: 3px; }
.classification-dialog-header strong { font-size: 20px; line-height: 1.25; }
.classification-dialog-header small { color: rgba(255, 255, 255, 0.76); font-size: 12px; }
.classification-kicker { color: #cfe5ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.classification-close { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 50%; padding: 0; color: #fff; background: rgba(255, 255, 255, 0.14); font-size: 24px; font-weight: 400; line-height: 1; }
.classification-close:hover { background: rgba(255, 255, 255, 0.24); }
.classification-dialog-body { display: grid; gap: 14px; padding: 20px; background: rgba(255, 255, 255, 0.34); }
.classification-search-row { gap: 10px; }
.classification-search-row input { flex: 1; min-height: 46px; padding-inline: 15px; background: rgba(255, 255, 255, 0.82); border-color: rgba(153, 171, 215, 0.58); box-shadow: 0 5px 16px rgba(26, 53, 120, 0.06); }
.classification-search-row select { width: 132px; min-height: 46px; background-color: rgba(255, 255, 255, 0.82); border-color: rgba(153, 171, 215, 0.58); }
.classification-results { display: grid; max-height: 480px; min-height: 112px; overflow-y: auto; border: 1px solid rgba(153, 171, 215, 0.42); border-radius: 7px; background: rgba(255, 255, 255, 0.56); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82); }
.classification-results > p { align-self: center; margin: 0; padding: 28px; color: var(--fb-muted); text-align: center; }
.classification-result { width: 100%; min-height: 58px; justify-content: flex-start; gap: 16px; border: 0; border-bottom: 1px solid rgba(153, 171, 215, 0.3); border-radius: 0; background: transparent; padding: 11px 14px; text-align: left; white-space: normal; transition: background .16s ease, transform .16s ease; }
.classification-result:last-child { border-bottom: 0; }
.classification-result:hover { background: rgba(225, 235, 255, 0.82); transform: translateX(2px); }
.classification-result span { flex: 0 0 108px; justify-content: space-between; gap: 6px; }
.classification-result small { border-radius: 999px; padding: 3px 7px; color: #1749c7; background: rgba(213, 228, 255, 0.86); font-size: 10px; font-weight: 800; }
.classification-result em { min-width: 0; overflow-wrap: anywhere; color: #47536b; font-size: 11px; font-style: normal; font-weight: 400; line-height: 1.42; text-transform: none; }
@media (max-width: 560px) { .classification-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); } .classification-dialog-header { padding: 18px; } .classification-dialog-body { padding: 14px; } .classification-search-row { align-items: stretch; flex-direction: column; } .classification-search-row select { width: 100%; } .classification-result { align-items: flex-start; flex-direction: column; gap: 6px; } .classification-result span { flex-basis: auto; width: 100%; justify-content: flex-start; } }
.item-hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.item-hero-actions form { margin: 0; }
.image-upload-label { color: var(--fb-blue); font-size: 12px; font-weight: 800; }
.remove-image-option { display: flex; align-items: center; gap: 8px; align-self: center; color: var(--fb-muted); font-size: 12px; }
.remove-image-option input { width: 16px; height: 16px; }
.item-delete-dialog { width: min(440px, calc(100vw - 28px)); border: 1px solid rgba(255,255,255,.65); border-radius: 8px; padding: 0; background: rgba(255,255,255,.9); box-shadow: 0 28px 80px rgba(22,32,62,.34); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.item-delete-dialog::backdrop { background: rgba(13,20,40,.52); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.item-delete-dialog-shell { display: grid; gap: 16px; padding: 24px; }
.item-delete-dialog-shell h2, .item-delete-dialog-shell p { margin: 0; }
.item-delete-dialog-shell > p { color: var(--fb-muted); font-size: 13px; line-height: 1.55; }
.delete-dialog-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #b42318; background: #fee4e2; font-weight: 900; }
.delete-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.delete-dialog-actions form { margin: 0; }

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--fb-text);
  background: var(--fb-bg);
  font-family: "Manrope", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.42;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.icon-button {
  min-height: 34px;
  border: 1px solid var(--fb-line);
  border-radius: 6px;
  color: var(--fb-text);
  background: var(--fb-surface);
  padding: 0 12px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.button-primary,
.create-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fb-primary);
  border-radius: 6px;
  color: #fff;
  background: var(--fb-primary);
  padding: 0 13px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.button-secondary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--fb-line);
  border-radius: 6px;
  color: var(--fb-text);
  background: var(--fb-surface);
  padding: 0 13px;
  text-decoration: none;
  font-weight: 800;
}

.button-danger {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f4b6ad;
  border-radius: 6px;
  color: #9b3026;
  background: #fff1ec;
  padding: 0 13px;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  display: block;
}

.sidebar {
  position: relative;
  top: 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: visible;
  background: linear-gradient(155deg, #20abf7 0%, #3697f8 28%, #3972f6 56%, #3948f5 78%, #2529ff 100%);
  background-size: 260% 260%;
  animation: evolvv-sidebar-flow 14s ease-in-out infinite alternate;
  color: #fff;
  padding: 10px;
  isolation: isolate;
}

.admin-sidebar {
  background: linear-gradient(150deg, #20abf7 0%, #216dff 48%, #2529ff 100%);
}

.sidebar::before {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 8px;
  min-width: 0;
  border-radius: var(--fb-radius);
  cursor: pointer;
}

.sidebar-brand:focus-visible {
  outline: 2px solid var(--fb-primary);
  outline-offset: 3px;
}

.sidebar-brand strong,
.sidebar-brand small,
.tenant-card strong,
.tenant-card span,
.plan-row strong,
.plan-row span,
.license-card strong,
.license-card small {
  display: block;
}

.sidebar-brand small {
  color: rgba(255, 255, 255, 0.88);
}

.sidebar-brand div {
  min-width: 0;
}

.sidebar-brand strong,
.sidebar-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand strong {
  font-size: 18px;
  letter-spacing: -0.01em;
}

.logo-line {
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #5b6684;
  border-radius: 6px;
  font-weight: 900;
}

.product-brand-logo {
  display: block;
  width: 128px;
  height: 36px;
  object-fit: contain;
  object-position: left center;
  filter: saturate(1.8) contrast(2.4);
}

.product-brand-lockup {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: 8px;
  line-height: 1.2;
  white-space: nowrap;
}

.product-brand-mark {
  display: none;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-toggle {
  display: none;
}

.sidebar-toggle span {
  display: block;
  width: 9px;
  height: 9px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.setup-card {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  border: 1px solid #444c67;
  border-radius: var(--fb-radius);
  color: #fff;
  background: var(--fb-sidebar-2);
  padding: 13px 14px;
  text-decoration: none;
  font-weight: 800;
}
.setup-card .nav-label { text-align: left; }
.setup-card .setup-arrow { margin-left: auto; }

.side-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.side-nav::-webkit-scrollbar {
  display: none;
}

.side-nav a,
.logout-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  flex: 0 0 auto;
  border-radius: 6px;
  color: #fff;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
}

.nav-icon {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  color: currentColor;
}

.nav-icon::before {
  inset: 0 !important;
  width: 18px !important;
  height: 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  box-shadow: none !important;
  transform: none !important;
  clip-path: none !important;
  -webkit-mask: var(--icon-mask) center / 18px 18px no-repeat;
  mask: var(--icon-mask) center / 18px 18px no-repeat;
}

.nav-icon::after {
  display: none !important;
}

.nav-icon-home { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m3 11 9-8 9 8'/%3E%3Cpath d='M5 10v10h14V10'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E"); }
.nav-icon-users { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E"); }
.nav-icon-portal { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M8 9h8M8 13h5'/%3E%3C/svg%3E"); }
.nav-icon-items,
.nav-icon-plans { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E"); }
.nav-icon-estimates { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='4' y='4' width='16' height='18' rx='2'/%3E%3Cpath d='M9 2h6v4H9z'/%3E%3Cpath d='m9 13 2 2 4-4'/%3E%3Cpath d='M9 19h6'/%3E%3C/svg%3E"); }
.nav-icon-invoices,
.nav-icon-credit,
.nav-icon-license { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3Cpath d='M16 13H8'/%3E%3Cpath d='M16 17H8'/%3E%3Cpath d='M10 9H8'/%3E%3C/svg%3E"); }
.nav-icon-recurring { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M21 2v6h-6'/%3E%3Cpath d='M3 12a9 9 0 0 1 15-6.7L21 8'/%3E%3Cpath d='M3 22v-6h6'/%3E%3Cpath d='M21 12a9 9 0 0 1-15 6.7L3 16'/%3E%3C/svg%3E"); }
.nav-icon-delivery { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M10 17h4V5H2v12h3'/%3E%3Cpath d='M20 17h2v-5l-3-4h-5v9h1'/%3E%3Ccircle cx='7.5' cy='17.5' r='2.5'/%3E%3Ccircle cx='17.5' cy='17.5' r='2.5'/%3E%3C/svg%3E"); }
.nav-icon-link { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1.5 1.5'/%3E%3Cpath d='M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1.5-1.5'/%3E%3C/svg%3E"); }
.nav-icon-payments { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20'/%3E%3Cpath d='M7 15h.01'/%3E%3Cpath d='M11 15h2'/%3E%3C/svg%3E"); }
.nav-icon-expenses,
.nav-icon-audit { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M16 8H8'/%3E%3Cpath d='M16 12H8'/%3E%3Cpath d='M13 16H8'/%3E%3C/svg%3E"); }
.nav-icon-time { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.nav-icon-reports,
.nav-icon-usage { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 16v-5'/%3E%3Cpath d='M12 16V7'/%3E%3Cpath d='M17 16v-3'/%3E%3C/svg%3E"); }
.nav-icon-settings { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21a2 2 0 1 1-4 0v-.09A1.7 1.7 0 0 0 8.6 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H3a2 2 0 1 1 0-4h.09A1.7 1.7 0 0 0 4.6 8.6a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V3a2 2 0 1 1 4 0v.09A1.7 1.7 0 0 0 15.4 4.6a1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9c.3.4.7.6 1.1.6H21a2 2 0 1 1 0 4h-.09A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E"); }
.nav-icon-send { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.nav-icon-start { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 4-2 4s2.74-.5 4-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09Z'/%3E%3Cpath d='m12 15-3-3a22 22 0 0 1 2-5.5A8.5 8.5 0 0 1 20.5 3 8.5 8.5 0 0 1 17 12.5a22 22 0 0 1-5 2.5Z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0'/%3E%3Cpath d='M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E"); }
.nav-icon-logout { --icon-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E"); }

.nav-icon::before,
.nav-icon::after {
  position: absolute;
  content: "";
  box-sizing: border-box;
}

.nav-icon-home::before {
  inset: 5px 3px 2px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 2px;
}

.nav-icon-home::after {
  left: 3px;
  top: 1px;
  width: 12px;
  height: 12px;
  border-left: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-icon-users::before {
  left: 2px;
  top: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-users::after {
  left: 0;
  bottom: 2px;
  width: 14px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 8px 8px 2px 2px;
}

.nav-icon-items::before,
.nav-icon-plans::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 4px;
}

.nav-icon-items::after,
.nav-icon-plans::after {
  left: 5px;
  right: 5px;
  top: 8px;
  border-top: 2px solid currentColor;
}

.nav-icon-estimates::before,
.nav-icon-invoices::before,
.nav-icon-credit::before,
.nav-icon-license::before {
  inset: 1px 3px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.nav-icon-estimates::after,
.nav-icon-invoices::after,
.nav-icon-credit::after,
.nav-icon-license::after {
  left: 6px;
  right: 6px;
  top: 6px;
  height: 6px;
  border-top: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-icon-recurring::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.nav-icon-recurring::after {
  right: 1px;
  top: 2px;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.nav-icon-delivery::before {
  left: 1px;
  top: 5px;
  width: 12px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-icon-delivery::after {
  right: 1px;
  bottom: 2px;
  width: 11px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-icon-link::before {
  left: 1px;
  top: 5px;
  width: 10px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px;
  transform: rotate(-25deg);
}

.nav-icon-link::after {
  right: 1px;
  top: 5px;
  width: 10px;
  height: 8px;
  border: 2px solid currentColor;
  border-radius: 8px;
  transform: rotate(-25deg);
}

.nav-icon-payments::before {
  inset: 3px 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-payments::after {
  left: 8px;
  top: 2px;
  bottom: 2px;
  border-left: 2px solid currentColor;
}

.nav-icon-expenses::before,
.nav-icon-audit::before {
  inset: 2px 4px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.nav-icon-expenses::after,
.nav-icon-audit::after {
  left: 7px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.nav-icon-time::before {
  inset: 2px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-time::after {
  left: 8px;
  top: 4px;
  width: 5px;
  height: 6px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.nav-icon-reports::before,
.nav-icon-usage::before {
  left: 2px;
  right: 2px;
  bottom: 2px;
  height: 12px;
  border-left: 3px solid currentColor;
  border-right: 3px solid currentColor;
}

.nav-icon-reports::after,
.nav-icon-usage::after {
  left: 8px;
  bottom: 2px;
  height: 16px;
  border-left: 3px solid currentColor;
}

.nav-icon-settings::before {
  inset: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-settings::after {
  inset: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -7px 0 -1px currentColor, 0 7px 0 -1px currentColor, -7px 0 0 -1px currentColor, 7px 0 0 -1px currentColor;
}

.nav-icon-start::before {
  inset: 2px;
  border-radius: 50%;
  background: currentColor;
  clip-path: polygon(50% 0, 62% 35%, 100% 50%, 62% 65%, 50% 100%, 38% 65%, 0 50%, 38% 35%);
}

.nav-icon-logout::before {
  inset: 3px 7px 3px 2px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 3px;
}

.nav-icon-logout::after {
  right: 1px;
  top: 5px;
  width: 9px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.side-nav a:hover,
.side-nav a.active,
.setup-card.active {
  color: #fff;
  background: var(--fb-primary);
}

.logout-link {
  margin-top: 0;
  color: #fff;
}

.logout-form {
  margin: 0;
  margin-top: auto;
}

.logout-form .logout-link {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.workspace-shell {
  min-width: 0;
  flex: 1;
}

.utility-bar {
  min-height: auto;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--fb-line);
  background: var(--fb-surface);
  padding: 10px;
}

.search-box {
  width: 100%;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  color: var(--fb-muted);
  background: var(--fb-soft);
  padding: 11px 14px;
}

.global-search { position: relative; width: min(520px, 100%); }
.global-search > input { width: 100%; height: 42px; border: 1px solid var(--fb-line); border-radius: 7px; background: var(--fb-soft); padding: 9px 58px 9px 40px; color: var(--fb-ink); outline: 0; }
.global-search > input:focus { border-color: var(--fb-blue); background: #fff; box-shadow: 0 0 0 3px rgb(36 118 255 / 12%); }
.global-search-icon { position: absolute; z-index: 2; top: 13px; left: 14px; width: 14px; height: 14px; border: 2px solid #7b879b; border-radius: 50%; pointer-events: none; }
.global-search-icon::after { content: ''; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; background: #7b879b; transform: rotate(45deg); }
.global-search kbd { position: absolute; top: 10px; right: 10px; border: 1px solid #d6deea; border-radius: 4px; background: #fff; padding: 3px 6px; color: #758197; font: 700 10px/1.3 inherit; }
.global-search-results { position: absolute; z-index: 80; top: calc(100% + 7px); left: 0; width: min(580px, calc(100vw - 24px)); max-height: min(520px, calc(100vh - 90px)); overflow-y: auto; border: 1px solid var(--fb-line); border-radius: 8px; background: #fff; padding: 7px; box-shadow: 0 20px 55px rgb(18 31 56 / 20%); }
.global-search-group { padding: 9px 10px 5px; color: #7a879c; font-size: 10px; font-weight: 900; text-transform: uppercase; }
.global-search-results a { display: grid; grid-template-columns: 30px minmax(0, 1fr) 20px; align-items: center; gap: 9px; border-radius: 5px; padding: 9px 10px; color: var(--fb-ink); text-decoration: none; }
.global-search-results a:hover, .global-search-results a.active { background: #edf4ff; }
.global-search-results strong, .global-search-results small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-search-results strong { font-size: 12px; }.global-search-results small { margin-top: 2px; color: var(--fb-muted); font-size: 10px; }
.global-search-result-icon { width: 26px; height: 26px; border-radius: 5px; background: #e8f0ff; }.global-search-enter { color: #98a3b5; }
.global-search-loading, .global-search-empty { display: grid; gap: 3px; padding: 20px; color: var(--fb-muted); font-size: 11px; text-align: center; }

.utility-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.create-action,
.login-form button {
  border-color: var(--fb-primary);
  color: #fff;
  background: var(--fb-primary);
}

.create-action {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  line-height: 1;
  font-size: 24px;
}

.avatar {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #fff;
  background: #7a2fb8;
  font-weight: 900;
}

.page {
  width: 100%;
  margin: 0;
  padding: 14px 10px 36px;
}

.welcome-band {
  border-bottom: 1px solid var(--fb-line);
  background:
    radial-gradient(circle at 20px 20px, rgba(47, 134, 255, 0.09) 0 2px, transparent 3px),
    var(--fb-surface);
  background-size: 46px 46px;
  margin: -14px -10px 16px;
  padding: 18px 10px 0;
}

.welcome-band h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.welcome-band p {
  margin: 0 0 22px;
  color: var(--fb-muted);
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  flex: 0 0 auto;
  border-bottom: 3px solid transparent;
  color: #30364a;
  padding: 0 0 14px;
  text-decoration: none;
  font-weight: 700;
}

.tabs a.active {
  border-color: var(--fb-blue);
  color: var(--fb-text);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.panel,
.license-warning,
.metrics article,
.auth-card {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: var(--fb-surface);
  box-shadow: var(--fb-shadow);
}

.panel {
  min-width: 0;
  overflow: visible;
  padding: 14px;
}

.span-2 {
  grid-column: span 1;
}

.panel-head {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
}

.panel-head > div {
  min-width: 0;
}

.panel-head h2,
.panel-head p {
  overflow-wrap: anywhere;
}

.receivable-bar {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffce55;
  margin: 16px 0 22px;
}

.receivable-bar span {
  display: block;
  width: 96%;
  height: 100%;
  margin-left: 4%;
  background: var(--fb-orange);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0;
}

.metrics.inline {
  margin: 0;
}

.metrics article {
  min-width: 0;
  padding: 13px;
  box-shadow: none;
}

.metrics strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.15;
}

.metrics span,
.muted,
.panel p,
.tenant-card span,
.plan-row span,
.license-card small {
  color: var(--fb-muted);
}

.license-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.license-warning {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 16px;
  color: #8d2f25;
  background: #fff1ec;
}

.data-list {
  display: grid;
  gap: 10px;
}

.document-row,
.tenant-card {
  display: grid;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--fb-line);
  padding: 13px 0;
  min-width: 0;
}

.document-row > *,
.tenant-card > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.document-row {
  grid-template-columns: 1fr;
}

.tenant-card {
  grid-template-columns: 1fr;
}

.usage-mini {
  display: grid;
  gap: 4px;
}

.status {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  color: #40505a;
  background: #edf0ef;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
  max-width: 100%;
  white-space: nowrap;
}

.status.active {
  color: #0f6848;
  background: #dff5ea;
}

.status.inactive {
  color: #7a4a14;
  background: #fff1d8;
}

.status.suspended,
.status.expired {
  color: #a0382d;
  background: #ffe2dc;
}

.stat-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 18px;
}

.stat-stack div {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: var(--fb-surface);
  padding: 16px;
}

.stat-stack strong {
  display: block;
  font-size: 28px;
}

.stat-stack span {
  color: var(--fb-muted);
}

.plan-row {
  border-top: 1px solid var(--fb-line);
  padding: 14px 0;
}

.build-list {
  margin-bottom: 0;
  color: var(--fb-muted);
}

.build-list li {
  margin-bottom: 10px;
}

.begin-page {
  max-width: 1400px;
}

.begin-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--fb-line);
  background: var(--fb-surface);
  margin: -14px -10px 18px;
  padding: 18px 10px;
}

.begin-hero-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #25b979, #2f86ff);
  font-weight: 900;
}

.begin-hero h1 {
  margin: 0 0 3px;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.begin-hero p {
  margin: 0;
  color: var(--fb-muted);
}

.overview-link {
  grid-column: 1 / -1;
  justify-self: start;
  color: var(--fb-blue);
  font-weight: 800;
  text-decoration: none;
}

.begin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.setup-panel {
  display: grid;
  gap: 12px;
}

.setup-step,
.collapsed-step,
.invoice-preview {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: var(--fb-surface);
  box-shadow: var(--fb-shadow);
}

.setup-step {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.step-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  color: var(--fb-blue);
  background: #f3f8ff;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.setup-step h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.setup-step p {
  margin: -10px 0 0;
  color: var(--fb-muted);
}

.template-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.template-row button {
  display: grid;
  gap: 8px;
  height: auto;
  min-height: 118px;
  justify-items: center;
  border-color: var(--fb-line);
  background: #fbfcff;
  padding: 12px;
  font-size: 12px;
  text-transform: uppercase;
}

.template-row button.selected {
  border-color: var(--fb-blue);
  color: var(--fb-blue);
  box-shadow: inset 0 0 0 1px var(--fb-blue);
}

.template-thumb {
  width: 62px;
  height: 72px;
  border: 1px solid #dfe6f5;
  border-radius: 8px;
  background:
    linear-gradient(#dfe5f3 0 0) 10px 12px / 22px 4px no-repeat,
    linear-gradient(#dfe5f3 0 0) 10px 22px / 38px 4px no-repeat,
    linear-gradient(#f7f9fe 0 0) 10px 40px / 42px 20px no-repeat,
    #fff;
}

.brand-upload {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fbfcff;
  padding: 13px;
  min-width: 0;
}

.brand-logo,
.preview-logo {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  color: #fff;
  background: var(--fb-sidebar);
  font-weight: 900;
}

.brand-logo img,
.preview-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-upload span {
  display: block;
  color: var(--fb-muted);
  font-size: 13px;
}

.branding-layout {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.branding-layout > * {
  min-width: 0;
}

@media (min-width: 1320px) {
  .branding-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
  }
}

.branding-form {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.brand-logo-preview {
  display: grid;
  place-items: center;
  width: min(168px, 100%);
  height: 92px;
  min-height: 92px;
  border: 1px dashed #cfd8ea;
  border-radius: 10px;
  background: #fff;
  color: var(--fb-muted);
  overflow: hidden;
  text-align: center;
}

.brand-logo-preview svg,
.signature-preview svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: #8a94aa;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-logo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 8px;
}

.brand-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.brand-logo-preview strong {
  display: block;
  color: var(--fb-sidebar);
  font-size: 28px;
}

.brand-logo-preview small {
  display: block;
  margin-top: 6px;
  padding: 0 12px;
  color: var(--fb-muted);
  font-size: 12px;
}

.signature-grid {
  align-items: end;
}

.signature-maker {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fbfcff;
}

.signature-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--fb-line);
  border-radius: 9px;
  background: #fff;
}

.signature-tabs button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--fb-muted);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.signature-tabs button.active {
  background: #eaf8f1;
  color: var(--fb-green-dark);
}

.signature-panel {
  display: none;
  min-width: 0;
}

.signature-panel.active {
  display: grid;
  gap: 10px;
}

.signature-maker-tools {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.signature-maker canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 120px;
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  background: #fff;
  cursor: crosshair;
  touch-action: none;
}

.signature-maker-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.signature-maker-actions span {
  color: var(--fb-muted);
  font-size: 12px;
}

.signature-preview {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 116px;
  border: 1px dashed #cfd8ea;
  border-radius: 10px;
  background: #fff;
  color: var(--fb-muted);
  overflow: hidden;
  text-align: center;
}

.signature-preview img {
  display: block;
  max-width: 100%;
  max-height: 112px;
  object-fit: contain;
}

.signature-preview-wide img {
  max-width: 100%;
  object-fit: contain;
}

.signature-preview strong,
.signature-preview small {
  display: block;
}

.signature-upload-inline {
  display: grid !important;
  gap: 8px;
}

.signature-upload-inline input {
  width: 100%;
}

.signature-upload-inline span {
  justify-self: start;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  color: var(--fb-text);
  cursor: pointer;
  font-weight: 800;
  padding: 9px 12px;
}

@media (min-width: 760px) {
  .signature-maker-tools {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  }
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
}

.toggle-row input[type="hidden"] {
  display: none;
}

.toggle-row input[type="checkbox"] {
  position: absolute;
  width: 1px;
  min-width: 0;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.toggle-row strong {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cfd6e5;
  transition: background 160ms ease;
}

.toggle-row strong::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(29, 35, 54, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.toggle-row input[type="checkbox"]:checked + strong {
  background: var(--fb-primary);
}

.toggle-row input[type="checkbox"]:checked + strong::after {
  transform: translateX(18px);
}

.mini-signature {
  display: grid;
  justify-items: end;
  gap: 4px;
  border-top: 1px solid var(--fb-line);
  padding-top: 10px;
}

.mini-signature img {
  display: block;
  max-width: 150px;
  max-height: 56px;
  object-fit: contain;
}

.mini-signature span {
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 800;
}

.branding-preview {
  display: grid;
  gap: 12px;
  min-width: 0;
}

@media (min-width: 1320px) {
  .branding-preview {
    position: sticky;
    top: 84px;
  }
}

.mini-document-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--fb-line);
  border-left: 4px solid var(--tenant-brand, var(--fb-green));
  border-radius: var(--fb-radius);
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.document-logo-box {
  display: grid;
  place-items: center start;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  border: 0;
  border-right: 1px solid var(--fb-line);
  border-radius: 0;
  background: #fff;
  color: var(--fb-sidebar);
  font-weight: 900;
  overflow: visible;
  padding-right: 12px;
}

.document-logo-box img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: left center;
  padding-right: 0;
}

.branding-form .form-grid > *,
.branding-form .company-field-row > * {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1319px) {
  .branding-preview {
    order: -1;
    position: static;
  }

  .branding-preview .mini-document-header {
    max-width: 620px;
  }
}

@media (min-width: 981px) {
  .page.branding-page {
    width: min(1600px, calc(100vw - 224px));
    max-width: none;
  }

  .sidebar-collapsed .page.branding-page {
    width: min(1600px, calc(100vw - 72px));
  }
}

@media (max-width: 620px) {
  .branding-page .module-header h1 {
    font-size: 23px;
  }

  .branding-page .panel {
    padding: 14px;
  }

  .branding-page .form-section {
    gap: 14px;
  }

  .branding-preview .mini-document-header {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    padding: 12px;
  }

  .document-logo-box {
    width: 92px;
    height: 92px;
    flex-basis: 92px;
  }
}

@media (max-width: 390px) {
  .branding-preview .mini-document-header {
    grid-template-columns: 1fr;
  }

  .document-logo-box {
    width: 100%;
    height: 84px;
    border-right: 0;
    border-bottom: 1px solid var(--fb-line);
    padding: 0 0 10px;
  }

  .document-logo-box img {
    object-position: left center;
    padding: 0;
  }
}

.mini-document-header strong,
.mini-document-header span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mini-document-header strong {
  margin-bottom: 4px;
  color: var(--fb-ink);
}

.mini-document-header span {
  color: var(--fb-muted);
  font-size: 13px;
  line-height: 1.35;
}

.color-picks {
  display: grid;
  gap: 10px;
}

.color-picks label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--fb-muted);
  font-weight: 800;
}

.color-picks input {
  width: 44px;
  height: 34px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 3px;
}

.collapsed-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--fb-muted);
  padding: 16px 18px;
  text-decoration: none;
  font-weight: 800;
}

.collapsed-step strong {
  color: var(--fb-blue);
}

.invoice-preview-stage {
  border: 1px solid #dde8f8;
  border-radius: var(--fb-radius);
  background:
    radial-gradient(circle, rgba(47, 134, 255, 0.15) 1px, transparent 1.5px),
    #f6faff;
  background-size: 22px 22px;
  padding: 20px;
}

.invoice-preview {
  width: min(520px, 100%);
  margin: 0 auto;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(29, 35, 54, 0.12);
}

.invoice-preview header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--fb-line);
  padding: 22px;
}

.invoice-preview header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.invoice-preview h2 {
  margin: 0;
  text-transform: uppercase;
}

.invoice-preview dl {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 18px 22px;
}

.invoice-preview dl div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.invoice-preview dt {
  color: var(--fb-muted);
  font-weight: 800;
}

.invoice-preview dd {
  margin: 0;
}

.invoice-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.invoice-preview th,
.invoice-preview td {
  border-top: 1px solid var(--fb-line);
  border-right: 1px solid var(--fb-line);
  padding: 12px;
  text-align: right;
  vertical-align: top;
}

.invoice-preview th:first-child,
.invoice-preview td:first-child {
  text-align: left;
}

.invoice-preview th:last-child,
.invoice-preview td:last-child {
  border-right: 0;
}

.invoice-preview small {
  color: var(--fb-muted);
}

.skeleton {
  display: block;
  width: 80%;
  height: 8px;
  border-radius: 999px;
  background: #e5e9f5;
  margin: 4px 0;
}

.skeleton.short {
  width: 52%;
}

.skeleton.tiny {
  width: 22px;
  margin-left: auto;
}

.invoice-preview footer {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  border-top: 1px solid var(--fb-line);
  padding: 18px 22px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(29, 35, 54, 0.96), rgba(29, 35, 54, 0.84)),
    var(--fb-sidebar);
  padding: 16px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 22px;
  overflow: hidden;
}

.auth-page.auth-page-split {
  display: grid;
  grid-template-rows: minmax(170px, 30vh) 1fr;
  place-items: stretch;
  padding: 0;
  background: #fff;
}

.auth-visual {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(112deg, #20abf7 0%, #216dff 52%, #2529ff 100%);
  isolation: isolate;
}

.auth-visual::before,
.auth-visual::after,
.auth-light-flow {
  position: absolute;
  content: '';
  inset: -25%;
  pointer-events: none;
}

.auth-visual::before {
  background: linear-gradient(118deg, transparent 20%, rgba(255, 255, 255, 0.42) 43%, transparent 66%);
  transform: translateX(-42%) skewX(-9deg);
  animation: evolvv-light-sweep 8s ease-in-out infinite alternate;
}

.auth-visual::after {
  inset: 12%;
  background: url('../images/evolvv-logo.png') center / min(72%, 520px) no-repeat;
  opacity: 0.18;
  animation: evolvv-mark-breathe 7s ease-in-out infinite;
}

.auth-light-flow {
  background:
    linear-gradient(35deg, transparent 28%, rgba(91, 225, 255, 0.28) 48%, transparent 67%),
    linear-gradient(145deg, transparent 32%, rgba(168, 126, 255, 0.32) 53%, transparent 72%);
  background-size: 160% 160%, 180% 180%;
  animation: evolvv-fluid-light 11s ease-in-out infinite alternate;
}

.auth-panel {
  display: grid;
  place-items: center;
  min-width: 0;
  background: #fff;
  padding: 32px clamp(22px, 7vw, 88px);
  overflow-y: auto;
}

.auth-form-shell {
  width: min(440px, 100%);
}

.auth-page-split .auth-brand {
  margin-bottom: 30px;
}

.auth-page-split .login-form {
  margin-top: 0;
}

.auth-page-split .auth-signup {
  margin: 8px 0 0;
  text-align: center;
}

.auth-mode-link {
  display: inline;
  min-height: 0 !important;
  border: 0;
  color: var(--fb-blue);
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
  text-decoration: none;
}

.auth-mode-link:hover {
  text-decoration: underline;
}

.auth-register-form {
  gap: 11px;
}

@keyframes evolvv-light-sweep {
  to { transform: translateX(44%) skewX(8deg); }
}

@keyframes evolvv-fluid-light {
  from { background-position: 15% 20%, 85% 75%; transform: scale(1) rotate(-2deg); }
  to { background-position: 90% 75%, 10% 20%; transform: scale(1.08) rotate(3deg); }
}

@keyframes evolvv-mark-breathe {
  0%, 100% { opacity: 0.09; transform: scale(0.94); }
  50% { opacity: 0.18; transform: scale(1.03); }
}

@keyframes evolvv-sidebar-flow {
  0% { background-position: 0% 15%; }
  50% { background-position: 65% 85%; }
  100% { background-position: 100% 20%; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-visual::before,
  .auth-visual::after,
  .auth-light-flow,
  .sidebar,
  .sidebar::before {
    animation: none;
  }
}

@media (min-width: 900px) {
  .auth-page.auth-page-split {
    grid-template-columns: minmax(0, 54%) minmax(420px, 46%);
    grid-template-rows: 100vh;
  }

  .auth-panel {
    min-height: 100vh;
  }

}

.auth-brand {
  display: grid;
  justify-items: start;
  gap: 7px;
  margin-bottom: 24px;
}

.auth-brand-logo {
  display: block;
  width: 190px;
  height: auto;
}

.auth-brand-tagline {
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.login-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.login-form label,
.login-form span {
  display: grid;
  gap: 7px;
}

.login-form label span {
  color: var(--fb-muted);
  font-size: 13px;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  padding: 12px 13px;
  min-width: 0;
}

.password-control {
  position: relative;
  display: block !important;
}

.password-control input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 34px;
  height: 34px;
  min-height: 0 !important;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  color: var(--fb-muted);
  background: transparent;
  padding: 7px;
}

.password-toggle:hover,
.password-toggle.is-showing {
  color: var(--fb-text);
  background: #f0f3f8;
}

.password-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.auth-email-summary,
.auth-signup {
  color: var(--fb-muted);
}

.auth-email-summary a,
.auth-signup a,
.auth-row a,
.form-error a {
  color: var(--fb-blue);
  font-weight: 800;
  text-decoration: none;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.remember-option {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 7px !important;
  color: var(--fb-muted);
}

.remember-option input {
  width: 16px;
  height: 16px;
}

.form-error {
  display: grid;
  gap: 5px;
}

.login-form button {
  min-height: 44px;
}

.form-error {
  border: 1px solid #ffd0c6;
  border-radius: 7px;
  color: #8d2f25;
  background: #fff1ec;
  padding: 12px;
}

.portal-switch {
  margin-top: 18px;
}

.portal-switch a {
  color: var(--fb-blue);
  font-weight: 800;
  text-decoration: none;
}

.module-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.module-header h1 {
  margin: 0 0 6px;
  font-size: 25px;
}

.module-header p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--fb-muted);
}

.module-header.compact {
  align-items: center;
  margin-bottom: 16px;
}

.customer-page {
  max-width: 1320px;
}

.customer-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.customer-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.customer-list {
  align-self: start;
}

.customer-profile {
  align-self: start;
}

.customer-search {
  border: 1px solid var(--fb-line);
  border-radius: 8px;
  color: var(--fb-muted);
  background: var(--fb-soft);
  margin-bottom: 12px;
  padding: 11px 12px;
}

.compact-list {
  display: grid;
  gap: 4px;
}

.customer-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 7px;
  color: var(--fb-text);
  padding: 12px 10px;
  text-decoration: none;
}

.customer-list-item:hover {
  background: var(--fb-soft);
}

.customer-list-item strong,
.customer-list-item small,
.customer-list-item em {
  display: block;
}

.customer-list-item small {
  overflow: hidden;
  color: var(--fb-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-list-item em {
  color: var(--fb-muted);
  font-style: normal;
  font-weight: 800;
}

.customer-empty {
  min-height: 280px;
  padding: 22px 24px;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: var(--fb-soft);
  margin-bottom: 16px;
  padding: 16px;
}

.identity-card div {
  min-width: 0;
}

.identity-card strong,
.identity-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-card small {
  color: var(--fb-muted);
}

.status-control {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.status-control > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fb-muted);
  font-size: 13px;
  font-weight: 900;
}

.help-dot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  min-height: 18px;
  border: 1px solid #cdd6e8;
  border-radius: 999px;
  color: var(--fb-muted);
  background: #fff;
  padding: 0;
  font-size: 11px;
}

.help-dot:hover::after,
.help-dot:focus-visible::after {
  position: absolute;
  left: 22px;
  top: -8px;
  z-index: 4;
  width: 220px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  color: var(--fb-text);
  background: #fff;
  box-shadow: var(--fb-shadow);
  content: attr(aria-label);
  padding: 9px 10px;
  text-align: left;
}

.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
}

.status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-switch span {
  position: relative;
  flex: 0 0 38px;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: #d9deea;
  transition: background 160ms ease;
}

.status-switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(29, 35, 54, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.status-switch input:checked + span {
  background: var(--fb-primary);
}

.status-switch input:checked + span::after {
  transform: translateX(16px);
}

.status-switch strong {
  min-width: 58px;
}

.avatar.large {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.detail-list div {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--fb-line);
  padding-bottom: 10px;
}

.detail-list dt {
  color: var(--fb-muted);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.customer-detail {
  display: grid;
  gap: 16px;
}

.customer-toolbar {
  align-items: flex-start;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.customer-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--fb-line);
  overflow-x: auto;
}

.customer-tabs a {
  flex: 0 0 auto;
  border-bottom: 3px solid transparent;
  color: var(--fb-muted);
  padding: 0 0 12px;
  text-decoration: none;
  font-weight: 900;
}

.customer-tabs a.active {
  border-color: var(--fb-blue);
  color: var(--fb-text);
}

.success-banner,
.info-strip {
  border: 1px solid #ccebdc;
  border-radius: 8px;
  color: #0f6848;
  background: #edfdf5;
  padding: 12px 14px;
  font-weight: 800;
}

.preline {
  white-space: pre-line;
}

.receivables-panel {
  display: grid;
  gap: 16px;
}

.receivable-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.receivable-cards div {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  padding: 14px;
}

.receivable-cards strong,
.receivable-cards span {
  display: block;
}

.receivable-cards strong {
  font-size: 22px;
  letter-spacing: -0.01em;
}

.receivable-cards span {
  color: var(--fb-muted);
}

.tone-blue {
  background: #eef6ff;
}

.tone-green {
  background: #edfdf5;
}

.tone-orange {
  background: #fff6ec;
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  font-size: 13px;
}

.statement-table th,
.statement-table td {
  border-bottom: 1px solid var(--fb-line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.statement-table th {
  color: var(--fb-muted);
  background: var(--fb-soft);
  font-size: 12px;
  text-transform: uppercase;
}

.statement-table span {
  color: var(--fb-muted);
}

.account-mini .detail-list.compact div {
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
}

.address-summary {
  display: grid;
  gap: 14px;
}

.address-summary div {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fbfcff;
  padding: 14px;
}

.address-summary strong,
.contact-stack strong,
.contact-stack span {
  display: block;
}

.contact-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.contact-stack div {
  border-bottom: 1px solid var(--fb-line);
  padding-bottom: 10px;
}

.contact-stack span {
  color: var(--fb-muted);
}

.note-box {
  border-radius: var(--fb-radius);
  background: var(--fb-soft);
  margin: 14px 0 0;
  padding: 12px;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-list > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
}

.timeline-list time {
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 900;
}

.timeline-list article {
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fff;
  padding: 12px 14px;
}

.timeline-list strong,
.timeline-list span {
  display: block;
}

.timeline-list span {
  color: var(--fb-muted);
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.catalog-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.catalog-filters label {
  display: grid;
  gap: 7px;
}

.catalog-filters span {
  color: var(--fb-muted);
  font-size: 13px;
  font-weight: 900;
}

.catalog-filters input,
.catalog-filters select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  color: var(--fb-text);
  background: #fff;
  padding: 11px 12px;
}

.item-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  color: var(--fb-text);
  text-decoration: none;
}

.item-card strong,
.item-card small {
  display: block;
}

.item-card small {
  overflow: hidden;
  color: var(--fb-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card em {
  grid-column: 1 / -1;
  color: var(--fb-text);
  font-style: normal;
  font-weight: 900;
}

.item-thumb,
.item-image-large {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--fb-line);
  color: var(--fb-primary);
  background: #edfdf5;
  font-weight: 900;
}

.item-thumb {
  width: 54px;
  height: 54px;
  border-radius: 9px;
}

.item-thumb img,
.item-image-large img,
.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-form {
  max-width: 1180px;
}

.item-form-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.image-upload {
  display: grid;
  align-self: start;
  cursor: pointer;
}

.image-upload input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.image-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 220px;
  border: 2px dashed #cfd7e8;
  border-radius: var(--fb-radius);
  color: var(--fb-muted);
  background: #fbfcff;
  padding: 18px;
  text-align: center;
}

.image-preview strong,
.image-preview small {
  display: block;
}

.image-preview::before {
  width: 40px;
  height: 32px;
  border: 3px solid currentColor;
  border-radius: 8px;
  content: "";
}

.image-preview:has(img)::before {
  display: none;
}

.image-preview img {
  border-radius: 6px;
}

.image-preview.brand-logo-preview {
  width: min(220px, 100%);
  height: 220px;
  min-height: 0;
  padding: 14px;
}

.image-preview.brand-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 0;
}

.item-detail {
  display: grid;
  gap: 16px;
}

.item-hero-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.item-hero-card .button-secondary {
  grid-column: 1 / -1;
  justify-self: start;
}

.item-image-large {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  font-size: 34px;
}

.item-hero-card h1 {
  margin: 0 0 5px;
}

.item-hero-card p {
  margin-bottom: 0;
}

.customer-form {
  width: 100%;
  max-width: 1120px;
}

.form-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--fb-line);
  padding: 22px 0;
}

.form-section:first-of-type {
  border-top: 0;
}

.address-grid h3 {
  margin: 0;
}

.form-section > h2 {
  margin: 0;
  font-size: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.form-grid.compact {
  gap: 10px;
}

.form-grid label,
.customer-form label,
.branding-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.form-grid span,
.customer-form label > span,
.branding-form label > span {
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 800;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.customer-form textarea,
.address-grid select,
.branding-form input:not([type="file"]):not([type="color"]):not([type="checkbox"]):not([type="hidden"]),
.branding-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  color: var(--fb-text);
  background: #fff;
  padding: 10px 11px;
}

.form-grid textarea,
.customer-form textarea,
.branding-form textarea {
  min-height: 90px;
  resize: vertical;
}

.branding-form input[type="color"] {
  width: 64px;
  min-width: 64px;
  height: 42px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 5px;
}

.branding-form input[type="file"] {
  max-width: 100%;
}

.branding-form input[type="hidden"] {
  display: none;
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  color: var(--fb-text);
  font-weight: 700;
}

.inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.address-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.address-grid > div {
  display: grid;
  gap: 12px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fbfcff;
  padding: 14px;
}

.address-grid.single > div {
  max-width: none;
  width: 100%;
}

.currency-after-address {
  max-width: 480px;
}

.currency-after-address small {
  color: var(--fb-muted);
  font-size: 12px;
  line-height: 1.4;
}

.address-grid label {
  display: grid;
  gap: 7px;
}

.address-grid input,
.mini-table input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
}

.mini-table {
  overflow-x: auto;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
}

.mini-table-head,
.mini-table-row {
  display: grid;
  grid-template-columns: 110px 150px 150px 220px 150px 150px;
  min-width: 930px;
}

.mini-table-head {
  color: var(--fb-muted);
  background: var(--fb-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-table-head span,
.mini-table-row input {
  border: 0;
  border-right: 1px solid var(--fb-line);
  border-radius: 0;
  padding: 11px;
}

.mini-table-row {
  border-top: 1px solid var(--fb-line);
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--fb-line);
  background: rgba(255, 255, 255, 0.94);
  margin: 0 -14px -14px;
  padding: 14px;
}

code {
  border: 1px solid var(--fb-line);
  border-radius: 5px;
  background: var(--fb-soft);
  padding: 2px 5px;
}

@media (min-width: 640px) {
  .utility-bar {
    min-height: 54px;
    align-items: center;
    flex-direction: row;
    padding: 0 22px;
  }

  .search-box {
    width: min(420px, 55vw);
  }

  .utility-actions {
    justify-content: flex-end;
  }

  .page {
    padding: 22px 18px 44px;
  }

  .welcome-band {
    margin: -22px -18px 22px;
    padding: 24px 18px 0;
  }

  .begin-hero {
    grid-template-columns: auto minmax(0, 1fr) auto;
    margin: -22px -18px 22px;
    padding: 18px;
  }

  .overview-link {
    grid-column: auto;
    justify-self: end;
  }

  .panel {
    padding: 18px;
  }

  .panel-head {
    align-items: center;
    flex-direction: row;
    gap: 14px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .receivable-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .item-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .catalog-filters {
    grid-template-columns: minmax(240px, 1fr) minmax(160px, 220px);
    align-items: end;
  }

  .item-card em {
    grid-column: auto;
  }

  .address-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-page {
    padding: 24px;
  }

  .auth-card {
    padding: 28px;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .color-picks {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .document-row {
    grid-template-columns: 92px minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(72px, auto);
  }

  .document-row .status {
    grid-column: 1 / -1;
  }

  .tenant-card {
    grid-template-columns: minmax(180px, 1fr) minmax(145px, 190px) auto auto;
  }
}

@media (min-width: 981px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 224px;
    min-height: 100vh;
    gap: 14px;
    overflow-x: visible;
    overflow-y: auto;
    padding: 12px 8px;
    transition: width 180ms ease;
    z-index: 3;
  }

  .sidebar-brand {
    padding: 4px 6px 14px;
  }

  .sidebar-toggle {
    display: grid;
    place-items: center;
    position: absolute;
    right: 0;
    top: 16px;
    width: 17px;
    min-height: 34px;
    margin: 0;
    border: 0;
    border-radius: 17px 0 0 17px;
    color: #1454ca;
    background: #fff;
    padding: 0;
    box-shadow: -4px 0 10px rgba(15, 54, 125, 0.2);
    z-index: 5;
  }

  .sidebar-toggle span {
    width: 7px;
    height: 7px;
    margin-left: -2px;
  }

  .side-nav {
    display: grid;
    overflow-x: visible;
  }

  .side-nav a,
  .logout-link {
    flex: initial;
    padding: 0 10px;
    font-size: 14px;
  }

  .logout-link {
    margin-top: auto;
  }

  .page {
    width: min(1180px, calc(100vw - 224px));
    padding: 25px 22px 44px;
    transition: width 180ms ease;
  }

  .workspace-shell {
    margin-left: 224px;
    transition: margin-left 180ms ease;
  }

  .welcome-band {
    margin: -25px -22px 22px;
    padding: 25px 22px 0;
  }

  .panel {
    padding: 20px;
  }
}

@media (min-width: 981px) {
  .sidebar-collapsed .sidebar {
    width: 72px;
  }

  .sidebar-collapsed .workspace-shell {
    margin-left: 72px;
  }

  .sidebar-collapsed .sidebar-copy,
  .sidebar-collapsed .product-brand-lockup,
  .sidebar-collapsed .nav-label,
  .sidebar-collapsed .setup-arrow {
    display: none;
  }

  .sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-collapsed .product-brand-mark {
    display: block;
  }

  .sidebar-collapsed .sidebar-toggle {
    right: 0;
    top: 16px;
    width: 17px;
    min-height: 34px;
    color: #1454ca;
    background: #fff;
    box-shadow: -4px 0 10px rgba(15, 54, 125, 0.2);
  }

  .sidebar-collapsed .sidebar-toggle span {
    transform: rotate(225deg);
  }

  .sidebar-collapsed .setup-card,
  .sidebar-collapsed .side-nav a,
  .sidebar-collapsed .logout-link {
    justify-content: center;
    padding-inline: 0;
  }

  .sidebar-collapsed .setup-card {
    min-height: 42px;
  }

  .sidebar-collapsed .page {
    width: min(1280px, calc(100vw - 72px));
  }
}

@media (min-width: 1180px) {
  .begin-layout {
    grid-template-columns: minmax(420px, 520px) minmax(0, 1fr);
    align-items: start;
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-form-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .item-hero-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .item-hero-card .button-secondary {
    grid-column: auto;
  }

  .invoice-preview-stage {
    min-height: 620px;
    display: grid;
    place-items: center;
    padding: 42px;
  }

  .address-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .address-grid.single {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(96px, 1fr));
    gap: 14px;
  }
}

@media (min-width: 1320px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
  }

  .document-row {
    grid-template-columns: 92px minmax(90px, 0.8fr) minmax(120px, 1fr) minmax(72px, auto) auto;
  }

  .document-row .status {
    grid-column: auto;
  }

  .customer-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .customer-workspace {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .customer-form {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  .content-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .welcome-band h1 {
    font-size: 21px;
  }

  .icon-button {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-box {
    padding: 10px 11px;
  }

  .utility-actions {
    gap: 8px;
  }

  .setup-card {
    padding: 11px 12px;
  }

  .side-nav a,
  .logout-link {
    min-height: 36px;
    padding: 0 11px;
  }
}

@media (max-width: 340px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .create-action {
    width: 34px;
    height: 34px;
    min-height: 34px;
    flex-basis: 34px;
  }
}

.document-list {
  display: grid;
  gap: 12px;
}

.document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  color: var(--fb-text);
  text-decoration: none;
}

.document-row strong,
.document-row small {
  display: block;
}

.document-row small {
  color: var(--fb-muted);
}

.document-row em {
  font-style: normal;
  font-weight: 900;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  border-radius: 999px;
  color: #8b5b14;
  background: #fff5dd;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  color: #0d7651;
  background: #dcf9eb;
}

.order-form {
  display: grid;
  gap: 0;
}

.order-form.panel { padding-block: 10px 16px; }
.order-form > .form-section { padding-block: 16px; }
.order-form > .proposal-start { padding-bottom: 14px; }
.order-form > .proposal-composer { border-top: 1px solid var(--fb-line); padding-top: 16px; }
.proposal-composer > .form-section { border-top: 0; padding: 0; }

.document-mode-options,
.proposal-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.document-mode-card,
.proposal-template-grid label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 11px;
}

.document-mode-card:has(input:checked),
.proposal-template-grid label:has(input:checked) {
  border-color: var(--fb-blue);
  background: #f2f7ff;
  box-shadow: inset 0 0 0 1px var(--fb-blue);
}

.document-mode-card input,
.proposal-template-grid input,
.proposal-section-toggle input {
  width: auto;
  margin-top: 3px;
}

.document-mode-card strong,
.document-mode-card small,
.proposal-template-grid strong,
.proposal-template-grid small {
  display: block;
}

.document-mode-card strong { font-size: 13px; }

.document-mode-card small,
.proposal-template-grid small {
  margin-top: 4px;
  color: var(--fb-muted);
  font-weight: 500;
}

.proposal-template-picker { margin-top: 18px; }
[data-proposal-options][hidden] { display: none !important; }
.proposal-template-picker .field-label { display: block; margin-bottom: 8px; font-weight: 800; }
.proposal-template-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.proposal-template-grid label { grid-template-columns: 1fr; }
.proposal-template-grid input { position: absolute; opacity: 0; pointer-events: none; }

.proposal-section-list { display: grid; gap: 8px; }
.proposal-cover-controls { display: grid; grid-template-columns: 88px 180px minmax(160px, 1fr) minmax(180px, 1fr); gap: 10px; margin-bottom: 12px; }
.proposal-cover-controls label { display: grid; gap: 5px; min-width: 0; color: var(--fb-muted); font-size: 12px; font-weight: 800; }
.proposal-cover-controls input { width: 100%; min-width: 0; }
.proposal-cover-controls input[type="color"] { width: 34px; height: 34px; border-radius: 5px; padding: 3px; }
.proposal-design-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; border: 1px solid var(--fb-line); border-radius: 7px; background: #f8faff; padding: 10px 12px; }
.proposal-design-summary strong, .proposal-design-summary small { display: block; }
.proposal-design-summary strong { font-size: 12px; }.proposal-design-summary small { margin-top: 2px; color: var(--fb-muted); font-size: 10px; }
.proposal-design-swatches { display: flex; align-items: center; }
.proposal-design-swatches span { width: 28px; height: 28px; border: 2px solid #fff; border-radius: 5px; box-shadow: 0 0 0 1px #d7dfeb; }
.proposal-design-swatches span + span { margin-left: -7px; }
.proposal-design-edit { display: inline-flex; align-items: center; gap: 7px; margin: 0; min-height: 34px; padding: 7px 10px; }
.proposal-designer-dialog { width: min(1440px, calc(100vw - 30px)); height: min(920px, calc(100vh - 30px)); max-width: none; max-height: none; border: 0; border-radius: 8px; background: #eef2f7; padding: 0; color: var(--fb-ink); box-shadow: 0 28px 90px rgb(10 21 44 / 38%); }
.proposal-designer-dialog::backdrop { background: rgb(10 20 42 / 62%); backdrop-filter: blur(5px); }
.proposal-designer-head { height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--fb-line); background: #fff; padding: 10px 16px; }
.proposal-designer-head > div { display: flex; align-items: center; gap: 8px; }.proposal-designer-head strong, .proposal-designer-head small { display: block; }.proposal-designer-head small { color: var(--fb-muted); }
.proposal-designer-shell { height: calc(100% - 62px); display: grid; grid-template-columns: 82px 330px minmax(0, 1fr); }
.proposal-designer-tabs { display: flex; flex-direction: column; gap: 5px; border-right: 1px solid var(--fb-line); background: #fff; padding: 12px 8px; }
.proposal-designer-tabs button { min-height: 42px; border: 0; border-radius: 5px; background: transparent; color: #617087; font-size: 10px; font-weight: 800; }.proposal-designer-tabs button:hover, .proposal-designer-tabs button.active { color: var(--fb-blue); background: #edf4ff; }
.proposal-designer-properties { overflow-y: auto; border-right: 1px solid var(--fb-line); background: #fff; padding: 18px; }
.proposal-designer-properties h3 { margin: 0 0 4px; font-size: 16px; }.proposal-designer-properties > p { margin: 0 0 18px; color: var(--fb-muted); font-size: 11px; }
.proposal-designer-properties .proposal-cover-controls, .proposal-designer-properties .proposal-cover-layout-controls { grid-template-columns: 1fr 1fr; }
.proposal-designer-properties .proposal-cover-controls > label:nth-child(n+3), .proposal-designer-properties .cover-note-field { grid-column: 1 / -1; }
.proposal-designer-properties .proposal-footer-controls { grid-template-columns: 1fr; align-items: start; margin-top: 18px; }
.proposal-designer-canvas { overflow: auto; padding: 0 24px 24px; }
.proposal-designer-formatbar { position: sticky; z-index: 4; top: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; width: min(760px, 100%); margin: 0 auto 18px; border-bottom: 1px solid var(--fb-line); background: rgb(255 255 255 / 96%); padding: 10px 12px; box-shadow: 0 5px 18px rgb(28 41 68 / 9%); backdrop-filter: blur(12px); }
.proposal-designer-formatbar button { min-width: 30px; height: 32px; border: 1px solid var(--fb-line); border-radius: 4px; background: #fff; padding: 0 8px; color: var(--fb-ink); font-size: 11px; font-weight: 800; }
.proposal-designer-formatbar button:hover { border-color: var(--fb-blue); color: var(--fb-blue); }
.proposal-designer-formatbar .toolbar-swatch { width: 32px; height: 32px; }
.proposal-designer-formatbar .toolbar-swatch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.proposal-designer-canvas .proposal-section-content[contenteditable="true"] { outline: 1px dashed transparent; cursor: text; }
.proposal-designer-canvas .proposal-section-content[contenteditable="true"]:focus { outline-color: #8eb8ff; background: #fbfdff; }
.proposal-designer-canvas .proposal-section-content[contenteditable="true"] { user-select: text; }
.proposal-designer-canvas .proposal-preview-modal-pages { width: min(610px, calc(100% - 20px)); margin: 0 auto; }
.proposal-designer-canvas .proposal-preview-page { box-shadow: 0 12px 34px rgb(18 31 56 / 16%); }
.proposal-cover-layout-controls { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.proposal-cover-layout-controls label { display: grid; gap: 4px; color: var(--fb-muted); font-size: 11px; font-weight: 800; }
.proposal-cover-layout-controls select,
.proposal-cover-layout-controls input { min-height: 34px; }
.proposal-cover-layout-controls .cover-note-field { grid-column: 1 / -1; }
.order-form.is-proposal-mode .proposal-document-details { padding: 12px 16px; }
.order-form.is-proposal-mode .proposal-document-details h2 { margin: 0 0 9px; font-size: 15px; }
.order-form.is-proposal-mode .proposal-document-details .order-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px 10px; }
.order-form.is-proposal-mode .proposal-document-details label > span:first-child { margin-bottom: 3px; font-size: 10px; }
.order-form.is-proposal-mode .proposal-document-details input,
.order-form.is-proposal-mode .proposal-document-details select { min-height: 34px; padding-block: 6px; }
.order-form.is-proposal-mode .proposal-document-details > label:last-child textarea { min-height: 42px; height: 42px; padding: 8px 10px; }
.proposal-footer-controls { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 10px; margin: -2px 0 12px; padding: 9px 10px; border: 1px solid var(--fb-line); border-radius: 6px; background: #fbfcff; }
.proposal-footer-controls > label:first-child { display: grid; gap: 5px; color: var(--fb-muted); font-size: 12px; font-weight: 800; }
.proposal-footer-controls .compact-check { display: flex; align-items: center; gap: 6px; min-height: 34px; white-space: nowrap; color: var(--fb-text); font-size: 12px; font-weight: 800; }
.proposal-footer-controls .compact-check input[type="checkbox"] { width: 15px; height: 15px; }
.cover-colour-pickers { display: flex; gap: 5px; }
.angle-control { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.angle-control input[type="range"] { width: 120px; }
.angle-control output { width: 40px; color: var(--fb-text); font-variant-numeric: tabular-nums; }
.proposal-section-row { display: grid; grid-template-columns: 24px 20px minmax(0, 1fr); gap: 8px; align-items: start; border: 1px solid var(--fb-line); border-radius: 7px; background: #fff; padding: 10px; }
.proposal-section-row.dragging { opacity: .45; }
.proposal-section-toggle .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.proposal-drag { color: var(--fb-muted); padding-top: 10px; cursor: grab; }
.proposal-section-fields { display: grid; gap: 7px; }
.proposal-composer { display: grid; gap: 14px; align-items: start; }
.proposal-editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; overflow: visible; border: 1px solid var(--fb-line); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--fb-soft); padding: 5px; }
.proposal-editor-toolbar button { display: grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 4px; color: var(--fb-text); background: transparent; padding: 0; font-size: 12px; }
.toolbar-font-control, .toolbar-type-control { position: relative; flex: 0 0 auto; }
.proposal-editor-toolbar .toolbar-font-control > button { width: 32px; font-family: Georgia, serif; font-size: 12px; font-weight: 700; }
.proposal-editor-toolbar .toolbar-type-control > button { width: 32px; font-size: 11px; font-weight: 800; }
.toolbar-font-popover, .toolbar-type-popover { position: absolute; z-index: 8; top: calc(100% + 6px); left: 0; display: none; width: 184px; border: 1px solid var(--fb-line); border-radius: 6px; background: #fff; padding: 8px; box-shadow: 0 12px 26px rgb(22 35 60 / 16%); }
.toolbar-font-control.is-open .toolbar-font-popover, .toolbar-type-control.is-open .toolbar-type-popover { display: grid; gap: 8px; }
.toolbar-font-popover label, .toolbar-type-popover label { display: grid; gap: 5px; color: var(--fb-muted); font-size: 10px; font-weight: 800; }
.proposal-editor-toolbar .toolbar-font-popover select, .proposal-editor-toolbar .toolbar-type-popover select { width: 100% !important; min-width: 0 !important; max-width: none; height: 30px; border: 1px solid var(--fb-line); border-radius: 4px; background: #fff; padding: 0 7px; color: var(--fb-text); font-size: 12px; }
.toolbar-swatch { display: grid; place-items: center; width: 30px; height: 28px; }
.toolbar-swatch { position: relative; cursor: pointer; font-size: 14px; font-weight: 900; }
.toolbar-swatch > span { border-bottom: 3px solid #172033; line-height: 17px; }
.toolbar-swatch.highlight > span { border-bottom-color: #f2c94c; background: #fff1a8; padding-inline: 2px; }
.toolbar-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.toolbar-list-icon span, .toolbar-indent span { position: relative; display: block; width: 17px; height: 14px; }
.toolbar-list-icon span::before { content: ''; position: absolute; left: 6px; top: 2px; width: 11px; height: 2px; background: currentColor; box-shadow: 0 5px currentColor, 0 10px currentColor; }
.toolbar-list-icon.bullets span::after { content: '•'; position: absolute; left: 0; top: -5px; font-size: 16px; line-height: 1; text-shadow: 0 5px currentColor, 0 10px currentColor; }
.toolbar-list-icon.numbers span::after { content: '1\A 2\A 3'; white-space: pre; position: absolute; left: 0; top: -1px; font-size: 6px; line-height: 5px; }
.toolbar-indent span::before { content: ''; position: absolute; left: 6px; top: 2px; width: 11px; height: 2px; background: currentColor; box-shadow: 0 5px currentColor, 0 10px currentColor; }
.toolbar-indent span::after { content: '›'; position: absolute; left: 0; top: -4px; font-size: 17px; }
.toolbar-indent.outdent span { transform: scaleX(-1); }
.proposal-editor-toolbar button:hover,
.proposal-editor-toolbar button:focus-visible { background: #fff; outline: 1px solid var(--fb-line); }
.proposal-rich-editor { min-height: 150px; max-height: 620px; resize: vertical; overflow: auto; overflow-wrap: anywhere; border: 1px solid var(--fb-line); border-radius: 0 0 7px 7px; background: #fff; padding: 13px; font-size: 14px; line-height: 1.55; }
.proposal-rich-editor h1 { margin: 0 0 12px; font-size: 27px; }
.proposal-rich-editor:focus { border-color: var(--fb-blue); outline: 2px solid rgb(36 118 255 / 14%); }
.proposal-rich-editor h2 { margin: 0 0 10px; font-size: 21px; }
.proposal-rich-editor h3 { margin: 0 0 8px; font-size: 17px; }
.proposal-rich-editor p { margin: 0 0 10px; }
.proposal-rich-editor ul,
.proposal-rich-editor ol { margin: 0 0 10px; padding-left: 24px; }
.proposal-live-preview { position: sticky; top: 76px; min-width: 0; }
.proposal-preview-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.proposal-preview-heading span,
.proposal-preview-heading small { display: block; }
.proposal-preview-heading span { font-weight: 900; }
.proposal-preview-heading small { color: var(--fb-muted); font-size: 11px; }
.proposal-preview-actions { display: flex; align-items: center; gap: 6px; }
.proposal-preview-pages,
.proposal-preview-modal-pages { display: grid; gap: 12px; }
.proposal-preview-pages .proposal-page,
.proposal-preview-modal-pages .proposal-page { width: 100%; height: auto; min-height: 0; aspect-ratio: 210 / 297; margin: 0; padding: 8%; font-size: clamp(5px, .68vw, 8px); box-shadow: 0 8px 22px rgb(29 42 72 / 10%); }
.proposal-preview-pages .proposal-cover-page,
.proposal-preview-modal-pages .proposal-cover-page { padding: 8%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-brand,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-brand,
.proposal-preview-pages .proposal-cover-page .proposal-client-logo,
.proposal-preview-modal-pages .proposal-cover-page .proposal-client-logo { width: 34%; min-height: 8%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-brand img,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-brand img,
.proposal-preview-pages .proposal-cover-page .proposal-client-logo img,
.proposal-preview-modal-pages .proposal-cover-page .proposal-client-logo img { max-width: 100%; max-height: 56px; }
.proposal-preview-pages .proposal-cover-page .cover-item-top-left,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-top-left { top: 8%; left: 8%; }
.proposal-preview-pages .proposal-cover-page .cover-item-top-right,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-top-right { top: 8%; right: 8%; }
.proposal-preview-pages .proposal-cover-page .cover-item-bottom-left,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-bottom-left { bottom: 8%; left: 8%; }
.proposal-preview-pages .proposal-cover-page .cover-item-bottom-right,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-bottom-right { right: 8%; bottom: 8%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy { left: 8%; right: 8%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-top,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-top { top: 18%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-middle,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-middle { top: 43%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-bottom,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-bottom { bottom: 14%; }
.proposal-preview-pages .proposal-cover-copy h1,
.proposal-preview-modal-pages .proposal-cover-copy h1 { margin-bottom: 4%; font-size: 2.7em; }
.proposal-preview-pages .proposal-cover-copy p,
.proposal-preview-modal-pages .proposal-cover-copy p { font-size: 1em; }
.proposal-preview-pages .proposal-page-header,
.proposal-preview-modal-pages .proposal-page-header { padding-bottom: 2%; font-size: .8em; }
.proposal-preview-pages .proposal-page-body,
.proposal-preview-modal-pages .proposal-page-body { padding-top: 7%; }
.proposal-preview-pages .proposal-page-body > h1,
.proposal-preview-modal-pages .proposal-page-body > h1 { margin-bottom: 4%; font-size: 2.3em; }
.proposal-preview-pages .proposal-content-page .proposal-section-content,
.proposal-preview-modal-pages .proposal-content-page .proposal-section-content { font-size: 1em; line-height: 1.55; }
.proposal-preview-pages .proposal-page-footer,
.proposal-preview-modal-pages .proposal-page-footer { right: 8%; bottom: 4%; left: 8%; width: 84%; font-size: .72em; }
.proposal-preview-pages .proposal-estimate-header,
.proposal-preview-modal-pages .proposal-estimate-header,
.proposal-preview-pages .proposal-estimate-meta,
.proposal-preview-modal-pages .proposal-estimate-meta,
.proposal-preview-pages .proposal-investment-table,
.proposal-preview-modal-pages .proposal-investment-table { table-layout: fixed; }
.proposal-preview-pages .proposal-estimate-header td,
.proposal-preview-modal-pages .proposal-estimate-header td { padding: 3% 2%; }
.proposal-preview-pages .proposal-estimate-header h2,
.proposal-preview-modal-pages .proposal-estimate-header h2 { margin-bottom: 2%; font-size: 2.25em; line-height: 1.05; }
.proposal-preview-pages .proposal-estimate-header img,
.proposal-preview-modal-pages .proposal-estimate-header img { max-width: 76%; max-height: 2.8em; margin-bottom: 2%; }
.proposal-preview-pages .proposal-estimate-header small,
.proposal-preview-modal-pages .proposal-estimate-header small { font-size: .8em; overflow-wrap: anywhere; }
.proposal-preview-pages .proposal-estimate-meta,
.proposal-preview-modal-pages .proposal-estimate-meta { margin-bottom: 6%; }
.proposal-preview-pages .proposal-estimate-meta td,
.proposal-preview-modal-pages .proposal-estimate-meta td { padding: 2.5% 2%; }
.proposal-preview-pages .proposal-estimate-meta b,
.proposal-preview-modal-pages .proposal-estimate-meta b { min-width: 0; margin-right: .35em; }
.proposal-preview-pages .proposal-investment-page .proposal-page-body > h1,
.proposal-preview-modal-pages .proposal-investment-page .proposal-page-body > h1 { margin-bottom: 4%; font-size: 2em; }
.proposal-preview-pages .proposal-investment-table,
.proposal-preview-modal-pages .proposal-investment-table { font-size: .9em; }
.proposal-preview-pages .proposal-investment-table th,
.proposal-preview-pages .proposal-investment-table td,
.proposal-preview-modal-pages .proposal-investment-table th,
.proposal-preview-modal-pages .proposal-investment-table td { padding: 2.25% 1.5%; overflow-wrap: anywhere; }
.proposal-preview-pages .proposal-investment-table th:first-child,
.proposal-preview-pages .proposal-investment-table td:first-child,
.proposal-preview-modal-pages .proposal-investment-table th:first-child,
.proposal-preview-modal-pages .proposal-investment-table td:first-child { width: 41%; }
.proposal-preview-pages .proposal-investment-table th:nth-child(2),
.proposal-preview-pages .proposal-investment-table td:nth-child(2),
.proposal-preview-pages .proposal-investment-table th:nth-child(3),
.proposal-preview-pages .proposal-investment-table td:nth-child(3),
.proposal-preview-modal-pages .proposal-investment-table th:nth-child(2),
.proposal-preview-modal-pages .proposal-investment-table td:nth-child(2),
.proposal-preview-modal-pages .proposal-investment-table th:nth-child(3),
.proposal-preview-modal-pages .proposal-investment-table td:nth-child(3) { width: 17%; white-space: nowrap; }
.proposal-preview-pages .proposal-investment-table th:last-child,
.proposal-preview-pages .proposal-investment-table td:last-child,
.proposal-preview-modal-pages .proposal-investment-table th:last-child,
.proposal-preview-modal-pages .proposal-investment-table td:last-child { width: 25%; white-space: nowrap; }

/* Match the full-size proposal A4 grid from document.css while the page is scaled in a preview. */
.proposal-preview-pages .proposal-page,
.proposal-preview-modal-pages .proposal-page { padding: 9.5238%; }
.proposal-preview-pages .proposal-cover-page,
.proposal-preview-modal-pages .proposal-cover-page { padding: 0; }
.proposal-preview-pages .proposal-cover-page .cover-item-top-left,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-top-left { top: 7.619%; left: 7.619%; }
.proposal-preview-pages .proposal-cover-page .cover-item-top-right,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-top-right { top: 7.619%; right: 7.619%; }
.proposal-preview-pages .proposal-cover-page .cover-item-bottom-left,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-bottom-left { bottom: 7.619%; left: 7.619%; }
.proposal-preview-pages .proposal-cover-page .cover-item-bottom-right,
.proposal-preview-modal-pages .proposal-cover-page .cover-item-bottom-right { right: 7.619%; bottom: 7.619%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy { left: 7.619%; right: 7.619%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-top,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-top { top: 18.182%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-middle,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-middle { top: 43.098%; }
.proposal-preview-pages .proposal-cover-page .proposal-cover-copy.cover-copy-bottom,
.proposal-preview-modal-pages .proposal-cover-page .proposal-cover-copy.cover-copy-bottom { bottom: 9.428%; }
.proposal-preview-pages .proposal-page-body,
.proposal-preview-modal-pages .proposal-page-body { padding-top: 6.19%; }
.proposal-preview-pages .proposal-page-footer,
.proposal-preview-modal-pages .proposal-page-footer { right: 9.5238%; bottom: 3.367%; left: 9.5238%; width: 80.9524%; }
.proposal-preview-pages .proposal-cover-page .proposal-page-footer,
.proposal-preview-modal-pages .proposal-cover-page .proposal-page-footer { right: 7.619%; bottom: 2.694%; left: 7.619%; width: 84.762%; }
.proposal-preview-page { position: relative; aspect-ratio: 210 / 297; overflow: hidden; border: 1px solid var(--fb-line); background: #fff; box-shadow: 0 8px 22px rgb(29 42 72 / 10%); padding: 22px; color: #172033; }
.proposal-preview-footer { position: absolute; left: 22px; right: 22px; bottom: 9px; display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid #e1e6ef; padding-top: 5px; color: #8792a8; font-size: 8px; }
.proposal-preview-cover .proposal-preview-footer { border-top-color: rgb(255 255 255 / 32%); color: rgb(255 255 255 / 78%); }
.proposal-preview-cover { border-top: 0; color: #fff; background: var(--cover-color, var(--fb-blue)); }
.proposal-preview-cover .preview-brand { position: absolute; min-height: 48px; color: #fff; font-size: 18px; font-weight: 900; }
.proposal-preview-cover .preview-brand img { display: block; width: auto; max-width: 42%; height: 48px; object-fit: contain; object-position: left center; }
.proposal-preview-cover .preview-client-brand { position: absolute; width: 30%; height: 42px; }
.proposal-preview-cover .preview-client-brand img { width: 100%; height: 100%; object-fit: contain; object-position: right center; }
.preview-cover-copy { position: absolute; left: 22px; right: 22px; }
.preview-cover-copy.cover-copy-top { top: 92px; }
.preview-cover-copy.cover-copy-middle { top: 50%; transform: translateY(-50%); }
.preview-cover-copy.cover-copy-bottom { bottom: 42px; }
.preview-cover-copy.cover-align-left { text-align: left; }
.preview-cover-copy.cover-align-center { text-align: center; }
.preview-cover-copy.cover-align-right { text-align: right; }
.proposal-preview-cover h2 { margin: 0 0 10px; font-size: 23px; line-height: 1.15; }
.proposal-preview-cover p { color: rgb(255 255 255 / 82%); font-size: 11px; line-height: 1.5; }
.preview-cover-note { margin-top: 13px; max-width: 85%; }
.cover-align-center .preview-cover-note { margin-inline: auto; }
.cover-align-right .preview-cover-note { margin-left: auto; }
.proposal-preview-cover .cover-item-top-left { top: 22px; left: 22px; right: auto; bottom: auto; text-align: left; }
.proposal-preview-cover .cover-item-top-right { top: 22px; right: 22px; left: auto; bottom: auto; text-align: right; }
.proposal-preview-cover .cover-item-bottom-left { bottom: 22px; left: 22px; right: auto; top: auto; text-align: left; }
.proposal-preview-cover .cover-item-bottom-right { right: 22px; bottom: 22px; left: auto; top: auto; text-align: right; }
.proposal-preview-cover .cover-item-top-right img,
.proposal-preview-cover .cover-item-bottom-right img { margin-left: auto; object-position: right center; }
.proposal-section-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; color: var(--fb-muted); font-size: 11px; }
.proposal-section-options label { display: flex; align-items: center; gap: 6px; }
.page-break-badge { cursor: pointer; }
.page-break-badge input[type="checkbox"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.page-break-badge span { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid var(--fb-line); border-radius: 999px; background: #fff; padding: 4px 10px; color: var(--fb-muted); font-weight: 800; line-height: 1; }
.page-break-badge input:checked + span { border-color: var(--fb-blue); color: var(--fb-blue); background: #edf4ff; }
.page-break-badge input:focus-visible + span { outline: 2px solid rgb(36 118 255 / 22%); outline-offset: 2px; }
.section-layout-control { margin-left: auto; }
.section-layout-control > span { font-weight: 800; }
.proposal-section-options select { min-height: 30px; }
.timeline-phase-editor { display: grid; gap: 6px; border-top: 1px dashed var(--fb-line); padding-top: 8px; }
.timeline-phase-head, .timeline-phase-row { display: grid; grid-template-columns: 1fr 1.45fr 70px 70px 82px 32px; gap: 6px; }
.timeline-phase-head { padding: 0 3px; color: var(--fb-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.timeline-phase-row input, .timeline-phase-row select { min-width: 0; }
.preview-timeline { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px 0; margin-top: 10px; }
.preview-phase { grid-column: var(--phase-start) / span var(--phase-span); border-left: 3px solid var(--cover-color, var(--fb-blue)); background: #edf4ff; padding: 5px 7px; }
.preview-phase strong, .preview-phase small { display: block; }
.preview-phase small { color: #667189; font-size: 8px; }
.icon-text-button { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; border: 1px solid var(--fb-line); border-radius: 6px; background: #fff; padding: 8px 11px; font-weight: 800; }
.overview-signoff-editor, .work-sample-editor { display: grid; gap: 8px; border: 1px dashed var(--fb-line); border-radius: 6px; background: #fbfcff; padding: 10px; }
.signoff-fields { display: grid; grid-template-columns: 110px 1fr 1fr; gap: 8px; align-items: end; }
.signoff-text-field { display: grid; gap: 4px; color: var(--fb-muted); font-size: 10px; font-weight: 800; }
.signoff-text-field > span:last-child { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 5px; }
.signoff-text-field input[type="color"] { width: 34px; min-width: 34px; height: 34px; padding: 3px; }
.image-upload-tile { position: relative; display: grid; place-items: center; min-height: 42px; border: 1px dashed #aab6ca; border-radius: 5px; background: #fff; color: var(--fb-blue); font-size: 11px; font-weight: 800; cursor: pointer; }
.image-upload-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.overview-signoff-editor .signoff-toggle { display: flex !important; grid-column: 1 / -1; grid-template-columns: none !important; align-items: center !important; justify-self: stretch; justify-content: flex-start !important; gap: 7px !important; width: 100%; max-width: none; margin: 0; color: var(--fb-muted); font-size: 11px; line-height: 1.35; text-align: left; }
.overview-signoff-editor .signoff-toggle > span { display: block !important; flex: 0 1 auto; width: auto !important; margin: 0 !important; }
.overview-signoff-editor .signoff-toggle input { position: static !important; flex: 0 0 16px; width: 16px !important; height: 16px !important; margin: 0 !important; opacity: 1 !important; pointer-events: auto !important; }
.work-sample-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 105px 32px; gap: 8px; align-items: start; }
.work-sample-row > div { display: grid; gap: 6px; }
.work-sample-row textarea { min-height: 64px; }
.add-portfolio-piece { justify-self: start; margin-top: 2px; }
.preview-signoff { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.preview-signoff img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.preview-signoff strong, .preview-signoff small { display: block; }
.preview-signoff small { color: #667189; font-size: 8px; }
.preview-work-list { display: grid; gap: 10px; margin-top: 10px; }
.preview-work-sample { display: grid; grid-template-columns: 42% 1fr; gap: 8px; align-items: center; }
.preview-work-sample.image-right img, .preview-work-sample.image-right .preview-image-placeholder { grid-column: 2; grid-row: 1; }
.preview-work-sample.image-right > div { grid-column: 1; grid-row: 1; }
.preview-work-sample img, .preview-image-placeholder { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #edf1f7; }
.preview-work-sample strong { display: block; font-size: 10px; }
.preview-work-sample p { margin: 3px 0 0; color: #667189; font-size: 8px; }
.proposal-preview-section { margin-bottom: 18px; }
.proposal-preview-section h2 { margin: 0 0 7px; font-size: 15px; }
.proposal-preview-section h3 { margin: 0 0 6px; font-size: 13px; }
.proposal-preview-section .preview-copy { color: #46526a; font-size: 10px; line-height: 1.5; }
.proposal-preview-section .preview-copy p { margin: 0 0 7px; }
.proposal-preview-section .preview-copy ul,
.proposal-preview-section .preview-copy ol { margin: 0 0 7px; padding-left: 16px; }
.proposal-preview-pricing { margin-top: 18px; border-top: 1px solid #dce3ee; padding-top: 12px; font-size: 10px; }
.proposal-preview-dialog { width: min(900px, calc(100% - 28px)); max-height: calc(100vh - 28px); border: 0; border-radius: 8px; background: #eaf0f8; padding: 0; box-shadow: 0 24px 80px rgb(12 22 46 / 34%); }
.proposal-preview-dialog::backdrop { background: rgb(14 24 48 / 58%); backdrop-filter: blur(5px); }
.proposal-preview-dialog-head { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--fb-line); background: rgb(255 255 255 / 88%); padding: 12px 16px; backdrop-filter: blur(14px); }
.proposal-preview-dialog-head strong,
.proposal-preview-dialog-head small { display: block; }
.proposal-preview-dialog-head small { color: var(--fb-muted); }
.proposal-preview-modal-pages { width: min(690px, calc(100% - 28px)); margin: 20px auto; }
.proposal-preview-modal-pages .proposal-preview-page { padding: 42px; }
.attachment-caption-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.attachment-caption-grid label { display: grid; gap: 5px; }
.attachment-caption-grid span { overflow: hidden; color: var(--fb-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 920px) {
  .proposal-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1179px) {
  .proposal-live-preview {
    position: fixed;
    z-index: 25;
    top: 50%;
    right: 0;
    width: auto;
    min-width: 0;
    transform: translateY(-50%);
  }

  .proposal-live-preview .proposal-preview-pages,
  .proposal-live-preview .proposal-preview-heading > div {
    display: none;
  }

  .proposal-live-preview .proposal-preview-heading {
    margin: 0;
  }

  .proposal-live-preview .icon-command {
    width: 44px;
    height: 52px;
    border-color: #1f64dc;
    border-right: 0;
    border-radius: 8px 0 0 8px;
    color: #fff;
    background: var(--fb-blue);
    box-shadow: 0 8px 24px rgb(22 42 84 / 24%);
  }

  .proposal-live-preview .icon-command::after {
    content: 'Preview';
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }
}

@media (min-width: 1180px) {
  .proposal-composer { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 620px) {
  .document-mode-options,
  .proposal-template-grid,
  .attachment-caption-grid { grid-template-columns: 1fr; }
  .proposal-section-row { grid-template-columns: 20px 20px minmax(0, 1fr); }
  .proposal-rich-editor { min-height: 180px; }
  .proposal-live-preview { position: static; }
}

.section-title-row,
.document-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-lines {
  display: grid;
  gap: 10px;
}

.order-line {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: #fff;
  padding: 12px;
}

.order-line-head {
  display: none;
  color: var(--fb-muted);
  background: var(--fb-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-line label {
  display: grid;
  gap: 8px;
}

.smart-item-field {
  position: relative;
}

.item-suggestion-menu {
  position: absolute;
  z-index: 30;
  top: 42px;
  right: 0;
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 12px 28px rgb(24 36 64 / 16%);
}

.item-suggestion {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--fb-line);
  color: var(--fb-text);
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.item-suggestion:last-child {
  border-bottom: 0;
}

.item-suggestion:hover,
.item-suggestion:focus-visible {
  background: #ecfbf4;
  outline: none;
}

.order-line .item-suggestion strong {
  display: block;
  min-height: 0;
  font-size: 14px;
  text-align: left;
  justify-content: flex-start;
}

.item-suggestion span,
.item-suggestion-empty {
  color: var(--fb-muted);
  font-size: 12px;
}

.item-suggestion-empty {
  display: block;
  padding: 12px;
}

.readonly-field {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  color: var(--fb-text);
  background: var(--fb-soft);
  padding: 10px 11px;
}

.order-line input,
.order-line select,
.order-line textarea,
.order-form input,
.order-form select,
.order-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  color: var(--fb-text);
  background: #fff;
  padding: 10px 11px;
}

.order-line textarea,
.order-form textarea {
  min-height: 78px;
  resize: vertical;
}

.order-line strong {
  display: flex;
  align-items: center;
  min-height: 40px;
  font-size: 17px;
}

.order-bottom-grid,
.document-detail {
  display: grid;
  gap: 14px;
}

.totals-panel {
  display: grid;
  align-self: start;
  gap: 12px;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  background: var(--fb-soft);
  padding: 16px;
}

.totals-panel div,
.totals-panel label,
.document-total-stack span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.totals-panel label {
  color: var(--fb-muted);
  font-weight: 800;
}

.totals-panel input {
  max-width: 150px;
  text-align: right;
}

.totals-panel .discount-control {
  display: grid;
  grid-template-columns: 112px minmax(78px, 1fr);
  max-width: 190px;
}

.totals-panel .discount-control select,
.totals-panel .discount-control input {
  min-width: 0;
  border-radius: 0;
}

.totals-panel .discount-control select {
  border-radius: 6px 0 0 6px;
  border-right: 0;
  padding-inline: 9px;
}

.totals-panel .discount-control input {
  border-radius: 0 6px 6px 0;
}

.totals-panel .charge-row {
  align-items: stretch;
}

.totals-panel .charge-label-input {
  max-width: none;
  min-width: 0;
  text-align: left;
  font-weight: 700;
}

.total-row {
  border-top: 1px solid var(--fb-line);
  padding-top: 12px;
  font-size: 19px;
  font-weight: 900;
}

.muted-box {
  color: var(--fb-muted);
  background: var(--fb-soft);
}
.form-section.muted-box { padding-right: 16px; padding-left: 16px; }

.attachment-field label {
  display: grid;
  gap: 8px;
}

.attachment-field input[type="file"] {
  border: 1px dashed #c9d1e2;
  background: #fff;
  cursor: pointer;
}

.attachment-field small {
  color: var(--fb-muted);
}

.document-summary-card {
  display: grid;
  gap: 14px;
}

.document-summary-card h1,
.document-preview h2 {
  margin: 0;
}

.document-summary-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.document-summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--fb-line);
  padding-bottom: 8px;
}

.document-summary-card dt {
  color: var(--fb-muted);
  font-weight: 900;
}

.document-summary-card dd {
  margin: 0;
  text-align: right;
}

.document-preview {
  display: grid;
  gap: 18px;
}

.line-table {
  display: grid;
  border: 1px solid var(--fb-line);
  border-radius: var(--fb-radius);
  overflow: hidden;
}

.line-table-head,
.line-table-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
}

.line-table-head {
  display: none;
  color: var(--fb-muted);
  background: var(--fb-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.line-table-row {
  border-top: 1px solid var(--fb-line);
}

.line-table-row small {
  display: block;
  color: var(--fb-muted);
}

.document-total-stack {
  display: grid;
  gap: 8px;
  margin-left: auto;
  width: min(100%, 340px);
}

.document-notes {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--fb-line);
  padding-top: 14px;
  color: var(--fb-muted);
}

.attachment-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--fb-line);
  border-radius: 6px;
  color: var(--fb-text);
  background: var(--fb-soft);
  padding: 8px 10px;
  text-decoration: none;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-workspace-page {
  width: 100%;
  max-width: none;
}

.order-workspace {
  display: grid;
  gap: 16px;
}

.order-list-pane {
  display: grid;
  align-self: start;
  gap: 14px;
  padding: 14px;
}

.order-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-list-head h1 {
  margin: 0;
  font-size: 18px;
}

.order-list-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
}

.order-list-filters input,
.order-list-filters select {
  min-width: 0;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  padding: 9px 10px;
}

.order-list {
  display: grid;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.order-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--fb-line);
  color: var(--fb-text);
  padding: 12px 6px;
  text-decoration: none;
}

.order-list-item.active,
.order-list-item:hover {
  background: #eef2ff;
}

.order-list-item strong,
.order-list-item small,
.order-list-item em {
  display: block;
}

.order-list-item small {
  color: var(--fb-muted);
}

.order-list-item em {
  margin-top: 4px;
  color: var(--fb-blue);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.order-list-item em.draft {
  color: #8b5b14;
}

.order-list-item b {
  white-space: nowrap;
}

.order-preview-pane {
  min-width: 0;
}

.document-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  overflow: visible;
}

.document-toolbar strong {
  margin-right: auto;
  white-space: nowrap;
}

.toolbar-popover {
  position: relative;
  flex: 0 0 auto;
}

.toolbar-popover summary {
  cursor: pointer;
  list-style: none;
}

.toolbar-popover summary::-webkit-details-marker {
  display: none;
}

.toolbar-popover[open] > summary {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 2px rgba(30, 184, 121, 0.14);
}

.toolbar-popover form {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  padding: 12px;
  border: 1px solid var(--fb-line);
  border-radius: 6px;
  background: var(--fb-surface);
  box-shadow: var(--fb-shadow);
}

.toolbar-popover label,
.toolbar-popover label span {
  display: block;
}

.toolbar-popover label span {
  margin-bottom: 5px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar-popover select,
.toolbar-popover input,
.toolbar-popover .button-primary {
  width: 100%;
}

.toolbar-popover .button-primary {
  margin-top: 8px;
}

.toolbar-popover small {
  display: block;
  margin-top: 7px;
  color: var(--fb-muted);
  line-height: 1.35;
}

.document-icon-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0;
  background: color-mix(in srgb, currentColor 8%, white);
  color: #526078;
  cursor: pointer;
  text-decoration: none;
  transition: background 140ms ease, transform 140ms ease;
}

.document-icon-action:hover {
  background: color-mix(in srgb, currentColor 15%, white);
  transform: translateY(-1px);
}

.action-icon {
  width: 15px;
  height: 15px;
  display: block;
  background: currentColor;
  -webkit-mask: var(--action-mask) center / contain no-repeat;
  mask: var(--action-mask) center / contain no-repeat;
}

.icon-eye { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12Z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.icon-edit { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E"); }
.icon-send { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3Cpath d='M22 2 11 13'/%3E%3C/svg%3E"); }
.icon-bell { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3Cpath d='M10 21h4'/%3E%3C/svg%3E"); }
.icon-copy { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='8' y='8' width='13' height='13' rx='2'/%3E%3Cpath d='M16 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E"); }
.icon-repeat { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m17 1 4 4-4 4'/%3E%3Cpath d='M3 11V9a4 4 0 0 1 4-4h14'/%3E%3Cpath d='m7 23-4-4 4-4'/%3E%3Cpath d='M21 13v2a4 4 0 0 1-4 4H3'/%3E%3C/svg%3E"); }
.icon-time { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.icon-plus { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }
.icon-download { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M5 21h14'/%3E%3C/svg%3E"); }
.icon-print { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9V2h12v7'/%3E%3Cpath d='M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2'/%3E%3Crect x='6' y='14' width='12' height='8'/%3E%3C/svg%3E"); }
.icon-check { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E"); }
.icon-close { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.icon-attachment { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m21.4 11.6-8.9 8.9a6 6 0 0 1-8.5-8.5l9.6-9.6a4 4 0 0 1 5.7 5.7l-9.6 9.6a2 2 0 0 1-2.8-2.8l8.9-8.9'/%3E%3C/svg%3E"); }
.icon-lock { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E"); }
.icon-link-off { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m2 2 20 20M9 9l-2 2a5 5 0 0 0 7 7l2-2M15 15l2-2a5 5 0 0 0-7-7L8 8'/%3E%3C/svg%3E"); }
.icon-link { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-1.5 1.5'/%3E%3Cpath d='M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l1.5-1.5'/%3E%3C/svg%3E"); }

.icon-command { width: 36px; height: 36px; min-width: 36px; display: inline-grid; place-items: center; border: 1px solid var(--fb-line); border-radius: 6px; padding: 0; color: #526078; background: #fff; text-decoration: none; }
.icon-command.danger { color: var(--fb-danger); background: #fff7f7; }

.payment-links-page { max-width: 1180px; }
.payment-links-page > * + * { margin-top: 18px; }
.payment-link-result, .payment-link-create { padding: 22px; }
.payment-link-result { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(320px, 1.3fr); gap: 24px; align-items: end; }
.payment-link-create { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); gap: 24px; align-items: end; }
.payment-link-create form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.payment-link-create label { min-width: 0; }
.payment-link-create label span { display: block; margin-bottom: 7px; color: #63718a; font-size: 13px; font-weight: 700; }
.payment-link-create select { width: 100%; }
.payment-link-create .button { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.payment-link-list { padding: 0; overflow: hidden; }
.payment-link-list .section-heading { padding: 18px 20px 14px; border-bottom: 1px solid var(--fb-line); }
.responsive-table-wrap { overflow-x: auto; }
.payment-link-table { min-width: 760px; }
.payment-link-table th { padding: 11px 14px; }
.payment-link-table td { padding: 12px 14px; vertical-align: middle; }
.payment-link-table th:first-child, .payment-link-table td:first-child { padding-left: 20px; }
.payment-link-table th:last-child, .payment-link-table td:last-child { padding-right: 20px; }
.payment-link-table .table-actions { display: flex; justify-content: flex-end; gap: 8px; }
.payment-link-table .table-actions form { margin: 0; }
.payment-link-view-meta { display: block; margin-top: 4px; color: var(--fb-muted); font-size: 10px; white-space: nowrap; }
.status-pill.viewed { color: #195fb8; background: #eaf3ff; }
.payment-link-menu form { width: min(300px, calc(100vw - 32px)); }
.payment-link-menu form strong { display: block; margin-bottom: 4px; }
.payment-link-menu .button-primary { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.payment-link-popover-result { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: min(320px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--fb-line); border-radius: 6px; background: rgba(255, 255, 255, .96); box-shadow: var(--fb-shadow); backdrop-filter: blur(12px); }
.payment-link-popover-result > strong { display: block; margin-bottom: 7px; font-size: 12px; }
.compact-copy-field { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 6px; }
.compact-copy-field input { width: 100%; height: 32px; min-height: 32px; padding: 5px 8px; font-size: 11px; font-weight: 400; color: #526078; }
.compact-copy-field .icon-command { width: 32px; height: 32px; min-width: 32px; }
.compact-copy-field .icon-command.copied { color: #087d63; border-color: #8fd8bc; background: #e9f8f1; }
.copy-confirmation { display: block; min-height: 15px; margin-top: 4px; color: #087d63 !important; font-size: 10px !important; font-weight: 700; }

.customer-portals-page { max-width: 1180px; }
.customer-portals-page > * + * { margin-top: 18px; }
.customer-portal-list { padding: 0; overflow: hidden; }
.customer-portal-list .section-heading { padding: 18px 20px 14px; border-bottom: 1px solid var(--fb-line); }
.portal-management-table { min-width: 720px; }
.portal-management-table th, .portal-management-table td { padding: 12px 14px; vertical-align: middle; }
.portal-management-table .table-actions { display: flex; justify-content: flex-end; gap: 8px; }
.portal-management-table .table-actions form { margin: 0; }

.portal-document-shell { min-height: 100vh; padding: 20px; background: #eef2f8; }
.portal-document-toolbar { max-width: 920px; margin: 0 auto 14px; display: flex; align-items: center; gap: 12px; }
.portal-document-toolbar strong { margin-right: auto; }
.portal-document-stage { max-width: 1080px; margin: 0 auto; overflow: hidden; }
.portal-document-stage .a4-document { margin: 0 auto; }
.portal-shared-proposal { display: grid; gap: 18px; width: min(760px, 100%); margin: 0 auto; }
.portal-shared-proposal .proposal-page { width: 100%; height: auto; min-height: 0; aspect-ratio: 210 / 297; margin: 0; padding: 8%; font-size: clamp(8px, 1vw, 12px); box-shadow: 0 8px 24px rgb(31 45 78 / 12%); }
.portal-shared-proposal .proposal-cover-page .proposal-cover-brand,
.portal-shared-proposal .proposal-cover-page .proposal-client-logo { width: 34%; min-height: 8%; }
.portal-shared-proposal .proposal-cover-page .proposal-cover-brand img,
.portal-shared-proposal .proposal-cover-page .proposal-client-logo img { max-width: 100%; max-height: 72px; }
.portal-shared-proposal .proposal-cover-page .cover-item-top-left { top: 8%; left: 8%; }.portal-shared-proposal .proposal-cover-page .cover-item-top-right { top: 8%; right: 8%; }.portal-shared-proposal .proposal-cover-page .cover-item-bottom-left { bottom: 8%; left: 8%; }.portal-shared-proposal .proposal-cover-page .cover-item-bottom-right { right: 8%; bottom: 8%; }
.portal-shared-proposal .proposal-cover-copy { left: 8%; right: 8%; }.portal-shared-proposal .proposal-cover-copy.cover-copy-top { top: 18%; }.portal-shared-proposal .proposal-cover-copy.cover-copy-middle { top: 43%; }.portal-shared-proposal .proposal-cover-copy.cover-copy-bottom { bottom: 14%; }
.portal-shared-proposal .proposal-cover-copy h1 { font-size: 3em; }.portal-shared-proposal .proposal-cover-copy p { font-size: 1em; }
.portal-shared-proposal .proposal-page-header { font-size: .78em; }.portal-shared-proposal .proposal-page-body { padding-top: 7%; }.portal-shared-proposal .proposal-page-body > h1 { margin-bottom: 4%; font-size: 2.3em; }.portal-shared-proposal .proposal-content-page .proposal-section-content { font-size: 1em; }.portal-shared-proposal .proposal-page-footer { right: 8%; bottom: 4%; left: 8%; width: 84%; font-size: .72em; }
.portal-shared-proposal .proposal-page { padding: 9.5238%; }
.portal-shared-proposal .proposal-cover-page { padding: 0; }
.portal-shared-proposal .proposal-cover-page .cover-item-top-left { top: 7.619%; left: 7.619%; }
.portal-shared-proposal .proposal-cover-page .cover-item-top-right { top: 7.619%; right: 7.619%; }
.portal-shared-proposal .proposal-cover-page .cover-item-bottom-left { bottom: 7.619%; left: 7.619%; }
.portal-shared-proposal .proposal-cover-page .cover-item-bottom-right { right: 7.619%; bottom: 7.619%; }
.portal-shared-proposal .proposal-cover-copy { left: 7.619%; right: 7.619%; }
.portal-shared-proposal .proposal-cover-copy.cover-copy-top { top: 18.182%; }
.portal-shared-proposal .proposal-cover-copy.cover-copy-middle { top: 43.098%; }
.portal-shared-proposal .proposal-cover-copy.cover-copy-bottom { bottom: 9.428%; }
.portal-shared-proposal .proposal-page-body { padding-top: 6.19%; }
.portal-shared-proposal .proposal-page-footer { right: 9.5238%; bottom: 3.367%; left: 9.5238%; width: 80.9524%; }
.portal-shared-proposal .proposal-cover-page .proposal-page-footer { right: 7.619%; bottom: 2.694%; left: 7.619%; width: 84.762%; }
.portal-pdf-viewer { display: block; width: 100%; border: 0; background: #dfe5ee; }.portal-pdf-viewer-full { height: calc(100vh - 150px); min-height: 680px; border-radius: 6px; }.portal-pdf-viewer-pane { height: 720px; border-top: 1px solid #dfe6f1; border-bottom: 1px solid #dfe6f1; }
.portal-proposal-pane { height: 720px; overflow: auto; padding: 18px; border-top: 1px solid #dfe6f1; border-bottom: 1px solid #dfe6f1; background: #e9eef6; }.portal-proposal-pages { display: grid; gap: 18px; width: min(760px, 100%); margin: 0 auto; }.portal-proposal-page { position: relative; aspect-ratio: 210 / 297; overflow: hidden; padding: 8%; color: #182136; background: #fff; box-shadow: 0 8px 24px rgb(31 45 78 / 12%); font-size: clamp(10px, 1.05vw, 14px); }.portal-proposal-page header { display: flex; justify-content: space-between; border-bottom: 1px solid #dbe2ec; padding-bottom: 2.5%; color: #69768d; font-size: .76em; }.portal-proposal-page h2 { margin: 9% 0 4%; font-size: 2em; letter-spacing: 0; }.portal-proposal-content { color: #44516a; font-size: 1em; line-height: 1.65; }.portal-proposal-content p { margin: 0 0 1em; }.portal-proposal-content ul, .portal-proposal-content ol { padding-left: 1.4em; }.portal-proposal-content li { margin-bottom: .65em; }.portal-proposal-page footer { position: absolute; left: 8%; right: 8%; bottom: 5%; display: flex; justify-content: space-between; border-top: 1px solid #dbe2ec; padding-top: 2%; color: #78849a; font-size: .72em; }.portal-proposal-cover { color: #fff; }.portal-proposal-brand { display: block; font-size: 1.15em; }.portal-proposal-cover-copy { position: absolute; left: 8%; right: 8%; bottom: 18%; }.portal-proposal-cover-copy h1 { max-width: 80%; margin: 0 0 5%; font-size: 3.2em; line-height: 1.1; letter-spacing: 0; }.portal-proposal-cover-copy p { margin: 1% 0; }.portal-proposal-note { margin-top: 4% !important; opacity: .85; }.portal-proposal-page-number { position: absolute; right: 5%; bottom: 4%; opacity: .72; }.portal-proposal-timeline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2%; margin-top: 7%; }.portal-proposal-timeline div { min-height: 90px; border-left: 4px solid #2476ff; background: #edf4ff; padding: 8%; }.portal-proposal-timeline strong, .portal-proposal-timeline span { display: block; }.portal-proposal-timeline span { margin-top: 7%; color: #66748d; font-size: .8em; }.portal-proposal-intro { color: #596780; }.portal-proposal-pricing table { width: 100%; margin-top: 7%; border-collapse: collapse; }.portal-proposal-pricing th, .portal-proposal-pricing td { border-bottom: 1px solid #dbe2ec; padding: 3% 2%; text-align: left; }.portal-proposal-pricing th:last-child, .portal-proposal-pricing td:last-child { text-align: right; }.portal-proposal-pricing small { display: block; margin-top: 1%; color: #758197; }.portal-proposal-pricing tfoot th { font-size: 1.15em; }
.portal-view-document { display: inline-block; margin: 0 0 16px; }

@media (max-width: 760px) {
  .proposal-cover-layout-controls { grid-template-columns: 1fr 1fr; }
  .order-form.is-proposal-mode .proposal-document-details .order-form-grid { grid-template-columns: 1fr 1fr; }
  .proposal-cover-controls { grid-template-columns: 1fr; }
  .proposal-design-summary { grid-template-columns: auto minmax(0, 1fr); }.proposal-design-edit { grid-column: 1 / -1; justify-content: center; }
  .proposal-designer-dialog { width: 100vw; height: 100vh; border-radius: 0; }
  .proposal-designer-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .proposal-designer-tabs { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--fb-line); padding: 7px; }.proposal-designer-tabs button { flex: 1; min-height: 34px; }
  .proposal-designer-properties { border-right: 0; }.proposal-designer-canvas { display: none; }
  .timeline-phase-row { grid-template-columns: 1fr 1fr; }
  .signoff-fields, .work-sample-row { grid-template-columns: 1fr; }
    .payment-link-result, .payment-link-create { grid-template-columns: 1fr; }
    .payment-link-create form { grid-template-columns: 1fr; }
    .document-toolbar .button-secondary { width: 32px; min-width: 32px; height: 32px; padding: 0; overflow: hidden; font-size: 0; display: grid; place-items: center; }
    .document-toolbar .button-secondary::before { content: '‹'; font-size: 24px; line-height: 1; }
    .portal-document-shell { padding: 12px; }
}
.email-settings-page, .invoice-email-page { max-width: 1120px; }

.reports-page { max-width: 1380px; }
.report-catalogue-page, .report-run-page { max-width: 1380px; }.report-catalogue-page > * + *, .report-run-page > * + * { margin-top: 18px; }
.report-library-group { display: grid; gap: 8px; }.report-library-heading { display: flex; align-items: baseline; }.report-library-heading h2 { margin: 0; font-size: 14px; }.report-library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }.report-library-card { min-width: 0; display: grid; gap: 12px; border: 1px solid var(--fb-line); border-radius: 7px; background: #fff; padding: 15px; }.report-library-card h3, .report-library-card p { margin: 0; }.report-library-card h3 { font-size: 13px; }.report-library-card p { margin-top: 5px; color: var(--fb-muted); font-size: 10px; line-height: 1.5; }.report-library-card .button-primary { justify-self: start; margin: 0; padding: 7px 10px; font-size: 10px; }
.report-type-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 8px; overflow-x: auto; padding: 2px 0 7px; scrollbar-width: thin; }.report-type-card { min-width: 150px; border: 1px solid var(--fb-line); border-radius: 6px; background: #fff; padding: 10px 12px; color: var(--fb-text); text-decoration: none; }.report-type-card span { display: block; margin-bottom: 3px; color: var(--fb-muted); font-size: 9px; text-transform: uppercase; }.report-type-card strong { display: block; font-size: 11px; }.report-type-card:hover { border-color: #91b5fb; }.report-type-card.active { border-color: #2476ff; background: #edf4ff; box-shadow: inset 0 -2px #2476ff; }
.report-back-link { display: inline-block; margin-bottom: 4px; color: var(--fb-blue); font-size: 10px; font-weight: 800; text-decoration: none; }.report-back-link::before { content: '‹ '; }
.generated-report-chart { padding: 18px; }.generated-chart-bars { min-width: 520px; height: 280px; display: flex; align-items: stretch; gap: 16px; border-bottom: 1px solid var(--fb-line); padding: 12px 14px 0; overflow-x: auto; }.generated-chart-group { min-width: 44px; flex: 1 0 44px; display: grid; grid-template-rows: 1fr 34px; align-items: end; text-align: center; }.generated-chart-columns { height: 100%; display: flex; align-items: end; justify-content: center; gap: 3px; }.generated-chart-columns i { width: min(18px, 42%); min-height: 3px; border-radius: 3px 3px 0 0; background: #2476ff; }.generated-chart-columns i[style*="--series:1"] { background: #19a879; }.generated-chart-columns i[style*="--series:2"] { background: #ef6572; }.generated-chart-columns i[style*="--series:3"] { background: #f0aa32; }.generated-chart-group > span { overflow: hidden; padding-top: 8px; color: var(--fb-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }.generated-chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--fb-muted); font-size: 10px; }.generated-chart-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: #2476ff; }.generated-chart-legend span[style*="--series:1"]::before { background: #19a879; }.generated-chart-legend span[style*="--series:2"]::before { background: #ef6572; }.generated-chart-legend span[style*="--series:3"]::before { background: #f0aa32; }
.reports-page > * + * { margin-top: 16px; }
.reports-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.reports-heading h1, .reports-heading p { margin-bottom: 0; }.report-export { display: inline-flex; align-items: center; gap: 7px; }
.report-filter-bar { display: grid; grid-template-columns: 150px 150px 150px minmax(200px, 1fr) auto auto; align-items: end; gap: 10px; padding: 14px; }
.report-filter-bar label { display: grid; gap: 5px; color: var(--fb-muted); font-size: 11px; font-weight: 800; }.report-filter-bar input, .report-filter-bar select { width: 100%; }
.report-filter-bar .button-primary, .report-filter-bar .button-secondary { min-height: 40px; margin: 0; }
.report-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--fb-line); border-radius: 7px; background: #fff; overflow: hidden; }
.report-metrics article { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--fb-line); }.report-metrics article:last-child { border-right: 0; }
.report-metrics span, .report-metrics strong, .report-metrics small { display: block; }.report-metrics span { color: var(--fb-muted); font-size: 11px; font-weight: 800; }.report-metrics strong { margin: 7px 0 4px; overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }.report-metrics small { color: #8793a7; font-size: 10px; }
.report-metrics .positive strong { color: #087d63; }.report-metrics .negative strong { color: #c63b4a; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.report-panel { min-width: 0; padding: 18px; }.report-trend-panel, .report-expenses-panel { grid-column: span 2; }
.report-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }.report-panel-head h2, .report-panel-head p { margin: 0; }.report-panel-head h2 { margin-top: 2px; font-size: 16px; }.report-panel-head > a, .report-panel-head > span { color: var(--fb-blue); font-size: 11px; font-weight: 800; text-decoration: none; }
.report-legend { display: flex; gap: 14px; color: var(--fb-muted); font-size: 10px; }.report-legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }.report-legend .revenue::before { background: #2476ff; }.report-legend .expenses::before { background: #ef6572; }
.report-trend-chart { height: 210px; display: grid; grid-template-columns: repeat(auto-fit, minmax(42px, 1fr)); align-items: end; gap: 12px; border-bottom: 1px solid var(--fb-line); padding: 10px 12px 0; }
.trend-month { height: 100%; display: grid; grid-template-rows: 1fr 24px; align-items: end; text-align: center; }.trend-month > span { padding-top: 7px; color: var(--fb-muted); font-size: 10px; }.trend-bars { height: 100%; display: flex; align-items: end; justify-content: center; gap: 4px; }.trend-bars i { width: min(18px, 35%); min-height: 3px; border-radius: 3px 3px 0 0; }.trend-bars .revenue { background: #2476ff; }.trend-bars .expenses { background: #ef6572; }
.horizontal-report-bars { display: grid; gap: 12px; }.horizontal-report-bars > div { display: grid; grid-template-columns: 92px minmax(70px, 1fr) 92px; align-items: center; gap: 10px; font-size: 10px; }.horizontal-report-bars > div > span { color: var(--fb-muted); }.horizontal-report-bars > div > b { height: 7px; border-radius: 5px; background: #edf1f7; overflow: hidden; }.horizontal-report-bars > div > b i { display: block; height: 100%; border-radius: inherit; background: #2476ff; }.horizontal-report-bars > div > strong { text-align: right; }
.category-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }.category-bars > div { grid-template-columns: 120px minmax(70px, 1fr) 100px; }.category-bars > div > b i { background: #19a879; }
.proposal-report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.proposal-report-summary > div, .time-report-numbers > div { border: 1px solid var(--fb-line); border-radius: 6px; background: #f8faff; padding: 12px; }.proposal-report-summary strong, .proposal-report-summary span, .time-report-numbers strong, .time-report-numbers span { display: block; }.proposal-report-summary strong, .time-report-numbers strong { font-size: 18px; }.proposal-report-summary span, .time-report-numbers span { margin-top: 3px; color: var(--fb-muted); font-size: 9px; }
.status-distribution { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }.status-distribution span { border-radius: 4px; background: #eef2f8; padding: 6px 8px; color: #647189; font-size: 9px; text-transform: capitalize; }.status-distribution b { margin-right: 4px; color: var(--fb-ink); }
.time-report-numbers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }.report-note { margin: 12px 0 0; color: var(--fb-muted); font-size: 10px; line-height: 1.5; }
.report-detail-panel { padding: 0; overflow: hidden; }.report-detail-panel .report-panel-head { margin: 0; padding: 17px 18px; border-bottom: 1px solid var(--fb-line); }.report-table th, .report-table td { padding: 11px 14px; }.report-empty { padding: 22px; color: var(--fb-muted); font-size: 11px; text-align: center; }
@media (max-width: 1050px) { .report-metrics { grid-template-columns: repeat(3, 1fr); }.report-metrics article { border-bottom: 1px solid var(--fb-line); }.report-filter-bar { grid-template-columns: 1fr 1fr; }.report-customer-filter { grid-column: span 2; } }
@media (max-width: 720px) { .reports-heading { align-items: flex-start; }.report-export { width: 38px; height: 38px; padding: 0; justify-content: center; overflow: hidden; font-size: 0; }.report-metrics { grid-template-columns: 1fr 1fr; }.report-metrics strong { font-size: 17px; }.report-grid { grid-template-columns: 1fr; }.report-trend-panel, .report-expenses-panel { grid-column: auto; }.category-bars { grid-template-columns: 1fr; }.report-filter-bar { grid-template-columns: 1fr 1fr; }.report-filter-bar .button-primary, .report-filter-bar .button-secondary { width: 100%; }.horizontal-report-bars > div { grid-template-columns: 80px minmax(50px, 1fr) 80px; } }
@media (max-width: 1050px) { .report-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 650px) { .report-library-grid { grid-template-columns: 1fr; }.generated-report-chart { overflow-x: auto; } }
.email-settings-grid { display: grid; gap: 14px; }
.sender-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px; }
.sender-card.connected { border-color: #a9dfca; box-shadow: 0 7px 22px rgba(37,185,121,.08); }
.sender-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 8px; font-size: 21px; font-weight: 900; }
.google-mark { color: #2667d8; background: #eef4ff; }
.smtp-mark { color: #087d63; background: #e8f8f1; }
.sender-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sender-card-title h2, .sender-card-copy p { margin: 0; }
.sender-card-title h2 { font-size: 16px; }
.sender-card-copy { display: grid; gap: 5px; }
.sender-card-copy p { max-width: 650px; color: var(--fb-muted); font-size: 12px; }
.sender-card-actions form { margin: 0; }
.email-privacy-note { display: flex; align-items: flex-start; gap: 12px; margin-top: 14px; padding: 16px 18px; background: #f7f9fc; }
.email-privacy-note > .action-icon { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: #42617c; }
.email-privacy-note p { margin: 3px 0 0; color: var(--fb-muted); font-size: 12px; }
.email-page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.email-composer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; align-items: start; gap: 16px; }
.email-composer { display: grid; gap: 14px; padding: 20px; }
.email-composer label { display: grid; gap: 6px; color: #536078; font-size: 12px; font-weight: 800; }
.email-composer input, .email-composer textarea { width: 100%; }
.email-composer textarea { resize: vertical; line-height: 1.55; }
.sender-line { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--fb-line); }
.sender-line > span:first-child { color: var(--fb-muted); font-size: 12px; }
.provider-chip { margin-left: auto; border-radius: 999px; padding: 4px 8px; color: #2d5e9c; background: #edf4ff; font-size: 10px; font-weight: 800; }
.email-copy-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attachment-toggle { grid-template-columns: 18px 18px 1fr !important; align-items: center; gap: 10px !important; border: 1px solid var(--fb-line); border-radius: 7px; padding: 12px; background: #f9fafc; }
.attachment-toggle input { width: 16px; height: 16px; }
.attachment-toggle .action-icon { color: #d84d45; }
.attachment-toggle span:last-child { display: grid; }
.attachment-toggle small { color: var(--fb-muted); font-weight: 500; }
.email-composer-actions { display: flex; justify-content: flex-end; gap: 8px; }
.send-email-button { gap: 8px; }
.send-email-button .action-icon { background: #fff; }
.email-side-column { display: grid; gap: 14px; }
.email-summary-card, .delivery-history { padding: 18px; }
.email-summary-card h2 { margin: 5px 0 16px; font-size: 24px; }
.email-summary-card dl { display: grid; gap: 10px; margin: 0; }
.email-summary-card dl div { display: flex; justify-content: space-between; gap: 12px; }
.email-summary-card dt { color: var(--fb-muted); }
.email-summary-card dd { margin: 0; text-align: right; font-weight: 700; }
.delivery-history { display: grid; gap: 12px; }
.delivery-row { display: grid; grid-template-columns: 8px minmax(0, 1fr); align-items: center; gap: 10px; }
.delivery-row div { display: grid; min-width: 0; }
.delivery-row strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.delivery-row small { color: var(--fb-muted); }
.delivery-state { width: 8px; height: 8px; border-radius: 50%; background: #d0d5dd; }
.delivery-state.sent { background: var(--fb-primary); }
.delivery-state.failed { background: var(--fb-danger); }
@media (max-width: 820px) { .email-composer-layout { grid-template-columns: 1fr; } .email-side-column { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .sender-card { grid-template-columns: 42px minmax(0, 1fr); } .sender-card-icon { width: 42px; height: 42px; } .sender-card-actions { grid-column: 2; } .email-copy-fields, .email-side-column { grid-template-columns: 1fr; } .email-composer-actions { justify-content: stretch; } .email-composer-actions > * { flex: 1; } }

.action-preview { color: #526078; }
.action-edit { color: #8a5d16; }
.action-send { color: #1768a5; }
.action-reminder { color: #9a6700; }
.action-duplicate { color: #6650a4; }
.action-recurring { color: #087d63; }
.action-download { color: #35628f; }
.action-print { color: #4c566a; }
.action-paid { color: #087d43; }
.icon-camera { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M14.5 4 16 7h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h3l1.5-3Z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E"); }
.icon-upload { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M12 16V4'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3Cpath d='M5 20h14'/%3E%3C/svg%3E"); }
.icon-receipt { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z'/%3E%3Cpath d='M16 8H8M16 12H8M13 16H8'/%3E%3C/svg%3E"); }
.icon-file { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E"); }

.expenses-page { max-width: 1180px; }
.expense-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.expense-heading h1 { margin: 2px 0 4px; }
.manual-expense-menu { position: relative; flex: 0 0 auto; }
.manual-expense-menu summary { list-style: none; cursor: pointer; }
.manual-expense-menu summary::-webkit-details-marker { display: none; }
.manual-expense-form { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(540px, calc(100vw - 32px)); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px; border: 1px solid var(--fb-line); border-radius: 6px; background: #fff; box-shadow: var(--fb-shadow); }
.manual-expense-form label span { display: block; margin-bottom: 4px; color: var(--fb-muted); font-size: 11px; font-weight: 700; }
.manual-expense-form input, .manual-expense-form select, .manual-expense-form textarea { width: 100%; }
.manual-expense-form .full { grid-column: 1 / -1; }
.manual-expense-form .button-primary { justify-self: start; }

.receipt-capture { margin-bottom: 22px; padding: 18px; border: 1px dashed #9dc7b5; background: #f7fcfa; }
.receipt-capture-form { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px; }
.capture-intro { display: grid; grid-template-columns: 46px 1fr; align-items: center; column-gap: 12px; }
.capture-intro strong, .capture-intro small { grid-column: 2; }
.capture-intro small { margin-top: 2px; color: var(--fb-muted); }
.capture-main-icon { grid-row: 1 / 3; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 6px; color: #087d63; background: #dff5eb; }
.capture-main-icon .action-icon { width: 23px; height: 23px; }
.capture-actions { display: flex; gap: 8px; }
.capture-action { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid currentColor; border-radius: 6px; padding: 0 14px; font-weight: 800; cursor: pointer; }
.capture-action .action-icon { width: 17px; height: 17px; }
.camera-action { color: #087d63; background: #e6f7ef; }
.upload-action { color: #35628f; background: #edf4fb; }
.upload-progress { grid-column: 1 / -1; color: #087d63; font-weight: 700; }

.expense-register-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.expense-register-head h2 { margin: 0; }
.expense-register-head span { color: var(--fb-muted); }
.expense-register-head input { width: min(320px, 42vw); }
.expense-table-wrap { padding: 0; overflow: hidden; }
.expense-table { width: 100%; border-collapse: collapse; }
.expense-table th { padding: 10px 12px; color: var(--fb-muted); background: #f5f7fb; font-size: 11px; text-align: left; text-transform: uppercase; }
.expense-table td { padding: 11px 12px; border-top: 1px solid var(--fb-line); vertical-align: middle; }
.expense-table td small { display: block; max-width: 280px; margin-top: 2px; color: var(--fb-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount-cell { text-align: right !important; }
.receipt-thumb { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--fb-line); border-radius: 5px; color: #526078; background: #f5f7fb; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.expense-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.expense-status.needs_review { color: #8a5d16; background: #fff3d6; }
.expense-status.ready { color: #087d43; background: #dff5eb; }

@media (max-width: 700px) {
  .expenses-page { padding: 14px 12px 28px; }
  .expense-heading { align-items: start; }
  .expense-heading .muted { max-width: 28ch; }
  .manual-expense-menu > summary { width: 32px; min-width: 32px; overflow: hidden; padding: 0 9px; color: transparent; }
  .manual-expense-menu > summary::first-letter { color: var(--fb-text); }
  .manual-expense-form { position: fixed; inset: auto 10px 12px; width: auto; grid-template-columns: 1fr; max-height: 80vh; overflow: auto; }
  .manual-expense-form .full { grid-column: auto; }
  .receipt-capture { padding: 18px 14px; }
  .receipt-capture-form { grid-template-columns: 1fr; text-align: center; }
  .capture-intro { grid-template-columns: 1fr; justify-items: center; }
  .capture-main-icon { grid-row: auto; margin-bottom: 8px; }
  .capture-intro strong, .capture-intro small { grid-column: 1; }
  .capture-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .capture-action { min-height: 64px; flex-direction: column; justify-content: center; padding: 8px; }
  .expense-register-head { align-items: end; }
  .expense-register-head input { width: 48vw; }
  .expense-table thead { display: none; }
  .expense-table, .expense-table tbody, .expense-table tr, .expense-table td { display: block; width: 100%; }
  .expense-table tr { position: relative; padding: 12px 12px 10px 68px; border-top: 1px solid var(--fb-line); }
  .expense-table td { min-height: 22px; display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; text-align: right; }
  .expense-table td::before { content: attr(data-label); color: var(--fb-muted); font-size: 11px; font-weight: 700; }
  .expense-table td:first-child { position: absolute; top: 14px; left: 12px; width: 44px; padding: 0; }
  .expense-table td:first-child::before { display: none; }
  .expense-table td:nth-child(3) { display: block; text-align: left; }
  .expense-table td:nth-child(3)::before { display: none; }
  .expense-table .amount-cell { text-align: right !important; }
  .expense-table td[colspan] { padding: 20px; }
}

.recurring-invoice-page {
  max-width: 1120px;
}

.compact-heading {
  margin-bottom: 14px;
}

.recurring-invoice-list {
  padding: 0 16px;
  overflow: hidden;
}

.recurring-invoice-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(300px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--fb-line);
}

.recurring-invoice-row:last-child {
  border-bottom: 0;
}

.recurring-invoice-row > div span {
  display: block;
  margin-top: 3px;
  color: var(--fb-muted);
}

.recurring-invoice-row dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 14px;
  margin: 0;
}

.recurring-invoice-row dl div {
  display: grid;
  gap: 2px;
}

.recurring-invoice-row dt {
  color: var(--fb-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.recurring-invoice-row dd {
  margin: 0;
  font-weight: 700;
}

@media (max-width: 760px) {
  .recurring-invoice-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .recurring-invoice-row .button-secondary {
    justify-self: start;
  }
}

.a4-stage {
  display: grid;
  justify-items: center;
  overflow: auto;
  border-radius: var(--fb-radius);
  background: #eef1f7;
  padding: 24px;
}

.a4-stage.detail {
  min-height: calc(100vh - 190px);
}

.a4-document {
  position: relative;
  width: min(100%, 794px);
  min-height: 1123px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 48px rgba(29, 35, 54, 0.14);
  color: #111827;
  font-size: 11px;
  line-height: 1.3;
  padding: 32px 36px;
}

.a4-ribbon {
  position: absolute;
  left: -38px;
  top: 44px;
  width: 150px;
  transform: rotate(-45deg);
  color: #8b5b14;
  background: #fff0c2;
  padding: 5px 0;
  font-size: 10px;
  text-align: center;
  font-weight: 900;
  text-transform: uppercase;
}

.a4-ribbon.sent {
  color: #fff;
  background: var(--fb-blue);
}

.a4-header,
.a4-meta,
.a4-bottom,
.a4-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.6fr);
  gap: 16px;
}

.a4-header {
  align-items: start;
  border: 1px solid #9ca3af;
  border-top: 4px solid var(--tenant-brand, #25b979);
  border-bottom: 0;
  padding: 12px;
}

.a4-header span,
.a4-meta span {
  display: block;
}

.a4-header h1 {
  margin: 10px 0 2px;
  text-align: right;
  font-size: 22px;
  letter-spacing: 0;
}

.a4-brand-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.a4-brand-block .a4-logo-box {
  border-right: 1px solid #d1d5db;
  padding-right: 12px;
}

.autosave-status {
  justify-self: end;
  min-height: 18px;
  color: var(--fb-muted);
  font-size: 12px;
  font-weight: 700;
}

.autosave-status.saving {
  color: #8b5b14;
}

.autosave-status.saved {
  color: #0d7651;
}

.autosave-status.error {
  color: #b42318;
}

.a4-logo-box {
  display: grid;
  place-items: start;
  flex: 0 0 106px;
  width: 106px;
  height: 60px;
  border: 0;
  background: #fff;
  color: #111827;
  font-size: 20px;
  font-weight: 900;
  overflow: hidden;
}

.a4-logo-box img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: left top;
}

.a4-brand-block strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.25;
}

.a4-brand-block small {
  display: block;
  max-width: 280px;
  color: #4b5563;
  font-size: 9px;
  line-height: 1.35;
  white-space: pre-line;
}

.a4-header div:last-child {
  text-align: right;
}

.a4-meta {
  border: 1px solid #9ca3af;
  padding: 10px 12px;
}

.a4-meta div:last-child span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #e5e7eb;
  padding: 4px 0;
}

.a4-subject {
  border-inline: 1px solid #9ca3af;
  padding: 9px 12px;
}

.a4-subject p {
  margin: 5px 0 0;
}

.a4-lines {
  border: 1px solid #9ca3af;
}

.a4-line-head,
.a4-line-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 82px 92px 110px;
}

.a4-line-head {
  background: #f3f4f6;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.a4-line-head span,
.a4-line-row span {
  border-right: 1px solid #cfd4dc;
  padding: 7px 8px;
}

.a4-line-head span:last-child,
.a4-line-row span:last-child {
  border-right: 0;
  text-align: right;
}

.a4-line-row {
  min-height: 48px;
  border-top: 1px solid #cfd4dc;
}

.a4-line-row small {
  display: block;
  margin-top: 4px;
  color: #4b5563;
}

.a4-bottom {
  border-inline: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  min-height: 100px;
}

.a4-bottom > div:first-child {
  padding: 12px;
}

.a4-totals {
  border-left: 1px solid #9ca3af;
}

.a4-totals span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #cfd4dc;
  padding: 7px 10px;
}

.a4-totals .a4-grand-total {
  font-size: 14px;
  font-weight: 900;
}

.a4-footer {
  border-inline: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
  min-height: 84px;
  padding: 12px;
}

.a4-footer em {
  display: grid;
  justify-items: center;
  gap: 4px;
  align-self: end;
  border-top: 1px solid #9ca3af;
  padding-top: 8px;
  text-align: center;
  font-style: normal;
}

.a4-footer em img {
  display: block;
  max-width: 118px;
  max-height: 42px;
  object-fit: contain;
}

.a4-footer em span {
  display: block;
}

.attachment-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.download-document-body {
  margin: 0;
  background: #eef1f7;
  padding: 24px;
}

.print-document-body .a4-document {
  margin: 0 auto;
}

.print-document-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
}

.document-print-frame {
  position: fixed;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 1180px) {
  .order-workspace {
    grid-template-columns: 330px minmax(0, 1fr);
    align-items: start;
  }
}

@media print {
  .sidebar,
  .utility-bar,
  .document-toolbar,
  .attachment-strip,
  .print-document-actions,
  .a4-ribbon,
  .notice {
    display: none !important;
  }

  .workspace-shell {
    margin: 0 !important;
  }

  .page,
  .order-workspace-page,
  .a4-stage,
  .print-document-body {
    width: auto !important;
    padding: 0 !important;
    background: #fff !important;
  }

  .a4-document {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
    padding: 11mm;
  }
}

@media (min-width: 760px) {
  .document-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }

  .order-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .order-line,
  .order-line-head {
    grid-template-columns: minmax(260px, 1fr) 84px 110px 130px 110px 42px;
    align-items: start;
  }

  .order-line-head {
    display: grid;
  }

  .order-lines-no-tax .order-line,
  .order-lines-no-tax .order-line-head {
    grid-template-columns: minmax(260px, 1fr) 84px 110px 110px 42px;
  }

  .order-line strong {
    justify-content: flex-end;
  }

  .order-bottom-grid,
  .document-detail {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
  }

  .line-table-head,
  .line-table-row {
    grid-template-columns: minmax(220px, 1fr) 70px 120px 120px 130px;
    align-items: start;
  }

  .line-table-head {
    display: grid;
  }
}
/* Customer portal */
.portal-body { margin: 0; min-width: 320px; background: #f4f7fc; color: #182238; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.customer-portal-shell { min-height: 100vh; }
.customer-portal-header { height: 68px; display: flex; align-items: center; gap: 16px; padding: 0 28px; border-bottom: 1px solid #dfe6f1; background: #fff; }
.portal-evolvv { color: #2076ff; font-size: 27px; font-weight: 800; line-height: 1; text-decoration: none; }
.customer-portal-header > div:nth-child(2) { padding-left: 16px; border-left: 1px solid #d6deea; }
.customer-portal-header strong, .customer-portal-header span { display: block; }
.customer-portal-header span { color: #6c7890; font-size: 12px; }
.portal-customer { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.portal-customer b { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #202b46; color: #fff; }
.customer-portal-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.customer-portal-nav { display: flex; flex-direction: column; gap: 5px; padding: 22px 12px; border-right: 1px solid #dfe6f1; background: #fff; }
.customer-portal-nav a { padding: 11px 13px; border-radius: 6px; color: #27334b; text-decoration: none; }
.customer-portal-nav a.active { background: #2076ff; color: #fff; }
.customer-portal-main { width: min(1120px, 100%); padding: 30px; }
.customer-portal-main h1 { margin: 2px 0 6px; font-size: 28px; letter-spacing: 0; }
.portal-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0; }
.portal-metrics > div { padding: 18px; border: 1px solid #dfe6f1; border-radius: 7px; background: #fff; }
.portal-metrics span, .portal-metrics strong { display: block; }
.portal-metrics span { color: #6c7890; font-size: 12px; }
.portal-metrics strong { margin-top: 7px; font-size: 22px; }
.portal-section { margin-top: 20px; border: 1px solid #dfe6f1; border-radius: 7px; background: #fff; overflow: hidden; }
.portal-section .panel-head { padding: 16px 18px; }
.portal-document-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid #e7ecf4; }
.portal-document-row strong, .portal-document-row span { display: block; }
.portal-empty { padding: 22px; color: #6c7890; }
.portal-table-wrap { overflow-x: auto; }
.portal-table-wrap table { min-width: 660px; }
.portal-review-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.portal-estimate-list { align-self: start; }
.portal-estimate-list a { display: block; padding: 14px 16px; border-bottom: 1px solid #e7ecf4; color: #253149; text-decoration: none; }
.portal-estimate-list a.active { border-left: 3px solid #2076ff; background: #eef5ff; }
.portal-estimate-list span { display: block; margin-top: 4px; color: #6c7890; font-size: 12px; }
.portal-decision { padding-bottom: 0; }
.portal-review-pane { min-width: 0; overflow: hidden; }.portal-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 16px 18px; }.portal-review-heading h2, .portal-review-heading p { margin: 0; }.portal-review-heading h2 { margin-top: 3px; }.portal-review-heading > div:last-child { display: grid; justify-items: end; gap: 8px; white-space: nowrap; }.portal-open-preview { color: #2076ff; font-size: 12px; font-weight: 800; text-decoration: none; }.portal-review-heading .portal-estimate-summary { padding: 8px 0 0; border: 0; }
.portal-estimate-summary { display: flex; flex-wrap: wrap; gap: 16px; padding: 15px 18px; border-bottom: 1px solid #e7ecf4; color: #6c7890; font-size: 13px; }
.portal-decision form { display: grid; gap: 14px; padding: 18px; }
.portal-decision label span { display: block; margin-bottom: 6px; font-weight: 700; }
.portal-decision input, .portal-decision textarea { width: 100%; padding: 11px 12px; border: 1px solid #cfd8e7; border-radius: 6px; font: inherit; }
.portal-decision textarea { min-height: 92px; resize: vertical; }
.portal-decision-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.portal-pane-actions { grid-template-columns: minmax(220px, 1fr) auto auto !important; align-items: end; padding: 14px 18px !important; background: #fff; }.portal-pane-actions textarea { min-height: 46px; max-height: 90px; }.portal-pane-actions .portal-decision-actions { flex-wrap: nowrap; }.portal-pane-actions .button-primary, .portal-pane-actions .button-secondary { min-height: 46px; padding-inline: 18px; white-space: nowrap; }.portal-approved-summary { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 15px 18px; color: #147650; background: #f3fbf7; }
.share-link-panel { display: flex; align-items: end; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid #cfe0f7; border-radius: 7px; background: #f4f8ff; }
.share-link-panel label { flex: 1; min-width: 0; }
.share-link-panel label span { display: block; margin-bottom: 5px; color: #5f6c83; font-size: 12px; font-weight: 700; }
.share-link-panel input { width: 100%; }
.proposal-share-result { display: grid; gap: 9px; margin-bottom: 12px; padding: 13px; }
.proposal-share-result > div:first-child strong,
.proposal-share-result > div:first-child small { display: block; }
.proposal-share-result > div:first-child small { margin-top: 2px; color: var(--fb-muted); }
.proposal-share-result .share-link-panel { margin: 0; }
.portal-direct-decision { position: sticky; z-index: 8; bottom: 0; width: min(930px, calc(100% - 32px)); margin: 0 auto; border: 1px solid #d9e2ef; border-bottom: 0; border-radius: 8px 8px 0 0; background: #fff; box-shadow: 0 -10px 30px rgb(26 42 75 / 12%); padding: 14px 18px; }
.portal-direct-decision form { display: grid; grid-template-columns: minmax(220px, 1fr) auto auto; align-items: end; gap: 10px; }
.portal-direct-decision label { display: grid; gap: 5px; color: #5f6c83; font-size: 12px; font-weight: 800; }
.portal-direct-decision textarea { width: 100%; min-height: 48px; max-height: 100px; resize: vertical; border: 1px solid #cfd8e7; border-radius: 6px; padding: 9px 10px; font: inherit; }
.portal-direct-actions { display: flex; gap: 8px; }
.portal-approve-button,
.portal-change-button { min-height: 48px; padding-inline: 18px; white-space: nowrap; }
.portal-decline-link { align-self: center; border: 0; background: none; padding: 6px 2px; color: #758197; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.portal-decision-complete { display: flex; align-items: center; justify-content: center; gap: 8px; color: #147650; }
@media (max-width: 760px) {
  .proposal-footer-controls { grid-template-columns: 1fr 1fr; }
  .proposal-footer-controls > label:first-child { grid-column: 1 / -1; }
  .portal-direct-decision { width: calc(100% - 20px); }
  .portal-direct-decision form { grid-template-columns: 1fr; }
  .portal-direct-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .portal-approve-button, .portal-change-button { white-space: normal; }
  .portal-review-grid { grid-template-columns: 1fr; }.portal-estimate-list { display: flex; overflow-x: auto; }.portal-estimate-list a { min-width: 180px; border-right: 1px solid #e7ecf4; border-bottom: 0; }.portal-pdf-viewer-pane, .portal-proposal-pane { height: 68vh; min-height: 520px; }.portal-proposal-pane { padding: 10px; }.portal-pane-actions { grid-template-columns: 1fr !important; }.portal-pane-actions .portal-decision-actions { display: grid; grid-template-columns: 1fr 1fr; }.portal-review-heading { align-items: flex-start; }.portal-review-heading > div:last-child { white-space: normal; }
}
.payment-request-page { min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #1fa9f4, #243bff); }
.payment-request-header { width: min(1180px, 100%); margin: 0 auto 14px; color: #fff; display: flex; align-items: baseline; gap: 10px; }
.payment-request-header .portal-evolvv { color: #fff; }
.payment-request-header small { opacity: .9; }
.payment-request-layout { width: min(1180px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .55fr); gap: 18px; align-items: start; }
.payment-invoice-preview { min-width: 0; padding: 16px; border-radius: 8px; background: rgba(255,255,255,.16); overflow: auto; }
.payment-invoice-preview .a4-document { margin: 0 auto; box-shadow: 0 14px 34px rgba(13,33,80,.18); }
.payment-request-panel { position: sticky; top: 24px; padding: 24px; border-radius: 8px; background: #fff; }
.payment-request-panel h1 { margin: 7px 0; font-size: 36px; }
.payment-request-panel dl { margin: 22px 0; }
.payment-request-panel dl div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #e5eaf1; }
.payment-request-panel dt { color: #68758c; }
.payment-request-panel .button-primary { width: 100%; margin-top: 14px; }
.payment-provider-label { margin: 18px 0 8px; color: #68758c; font-size: 12px; font-weight: 800; }
.payment-provider-options { display: grid; gap: 8px; }
.payment-provider-button { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid #dce3ee; border-radius: 6px; background: #fff; color: #1f293b; font-weight: 800; }
.payment-provider-button span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 5px; background: #eef3ff; color: #2457d6; }

.gateway-settings-page { max-width: 1180px; }
.gateway-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.gateway-card { padding: 18px; }
.gateway-card.connected { border-color: #a9dfca; }
.gateway-card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.gateway-card h2 { margin: 0 0 4px; font-size: 18px; }
.gateway-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; color: #fff; font-weight: 900; }
.gateway-mark.razorpay { background: #3159d8; }.gateway-mark.stripe { background: #635bff; }.gateway-mark.paypal { background: #0874c9; }
.gateway-card form > label { display: block; margin-top: 10px; }
.gateway-card label > span { display: block; margin-bottom: 5px; color: #68758c; font-size: 12px; font-weight: 800; }
.gateway-card input, .gateway-card select { width: 100%; }
.gateway-mode { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.gateway-mode .toggle-line input[type='checkbox'] { width: auto; }
.gateway-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.gateway-actions .button-primary { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.gateway-security-note { display: flex; gap: 12px; align-items: flex-start; padding: 18px; margin-top: 14px; }
.gateway-security-note p { margin: 4px 0 0; color: #68758c; font-size: 12px; }

@media (max-width: 920px) { .payment-request-layout { grid-template-columns: 1fr; } .payment-request-panel { position: static; order: -1; } .gateway-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .payment-request-page { padding: 12px; } .payment-request-header { display: block; } .payment-request-header small { display: block; margin-top: 3px; } .payment-invoice-preview { padding: 8px; } }

.time-tracking-page { max-width: 1320px; }
.time-view-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--fb-line); overflow-x: auto; }
.time-view-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 13px; color: var(--fb-muted); background: transparent; white-space: nowrap; }
.time-view-tabs button.active { color: var(--fb-blue); border-bottom-color: var(--fb-blue); }
.time-guidance { margin-bottom: 14px; padding: 11px 13px; border-radius: 6px; color: #285f9f; background: #edf5ff; font-size: 12px; }
.timesheet-panel { padding: 0; overflow: hidden; }
.timesheet-toolbar { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--fb-line); }
.timesheet-toolbar .status-pill { margin-left: auto; }
.timesheet-period-picker { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }.timesheet-period-picker select { min-height: 32px; padding: 5px 26px 5px 8px; font-size: 11px; font-weight: 800; }.timesheet-period-picker input { min-height: 32px; padding: 5px 7px; font-size: 11px; }
.weekly-time-grid { min-width: 980px; }
.weekly-time-grid th { text-align: center; }
.weekly-time-grid th:first-child { width: 230px; padding-left: 14px; text-align: left; }
.weekly-time-grid th small, .weekly-time-grid td:first-child small, .payment-link-table td small { display: block; margin-top: 3px; color: var(--fb-muted); font-size: 10px; font-weight: 400; }
.weekly-time-grid td { min-width: 92px; padding: 8px 6px; text-align: center; vertical-align: top; }
.weekly-time-grid td:first-child { padding: 12px 14px; text-align: left; }
.weekly-time-grid select { width: 100%; min-height: 32px; padding: 5px; font-size: 11px; }
.weekly-time-grid input { width: 100%; min-height: 28px; margin-top: 4px; padding: 4px 6px; font-size: 10px; }
.team-weekly-grid { min-width: 980px; }
.team-weekly-grid td { min-width: 112px; }
.time-empty-cell { color: var(--fb-muted); font-size: 12px; }
.team-empty-copy { margin: 0; color: var(--fb-muted); font-size: 13px; }
.timesheet-footer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.timesheet-footer span { color: var(--fb-muted); font-size: 11px; }
.timesheet-footer button { margin-left: auto; }
.timesheet-submit { display: flex; justify-content: flex-end; margin-top: 10px; }
.time-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.time-summary-grid > div { padding: 15px; border: 1px solid var(--fb-line); border-radius: 7px; background: #fff; }
.time-summary-grid span { display: block; color: var(--fb-muted); font-size: 10px; }
.time-summary-grid strong { display: block; margin-top: 5px; font-size: 22px; }
.time-review-actions { display: flex; align-items: center; gap: 5px; }
.time-review-actions input { width: 145px; min-height: 32px; padding: 5px 7px; font-size: 10px; }
.team-timesheets { display: grid; gap: 10px; }.team-timesheet-card { padding: 0; overflow: hidden; }.team-timesheet-card summary { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) 90px auto auto; align-items: center; gap: 14px; cursor: pointer; list-style: none; padding: 14px 16px; }.team-timesheet-card summary::-webkit-details-marker { display: none; }.team-timesheet-card summary > span:first-child small { display: block; margin-top: 3px; color: var(--fb-muted); font-size: 10px; }.team-timesheet-card summary > span:nth-child(2) { color: var(--fb-muted); font-size: 12px; }.team-timesheet-expand { justify-self: end; color: var(--fb-blue); font-size: 11px; font-weight: 800; }.team-timesheet-card[open] .team-timesheet-expand { color: var(--fb-text); }.team-timesheet-body { display: grid; gap: 12px; border-top: 1px solid var(--fb-line); padding: 14px 16px; }.team-timesheet-body form { display: grid; gap: 10px; }.team-timesheet-body select, .team-timesheet-body input { width: 100%; min-height: 32px; padding: 5px 7px; font-size: 11px; }.team-timesheet-body footer { display: flex; align-items: center; gap: 9px; }.team-timesheet-body footer span { margin-right: auto; color: var(--fb-muted); font-size: 11px; }
.project-list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.time-project-card { padding: 17px; }
.time-project-card h2, .time-project-card p { margin: 3px 0; }
.time-project-card dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 0; }
.time-project-card dl div { padding: 9px; border-radius: 6px; background: #f6f8fb; }
.time-project-card dt { color: var(--fb-muted); font-size: 9px; }
.time-project-card dd { margin: 4px 0 0; font-size: 12px; font-weight: 800; }
.time-invoice-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .5fr); gap: 14px; align-items: start; }
.time-invoice-layout > .panel:first-child { padding: 0; overflow: hidden; }
.time-invoice-form { display: grid; gap: 12px; padding: 17px; position: sticky; top: 18px; }
.time-invoice-form h2 { margin: 0; }
.time-invoice-form label { display: grid; gap: 5px; color: #536078; font-size: 11px; font-weight: 800; }
.time-dialog { width: min(720px, calc(100vw - 28px)); max-height: calc(100vh - 32px); border: 0; border-radius: 8px; padding: 0; color: var(--fb-ink); background: #fff; box-shadow: 0 24px 80px rgba(15, 26, 52, .28); }
.time-dialog::backdrop { background: rgba(16, 27, 50, .52); backdrop-filter: blur(4px); }
.time-dialog.compact { width: min(440px, calc(100vw - 28px)); }
.time-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: #fff; background: var(--fb-blue); }
.time-dialog header h2 { margin: 0; font-size: 15px; }
.time-dialog-body { padding: 17px; overflow-y: auto; }
.time-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--fb-line); }
.project-member-list { display: grid; gap: 7px; }
.project-member-list > div { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, .8fr) minmax(120px, .8fr); gap: 8px; align-items: center; }
.project-member-list label { display: flex; align-items: center; gap: 8px; }
.project-member-list input { width: 100%; }

@media (max-width: 820px) {
  .time-summary-grid, .project-list-grid, .time-invoice-layout { grid-template-columns: 1fr; }
  .time-invoice-form { position: static; }
  .project-member-list > div { grid-template-columns: 1fr; padding: 10px 0; border-bottom: 1px solid var(--fb-line); }
  .team-timesheet-card summary { grid-template-columns: 1fr auto; }.team-timesheet-card summary > span:nth-child(2), .team-timesheet-card summary > strong { grid-column: 1; }.team-timesheet-card summary .status-pill, .team-timesheet-expand { grid-column: 2; }.team-timesheet-body footer { align-items: stretch; flex-direction: column; }.team-timesheet-body footer span { margin-right: 0; }
}
@media (max-width: 760px) {
  .customer-portal-header { padding: 0 16px; }
  .customer-portal-header > div:nth-child(2), .portal-customer > span { display: none; }
  .customer-portal-body { grid-template-columns: 1fr; }
  .customer-portal-nav { position: sticky; top: 0; z-index: 3; flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid #dfe6f1; }
  .customer-portal-nav a { flex: 0 0 auto; }
  .customer-portal-main { padding: 20px 16px; }
  .portal-metrics, .portal-review-grid { grid-template-columns: 1fr; }
  .portal-document-row { grid-template-columns: 1fr auto; }
  .portal-document-row .button-primary { grid-column: 1 / -1; text-align: center; }
  .share-link-panel { align-items: stretch; }
}
.portal-proposal-brand img { display: block; width: auto; max-width: 180px; max-height: 64px; object-fit: contain; }
.proposal-rich-image-picker {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Keep every native select recognisable, while giving the app one deliberate
   control surface instead of browser-default arrows and inconsistent spacing. */
select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  min-height: 40px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%2363718a' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  box-shadow: 0 1px 2px rgb(29 39 64 / 4%);
  color: var(--fb-text);
  cursor: pointer;
  padding: 0 36px 0 12px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

select:not([multiple]):not([size]):hover:not(:disabled) {
  border-color: #b7c5df;
  background-color: #fbfdff;
}

select:not([multiple]):not([size]):focus {
  outline: 0;
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 3px rgb(47 134 255 / 16%);
}

select:not([multiple]):not([size]):disabled {
  cursor: not-allowed;
  color: #98a2b3;
  background-color: #f3f5f9;
  opacity: 1;
}

input[type='date'] {
  min-height: 40px;
  border: 1px solid var(--fb-line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(29 39 64 / 4%);
  color: var(--fb-text);
  padding: 0 11px;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input[type='date']:hover:not(:disabled) {
  border-color: #b7c5df;
  background-color: #fbfdff;
}

input[type='date']:focus {
  outline: 0;
  border-color: var(--fb-blue);
  box-shadow: 0 0 0 3px rgb(47 134 255 / 16%);
}
.customer-portal-list .portal-management-table{width:100%;border-collapse:collapse}
.customer-portal-list .portal-management-table th{background:#eaf0f8;color:#40516b;text-align:left;padding:14px 16px;border-bottom:1px solid #d8e1ed}
.customer-portal-list .portal-management-table td{padding:14px 16px;text-align:left;border-bottom:1px solid #e5ebf3}
.customer-portal-list .portal-management-table tbody tr:nth-child(odd){background:#fff}
.customer-portal-list .portal-management-table tbody tr:nth-child(even){background:#f3f6fb}
.customer-portal-list .portal-management-table tbody tr:hover{background:#eaf3ff}
.customer-portal-list .portal-management-table td.table-actions{display:table-cell;white-space:nowrap}
.customer-portal-list .portal-management-table td.table-actions form{display:inline-flex;margin:0 6px 0 0}
.quick-create{position:relative}.quick-create summary{list-style:none;cursor:pointer;display:grid;place-items:center}.quick-create summary::-webkit-details-marker{display:none}.quick-create nav{position:absolute;right:0;top:calc(100% + 8px);width:210px;z-index:40;background:#fff;border:1px solid #dce3ee;border-radius:6px;box-shadow:0 8px 25px #18273b26;padding:6px}.quick-create nav a{display:block;padding:10px;color:#26354b;text-decoration:none;font-size:13px}.quick-create nav a:hover{background:#eff5ff}.profile-link{text-decoration:none;overflow:hidden;flex-shrink:0}.profile-link img{width:100%;height:100%;object-fit:cover}.profile-form{max-width:480px;display:grid;gap:20px}.profile-form label{display:grid;gap:8px}.profile-form input{width:100%;padding:10px;border:1px solid #d9e1ee;border-radius:5px}.profile-photo{border-radius:50%;object-fit:cover}
.embed-settings{max-width:760px;display:grid;gap:14px}.embed-settings label{display:grid;gap:8px}.embed-settings textarea{width:100%;padding:12px;border:1px solid #dbe3ef;font:12px monospace;resize:vertical}.embed-settings .muted{font-size:12px;line-height:1.6}.embed-settings button{width:max-content}
.profile-form input[readonly]{background:#f1f4f8;color:#6d788a;cursor:default}
.brand-logo-editor { position: relative; width: max-content; max-width: 100%; }
.brand-logo-editor { width: 220px; }
.customer-page.customer-overview { width: 100%; max-width: none; min-width: 0; padding: 24px; }
.customer-overview .customer-workspace { grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 28px; }
.customer-overview .customer-profile { border-right: 1px solid #dde4ee; padding: 0 22px 24px 0; min-width: 0; }
.customer-overview .customer-profile h2 { font-size: 17px; line-height: 1.4; }
.customer-overview .identity-card { background: transparent; border: 0; padding: 8px 0 20px; box-shadow: none; }
.customer-overview .identity-card > div { min-width: 0; }
.customer-overview .identity-card small { overflow-wrap: anywhere; }
.customer-overview .identity-card .avatar { width: 36px; height: 36px; min-width: 36px; background: #e0f2ef; color: #147b65; font-size: 15px; }
.customer-overview .detail-list div { grid-template-columns: minmax(90px, .85fr) minmax(0, 1fr); gap: 12px; padding: 12px 0; }
.customer-overview .detail-list dt { font-weight: 500; font-size: 12px; }
.customer-overview .detail-list dd { font-size: 13px; }
.customer-overview .customer-detail { min-width: 0; gap: 24px; }
.customer-overview .customer-toolbar { margin: 0; gap: 18px; }
.customer-overview .customer-toolbar h1 { font-size: 26px; line-height: 1.3; overflow-wrap: anywhere; margin: 4px 0; }
.customer-overview .customer-toolbar p { font-size: 13px; }
.customer-overview .customer-tabs { gap: 26px; font-size: 13px; }
.customer-financial-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: 1px solid #dae3ed; }
.customer-financial-strip > div { position: relative; min-width: 0; padding: 22px 24px; border-right: 1px solid #dae3ed; }
.customer-financial-strip > div:last-child { border-right: 0; }
.customer-financial-strip strong { display: block; font-size: 24px; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: 0; }
.customer-financial-strip span { display: block; font-size: 12px; color: #6a778b; margin-top: 6px; }
.customer-financial-strip .customer-balance strong { color: #175cba; }
.customer-financial-strip .customer-credit strong { color: #14836c; }
.customer-financial-strip .customer-documents strong { color: #aa6719; }
.customer-overview .content-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 28px; align-items: start; }
.customer-overview .content-grid > article, .customer-overview .activity-panel { min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; border-radius: 0; }
.customer-overview .content-grid > article + article { border-left: 1px solid #dde4ee; padding-left: 24px; }
.customer-overview h2 { font-size: 17px; line-height: 1.4; margin: 4px 0 16px; }
.customer-overview .panel-head { align-items: center; margin-bottom: 14px; }
.customer-overview .receivables-panel { display: block; }
.customer-statement-scroll { overflow-x: auto; }
.customer-overview .statement-table { min-width: 570px; background: white; border: 0; }
.customer-overview .statement-table th, .customer-overview .statement-table td { padding: 14px 12px; font-size: 12px; white-space: nowrap; border-bottom: 1px solid #e1e7ee; }
.customer-overview .statement-table th { background: #edf2f7; font-size: 11px; }
.customer-overview .statement-table th:nth-child(3), .customer-overview .statement-table th:nth-child(4), .customer-overview .statement-table td:nth-child(3), .customer-overview .statement-table td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.customer-overview .address-summary { gap: 24px; }
.customer-overview .address-summary > div { padding: 0; border: 0; background: transparent; }
.customer-overview .address-summary p, .customer-overview .contact-stack, .customer-overview .note-box { font-size: 13px; line-height: 1.8; }
.customer-overview .note-box { padding: 12px 0; border: 0; background: transparent; }
.customer-overview .activity-panel { border-top: 1px solid #dde4ee; padding-top: 20px; }
.customer-document-chart { padding-top: 20px; }
.customer-document-chart h3 { margin: 0 0 14px; font-size: 13px; font-weight: 600; }
.customer-status-bar { height: 10px; width: 100%; display: flex; gap: 3px; overflow: hidden; border-radius: 4px; }
.customer-status-bar > span { flex-basis: 0; min-width: 3px; }
.customer-document-chart ul { list-style: none; padding: 0; margin: 12px 0 0; }
.customer-document-chart li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; }
.customer-document-chart li strong { margin-left: auto; }
.customer-document-chart .status-dot { width: 8px; height: 8px; border-radius: 50%; }
.customer-document-chart [class*="document-status-"] { background: #9daaba; }
.customer-document-chart .document-status-paid, .customer-document-chart .document-status-approved { background: #1da982; }
.customer-document-chart .document-status-sent { background: #3985e5; }
.customer-document-chart .document-status-overdue, .customer-document-chart .document-status-declined { background: #d86868; }
.customer-overview .statement-table, .customer-overview #activity { scroll-margin-top: 24px; }
@media (min-width: 1800px) { .customer-overview .content-grid { grid-template-columns: minmax(0, 3fr) minmax(300px, 1fr); } }
@media (max-width: 1450px) {
  .customer-overview .content-grid { grid-template-columns: minmax(0, 1fr); }
  .customer-overview .content-grid > article + article { border-left: 0; border-top: 1px solid #dde4ee; padding: 20px 0 0; }
}
@media (max-width: 1150px) {
  .customer-overview .customer-workspace { grid-template-columns: 210px minmax(0, 1fr); gap: 20px; }
  .customer-overview .content-grid { grid-template-columns: minmax(0, 1fr); }
  .customer-overview .content-grid > article + article { border-left: 0; border-top: 1px solid #dde4ee; padding: 20px 0 0; }
  .customer-financial-strip > div { padding: 18px 12px; }
  .customer-financial-strip strong { font-size: 20px; }
}
@media (max-width: 760px) {
  .customer-page.customer-overview { padding: 18px 12px; }
  .customer-overview .customer-workspace { display: flex; flex-direction: column-reverse; }
  .customer-overview .customer-detail, .customer-overview .customer-profile { width: 100%; }
  .customer-overview .customer-profile { border-right: 0; border-top: 1px solid #dde4ee; padding: 20px 0 0; }
  .customer-financial-strip { grid-template-columns: minmax(0, 1fr); }
  .customer-financial-strip > div { border-right: 0; border-bottom: 1px solid #dde4ee; }
  .customer-financial-strip > div:last-child { border-bottom: 0; }
}
.icon-delete { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M19 6l-1 14H6L5 6M9 6V3h6v3M10 10v6M14 10v6'/%3E%3C/svg%3E"); }
.brand-logo-actions { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity .15s; }
.brand-logo-editor:hover .brand-logo-actions, .brand-logo-editor:focus-within .brand-logo-actions { opacity: 1; }
.brand-logo-actions .icon-command { width: 32px; height: 32px; padding: 7px; background: #fff; color: #334155; border: 1px solid #cbd5e1; box-shadow: 0 2px 5px #0002; }
.brand-logo-actions [data-remove-logo] { color: #a63240; }
.brand-logo-editor [hidden], .branding-preview [hidden] { display: none !important; }
.branding-preview [data-brand-preview-address] { white-space: pre-line; overflow-wrap: anywhere; }
@media (hover: none) { .brand-logo-actions { opacity: 1; } }
.admin-license-page { padding: 24px; }
.admin-license-page .page-heading { margin-bottom: 24px; }
.admin-license-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid #dce3ed; margin-bottom: 28px; }
.admin-license-stats > div { padding: 20px 16px; border-right: 1px solid #dce3ed; }
.admin-license-stats > div:last-child { border-right: 0; }
.admin-license-stats span { display: block; font-size: 13px; color: #66748a; }
.admin-license-stats strong { display: block; margin-top: 8px; font-size: 30px; line-height: 1.2; }
.admin-license-stats > div:first-child strong { color: #087e57; }
.admin-license-stats > div:nth-child(2) strong { color: #2465c4; }
.admin-license-stats > div:nth-child(3) strong { color: #b43e3e; }
.admin-license-register { margin-bottom: 28px; scroll-margin-top: 20px; }
.admin-license-register table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; font-size: 13px; }
.admin-license-register th { color: #64738a; text-align: left; font-size: 12px; background: #eef2f6; }
.admin-license-register th, .admin-license-register td { padding: 14px 16px; border-bottom: 1px solid #e2e7ee; }
.admin-license-register td small { display: block; color: #758096; margin-top: 5px; overflow-wrap: anywhere; }
.admin-license-register tr:hover td { background: #f8fafc; }
.admin-license-page .status.scheduled { background: #e8eefb; color: #3e5e9b; }
.admin-license-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 20px; padding: 16px 0; font-size: 13px; }
.admin-license-page #tenants, .admin-license-page #plans { scroll-margin-top: 20px; }
@media (max-width: 720px) {
  .admin-license-page { padding: 18px 12px; }
  .admin-license-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-license-stats > div:nth-child(2) { border-right: 0; }
  .admin-license-stats > div:nth-child(-n+2) { border-bottom: 1px solid #dce3ed; }
  .admin-license-stats > div { padding: 16px 12px; }
}
.icon-image { --action-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2' ry='2'/%3E%3Ccircle cx='9' cy='9' r='2'/%3E%3Cpath d='m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21'/%3E%3C/svg%3E"); }
.proposal-designer-canvas .proposal-cover-copy [contenteditable]{cursor:text;outline:1px dashed transparent;min-height:2.5em}.proposal-designer-canvas .proposal-cover-copy [contenteditable]:hover,.proposal-designer-canvas .proposal-cover-copy [contenteditable]:focus{outline-color:#ffffff88}
.proposal-preview-pages .proposal-cover-page.has-bottom-logo .cover-copy-bottom,.proposal-preview-modal-pages .proposal-cover-page.has-bottom-logo .cover-copy-bottom{bottom:23%}
.proposal-preview-pages .proposal-cover-page:has(.cover-item-bottom-left img,.cover-item-bottom-right img) .cover-copy-bottom,.proposal-preview-modal-pages .proposal-cover-page:has(.cover-item-bottom-left img,.cover-item-bottom-right img) .cover-copy-bottom,.portal-shared-proposal .proposal-cover-page:has(.cover-item-bottom-left img,.cover-item-bottom-right img) .cover-copy-bottom{bottom:23%}
.embed-script-box{background:#edf9ef;border:2px solid #c4dfc8;border-radius:7px;padding:14px}.embed-script-box>header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px}.embed-script-actions{display:flex;gap:6px;align-items:center}.embed-script-actions form{margin:0}.embed-settings .embed-script-box textarea{border:0;background:transparent;resize:vertical;padding:0;color:#294c35;min-height:72px;line-height:1.6}.embed-access{border-top:1px solid #dce5df;padding-top:20px}.embed-access form{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:20px}.embed-access input{width:100%;padding:9px;border:1px solid #d2dbea;border-radius:5px}.embed-access label{font-size:12px;color:#64748b}.embed-access button{align-self:end;min-height:36px}.embed-reviewer{display:flex;gap:12px;flex-wrap:wrap;padding:12px 0;border-top:1px solid #e0e8e2;font-size:12px}.embed-reviewer span,.embed-reviewer small{color:#6d7b8b}@media(max-width:600px){.embed-access form{grid-template-columns:1fr}}
.embed-reviewer{align-items:center}.embed-reviewer-actions{display:flex;gap:5px;margin-left:auto}.embed-reviewer-actions .icon-command{width:28px;height:28px;padding:5px}.reviewer-remove{color:#aa4454}.embed-key-controls{padding-bottom:12px;font-size:12px;color:#6d7b8b}.embed-key-controls summary{cursor:pointer}.embed-key-controls form{margin-top:12px}.embed-reviewer-dialog{width:min(440px,calc(100vw - 32px));border:1px solid #d5e1d8;border-radius:8px;padding:22px;background:#fff;color:#22362b;box-shadow:0 18px 70px #142b2340}.embed-reviewer-dialog::backdrop{background:#142b2366;backdrop-filter:blur(3px)}.embed-reviewer-dialog header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.embed-reviewer-dialog h2{font-size:18px;margin:0}.embed-reviewer-dialog label{display:grid;gap:7px;margin:14px 0;font-size:12px}.embed-reviewer-dialog input{width:100%;padding:10px;border:1px solid #d5dfd7;border-radius:5px;font-size:13px}.embed-reviewer-dialog footer{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}.embed-reviewer-dialog [role=status]{font-size:12px;color:#ab3948}
