:root {
  --sf-bg-0: #eef3f1;
  --sf-bg-1: #e7eef8;
  --sf-panel: rgba(255, 255, 255, 0.88);
  --sf-panel-solid: #ffffff;
  --sf-text: #14201c;
  --sf-muted: #5b6b66;
  --sf-line: rgba(20, 32, 28, 0.08);
  --sf-banner: linear-gradient(105deg, #d9f0e4 0%, #e8f3df 55%, #f3efd4 100%);
  --sf-banner-text: #1f3d32;
  --sf-link: #0f6b5c;
  --sf-primary: #0f766e;
  --sf-primary-hover: #0d5f59;
  --sf-coming: #c27803;
  --sf-coming-bg: #fff4df;
  --sf-paid: #1a7f4b;
  --sf-paid-bg: #e5f7ec;
  --sf-overdue: #c0392b;
  --sf-overdue-bg: #fdeceb;
  --sf-balance: #0b6e9a;
  --sf-top: rgba(255, 255, 255, 0.72);
  --sf-sidebar: #10241f;
  --sf-sidebar-2: #16352d;
  --sf-sidebar-text: #b7ccc5;
  --sf-sidebar-active: #ffffff;
  --sf-sidebar-width: 240px;
  --sf-radius: 12px;
  --sf-radius-sm: 8px;
  --sf-font: "Manrope", "Segoe UI", sans-serif;
  --sf-display: "Sora", "Manrope", sans-serif;
  --sf-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-bs-theme="dark"] {
  color-scheme: dark;
  --sf-bg-0: #1a1f1e;
  --sf-bg-1: #1f2624;
  --sf-panel: rgba(36, 43, 41, 0.96);
  --sf-panel-solid: #242b29;
  --sf-text: #ffffff;
  --sf-muted: #ffffff;
  --sf-line: rgba(255, 255, 255, 0.14);
  --sf-banner: linear-gradient(105deg, #1a332c 0%, #1e2f28 55%, #2a3220 100%);
  --sf-banner-text: #ffffff;
  --sf-link: #7ecfbf;
  --sf-primary: #2a9d8f;
  --sf-primary-hover: #3db5a5;
  --sf-coming: #e0a84a;
  --sf-coming-bg: #3a2e18;
  --sf-paid: #4caf7a;
  --sf-paid-bg: #1a3226;
  --sf-overdue: #e57373;
  --sf-overdue-bg: #3a1f1f;
  --sf-balance: #64b5f6;
  --sf-top: rgba(26, 31, 30, 0.92);
  --sf-sidebar: #121716;
  --sf-sidebar-2: #1a2220;
  --sf-sidebar-text: #ffffff;
  --sf-sidebar-active: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sf-font);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--sf-text);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(59, 110, 160, 0.12), transparent 50%),
    linear-gradient(160deg, var(--sf-bg-0), var(--sf-bg-1));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sf-link); text-decoration: none; transition: color 160ms var(--sf-ease); }
a:hover { color: var(--sf-primary-hover); }

.sf-portal-nav {
  --sf-portal-nav-h: 3rem;
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--sf-top);
  border-bottom: 1px solid rgba(16, 36, 31, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.sf-portal-nav-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--sf-portal-nav-h);
  padding: 0.35rem 1rem;
}
.sf-portal-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}
.sf-portal-logo {
  height: 28px;
  width: auto;
  display: block;
}
.sf-portal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}
.sf-portal-link {
  color: #1f2d28;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 400;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sf-portal-link:hover,
.sf-portal-link:focus {
  background: rgba(16, 36, 31, 0.08);
  color: #0d1a16;
}
.sf-portal-link.is-active {
  background: rgba(16, 36, 31, 0.12);
  color: #0d1a16;
}
.sf-portal-link.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sf-portal-drop {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.sf-portal-nav-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex: 0 0 auto;
}
.sf-portal-user {
  font-size: 0.8rem;
  color: var(--sf-muted);
  white-space: nowrap;
}
.sf-portal-logout {
  margin: 0;
}
.sf-portal-logout button {
  appearance: none;
  border: 1px solid rgba(16, 36, 31, 0.18);
  background: var(--sf-panel-solid);
  color: #1f2d28;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.sf-portal-logout button:hover {
  background: rgba(16, 36, 31, 0.06);
}

body:has(.sf-portal-nav) .sf-sidebar {
  top: var(--sf-portal-nav-h, 3rem);
  height: calc(100vh - var(--sf-portal-nav-h, 3rem));
}
body:has(.sf-portal-nav) .sf-topbar {
  top: var(--sf-portal-nav-h, 3rem);
}

@media (max-width: 900px) {
  .sf-portal-nav-inner {
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
  }
  .sf-portal-nav-meta {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
  body:has(.sf-portal-nav) {
    --sf-portal-nav-h: auto;
  }
  body:has(.sf-portal-nav) .sf-sidebar,
  body:has(.sf-portal-nav) .sf-topbar {
    top: 0;
    height: auto;
  }
}

.sf-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.sf-sidebar {
  width: var(--sf-sidebar-width);
  flex: 0 0 var(--sf-sidebar-width);
  background:
    linear-gradient(180deg, var(--sf-sidebar) 0%, var(--sf-sidebar-2) 100%);
  color: var(--sf-sidebar-text);
  padding: 1.25rem 0.9rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
}
.sf-sidebar-footer {
  margin-top: auto;
  padding: 1.1rem 0.35rem 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sf-sidebar-theme-toggle {
  width: 100%;
}
.sf-sidebar-footer .sf-theme-toggle {
  width: 100%;
  border-radius: var(--sf-radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}
.sf-sidebar-footer .sf-theme-toggle:hover,
.sf-sidebar-footer .sf-theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.sf-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.25rem 0.55rem 1.35rem;
  text-decoration: none;
  color: #fff;
}
.sf-brand:hover { color: #fff; text-decoration: none; }
.sf-brand-mark {
  width: 2.35rem;
  height: 2.1rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.sf-brand-text {
  font-family: var(--sf-display);
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.sf-auth-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

body.sf-auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", "Segoe UI", sans-serif;
  line-height: 1.6;
  color: #1f2937;
  background: #f5f5f5;
  color-scheme: light;
}
.sf-auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.sf-auth-top {
  padding: 1.25rem 1.5rem 0.75rem;
  text-align: left;
}
.sf-auth-top-link {
  display: inline-block;
  line-height: 0;
}
.sf-auth-logo {
  height: 44px;
  width: auto;
  max-width: min(22rem, 90vw);
  object-fit: contain;
  display: inline-block;
}
.sf-auth-main {
  flex: 1;
  padding: 0 1rem 2rem;
}
.sf-auth-wrap {
  max-width: 26rem;
  margin: 0 auto;
}
.sf-auth-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.75rem 1.5rem 1.6rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.sf-auth-card-header {
  margin-bottom: 1rem;
}
.sf-auth-title {
  margin: 0 0 0.5rem;
  font-family: "Poppins", "Sora", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  letter-spacing: 0;
  line-height: 1.35;
}
.sf-auth-lead {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
}
.sf-auth-flash {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
body.sf-auth-body .sf-auth-form {
  max-width: none;
  gap: 1rem;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}
body.sf-auth-body .sf-auth-form label,
html[data-bs-theme="dark"] body.sf-auth-body .sf-auth-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
}
body.sf-auth-body .sf-auth-form input,
html[data-bs-theme="dark"] body.sf-auth-body .sf-auth-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.625rem 0.75rem;
  min-height: 2.5rem;
  background: #fff !important;
  color: #1f2937 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px;
}
body.sf-auth-body .sf-auth-form input:focus {
  border-color: #0f766e !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
body.sf-auth-body .sf-auth-form .sf-note,
html[data-bs-theme="dark"] body.sf-auth-body .sf-auth-form .sf-note {
  color: #6b7280;
  margin: 0;
  font-size: 0.875rem;
}
body.sf-auth-body .sf-auth-form .sf-form-actions {
  margin-top: 0.25rem;
}
body.sf-auth-body .sf-auth-form .sf-btn-primary {
  width: 100%;
  justify-content: center;
  min-height: 2.5rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  transform: none;
}
body.sf-auth-body .sf-auth-form .sf-btn-primary:hover:not(:disabled) {
  transform: none;
}
.sf-auth-foot {
  margin-top: 3rem;
  border-top: 3px solid #0f766e;
  background: linear-gradient(to bottom, #f9fafb 0%, #f3f4f6 100%);
  padding: 2rem 1rem 1.5rem;
  text-align: center;
}
.sf-auth-foot-logo {
  height: 28px;
  width: auto;
  max-width: min(16rem, 80vw);
  object-fit: contain;
  display: inline-block;
  margin-bottom: 0.35rem;
}
.sf-auth-foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.25rem 0;
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
}
.sf-auth-foot-links a {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s;
}
.sf-auth-foot-links a:hover,
.sf-auth-foot-links a:focus-visible {
  color: #0f766e;
  text-decoration: none;
}
.sf-auth-links {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 0.875rem;
  color: #6b7280;
}
.sf-auth-links a {
  color: #0f766e;
  text-decoration: none;
  font-weight: 500;
}
.sf-auth-links a:hover,
.sf-auth-links a:focus-visible {
  text-decoration: underline;
}
.sf-auth-row {
  display: grid;
  gap: 1rem;
}
@media (min-width: 480px) {
  .sf-auth-row {
    grid-template-columns: 1fr 1fr;
  }
}
body.sf-auth-body .sf-auth-form input[type="checkbox"] {
  width: 1.15rem !important;
  height: 1.15rem !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0.15rem 0 0;
  flex: none;
  align-self: flex-start;
  accent-color: #0f766e;
  border-radius: 4px;
  cursor: pointer;
}
.sf-auth-consent {
  align-items: flex-start !important;
  gap: 0.7rem !important;
  padding: 0.85rem 0.95rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-weight: 400 !important;
}
.sf-check-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 400;
  line-height: 1.5;
  color: #374151;
}
.sf-check-text a {
  color: #0f766e;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.sf-check-text a:hover,
.sf-check-text a:focus-visible {
  text-decoration: underline;
}
.sf-auth-wrap-wide {
  max-width: 980px;
}
.sf-auth-card-wide {
  padding: 1.75rem 1.5rem 2rem;
}
.sf-btn-sm {
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  min-height: 0;
}
.sf-price-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.sf-price-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.sf-price-group {
  display: flex;
  gap: 0.35rem;
}
.sf-price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.sf-price-card {
  display: block;
  text-align: left;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  font: inherit;
}
.sf-price-card:hover {
  border-color: #0f766e;
  text-decoration: none;
  color: inherit;
}
.sf-price-card:disabled,
.sf-pay-card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.sf-price-card.is-selected {
  border-color: #0f54aa;
  outline: 2px solid #0f54aa;
}
.sf-price-card.is-recommended {
  border-color: #0f766e;
}
.sf-price-card h2,
.sf-pay-card h2 {
  margin: 0.35rem 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.125rem;
}
.sf-price-card p {
  margin: 0.25rem 0;
  font-size: 0.875rem;
  color: #6b7280;
}
.sf-price-amount {
  font-size: 1.5rem !important;
  font-weight: 700;
  color: #0f54aa !important;
  margin: 0.75rem 0 0.25rem !important;
}
.sf-price-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  background: #dbeafe;
  color: #1e40af;
}
.sf-price-custom,
.sf-price-pay {
  margin-top: 1.5rem;
  text-align: center;
}
.sf-price-qty {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 0.75rem;
}
.sf-price-gateways {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 640px;
  margin: 1rem auto 0;
}
.sf-pay-card {
  text-align: center;
}
.sf-price-gateways form {
  margin: 0;
}
.sf-legal p {
  margin: 0.75rem 0;
  color: #1f2937;
}
.sf-invoice-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.sf-invoice-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.sf-invoice-table th,
.sf-invoice-table td {
  text-align: left;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid #e5e7eb;
}
.sf-invoice-total {
  text-align: right;
  font-size: 1.125rem;
  margin-top: 1rem;
}
.sf-cookie {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.sf-cookie[hidden] {
  display: none !important;
}
.sf-cookie p {
  margin: 0;
  font-size: 0.875rem;
  color: #374151;
}
.sf-billing-banner {
  margin: 0 1.25rem 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  background: #e8f4fb;
  color: #0b6e9a;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.sf-billing-banner.is-due {
  background: var(--sf-overdue-bg, #fdecea);
  color: var(--sf-overdue, #c0392b);
}
.sf-billing-banner a {
  font-weight: 600;
}
.sf-app-foot {
  padding: 0.85rem 1.25rem 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #6b7280;
}
.sf-app-foot a {
  color: #0f766e;
  margin: 0 0.4rem;
  text-decoration: none;
}
.sf-app-foot a:hover {
  text-decoration: underline;
}

.sf-nav { display: flex; flex-direction: column; gap: 0.2rem; }
.sf-nav-section {
  margin: 1rem 0.65rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-sidebar-text);
  opacity: 0.75;
}
.sf-nav-link {
  display: block;
  padding: 0.58rem 0.75rem;
  border-radius: var(--sf-radius-sm);
  color: var(--sf-sidebar-text);
  text-decoration: none;
  font-weight: 500;
  transition: background 180ms var(--sf-ease), color 180ms var(--sf-ease), transform 180ms var(--sf-ease);
}
.sf-nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
  transform: translateX(2px);
}
.sf-nav-link.is-active {
  background: linear-gradient(90deg, rgba(159, 232, 212, 0.22), rgba(159, 232, 212, 0.08));
  color: var(--sf-sidebar-active);
  font-weight: 650;
  box-shadow: inset 3px 0 0 #9fe8d4;
}

.sf-content {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.sf-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.35rem;
  background: var(--sf-top);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sf-line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sf-breadcrumb {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  color: var(--sf-muted);
  font-size: 0.92rem;
}
.sf-breadcrumb .sep { color: #9aaba4; opacity: 0.8; }
.sf-breadcrumb a { font-weight: 550; }

.sf-main {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.75rem 2.5rem;
  width: 100%;
  animation: sf-fade-up 420ms var(--sf-ease) both;
}

@keyframes sf-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.sf-banner {
  background: var(--sf-banner);
  color: var(--sf-banner-text);
  font-family: var(--sf-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(31, 61, 50, 0.08);
  border-radius: var(--sf-radius);
  margin-bottom: 1rem;
}

.sf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.sf-search { display: flex; gap: 0.5rem; }
.sf-search.is-live button[type="submit"] { display: none; }
[data-sf-live-search-results].is-filtering {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 120ms var(--sf-ease);
}
.sf-search input {
  min-width: 240px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 160ms var(--sf-ease), box-shadow 160ms var(--sf-ease);
}
.sf-search input:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-search button,
.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid var(--sf-line);
  background: var(--sf-panel-solid);
  color: var(--sf-text);
  padding: 0.5rem 0.95rem;
  min-height: 2.4rem;
  border-radius: var(--sf-radius-sm);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.15;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 160ms var(--sf-ease), background 160ms var(--sf-ease), border-color 160ms var(--sf-ease), filter 160ms var(--sf-ease);
}
.sf-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.28);
  text-decoration: none;
  color: inherit;
}
.sf-btn-primary {
  background: var(--sf-primary);
  border-color: transparent;
  color: #fff;
}
.sf-btn-primary:hover:not(:disabled) {
  background: var(--sf-primary-hover);
  color: #fff;
}
.sf-btn-primary:disabled,
.sf-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.sf-btn-quiet {
  background: rgba(255, 255, 255, 0.9);
  color: var(--sf-text);
  font-weight: 550;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  min-height: 0;
}
.sf-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.sf-link-muted { color: var(--sf-muted); pointer-events: none; opacity: 0.7; }

.sf-table-wrap {
  background: var(--sf-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  overflow-x: auto;
  width: 100%;
  box-shadow: 0 10px 30px rgba(16, 36, 31, 0.04);
}

.sf-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: transparent;
  table-layout: auto;
}
.sf-table th,
.sf-table td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--sf-line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.sf-table th {
  font-family: var(--sf-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sf-muted);
  background: rgba(246, 250, 248, 0.92);
  position: sticky;
  top: 0;
}
.sf-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.sf-sort:hover {
  color: var(--sf-primary);
  text-decoration: none;
}
.sf-sort.is-active {
  color: var(--sf-text);
}
.sf-sort-ind {
  font-size: 0.72rem;
  opacity: 0.55;
  line-height: 1;
}
.sf-sort.is-active .sf-sort-ind {
  opacity: 0.95;
  color: var(--sf-primary);
}
.sf-table th.num .sf-sort {
  justify-content: flex-end;
  width: 100%;
}
.sf-table tbody tr {
  transition: background 140ms var(--sf-ease);
}
.sf-table tbody tr:hover {
  background: rgba(15, 118, 110, 0.035);
}
.sf-table td.num,
.sf-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 8.5rem;
  font-weight: 550;
}
.sf-table th.col-balance,
.sf-table td.col-balance { min-width: 8.5rem; }
.sf-table th.col-status,
.sf-table td.col-status { min-width: 7.5rem; }
.sf-table td.col-description,
.sf-table th.col-description {
  white-space: normal;
  max-width: 22rem;
  min-width: 12rem;
}
.sf-table .col-actions { white-space: nowrap; width: 1%; }
.sf-table .col-paid {
  white-space: nowrap;
  width: 1%;
  text-align: right;
  vertical-align: middle;
}
.sf-table .col-paid .sf-inline-action {
  display: inline;
  margin: 0 0 0 0.25rem;
}
.sf-table .col-paid .sf-inline-action:first-child {
  margin-left: 0;
}
.sf-table .col-select {
  width: 2.25rem;
  text-align: center;
  vertical-align: middle;
}
.sf-table .col-select input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}
.sf-toolbar-actions .sf-btn-delete:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sf-bulk-form:not(:has(.sf-table-wrap)) {
  display: none;
}
.sf-table .col-actions .sf-btn { margin-right: 0.25rem; }
.sf-table .col-actions .sf-inline-action {
  display: inline;
  margin: 0;
}
.sf-quote-actions {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 0.25rem;
  align-items: center;
  justify-content: start;
}
.sf-quote-actions .sf-btn {
  margin-right: 0;
  min-width: 4.75rem;
  justify-content: center;
  text-align: center;
}
.sf-quote-actions .sf-inline-action {
  display: contents;
}
.sf-quote-actions .sf-inline-action .sf-btn {
  width: 100%;
}
.sf-quote-action-slot {
  display: block;
  min-width: 4.75rem;
  min-height: 1px;
}
.sf-table .sf-btn-convert-list {
  color: var(--sf-primary);
  border-color: rgba(15, 118, 110, 0.22);
}
.sf-table .sf-btn-convert-list:hover:not(:disabled) {
  background: rgba(15, 118, 110, 0.08);
  color: var(--sf-primary-hover);
}
.sf-table .sf-btn-paid-list {
  color: var(--sf-paid);
  border-color: rgba(26, 127, 75, 0.28);
}
.sf-table .sf-btn-paid-list:hover:not(:disabled) {
  background: var(--sf-paid-bg);
  color: var(--sf-paid);
}
.sf-btn-paid {
  background: var(--sf-paid);
  border-color: transparent;
  color: #fff;
}
.sf-btn-paid:hover:not(:disabled) {
  filter: brightness(0.94);
  color: #fff;
  border-color: transparent;
}
.sf-doc-view-toolbar .sf-inline-action {
  display: inline;
  margin: 0;
}
.balance-due { color: var(--sf-balance); font-weight: 700; }
.sf-table tfoot td {
  background: rgba(246, 250, 248, 0.95);
  border-top: 1px solid rgba(15, 118, 110, 0.18);
  font-weight: 650;
}
.sf-table-total td { padding-top: 0.85rem; padding-bottom: 0.85rem; }

.sf-status {
  display: inline-block;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.status-coming-due { background: var(--sf-coming-bg); color: var(--sf-coming); }
.status-paid { background: var(--sf-paid-bg); color: var(--sf-paid); }
.status-overdue { background: var(--sf-overdue-bg); color: var(--sf-overdue); }
.status-unknown { background: var(--sf-panel-solid); color: var(--sf-muted); }

.sf-pager,
.sf-pager-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--sf-muted);
  font-weight: 500;
}
.sf-pager a {
  font-weight: 650;
  padding: 0.35rem 0.65rem;
  border-radius: var(--sf-radius-sm);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--sf-line);
}

.sf-page-title {
  margin: 0 0 1.1rem;
  font-family: var(--sf-display);
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

/* Recurring sales invoices — pending */
.sf-recurring-page {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sf-recurring-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.sf-recurring-heading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}
.sf-recurring-title {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--sf-text);
}
.sf-recurring-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 1px solid rgba(20, 32, 28, 0.22);
  color: var(--sf-muted);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
  user-select: none;
}
.sf-recurring-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.sf-recurring-advanced-queries {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--sf-muted);
  font-size: 0.9rem;
  font-weight: 550;
  opacity: 0.75;
  cursor: default;
}
.sf-recurring-aq-icon {
  font-size: 0.75rem;
  line-height: 1;
}
.sf-recurring-edit-head {
  color: var(--sf-muted);
  font-size: 0.95rem;
}
.sf-recurring-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.sf-recurring-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  color: var(--sf-muted);
  font-size: 0.88rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.65);
  transition: color 140ms var(--sf-ease), background 140ms var(--sf-ease), border-color 140ms var(--sf-ease);
}
.sf-recurring-tab:hover {
  color: var(--sf-text);
  border-color: rgba(15, 118, 110, 0.35);
  text-decoration: none;
}
.sf-recurring-tab.is-active {
  color: #fff;
  background: var(--sf-primary);
  border-color: var(--sf-primary);
}
.sf-recurring-paused {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(194, 120, 3, 0.14);
  color: #8a5a05;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sf-recurring-sla {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: var(--sf-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.sf-sla-alert-on {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0.65rem 0 0;
  max-width: 14rem;
}
.sf-sla-alert-on input[type="date"] {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sf-line);
  border-radius: 7px;
  background: var(--sf-panel-solid);
  color: var(--sf-text);
}
.sf-recurring-outlook-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0.35rem 0 0.75rem;
  font-size: 0.88rem;
  color: var(--sf-muted);
}
.sf-recurring-outlook-status {
  font-weight: 600;
  color: var(--sf-text);
}
.sf-recurring-outlook-warn {
  color: #8a5a05;
  font-size: 0.85rem;
}
.sf-recurring-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.75rem;
}
.sf-recurring-pending-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: rgba(255, 255, 255, 0.72);
}
.sf-recurring-template {
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sf-recurring-outlook-card {
  margin: 0.85rem 0 1rem;
}
.sf-recurring-outlook-card select {
  width: min(100%, 36rem);
}
.sf-template-picker-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0.85rem 0 0;
}
.sf-template-picker-field > strong {
  font-weight: 650;
}
.sf-template-picker {
  max-width: min(100%, 42rem);
  margin: 0;
}
.sf-template-picker.is-disabled {
  opacity: 0.62;
  pointer-events: none;
}
.sf-template-picker .sf-note-picker-value {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.sf-recurring-outlook-meta {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--sf-muted);
}
.sf-reminder-emails {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.4rem 0 0.5rem;
}
.sf-reminder-email-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  max-width: min(100%, 36rem);
}
.sf-reminder-email-row input {
  flex: 1;
  min-width: 0;
}
.sf-yearly-markup input {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sf-line);
  border-radius: 7px;
  background: var(--sf-panel-solid);
  color: var(--sf-text);
  width: 100%;
  max-width: 8rem;
}
.sf-logs-mode {
  border: 0;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.sf-logs-mode legend {
  font-weight: 650;
  padding: 0;
  margin: 0 0 0.4rem;
}
.sf-logs-period {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: var(--sf-muted);
}
.sf-logs-period strong {
  color: var(--sf-text);
  font-variant-numeric: tabular-nums;
}
.sf-logs-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 14rem));
  gap: 0.75rem 1rem;
  margin: 0.85rem 0 0;
  align-items: end;
}
.sf-logs-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sf-logs-fields input[type="text"] {
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sf-line);
  border-radius: 7px;
  background: var(--sf-panel-solid);
  color: var(--sf-text);
}
.sf-logs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
}
.sf-logs-status {
  margin: 0.65rem 0 0;
  font-size: 0.88rem;
  color: var(--sf-muted);
}
.sf-logs-status.is-error {
  color: var(--sf-overdue);
}
.sf-logs-preview {
  margin: 0.75rem 0 0;
}
.sf-logs-select-all {
  margin: 0 0 0.4rem;
}
.sf-logs-list {
  list-style: none;
  margin: 0;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  max-height: 16rem;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
}
.sf-logs-list .sf-check {
  align-items: flex-start;
}
.sf-logs-list .sf-check strong {
  white-space: pre-line;
  font-weight: 650;
}
.sf-logs-meta {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sf-muted);
}
.sf-logs-spacer {
  list-style: none;
  padding: 0.15rem 0 0.35rem 1.75rem;
}
.sf-logs-spacer-line {
  display: block;
  height: 0.65rem;
}
.sf-table .col-check {
  width: 2.2rem;
  text-align: center;
}
.sf-table-zebra tbody tr.is-paused {
  opacity: 0.72;
}
.sf-table-zebra tbody tr:nth-child(even) {
  background: rgba(20, 32, 28, 0.035);
}
.sf-table-zebra tbody tr:hover {
  background: rgba(15, 118, 110, 0.05);
}
.sf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sf-empty {
  color: var(--sf-muted);
  font-style: italic;
  text-align: center;
  padding: 1.25rem 0.85rem !important;
}

.sf-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 280px));
  gap: 1rem;
}
.sf-settings-grid--single {
  grid-template-columns: minmax(180px, 280px);
}
.sf-settings-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.15rem;
  background: var(--sf-panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  color: var(--sf-link);
  transition: transform 180ms var(--sf-ease), border-color 180ms var(--sf-ease);
}
.sf-settings-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  text-decoration: none;
  transform: translateY(-2px);
}
.sf-settings-icon {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 118, 110, 0.25);
  border-radius: 9px;
  color: var(--sf-primary);
  background: rgba(15, 118, 110, 0.06);
  font-family: var(--sf-display);
  font-weight: 700;
}
.sf-settings-label { font-weight: 650; color: var(--sf-text); }
.sf-settings-meta { color: var(--sf-muted); font-size: 0.82rem; }

.sf-advanced-import {
  cursor: default;
  color: inherit;
  text-decoration: none;
}
.sf-advanced-import:hover {
  transform: none;
  text-decoration: none;
}
.sf-advanced-import-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.35rem;
  color: var(--sf-text);
  font-size: 0.82rem;
  font-weight: 600;
}
.sf-advanced-import-field input[type="file"],
.sf-advanced-import-field select {
  font: inherit;
  font-weight: 500;
  color: var(--sf-text);
}
.sf-advanced-import .sf-btn {
  align-self: flex-start;
  margin-top: 0.35rem;
}

/* Advanced hub — shared layout + graffiti/normal themes */
.sf-advanced-page {
  position: relative;
  padding: 0.35rem 0 0.5rem;
  isolation: isolate;
}
.sf-advanced-page > * {
  position: relative;
  z-index: 1;
}
.sf-advanced-theme-toggle {
  cursor: pointer;
  font: inherit;
}
.sf-advanced-groups {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin-top: 1.35rem;
}
.sf-advanced-group-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
}
.sf-advanced-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  height: 1.7rem;
  padding: 0 0.5rem;
}
.sf-advanced-back-bar {
  margin: 0 0 0.85rem;
}
.sf-advanced-back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  transition:
    transform 160ms var(--sf-ease),
    box-shadow 160ms var(--sf-ease),
    background 160ms var(--sf-ease),
    color 160ms var(--sf-ease),
    border-color 160ms var(--sf-ease);
}
.sf-advanced-back:hover { text-decoration: none; }
.sf-advanced-back-arrow {
  font-size: 1.05rem;
  line-height: 1;
  font-family: var(--sf-font);
}
@keyframes sf-advanced-banner-shift {
  from { background-position: 0% 50%; }
  to { background-position: 100% 50%; }
}

/* Graffiti (default) */
html[data-sf-adv-theme="graffiti"] .sf-advanced-page {
  --adv-ink: #111111;
  --adv-banking: #39ff14;
  --adv-banking-deep: #1f8f0e;
  --adv-settings: #ff3b1f;
  --adv-settings-deep: #b4230f;
  --adv-reports: #ffe600;
  --adv-tag: "Permanent Marker", "Bangers", cursive;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-page::before {
  content: "";
  position: absolute;
  inset: -1.25rem -1.25rem -0.5rem;
  z-index: 0;
  pointer-events: none;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 18%, rgba(57, 255, 20, 0.28) 0 2px, transparent 3px),
    radial-gradient(circle at 18% 22%, rgba(57, 255, 20, 0.18) 0 8px, transparent 18px),
    radial-gradient(circle at 78% 12%, rgba(255, 59, 31, 0.3) 0 3px, transparent 4px),
    radial-gradient(circle at 84% 16%, rgba(255, 59, 31, 0.16) 0 14px, transparent 28px),
    radial-gradient(circle at 62% 8%, rgba(255, 230, 0, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 55% 14%, rgba(0, 229, 255, 0.2) 0 18px, transparent 36px),
    radial-gradient(900px 320px at 50% -10%, rgba(0, 0, 0, 0.35), transparent 70%),
    repeating-linear-gradient(
      -12deg,
      transparent 0 18px,
      rgba(255, 255, 255, 0.02) 18px 19px
    ),
    linear-gradient(165deg, #35353b 0%, #1d1d22 48%, #2b2b31 100%);
  box-shadow: inset 0 0 0 3px #0d0d0f, 0 18px 40px rgba(0, 0, 0, 0.28);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-banner {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(57, 255, 20, 0.95) 0%, rgba(0, 229, 255, 0.9) 35%, rgba(255, 230, 0, 0.95) 68%, rgba(255, 59, 31, 0.95) 100%);
  color: var(--adv-ink);
  font-family: var(--adv-tag);
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 #fff,
    -2px 0 0 rgba(0, 0, 0, 0.35);
  border: 3px solid #0d0d0f;
  border-radius: 4px 18px 8px 22px / 14px 6px 20px 10px;
  box-shadow:
    6px 6px 0 #0d0d0f,
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  transform: rotate(-0.8deg);
  animation: sf-advanced-banner-shift 8s ease-in-out infinite alternate;
  background-size: 180% 100%;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-banner::after {
  content: "SF";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-55%) rotate(8deg);
  font-family: "Bangers", var(--adv-tag);
  font-size: 2.4rem;
  color: rgba(13, 13, 15, 0.18);
  letter-spacing: 0.08em;
  pointer-events: none;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-theme-toggle {
  padding: 0.55rem 0.95rem;
  border: 2px solid #0d0d0f;
  border-radius: 3px 12px 5px 14px / 12px 4px 14px 5px;
  background: #00e5ff;
  color: #111;
  font-family: "Bangers", "Permanent Marker", cursive;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-theme-toggle:hover {
  background: #ffe600;
  transform: translate(-1px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group {
  padding: 1.05rem 1.1rem 1.2rem;
  border-radius: 6px 16px 10px 20px / 16px 8px 18px 6px;
  border: 3px solid #0d0d0f;
  background: rgba(18, 18, 20, 0.88);
  box-shadow: 5px 5px 0 #0d0d0f;
  color: #f4f4f0;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-banking {
  background:
    linear-gradient(145deg, rgba(57, 255, 20, 0.18), rgba(18, 18, 20, 0.92) 45%),
    #121214;
  box-shadow: 5px 5px 0 var(--adv-banking);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-settings {
  background:
    linear-gradient(145deg, rgba(255, 59, 31, 0.2), rgba(18, 18, 20, 0.92) 45%),
    #121214;
  box-shadow: 5px 5px 0 var(--adv-settings);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-reports {
  background:
    linear-gradient(145deg, rgba(255, 230, 0, 0.2), rgba(18, 18, 20, 0.92) 45%),
    #121214;
  box-shadow: 5px 5px 0 var(--adv-reports);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group-head {
  font-family: var(--adv-tag);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-chip {
  border-radius: 3px 10px 4px 12px / 10px 4px 12px 3px;
  border: 2px solid #0d0d0f;
  font-family: "Bangers", var(--adv-tag);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #0d0d0f;
  box-shadow: 2px 2px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-banking .sf-advanced-chip { background: var(--adv-banking); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-settings .sf-advanced-chip { background: var(--adv-settings); color: #fff; }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-reports .sf-advanced-chip { background: var(--adv-reports); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-banking .sf-advanced-group-head { color: var(--adv-banking); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-settings .sf-advanced-group-head { color: #ff8a78; }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-reports .sf-advanced-group-head { color: var(--adv-reports); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-card {
  border: 2px solid #0d0d0f !important;
  border-radius: 4px 12px 6px 14px / 12px 4px 14px 6px !important;
  background: rgba(245, 245, 240, 0.96) !important;
  box-shadow: 3px 3px 0 #0d0d0f;
  transform: rotate(-0.35deg);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-card:nth-child(even) {
  transform: rotate(0.45deg);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-banking a.sf-advanced-card:hover {
  border-color: #0d0d0f !important;
  background: var(--adv-banking) !important;
  box-shadow: 5px 5px 0 #0d0d0f;
  transform: translate(-1px, -2px) rotate(-1deg);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-settings a.sf-advanced-card:hover {
  border-color: #0d0d0f !important;
  background: #ffb4a8 !important;
  box-shadow: 5px 5px 0 #0d0d0f;
  transform: translate(-1px, -2px) rotate(1deg);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-reports a.sf-advanced-card:hover {
  border-color: #0d0d0f !important;
  background: var(--adv-reports) !important;
  box-shadow: 5px 5px 0 #0d0d0f;
  transform: translate(-1px, -2px) rotate(-0.8deg);
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group .sf-settings-label {
  font-family: "Bangers", var(--adv-tag);
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group .sf-settings-meta {
  color: #4a4a4a;
  font-weight: 550;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-banking .sf-settings-label { color: var(--adv-banking-deep); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-settings .sf-settings-label { color: var(--adv-settings-deep); }
html[data-sf-adv-theme="graffiti"] .sf-advanced-group.is-reports .sf-settings-label { color: #7a6800; }
html[data-sf-adv-theme="graffiti"] .sf-advanced-back {
  padding: 0.42rem 0.9rem 0.42rem 0.7rem;
  border-radius: 3px 12px 5px 14px / 12px 4px 14px 5px;
  border: 2px solid #0d0d0f;
  background: #ffe600;
  color: #111;
  font-family: "Bangers", "Permanent Marker", cursive;
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-advanced-back:hover {
  color: #111;
  background: #39ff14;
  transform: translate(-1px, -2px) rotate(-1deg);
  box-shadow: 5px 5px 0 #0d0d0f;
}

/* Graffiti — global shell (sidebar + sales banners) */
html[data-sf-adv-theme="graffiti"] body {
  background:
    radial-gradient(circle at 8% 12%, rgba(57, 255, 20, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 18% 20%, rgba(57, 255, 20, 0.08) 0 10px, transparent 22px),
    radial-gradient(circle at 92% 8%, rgba(255, 59, 31, 0.12) 0 3px, transparent 4px),
    radial-gradient(circle at 86% 18%, rgba(255, 59, 31, 0.08) 0 14px, transparent 28px),
    radial-gradient(circle at 55% 4%, rgba(255, 230, 0, 0.14) 0 2px, transparent 3px),
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 118, 110, 0.1), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(255, 59, 31, 0.06), transparent 50%),
    linear-gradient(160deg, #e8ece9, #e4e8f0);
}
html[data-sf-adv-theme="graffiti"] .sf-sidebar {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 12%, rgba(57, 255, 20, 0.22) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 8%, rgba(255, 59, 31, 0.24) 0 2px, transparent 3px),
    radial-gradient(circle at 42% 88%, rgba(255, 230, 0, 0.16) 0 10px, transparent 22px),
    linear-gradient(180deg, #1a1a1e 0%, #121214 55%, #1d1d22 100%);
  color: #d7d7d0;
  border-right: 3px solid #0d0d0f;
  box-shadow: 4px 0 0 rgba(57, 255, 20, 0.35);
}
html[data-sf-adv-theme="graffiti"] .sf-brand {
  color: #ffe600;
}
html[data-sf-adv-theme="graffiti"] .sf-brand:hover { color: #39ff14; }
html[data-sf-adv-theme="graffiti"] .sf-brand-mark {
  border-radius: 3px 10px 4px 12px / 10px 4px 12px 3px;
}
html[data-sf-adv-theme="graffiti"] .sf-brand-text {
  font-family: "Bangers", "Permanent Marker", cursive;
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-nav-section {
  color: #ffe600;
  font-family: "Permanent Marker", "Bangers", cursive;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}
html[data-sf-adv-theme="graffiti"] .sf-nav-link {
  border-radius: 3px 10px 4px 12px / 10px 4px 12px 3px;
  color: #cfcfc8;
  font-weight: 550;
}
html[data-sf-adv-theme="graffiti"] .sf-nav-link:hover {
  background: rgba(0, 229, 255, 0.16);
  color: #00e5ff;
  transform: translateX(3px) rotate(-0.4deg);
}
html[data-sf-adv-theme="graffiti"] .sf-nav-link.is-active {
  background: rgba(57, 255, 20, 0.16);
  color: #39ff14;
  font-weight: 700;
  box-shadow: inset 3px 0 0 #39ff14;
}
html[data-sf-adv-theme="graffiti"] .sf-sidebar-theme-toggle {
  width: 100%;
}
html[data-sf-adv-theme="graffiti"] .sf-banner:not(.sf-advanced-banner) {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(57, 255, 20, 0.95) 0%, rgba(0, 229, 255, 0.9) 35%, rgba(255, 230, 0, 0.95) 68%, rgba(255, 59, 31, 0.95) 100%);
  color: #111;
  font-family: "Permanent Marker", "Bangers", cursive;
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    3px 3px 0 #fff,
    -2px 0 0 rgba(0, 0, 0, 0.35);
  border: 3px solid #0d0d0f;
  border-radius: 4px 18px 8px 22px / 14px 6px 20px 10px;
  box-shadow:
    6px 6px 0 #0d0d0f,
    0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  transform: rotate(-0.6deg);
  animation: sf-advanced-banner-shift 8s ease-in-out infinite alternate;
  background-size: 180% 100%;
}
html[data-sf-adv-theme="graffiti"] .sf-banner:not(.sf-advanced-banner)::after {
  content: "SF";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-55%) rotate(8deg);
  font-family: "Bangers", "Permanent Marker", cursive;
  font-size: 2rem;
  color: rgba(13, 13, 15, 0.18);
  letter-spacing: 0.08em;
  pointer-events: none;
}
html[data-sf-adv-theme="graffiti"] .sf-toolbar:has([data-sf-live-search]) {
  margin-top: 1.35rem;
}
html[data-sf-adv-theme="graffiti"] .sf-table-wrap {
  border: 2px solid #0d0d0f;
  border-radius: 4px 14px 8px 16px / 14px 6px 16px 8px;
  box-shadow: 4px 4px 0 #0d0d0f;
}
html[data-sf-adv-theme="graffiti"] .sf-flash {
  border: 2px solid #0d0d0f;
  box-shadow: 3px 3px 0 #0d0d0f;
}

/* Normal — matches rest of SouthFin */
html[data-sf-adv-theme="normal"] .sf-advanced-page {
  --adv-banking-deep: #0b6f6e;
  --adv-settings-deep: #0f4f9e;
  --adv-reports-deep: #1f3d32;
}
html[data-sf-adv-theme="normal"] .sf-advanced-banner {
  background: var(--sf-banner);
  color: var(--sf-banner-text);
  font-family: var(--sf-display);
  font-size: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  text-shadow: none;
  border: 1px solid rgba(31, 61, 50, 0.08);
  border-radius: var(--sf-radius);
  box-shadow: none;
  transform: none;
  animation: none;
}
html[data-sf-adv-theme="normal"] .sf-advanced-banner::after { content: none; }
html[data-sf-adv-theme="normal"] .sf-advanced-theme-toggle {
  padding: 0.55rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--sf-radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #e8f0ed;
  font-weight: 650;
  font-size: 0.88rem;
  box-shadow: none;
}
html[data-sf-adv-theme="normal"] .sf-advanced-theme-toggle:hover {
  border-color: rgba(159, 232, 212, 0.45);
  color: #9fe8d4;
  background: rgba(159, 232, 212, 0.12);
}
html[data-sf-adv-theme="normal"] .sf-advanced-group {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}
html[data-sf-adv-theme="normal"] .sf-advanced-group-head {
  font-family: var(--sf-display);
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-transform: none;
  text-shadow: none;
  color: var(--sf-text);
}
html[data-sf-adv-theme="normal"] .sf-advanced-chip {
  border-radius: 999px;
  border: 0;
  font-family: var(--sf-font);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--sf-primary);
  box-shadow: none;
}
html[data-sf-adv-theme="normal"] .sf-advanced-group.is-banking .sf-advanced-chip { background: #0ea5a4; }
html[data-sf-adv-theme="normal"] .sf-advanced-group.is-settings .sf-advanced-chip { background: #2563eb; }
html[data-sf-adv-theme="normal"] .sf-advanced-group.is-reports .sf-advanced-chip { background: #0f766e; }
html[data-sf-adv-theme="normal"] .sf-advanced-card {
  border: 1px solid var(--sf-line) !important;
  border-radius: var(--sf-radius) !important;
  background: var(--sf-panel) !important;
  box-shadow: none;
  transform: none !important;
}
html[data-sf-adv-theme="normal"] .sf-advanced-group a.sf-advanced-card:hover {
  border-color: rgba(15, 118, 110, 0.35) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: none;
  transform: translateY(-2px) !important;
}
html[data-sf-adv-theme="normal"] .sf-advanced-group .sf-settings-label {
  font-family: var(--sf-font);
  font-size: inherit;
  font-weight: 650;
  letter-spacing: normal;
  text-transform: none;
  color: var(--sf-text);
}
html[data-sf-adv-theme="normal"] .sf-advanced-group .sf-settings-meta {
  color: var(--sf-muted);
  font-weight: 500;
}
html[data-sf-adv-theme="normal"] .sf-advanced-back {
  padding: 0.45rem 0.85rem 0.45rem 0.7rem;
  border-radius: var(--sf-radius-sm);
  border: 1px solid var(--sf-line);
  background: var(--sf-panel);
  color: var(--sf-link);
  font-family: var(--sf-font);
  font-weight: 650;
  font-size: 0.88rem;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: 0 4px 12px rgba(16, 36, 31, 0.04);
}
html[data-sf-adv-theme="normal"] .sf-advanced-back:hover {
  color: var(--sf-primary-hover);
  border-color: rgba(15, 118, 110, 0.35);
  transform: translateX(-2px);
  box-shadow: 0 8px 18px rgba(16, 36, 31, 0.06);
}

.sf-divider {
  border: 0;
  border-top: 1px solid var(--sf-line);
  margin: 1.35rem 0;
}

.sf-form {
  max-width: 440px;
  display: grid;
  gap: 0.85rem;
  background: var(--sf-panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  padding: 1.15rem;
}
.sf-form label {
  display: grid;
  gap: 0.3rem;
  font-weight: 650;
  color: var(--sf-text);
}
.sf-form input,
.sf-form select,
.sf-form textarea {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  font: inherit;
  font-weight: 500;
  color: var(--sf-text);
  background: var(--sf-panel-solid);
  transition: border-color 160ms var(--sf-ease), box-shadow 160ms var(--sf-ease);
}
.sf-form input:focus,
.sf-form select:focus,
.sf-form textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-form select,
.sf-edit-meta-form select,
.sf-edit-table select,
.sf-quote-project-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-height: 2.45rem;
  padding-right: 2.35rem;
  cursor: pointer;
  background-color: var(--sf-panel-solid);
  background-image:
    linear-gradient(45deg, transparent 50%, #5f746c 50%),
    linear-gradient(135deg, #5f746c 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    100% 0;
  background-size: 5px 5px, 5px 5px, 2.4rem 100%;
  background-repeat: no-repeat;
}
.sf-form select:hover,
.sf-edit-meta-form select:hover,
.sf-edit-table select:hover,
.sf-quote-project-form select:hover {
  border-color: rgba(15, 118, 110, 0.35);
}
.sf-form select:disabled,
.sf-edit-meta-form select:disabled,
.sf-edit-table select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.sf-form-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}
.sf-form-actions .sf-btn-quiet {
  font-size: inherit;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  min-height: 2.4rem;
}
.sf-form-actions .sf-actions-spacer {
  flex: 1 1 0.75rem;
  min-width: 0.5rem;
}
.sf-form-wide { max-width: 560px; }
.sf-check {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  font-weight: 550 !important;
}
.sf-check input { width: auto; }
.sf-edit-meta-inline { margin: 0.35rem 0 0; }
.sf-note { color: var(--sf-muted); margin-top: -0.35rem; }

.sf-topbar-end {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.sf-company-switch {
  margin: 0;
  min-width: 0;
}
.sf-company-switch label {
  display: block;
  margin: 0;
}
.sf-company-switch select {
  max-width: 16rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  color: var(--sf-text);
}
.sf-topbar-company,
.sf-topbar-user {
  color: var(--sf-muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.sf-topbar-company {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16rem;
}
.sf-topbar-signout {
  flex: none;
  min-height: 2rem;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.sf-check-list {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  padding: 0.75rem 0.9rem;
  max-height: 320px;
  overflow: auto;
  display: grid;
  gap: 0.35rem;
  background: var(--sf-panel-solid);
}
.sf-check-list legend {
  padding: 0 0.35rem;
  font-weight: 650;
  color: var(--sf-text);
}

.sf-flash-wrap { margin: 0.85rem 0 0; padding: 0 1.35rem; }
.sf-flash {
  padding: 0.65rem 0.85rem;
  border-radius: var(--sf-radius-sm);
  margin-bottom: 0.4rem;
  font-weight: 550;
  border: 1px solid transparent;
  animation: sf-fade-up 320ms var(--sf-ease) both;
}
.sf-flash--ok { background: var(--sf-paid-bg); color: var(--sf-paid); border-color: rgba(26, 127, 75, 0.15); }
.sf-flash--error { background: var(--sf-overdue-bg); color: var(--sf-overdue); border-color: rgba(192, 57, 43, 0.15); }
.sf-flash--info { background: #e8f4fb; color: #0b6e9a; border-color: rgba(11, 110, 154, 0.15); }

.sf-edit-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  margin-bottom: 1.15rem;
  padding: 1.35rem 1.45rem;
  width: 100%;
  background: var(--sf-panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
}
.sf-edit-meta strong {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sf-muted);
  margin-bottom: 0.2rem;
  font-weight: 700;
}
.sf-edit-meta-form label {
  display: grid;
  gap: 0.35rem;
}
.sf-edit-meta-form input,
.sf-edit-meta-form select,
.sf-edit-meta-form textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  font: inherit;
  font-weight: 500;
  color: var(--sf-text);
  background: var(--sf-panel-solid);
  transition: border-color 160ms var(--sf-ease), box-shadow 160ms var(--sf-ease);
}
.sf-edit-meta-form textarea {
  min-height: 7.5rem;
  resize: vertical;
  line-height: 1.45;
}
.sf-edit-meta-form input:focus,
.sf-edit-meta-form select:focus,
.sf-edit-meta-form textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-edit-meta-form input.sf-input-readonly {
  background: #f3f5f4;
  color: var(--sf-muted);
  cursor: default;
}
.sf-edit-meta-form input.sf-input-readonly:focus {
  border-color: var(--sf-line);
  box-shadow: none;
}
.sf-edit-meta-form .sf-span-2 {
  grid-column: 1 / -1;
}
.sf-edit-lines {
  margin-bottom: 1rem;
  width: 100%;
}
.sf-edit-lines.sf-table-wrap {
  overflow-x: auto;
  padding: 0.35rem;
}
.sf-edit-table {
  width: max(100%, 1360px);
  min-width: 1360px;
  table-layout: auto;
  border-collapse: collapse;
}
#sf-credit-note-lines {
  min-width: 1480px;
}
.sf-edit-table th,
.sf-edit-table td {
  vertical-align: middle;
  box-sizing: border-box;
}
.sf-edit-table th.num,
.sf-edit-table td.num {
  min-width: 0;
}
.sf-edit-table .col-item {
  width: 14%;
  min-width: 12rem;
}

.sf-item-combo {
  position: relative;
  width: 100%;
  min-width: 0;
}
.sf-item-combo-select {
  display: none !important;
}
.sf-item-combo-input {
  width: 100%;
  min-height: 2.45rem;
  padding-right: 2.1rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #5f746c 50%),
    linear-gradient(135deg, #5f746c 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.sf-item-combo.is-open .sf-item-combo-input {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-item-combo-panel {
  position: fixed;
  z-index: 80;
  overflow: auto;
  padding: 0.28rem;
  background: var(--sf-panel-solid, #fff);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  box-shadow: 0 12px 32px rgba(16, 36, 31, 0.14);
}
.sf-item-combo-option {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-weight: 500;
  color: var(--sf-text);
  background: transparent;
  border: 0;
  border-radius: 0.35rem;
  padding: 0.45rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-item-combo-option:hover,
.sf-item-combo-option.is-active {
  background: rgba(15, 118, 110, 0.1);
}
.sf-item-combo-option.is-selected {
  font-weight: 650;
}
.sf-item-combo-empty {
  padding: 0.55rem 0.65rem;
  color: var(--sf-muted);
  font-size: 0.9rem;
}
.sf-edit-table .col-description {
  width: 28%;
  min-width: 18rem;
  max-width: none;
}
.sf-edit-table td.col-description,
.sf-edit-table th.col-description {
  max-width: none;
  min-width: 18rem;
  white-space: normal;
  vertical-align: top;
}
.sf-edit-table td.col-description textarea {
  min-width: 16rem;
}
.sf-edit-table th.col-description {
  vertical-align: middle;
}
.sf-edit-table select,
.sf-edit-table input,
.sf-edit-table textarea {
  width: 100%;
  font: inherit;
  font-weight: 500;
  color: var(--sf-text);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  padding: 0.55rem 0.65rem;
  background: var(--sf-panel-solid);
  transition: border-color 160ms var(--sf-ease), box-shadow 160ms var(--sf-ease);
}
.sf-edit-table select:focus,
.sf-edit-table input:focus,
.sf-edit-table textarea:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-edit-table textarea {
  min-width: 0;
  min-height: 4.5rem;
  resize: vertical;
  line-height: 1.4;
}
.sf-edit-table .col-handle {
  color: var(--sf-muted);
  width: 2rem;
  opacity: 0.7;
  text-align: center;
}
.sf-edit-table .col-keep {
  width: 3.25rem;
  text-align: center;
  vertical-align: middle;
}
.sf-edit-table .sf-line-keep {
  display: inline-flex;
  justify-content: center;
  margin: 0;
}
.sf-logs-reload {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.75rem 0 0.25rem;
}
.sf-logs-call-out {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.5rem 0 0.25rem;
}
.sf-edit-table .col-qty {
  width: 5.25rem;
}
.sf-edit-table .col-unit-price {
  width: 10.75rem;
}
.sf-edit-table .col-cost-price {
  width: 10.75rem;
}
.sf-edit-table .col-profit {
  width: 7.5rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sf-edit-table td.col-profit [data-sf-line-profit],
.sf-edit-table td.col-profit [data-sf-line-markup-pct],
.sf-edit-totals [data-sf-profit-total],
.sf-table td.col-profit,
.sf-table th.col-profit,
.sf-income-kpi-value.col-profit {
  color: #067647;
  font-weight: 650;
}
.sf-edit-table tr.is-low-margin td.col-cost-price input {
  color: #b42318;
  font-weight: 650;
}
.sf-edit-table tr.is-low-margin td.col-cost-price .sf-currency-tag {
  color: #b42318;
}
.sf-edit-table tr.is-low-margin td.col-profit [data-sf-line-profit],
.sf-edit-table tr.is-low-margin td.col-profit [data-sf-line-markup-pct],
.sf-table td.col-profit.is-loss,
.sf-table th.col-profit.is-loss,
.sf-income-kpi-value.col-profit.is-loss {
  color: #b42318;
  font-weight: 650;
}
.sf-edit-table .sf-line-profit-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.15;
}
.sf-edit-table [data-sf-line-markup-pct] {
  font-size: 0.78em;
  font-weight: 600;
  opacity: 0.85;
}
.sf-edit-table [data-sf-line-markup-pct][hidden] {
  display: none;
}
.sf-edit-table .col-markup {
  width: 7.5rem;
}
.sf-edit-table .col-tax {
  width: 9.5rem;
}
.sf-edit-table .col-line-total {
  width: 6.25rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.sf-edit-table .col-actions {
  width: 7.5rem;
  text-align: right;
  white-space: nowrap;
}
.sf-edit-table th.col-qty,
.sf-edit-table td.col-qty,
.sf-edit-table th.col-unit-price,
.sf-edit-table td.col-unit-price,
.sf-edit-table th.col-cost-price,
.sf-edit-table td.col-cost-price,
.sf-edit-table th.col-profit,
.sf-edit-table td.col-profit,
.sf-edit-table th.col-markup,
.sf-edit-table td.col-markup,
.sf-edit-table th.col-line-total,
.sf-edit-table td.col-line-total {
  text-align: right;
}
/* Sit headers over the numeric control, not the currency / mode suffix */
.sf-edit-table th.col-unit-price,
.sf-edit-table th.col-cost-price {
  padding-right: 2.85rem;
}
.sf-edit-table th.col-markup {
  padding-right: 2.85rem;
}
.sf-edit-table th.col-qty,
.sf-edit-table th.col-line-total,
.sf-edit-table td.col-qty,
.sf-edit-table td.col-line-total {
  padding-inline: 0.65rem;
}
.sf-edit-table td.col-line-total [data-sf-line-total] {
  display: block;
  width: 100%;
  text-align: right;
  line-height: 1;
  padding: 0.55rem 0;
  font-variant-numeric: tabular-nums;
}
.sf-edit-table td.col-actions {
  padding-inline: 0.35rem 0.5rem;
}
.sf-edit-table td.col-actions .sf-btn {
  margin: 0;
  vertical-align: middle;
}
.sf-line-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
.sf-line-tool {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: transform 120ms var(--sf-ease), box-shadow 120ms var(--sf-ease), background 120ms var(--sf-ease);
}
.sf-line-tool:hover {
  transform: translateY(-1px);
}
.sf-line-tool:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}
.sf-line-drag {
  background: var(--sf-panel-solid);
  border-color: var(--sf-line);
  color: var(--sf-muted);
  cursor: grab;
}
.sf-line-drag:active { cursor: grabbing; }
.sf-line-drag-icon {
  display: block;
  width: 0.85rem;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -4px 0 currentColor, 0 4px 0 currentColor;
}
.sf-line-add {
  background: #1f8f5f;
  color: #fff;
}
.sf-line-add:hover { background: #187a50; }
.sf-line-remove {
  background: #c0392b;
  color: #fff;
}
.sf-line-remove:hover { background: #a93226; }
.sf-edit-table tr.sf-line-dragging {
  opacity: 0.55;
  background: rgba(15, 118, 110, 0.06);
}
.sf-edit-table tr.sf-line-drag-over {
  box-shadow: inset 0 2px 0 rgba(15, 118, 110, 0.45);
}
.sf-money-input {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  width: 100%;
  min-width: 0;
}
.sf-money-input input {
  width: 100%;
  min-width: 0;
  text-align: right;
  padding-inline: 0.45rem;
  font-variant-numeric: tabular-nums;
}
.sf-edit-table .col-unit-price .sf-money-input input {
  min-width: 5.5rem;
}
.sf-markup-input {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;
}
.sf-markup-input input {
  width: 100%;
  min-width: 0;
  text-align: right;
  padding-inline: 0.4rem;
  font-variant-numeric: tabular-nums;
}
.sf-markup-mode {
  flex: 0 0 auto;
  min-width: 2.35rem;
  height: 2.15rem;
  padding: 0 0.35rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  color: var(--sf-muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  line-height: 1;
}
.sf-markup-mode:hover {
  background: #e4e9e7;
  color: var(--sf-text);
}
.sf-markup-mode:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-markup-mode:disabled {
  opacity: 0.65;
  cursor: default;
}
.sf-currency-tag { color: var(--sf-muted); font-size: 0.78rem; font-weight: 650; flex: 0 0 auto; }

.sf-edit-totals {
  display: grid;
  justify-content: end;
  gap: 0.5rem;
  margin: 1rem 0 1.25rem;
  min-width: 320px;
  width: min(420px, 100%);
  margin-left: auto;
  padding: 1.1rem 1.25rem;
  background: var(--sf-panel);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
}
.sf-edit-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 2.5rem;
  color: var(--sf-muted);
}
.sf-edit-totals strong { color: var(--sf-text); font-variant-numeric: tabular-nums; }
.sf-edit-grand {
  font-size: 1.1rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--sf-line);
}
.sf-edit-grand span,
.sf-edit-grand strong {
  color: var(--sf-text);
  font-family: var(--sf-display);
}

.sf-edit-options {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0;
  max-width: 420px;
  padding: 1.1rem 1.2rem;
  background: var(--sf-panel);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
}
.sf-edit-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}
.sf-custom-title {
  margin: 0.25rem 0 0.5rem 1.45rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sf-line);
  border-radius: 7px;
  width: min(320px, 100%);
  background: var(--sf-panel-solid);
}

.sf-edit-card {
  background: var(--sf-panel);
  backdrop-filter: blur(8px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  padding: 1.35rem 1.45rem;
  margin: 1rem 0;
  width: 100%;
}
.sf-edit-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--sf-display);
  font-size: 1rem;
  letter-spacing: -0.02em;
}
#sf-quote-project.sf-edit-card {
  padding: 1.75rem 1.75rem 1.9rem;
}
#sf-quote-project.sf-edit-card h2 {
  margin: 0 0 1.15rem;
}
.sf-quote-project-prompt {
  border-color: #2f6f4e;
  box-shadow: 0 0 0 2px rgba(47, 111, 78, 0.18);
}
.sf-quote-project-lead {
  margin: 0 0 1.5rem;
  max-width: 42rem;
  color: var(--sf-muted, #4b5563);
  line-height: 1.55;
}
.sf-quote-project-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}
.sf-quote-project-field {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 36rem;
}
.sf-quote-project-field strong {
  display: block;
}
.sf-quote-project-form select {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0.7rem 2.6rem 0.7rem 0.9rem;
  border: 1px solid var(--sf-line);
  border-radius: 10px;
  font: inherit;
  font-weight: 550;
  color: var(--sf-text);
  box-shadow: 0 1px 2px rgba(20, 32, 28, 0.04);
  transition: border-color 160ms var(--sf-ease), box-shadow 160ms var(--sf-ease);
}
.sf-quote-project-form select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-quote-project-unit {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.sf-quote-project-unit legend {
  font-weight: 650;
  padding: 0;
  float: none;
  width: auto;
}
.sf-quote-project-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.75rem;
  align-items: center;
}
.sf-quote-project-radios label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.sf-quote-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  padding-top: 0.35rem;
}
.sf-quote-project-error {
  margin: 1rem 0 0;
  color: #b42318;
}
.sf-notes-label {
  display: block;
  font-weight: 650;
  margin-bottom: 0.4rem;
}
.sf-notes {
  width: 100%;
  min-height: 180px;
  font: inherit;
  padding: 0.8rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  resize: vertical;
}

/* Saved note picker */
.sf-note-picker {
  position: relative;
  margin: 0 0 1rem;
  max-width: 34rem;
}
.sf-note-picker-trigger {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--sf-line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 248, 0.95));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset, 0 8px 20px rgba(16, 36, 31, 0.04);
  color: var(--sf-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms var(--sf-ease),
    box-shadow 180ms var(--sf-ease),
    transform 160ms var(--sf-ease);
}
.sf-note-picker-trigger:hover {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 10px 24px rgba(16, 36, 31, 0.07);
}
.sf-note-picker.is-open .sf-note-picker-trigger {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-note-picker-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 11px;
  background: rgba(15, 118, 110, 0.1);
  color: var(--sf-primary);
  flex: 0 0 auto;
}
.sf-note-picker-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
}
.sf-note-picker-kicker {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-note-picker-value {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-note-picker-chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--sf-muted);
  border-bottom: 2px solid var(--sf-muted);
  transform: rotate(45deg);
  margin: 0 0.2rem 0.25rem 0;
  transition: transform 180ms var(--sf-ease);
  flex: 0 0 auto;
}
.sf-note-picker.is-open .sf-note-picker-chevron {
  transform: rotate(225deg);
  margin-bottom: 0;
  margin-top: 0.25rem;
}
.sf-note-picker-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sf-line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(16, 36, 31, 0.14);
  overflow: hidden;
  animation: sf-note-picker-in 160ms var(--sf-ease);
}
body > .sf-note-picker-panel {
  z-index: 20000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body > .sf-note-picker-panel .sf-note-picker-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@keyframes sf-note-picker-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.sf-note-picker-search-wrap {
  padding: 0.75rem 0.75rem 0.35rem;
}
.sf-note-picker-search {
  width: 100%;
  border: 1px solid var(--sf-line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font: inherit;
  background: var(--sf-panel-solid);
}
.sf-note-picker-search:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  background: var(--sf-panel-solid);
}
.sf-note-picker-list {
  max-height: 18rem;
  overflow: auto;
  padding: 0.35rem 0.45rem 0.65rem;
}
.sf-note-picker-option {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 140ms var(--sf-ease);
}
.sf-note-picker-option:hover,
.sf-note-picker-option.is-active {
  background: rgba(15, 118, 110, 0.08);
}
.sf-note-picker-option-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.sf-note-picker-option-name {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sf-note-picker-badge {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--sf-primary);
  background: rgba(15, 118, 110, 0.12);
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
}
.sf-note-picker-option-preview {
  color: var(--sf-muted);
  font-size: 0.86rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
}
.sf-note-picker-empty {
  margin: 0;
  padding: 0.85rem 1rem 1.1rem;
  color: var(--sf-muted);
  font-size: 0.9rem;
}
.sf-file-box {
  border: 1px dashed rgba(15, 118, 110, 0.28);
  border-radius: var(--sf-radius-sm);
  padding: 0.85rem;
  background: rgba(15, 118, 110, 0.03);
}
.sf-edit-actions {
  margin: 1.15rem 0 2.5rem;
  max-width: none;
  width: 100%;
}
.sf-btn-update {
  background: var(--sf-paid);
  border-color: transparent;
  color: #fff;
}
.sf-btn-update:hover:not(:disabled) {
  filter: brightness(0.94);
  color: #fff;
  border-color: transparent;
}
.sf-btn-convert {
  background: var(--sf-primary);
  border-color: transparent;
  color: #fff;
}
.sf-btn-convert:hover:not(:disabled) {
  filter: brightness(0.94);
  color: #fff;
  border-color: transparent;
}
.sf-btn-delete {
  background: var(--sf-overdue);
  border-color: transparent;
  color: #fff;
}
.sf-btn-delete:hover:not(:disabled) {
  filter: brightness(0.94);
  color: #fff;
  border-color: transparent;
}

.sf-coa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.sf-coa-panel {
  background: var(--sf-panel);
  backdrop-filter: blur(10px);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  padding: 0.85rem 0.95rem 1.1rem;
  box-shadow: 0 10px 30px rgba(16, 36, 31, 0.04);
}
.sf-coa-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--sf-line);
}
.sf-coa-panel-head h2 {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 1rem;
  font-weight: 650;
  color: var(--sf-muted);
  letter-spacing: -0.02em;
}
.sf-coa-panel-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Reports hub */
.sf-reports-hero {
  margin: 0 0 1.5rem;
  padding: 1.35rem 1.4rem 1.45rem;
  border-radius: calc(var(--sf-radius) + 4px);
  border: 1px solid rgba(15, 118, 110, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(232, 244, 240, 0.88) 55%, rgba(236, 242, 248, 0.9) 100%);
  box-shadow: 0 10px 28px rgba(16, 36, 31, 0.05);
  animation: sf-fade-up 420ms var(--sf-ease) both;
}
.sf-reports-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sf-primary);
}
.sf-reports-hero h1 {
  margin: 0;
  font-family: var(--sf-display);
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--sf-text);
  line-height: 1.15;
}
.sf-reports-lead {
  margin: 0.55rem 0 0;
  max-width: 34rem;
  color: var(--sf-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.sf-reports-section {
  animation: sf-fade-up 520ms var(--sf-ease) both;
  animation-delay: 60ms;
}
.sf-reports-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.85rem;
}
.sf-reports-section-head h2 {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.95rem;
  align-items: stretch;
}
.sf-report-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.95rem;
  padding: 1.05rem 1.1rem;
  border-radius: var(--sf-radius);
  border: 1px solid var(--sf-line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(16, 36, 31, 0.04);
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms var(--sf-ease),
    border-color 180ms var(--sf-ease),
    box-shadow 180ms var(--sf-ease),
    background 180ms var(--sf-ease);
}
.sf-report-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--sf-panel-solid);
  box-shadow: 0 14px 30px rgba(16, 36, 31, 0.08);
  color: inherit;
}
.sf-report-card:focus-visible {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}
.sf-report-card-icon {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(15, 118, 110, 0.12), rgba(15, 118, 110, 0.04));
  color: var(--sf-primary);
  flex: 0 0 auto;
}
.sf-report-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.sf-report-card-body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}
.sf-report-card-title {
  font-family: var(--sf-display);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--sf-text);
}
.sf-report-card-meta {
  color: var(--sf-muted);
  font-size: 0.84rem;
  line-height: 1.4;
}
.sf-report-card-arrow {
  color: var(--sf-primary);
  font-size: 1.05rem;
  font-weight: 600;
  opacity: 0.55;
  transition: transform 180ms var(--sf-ease), opacity 180ms var(--sf-ease);
}
.sf-report-card:hover .sf-report-card-arrow {
  opacity: 1;
  transform: translateX(3px);
}

/* Legacy nested list (kept for any leftover markup) */
.sf-report-group {
  background: var(--sf-panel-solid);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(16, 36, 31, 0.04);
}
.sf-report-group-head {
  margin: 0;
  padding: 0.75rem 1rem;
  background: rgba(238, 243, 241, 0.9);
  color: var(--sf-muted);
  font-weight: 650;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--sf-line);
}
.sf-report-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-report-links li {
  border-bottom: 1px solid var(--sf-line);
}
.sf-report-links li:last-child {
  border-bottom: 0;
}
.sf-report-links a {
  display: block;
  padding: 0.85rem 1rem;
  color: var(--sf-link);
  font-weight: 600;
}
.sf-report-links a:hover {
  background: rgba(15, 118, 110, 0.05);
  color: var(--sf-primary-hover);
}
.sf-report-links a.is-disabled {
  color: #9aa6b2;
  pointer-events: none;
  cursor: default;
}
.sf-report-hint {
  display: block;
  margin-top: 0.2rem;
  color: var(--sf-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

@media (max-width: 640px) {
  .sf-reports-hero {
    padding: 1.1rem 1rem 1.2rem;
  }
  .sf-report-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .sf-report-card-arrow {
    display: none;
  }
}

/* Income by client */
.sf-income-toolbar {
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}
.sf-income-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.sf-income-views .sf-btn.is-active {
  background: var(--sf-primary);
  border-color: transparent;
  color: #fff;
}
.sf-income-views .sf-btn.is-active:hover:not(:disabled) {
  background: var(--sf-primary-hover);
  color: #fff;
}
.sf-reports-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.sf-reports-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  color: var(--sf-muted);
  font-size: 0.9rem;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.65);
  transition: color 140ms var(--sf-ease), background 140ms var(--sf-ease), border-color 140ms var(--sf-ease);
}
.sf-reports-tab:hover {
  color: var(--sf-text);
  border-color: rgba(15, 118, 110, 0.35);
  text-decoration: none;
}
.sf-reports-tab.is-active {
  color: #fff;
  background: var(--sf-primary);
  border-color: var(--sf-primary);
}
.sf-cat-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  min-width: 11rem;
  max-width: 18rem;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.32rem 1.85rem 0.32rem 0.5rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background-color: var(--sf-panel-solid);
  color: var(--sf-text);
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, #5f746c 50%),
    linear-gradient(135deg, #5f746c 50%, transparent 50%);
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.sf-cat-select.is-uncategorised {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
}
.sf-cat-select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}
.sf-expenses-form .sf-reports-section {
  margin-top: 1.25rem;
}
.sf-expenses-table input[type="text"] {
  width: 100%;
  min-width: 0;
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  color: var(--sf-text);
}
.sf-expenses-table td.num input {
  text-align: right;
  max-width: 9rem;
  margin-left: auto;
  display: block;
}
.sf-income-kpi-value.is-loss {
  color: #b42318;
  font-weight: 650;
}
.sf-income-month-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.sf-stmt-date-form input[type="month"],
.sf-stmt-date-form input[type="number"] {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
}
.sf-stmt-date-form input[type="number"] {
  width: 5.6rem;
}
.sf-income-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}
.sf-income-kpi {
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  background: var(--sf-panel-solid);
  box-shadow: 0 8px 22px rgba(16, 36, 31, 0.04);
}
.sf-income-kpi-label {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-income-kpi-value {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--sf-text);
}
.sf-income-charts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0.95rem;
  margin: 0 0 1.35rem;
}
.sf-income-chart-card {
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  background: var(--sf-panel-solid);
  box-shadow: 0 8px 22px rgba(16, 36, 31, 0.04);
}
.sf-income-chart-card h2 {
  margin: 0 0 0.75rem;
  font-family: var(--sf-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-income-chart-wrap {
  position: relative;
}
.sf-income-chart-wrap--pie { height: 16.5rem; }
.sf-income-chart-wrap--bar { height: 16.5rem; }
.sf-income-statements {
  margin-top: 3.25rem;
  padding-top: 1.75rem;
}
.sf-income-table tfoot th {
  font-weight: 700;
}
@media (max-width: 900px) {
  .sf-income-charts {
    grid-template-columns: 1fr;
  }
}

/* Unpaid customer statements */
.sf-stmt-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sf-stmt-list-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-width: 0;
}
.sf-stmt-list-title h1 {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.sf-stmt-help {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  border: 1px solid #c5ccd4;
  color: #7a8694;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
}
.sf-stmt-date-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.sf-stmt-date-form input[type="date"] {
  font: inherit;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
}
.sf-stmt-eye {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid #9aa6b2;
  border-radius: 50%;
  position: relative;
  vertical-align: middle;
}
.sf-stmt-eye::after {
  content: "";
  position: absolute;
  inset: 0.22rem;
  border-radius: 50%;
  background: #9aa6b2;
}
.sf-stmt-table .num { text-align: center; }
.sf-stmt-table td.num:last-child,
.sf-stmt-table th.num:last-child { text-align: right; }
.sf-stmt-table .is-nowrap {
  white-space: nowrap;
  width: 1%;
}
.sf-stmt-date-label {
  color: var(--sf-muted);
  font-size: 0.88rem;
  font-weight: 550;
}

/* Customer details report */
.sf-report-detail-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sf-report-customer-card {
  background: var(--sf-panel);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 8px 22px rgba(16, 36, 31, 0.04);
}
.sf-report-customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.95rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--sf-line);
}
.sf-report-customer-head h2 {
  margin: 0;
  font-family: var(--sf-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.sf-report-meta {
  margin: 0.2rem 0 0;
  color: var(--sf-muted);
  font-size: 0.86rem;
}
.sf-report-customer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}
.sf-report-customer-grid .sf-span-all {
  grid-column: 1 / -1;
}
.sf-report-customer-grid h3 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-report-dl {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}
.sf-report-dl > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.4rem;
}
.sf-report-dl dt {
  margin: 0;
  color: var(--sf-muted);
  font-weight: 550;
}
.sf-report-dl dd {
  margin: 0;
  font-weight: 550;
  word-break: break-word;
}
.sf-report-address {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  color: var(--sf-text);
  line-height: 1.4;
}
@media (max-width: 900px) {
  .sf-report-customer-grid {
    grid-template-columns: 1fr;
  }
  .sf-report-dl > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}
@media print {
  .sf-report-customer-card {
    break-inside: avoid;
    box-shadow: none;
    border-color: #ccc;
  }
  .sf-report-customer-head .sf-btn {
    display: none !important;
  }
}

.sf-coa-group { margin-bottom: 0.85rem; }
.sf-coa-group-title {
  font-weight: 750;
  color: var(--sf-text);
  margin: 0.35rem 0 0.35rem;
  font-size: 0.95rem;
}
.sf-coa-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sf-coa-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0.15rem;
  border-radius: var(--sf-radius-sm);
}
.sf-coa-row:hover { background: rgba(15, 118, 110, 0.05); }
.sf-coa-edit-placeholder { width: 3.2rem; }
.sf-coa-name { color: var(--sf-text); font-weight: 500; }
.sf-coa-code {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--sf-muted);
  font-size: 0.78rem;
  font-weight: 650;
}
.sf-coa-reorder { color: #9aaba4; font-size: 0.85rem; }
.sf-coa-empty {
  color: var(--sf-muted);
  padding: 0.35rem 0.15rem 0.55rem 3.9rem;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .sf-shell { flex-direction: column; }
  .sf-sidebar {
    width: 100%;
    flex-basis: auto;
    height: auto;
    position: relative;
  }
  .sf-sidebar-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
  }
  .sf-sidebar-theme-toggle {
    width: auto;
  }
  .sf-nav { flex-direction: row; flex-wrap: wrap; gap: 0.35rem; }
  .sf-nav-section { width: 100%; margin-top: 0.5rem; }
  .sf-settings-grid { grid-template-columns: 1fr; }
  .sf-coa-grid { grid-template-columns: 1fr; }
  .sf-edit-meta { grid-template-columns: 1fr; }
  .sf-search input { min-width: 140px; }
  .sf-main { padding: 1rem; }
}

/* ---- Mobile-friendly lists & toolbars ---- */
.sf-list-cards {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
}

.sf-list-card {
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  background: var(--sf-panel);
  padding: 0.85rem 0.95rem;
}

.sf-list-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.sf-list-card-title {
  font-weight: 650;
  word-break: break-word;
}

.sf-list-card-meta {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--sf-muted);
  word-break: break-word;
}

.sf-list-card-amounts {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.86rem;
}

.sf-list-card-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.sf-list-card-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  color: var(--sf-muted);
}

@media (max-width: 720px) {
  .sf-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sf-search {
    width: 100%;
    flex-wrap: wrap;
  }

  .sf-search input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0 !important;
  }

  .sf-toolbar-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sf-toolbar-actions .sf-btn,
  .sf-toolbar-actions .sf-btn-primary {
    flex: 1 1 auto;
  }

  .sf-table-wrap.sf-hide-mobile {
    display: none;
  }

  .sf-list-cards {
    display: flex;
  }

  .sf-recurring-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .sf-recurring-bulk-actions .sf-btn {
    flex: 1 1 auto;
    font-size: 0.82rem;
    padding: 0.45rem 0.65rem;
  }

  .sf-edit-totals {
    min-width: 0;
    width: 100%;
    margin-left: 0;
  }

  .sf-table td,
  .sf-table th {
    white-space: normal;
  }

  .sf-table {
    width: 100%;
  }

  .sf-nav-link {
    font-size: 0.82rem;
    padding: 0.35rem 0.55rem;
  }

  .sf-brand-text {
    font-size: 0.95rem;
  }

  .sf-topbar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .sf-main {
    padding: 0.75rem;
    padding-bottom: 4.5rem;
  }

  /* Line editor: one labeled card per row so columns stay readable on phones */
  .sf-edit-lines.sf-table-wrap {
    overflow: visible;
    padding: 0;
  }
  .sf-edit-table,
  #sf-credit-note-lines {
    display: block;
    width: 100%;
    min-width: 0 !important;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
  }
  .sf-edit-table thead {
    display: none;
  }
  .sf-edit-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .sf-edit-table tr.sf-line-row {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.75rem 0.85rem 0.85rem;
    border: 1px solid var(--sf-line);
    border-radius: var(--sf-radius);
    background: var(--sf-panel-solid);
  }
  .sf-edit-table td {
    display: grid;
    grid-template-columns: 6.75rem minmax(0, 1fr);
    align-items: center;
    gap: 0.45rem 0.65rem;
    width: 100%;
    max-width: none;
    padding: 0.4rem 0 !important;
    border: 0;
    text-align: left !important;
    white-space: normal;
    vertical-align: middle;
  }
  .sf-edit-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sf-muted);
    line-height: 1.2;
  }
  .sf-edit-table td.col-item::before { content: "Item"; }
  .sf-edit-table td.col-description::before { content: "Description"; }
  .sf-edit-table td.col-keep::before { content: "Keep"; }
  .sf-edit-table td.col-qty::before { content: "Qty"; }
  .sf-edit-table td.col-unit-price::before { content: "Unit price"; }
  .sf-edit-table td.col-cost-price::before { content: "Cost price"; }
  .sf-edit-table td.col-profit::before { content: "Profit"; }
  .sf-edit-table td.col-markup::before { content: "Markup"; }
  .sf-edit-table td.col-tax::before { content: "Tax"; }
  .sf-edit-table td.col-line-total::before { content: "Total"; }
  .sf-edit-table td.col-description {
    align-items: start;
  }
  .sf-edit-table td.col-keep {
    justify-items: start;
  }
  .sf-edit-table td.col-profit,
  .sf-edit-table td.col-line-total {
    white-space: normal;
  }
  .sf-edit-table .sf-line-profit-wrap {
    align-items: flex-start;
  }
  .sf-edit-table td.col-line-total [data-sf-line-total] {
    text-align: left;
    padding: 0.2rem 0;
  }
  .sf-edit-table td.col-actions {
    display: flex;
    justify-content: flex-end;
    grid-template-columns: none;
    padding-top: 0.65rem !important;
    border-top: 1px solid var(--sf-line);
    margin-top: 0.35rem;
  }
  .sf-edit-table td.col-actions::before {
    display: none;
  }
  .sf-edit-table select,
  .sf-edit-table input,
  .sf-edit-table textarea,
  .sf-edit-table .sf-money-input,
  .sf-edit-table .sf-markup-input {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  .sf-edit-table textarea {
    min-height: 3.6rem;
    min-width: 0;
  }
  .sf-edit-table .col-item,
  .sf-edit-table .col-description,
  .sf-edit-table .col-qty,
  .sf-edit-table .col-unit-price,
  .sf-edit-table .col-cost-price,
  .sf-edit-table .col-profit,
  .sf-edit-table .col-markup,
  .sf-edit-table .col-tax,
  .sf-edit-table .col-line-total,
  .sf-edit-table .col-actions,
  .sf-edit-table .col-keep {
    width: auto;
  }
  .sf-form-actions.sf-edit-actions {
    gap: 0.5rem;
  }
  .sf-form-actions.sf-edit-actions .sf-btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
    text-align: center;
  }
  .sf-recurring-outlook-bar {
    flex-wrap: wrap;
  }
  .sf-reminder-email-row {
    flex-wrap: wrap;
  }
  .sf-logs-list .sf-check strong {
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .sf-banner {
    font-size: 1.05rem;
    padding: 0.65rem 0.85rem;
  }

  .sf-list-card-actions .sf-btn {
    flex: 1 1 calc(50% - 0.4rem);
    justify-content: center;
  }

  .sf-edit-table td {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sf-form-actions.sf-edit-actions .sf-btn {
    flex: 1 1 100%;
  }
}

/* Confirm modal */
body.sf-modal-open { overflow: hidden; }

.sf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.sf-modal[hidden] { display: none; }

.sf-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 36, 31, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: sf-modal-fade-in 180ms var(--sf-ease);
}

.sf-modal-dialog {
  position: relative;
  width: min(100%, 26rem);
  padding: 1.35rem 1.35rem 1.15rem;
  border-radius: calc(var(--sf-radius) + 2px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 249, 0.96));
  box-shadow:
    0 24px 60px rgba(16, 36, 31, 0.18),
    0 2px 8px rgba(16, 36, 31, 0.06);
  animation: sf-modal-slide-in 220ms var(--sf-ease);
}

.sf-modal-title {
  margin: 0 0 0.55rem;
  font-family: var(--sf-display);
  font-size: 1.12rem;
  font-weight: 650;
  color: var(--sf-text);
}

.sf-modal-message {
  margin: 0 0 1.25rem;
  color: var(--sf-muted);
  line-height: 1.55;
}

.sf-modal-extra {
  margin: -0.35rem 0 1.15rem;
}
.sf-paid-prompt {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
}
.sf-draft-prompt {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  display: grid;
  gap: 0.55rem;
}
.sf-draft-prompt-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-draft-prompt-note {
  margin: 0;
  font-size: 0.92rem;
  color: var(--sf-text);
  line-height: 1.45;
}
.sf-draft-template-select {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-bg);
  color: var(--sf-text);
  font: inherit;
}
.sf-paid-prompt-legend {
  padding: 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sf-muted);
}
.sf-paid-option {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  color: var(--sf-text);
  cursor: pointer;
}
.sf-paid-option input {
  margin-top: 0.2rem;
}
.sf-paid-amount-wrap {
  margin: 0.65rem 0 0 1.55rem;
}
.sf-paid-amount-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.sf-paid-amount-input {
  width: 100%;
  max-width: 12rem;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
}
.sf-paid-error {
  margin: 0.4rem 0 0;
  color: var(--sf-overdue);
  font-size: 0.85rem;
  font-weight: 600;
}

.sf-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.sf-modal-ok { min-width: 6.5rem; }

.sf-themes-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}
.sf-themes-table .col-actions {
  width: 1%;
  white-space: nowrap;
}
.sf-themes-table .col-actions .sf-inline-action {
  display: inline;
}
.sf-themes-table .col-actions .sf-btn,
.sf-themes-table .col-actions .sf-theme-status {
  margin-right: 0.35rem;
  vertical-align: middle;
}
.sf-theme-status {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: var(--sf-radius-sm);
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.sf-themes-table tr.sf-theme-active td {
  background: rgba(15, 118, 110, 0.04);
}
.sf-table-count {
  display: inline-block;
  margin: 0.75rem 0 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  color: var(--sf-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.9rem;
}
.sf-theme-form {
  max-width: none;
  width: 100%;
}
.sf-theme-html-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sf-theme-html-label .sf-note {
  margin: 0;
}
.sf-code-editor {
  width: 100%;
  min-height: 28rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
  resize: vertical;
  background: #0f1413;
  color: #e8f0ec;
  border: 1px solid #1d2a27;
  border-radius: var(--sf-radius-sm);
  padding: 0.9rem 1rem;
}
.sf-code-editor:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.22);
}

.sf-doc-toolbar {
  align-items: center;
}
.sf-doc-theme-meta {
  margin: 0;
  color: var(--sf-muted);
  font-size: 0.9rem;
}

/* Standalone invoice HTML viewer (View) */
body.sf-doc-viewer {
  margin: 0;
  background: #e8ece9;
  min-height: 100vh;
}
.sf-doc-viewer-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--sf-line);
  backdrop-filter: blur(8px);
}
.sf-doc-viewer-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.sf-doc-viewer-page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 1.25rem auto 2.5rem;
  background: var(--sf-panel-solid);
  border: 1px solid var(--sf-line);
  box-shadow: 0 10px 30px rgba(20, 40, 30, 0.08);
  padding: 12mm 14mm;
  box-sizing: border-box;
}
.sf-doc-viewer-page .sf-doc-sheet {
  max-width: none;
  width: 100%;
  margin: 0;
}

.sf-business-form {
  max-width: 40rem;
}
.sf-business-logo-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.sf-business-logo-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sf-business-logo-preview {
  width: 9rem;
  height: 9rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: var(--sf-panel-solid);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.sf-business-logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.sf-business-logo-empty {
  color: var(--sf-muted);
  font-size: 0.85rem;
}
.sf-business-logo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 14rem;
}
.sf-business-logo-controls input[type="file"] {
  font: inherit;
  font-size: 0.88rem;
}
.sf-business-extra {
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius-sm);
  background: #fbfcfb;
}
.sf-business-extra summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--sf-text);
}
.sf-business-extra label {
  margin-top: 0.75rem;
}
.sf-doc-stage {
  background: var(--sf-panel-solid);
  border: 1px solid var(--sf-line);
  border-radius: var(--sf-radius);
  padding: 1.5rem 1.25rem 2rem;
  overflow-x: auto;
}
.sf-doc-stage table {
  width: 100%;
  border-collapse: collapse;
}

.sf-doc-view-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  justify-content: flex-start;
  margin: 0 0 0.85rem;
}
.sf-doc-view-toolbar .sf-doc-theme-meta {
  margin: 0;
  line-height: 1.2;
}
.sf-doc-page {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 0 auto;
  background: var(--sf-panel-solid);
  border: 1px solid var(--sf-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(20, 40, 30, 0.06);
  padding: 12mm 14mm;
  box-sizing: border-box;
  overflow-x: hidden;
  position: relative;
}
.sf-doc-stamp {
  position: absolute;
  top: 5.25rem;
  right: 1.25rem;
  z-index: 6;
  pointer-events: none;
  transform: rotate(-22deg);
  border: 3px solid currentColor;
  border-radius: 0.4rem;
  padding: 0.4rem 0.95rem;
  font-family: Sora, Manrope, Impact, sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0.88;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  box-shadow: inset 0 0 0 1px currentColor;
}
.sf-doc-stamp--paid {
  color: #15803d;
  background: rgba(21, 128, 61, 0.08);
}
.sf-doc-stamp--overdue {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}

.sf-doc-sheet {
  width: 100%;
  max-width: none;
  margin: 0;
  color: #1a1a1a;
  font-size: 0.9rem;
  line-height: 1.45;
  font-family: Manrope, "Segoe UI", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
}
.sf-doc-sheet--manager .sf-doc-header {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.15rem;
}
.sf-doc-sheet--manager .sf-doc-title {
  margin: 1.85rem 0 0;
  font-family: Manrope, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  width: auto;
  padding: 0;
}
.sf-doc-sheet--manager .sf-doc-logo {
  text-align: right;
  width: auto;
  max-width: none;
  padding-left: 12%;
  box-sizing: border-box;
}
.sf-doc-sheet--manager .sf-doc-logo img {
  display: block;
  margin-left: auto;
  height: auto;
  max-height: 7.6rem;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}
.sf-doc-brand {
  display: inline-block;
  font-family: var(--sf-display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1f6b45;
  line-height: 1.2;
}
.sf-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 1.5rem;
  margin-bottom: 1.35rem;
  align-items: start;
}
.sf-doc-col {
  min-width: 0;
}
.sf-doc-col-right {
  display: flex;
  justify-content: flex-end;
  padding-left: 12%;
  box-sizing: border-box;
  min-width: 0;
}
.sf-doc-meta-pair {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0;
  align-items: start;
  width: 100%;
  max-width: 100%;
}
.sf-doc-col-fields {
  text-align: right;
  padding-right: 1rem;
  white-space: nowrap;
}
.sf-doc-field {
  margin-bottom: 0.65rem;
}
.sf-doc-field:last-child {
  margin-bottom: 0;
}
.sf-doc-field-label {
  display: block;
  font-weight: 700;
  color: #222;
  white-space: nowrap;
}
.sf-doc-field-value {
  display: block;
  font-weight: 400;
  white-space: nowrap;
}
.sf-doc-col-business {
  text-align: left;
  border-left: 1px solid #222;
  padding-left: 1rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.sf-doc-strong {
  font-weight: 700;
}
.sf-doc-description {
  font-weight: 700;
  margin: 0 0 0.7rem;
}
.sf-doc-lines {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.sf-doc-lines th,
.sf-doc-lines td {
  border: 1px solid #cfcfcf;
  padding: 0.42rem 0.55rem;
  vertical-align: top;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.sf-doc-lines th {
  font-weight: 700;
  background: var(--sf-panel-solid);
  border-bottom-width: 1.5px;
  border-bottom-color: #bdbdbd;
}
.sf-doc-lines .is-left { text-align: left; }
.sf-doc-lines .is-right { text-align: right; }
.sf-doc-lines .is-nowrap { white-space: nowrap; }
.sf-doc-lines .is-overdue {
  color: var(--sf-overdue);
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sf-doc-lines .is-wrap {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  min-width: 0;
}
.sf-doc-lines th:nth-child(1),
.sf-doc-lines td:nth-child(1) { width: 24%; }
.sf-doc-lines th:nth-child(2),
.sf-doc-lines td:nth-child(2) { width: 32%; }
.sf-doc-lines th:nth-child(3),
.sf-doc-lines td:nth-child(3) { width: 10%; }
.sf-doc-lines th:nth-child(4),
.sf-doc-lines td:nth-child(4) { width: 17%; }
.sf-doc-lines th:nth-child(5),
.sf-doc-lines td:nth-child(5) { width: 17%; }
.sf-doc-lines--statement th:nth-child(1),
.sf-doc-lines--statement td:nth-child(1) {
  width: 7.5rem;
  min-width: 7.5rem;
  white-space: nowrap;
}
.sf-doc-lines--statement th:nth-child(2),
.sf-doc-lines--statement td:nth-child(2) {
  width: 5.5rem;
  min-width: 5.5rem;
  white-space: nowrap;
}
.sf-doc-lines--statement th:nth-child(3),
.sf-doc-lines--statement td:nth-child(3) {
  width: 34%;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
}
.sf-doc-lines--statement th:nth-child(4),
.sf-doc-lines--statement td:nth-child(4),
.sf-doc-lines--statement th:nth-child(5),
.sf-doc-lines--statement td:nth-child(5),
.sf-doc-lines--statement th:nth-child(6),
.sf-doc-lines--statement td:nth-child(6) { width: 13%; }
.sf-doc-lines--txn-statement th:nth-child(1),
.sf-doc-lines--txn-statement td:nth-child(1) {
  width: 7.5rem;
  min-width: 7.5rem;
  white-space: nowrap;
}
.sf-doc-lines--txn-statement th:nth-child(2),
.sf-doc-lines--txn-statement td:nth-child(2) {
  width: 42%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.sf-doc-lines--txn-statement th:nth-child(3),
.sf-doc-lines--txn-statement td:nth-child(3),
.sf-doc-lines--txn-statement th:nth-child(4),
.sf-doc-lines--txn-statement td:nth-child(4),
.sf-doc-lines--txn-statement th:nth-child(5),
.sf-doc-lines--txn-statement td:nth-child(5) {
  width: 15%;
  white-space: nowrap;
}
.sf-doc-aging {
  margin: 1.35rem 0 0 auto;
  width: min(100%, 22rem);
  display: grid;
  gap: 0.45rem;
}
.sf-doc-aging-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.92rem;
}
.sf-doc-aging-row.is-total {
  font-weight: 700;
  margin-top: 0.2rem;
}
.sf-doc-aging-box {
  min-width: 7.5rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid #222;
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--sf-panel-solid);
}
.sf-doc-lines tfoot .sf-doc-total-row td {
  padding: 0.42rem 0.55rem;
  background: transparent;
  vertical-align: middle;
}
.sf-doc-lines tfoot .sf-doc-total-label {
  border: 0;
  font-weight: 500;
  color: #222;
}
.sf-doc-lines tfoot .sf-doc-total-amount {
  border: 1px solid #cfcfcf;
  background: var(--sf-panel-solid);
  font-weight: 500;
}
.sf-doc-lines tfoot .sf-doc-total-row.is-emphasis .sf-doc-total-amount {
  font-weight: 700;
}
.sf-doc-lines tfoot .sf-doc-total-row.is-emphasis .sf-doc-total-label {
  font-weight: 700;
}
.sf-doc-notes {
  margin-top: 1.75rem;
  max-width: 48rem;
  font-size: 0.82rem;
  color: #333;
}

/* Standalone Print/PDF page uses the same document CSS as View. */
body.sf-doc-standalone {
  margin: 0;
  padding: 1rem;
  background: #e8ece9;
}
body.sf-doc-standalone .sf-doc-page {
  margin: 0 auto;
}
.sf-print-hint {
  display: none;
  max-width: 210mm;
  margin: 0 auto 0.75rem;
  color: var(--sf-muted);
  font: 500 0.9rem Manrope, "Segoe UI", sans-serif;
}
body.sf-doc-standalone--print .sf-print-hint {
  display: block;
}

/* App View only: stack on narrow screens. Standalone Print/PDF stay desktop. */
@media screen and (max-width: 900px) {
  body:not(.sf-doc-standalone) .sf-doc-sheet--manager .sf-doc-header,
  body:not(.sf-doc-standalone) .sf-doc-parties {
    grid-template-columns: 1fr;
  }
  body:not(.sf-doc-standalone) .sf-doc-sheet--manager .sf-doc-logo {
    padding-left: 0;
  }
  body:not(.sf-doc-standalone) .sf-doc-sheet--manager .sf-doc-logo img {
    margin-left: 0;
  }
  body:not(.sf-doc-standalone) .sf-doc-col-right {
    justify-content: flex-start;
    padding-left: 0;
  }
  body:not(.sf-doc-standalone) .sf-doc-meta-pair {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  body:not(.sf-doc-standalone) .sf-doc-col-fields {
    text-align: left;
    padding-right: 0;
  }
  body:not(.sf-doc-standalone) .sf-doc-col-business {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid #d7d7d7;
    padding-top: 0.85rem;
  }
}

@page {
  size: A4 portrait;
  /* Match .sf-doc-page screen padding so Print/PDF match View. */
  margin: 12mm 14mm;
}

@media print {
  html,
  body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sf-sidebar,
  .sf-topbar,
  .sf-banner,
  .sf-flash-wrap,
  .sf-doc-toolbar,
  .sf-doc-view-toolbar,
  .sf-doc-viewer-bar,
  .sf-print-hint,
  .sf-modal {
    display: none !important;
  }
  body.sf-doc-viewer,
  body.sf-doc-standalone {
    background: #fff !important;
    padding: 0 !important;
  }
  .sf-shell,
  .sf-content,
  .sf-main {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  .sf-doc-stage,
  .sf-doc-viewer-page,
  .sf-doc-page {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }
  /* Keep View typography/spacing — do not compact for print/PDF. */
  .sf-doc-sheet {
    width: 100% !important;
    max-width: none !important;
    font-size: 0.9rem !important;
    line-height: 1.45 !important;
  }
  .sf-doc-sheet--manager .sf-doc-header {
    margin-bottom: 1.15rem !important;
    gap: 1.5rem !important;
  }
  .sf-doc-sheet--manager .sf-doc-title {
    margin-top: 1.85rem !important;
    font-size: 1.9rem !important;
  }
  .sf-doc-sheet--manager .sf-doc-header,
  .sf-doc-parties {
    display: grid !important;
    grid-template-columns: 1fr 1.15fr !important;
    gap: 1.5rem !important;
  }
  .sf-doc-sheet--manager .sf-doc-logo {
    padding-left: 12% !important;
    text-align: right !important;
  }
  .sf-doc-sheet--manager .sf-doc-logo img {
    max-height: 7.6rem !important;
    margin-left: auto !important;
  }
  .sf-doc-col-right {
    display: flex !important;
    justify-content: flex-end !important;
    padding-left: 12% !important;
  }
  .sf-doc-meta-pair {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
  }
  .sf-doc-col-fields {
    text-align: right !important;
    padding-right: 1rem !important;
    white-space: nowrap !important;
  }
  .sf-doc-col-business {
    text-align: left !important;
    border-left: 1px solid #222 !important;
    border-top: 0 !important;
    padding-left: 1rem !important;
    padding-top: 0 !important;
    font-size: 0.88rem !important;
    line-height: 1.4 !important;
  }
  .sf-doc-field {
    margin-bottom: 0.65rem !important;
  }
  .sf-doc-lines th,
  .sf-doc-lines td {
    padding: 0.42rem 0.55rem !important;
    font-size: inherit !important;
  }
  .sf-doc-lines {
    page-break-inside: auto;
  }
  .sf-doc-lines thead {
    display: table-header-group;
  }
  .sf-doc-lines tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .sf-doc-notes {
    margin-top: 1.75rem !important;
    font-size: 0.82rem !important;
    max-width: 48rem !important;
    break-inside: auto;
    page-break-inside: auto;
  }
}

@keyframes sf-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sf-modal-slide-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sf-loading {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
}
.sf-loading[hidden] { display: none; }
.sf-loading-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 16, 0.45);
  backdrop-filter: blur(2px);
}
.sf-loading-dialog {
  position: relative;
  z-index: 1;
  min-width: min(18rem, calc(100vw - 2rem));
  max-width: 24rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--sf-radius-sm);
  border: 1px solid var(--sf-line);
  background: var(--sf-panel-solid);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  text-align: center;
}
.sf-loading-spinner {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 0.85rem;
  border: 3px solid rgba(15, 118, 110, 0.18);
  border-top-color: var(--sf-primary);
  border-radius: 50%;
  animation: sf-loading-spin 0.75s linear infinite;
}
.sf-loading-message {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sf-text);
  line-height: 1.4;
}
body.sf-loading-open { overflow: hidden; }
@keyframes sf-loading-spin {
  to { transform: rotate(360deg); }
}

/* Dark theme: force remaining hard-coded greys / lights */
html[data-bs-theme="dark"] .sf-form label,
html[data-bs-theme="dark"] .sf-check-list legend,
html[data-bs-theme="dark"] .sf-edit-meta label,
html[data-bs-theme="dark"] .sf-print-hint,
html[data-bs-theme="dark"] .sf-portal-link,
html[data-bs-theme="dark"] .sf-portal-user {
  color: #ffffff;
}
html[data-bs-theme="dark"] .sf-portal-nav {
  background: #000000;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}
html[data-bs-theme="dark"] .sf-portal-drop-menu {
  background: #000000;
  border-color: rgba(255, 255, 255, 0.14);
}
html[data-bs-theme="dark"] .sf-portal-drop-item,
html[data-bs-theme="dark"] .sf-portal-drop-btn::after {
  color: #ffffff;
}
html[data-bs-theme="dark"] .sf-portal-logout button {
  background: #2a3230;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
html[data-bs-theme="dark"] .sf-flash--info {
  background: #1a2e38;
  color: #9fd4f0;
  border-color: rgba(100, 181, 246, 0.25);
}

/* Force dark controls — native selects otherwise stay bright white */
html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] input,
html[data-bs-theme="dark"] textarea,
html[data-bs-theme="dark"] .sf-form select,
html[data-bs-theme="dark"] .sf-form input,
html[data-bs-theme="dark"] .sf-form textarea,
html[data-bs-theme="dark"] .sf-edit-meta-form select,
html[data-bs-theme="dark"] .sf-edit-meta-form input,
html[data-bs-theme="dark"] .sf-edit-meta-form textarea,
html[data-bs-theme="dark"] .sf-edit-table select,
html[data-bs-theme="dark"] .sf-edit-table input,
html[data-bs-theme="dark"] .sf-edit-table textarea,
html[data-bs-theme="dark"] .sf-money-input input,
html[data-bs-theme="dark"] .sf-edit-meta-form input.sf-input-readonly {
  background-color: #121716 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color-scheme: dark;
}
html[data-bs-theme="dark"] .sf-form select,
html[data-bs-theme="dark"] .sf-edit-meta-form select,
html[data-bs-theme="dark"] .sf-item-combo-panel {
  background: #121716 !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #fff;
}
html[data-bs-theme="dark"] .sf-item-combo-option {
  color: #fff;
}
html[data-bs-theme="dark"] .sf-item-combo-option:hover,
html[data-bs-theme="dark"] .sf-item-combo-option.is-active {
  background: rgba(255, 255, 255, 0.08);
}
html[data-bs-theme="dark"] .sf-item-combo-input {
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%) !important;
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px) !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}
html[data-bs-theme="dark"] .sf-edit-table select,
html[data-bs-theme="dark"] select {
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%),
    linear-gradient(to right, #1a1f1e, #1a1f1e) !important;
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    100% 0 !important;
  background-size: 5px 5px, 5px 5px, 2.4rem 100% !important;
  background-repeat: no-repeat !important;
}
html[data-bs-theme="dark"] option {
  background-color: #121716;
  color: #ffffff;
}
html[data-bs-theme="dark"] .sf-cat-select {
  background-color: #121716 !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%) !important;
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px) !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
}
html[data-bs-theme="dark"] .sf-cat-select.is-uncategorised {
  color: #f0b429 !important;
}
html[data-bs-theme="dark"] .sf-table th,
html[data-bs-theme="dark"] .sf-edit-table th,
html[data-bs-theme="dark"] .sf-edit-table thead,
html[data-bs-theme="dark"] .sf-table thead {
  background: #2a3230 !important;
  color: #ffffff !important;
}
html[data-bs-theme="dark"] .sf-edit-table td.col-line-total,
html[data-bs-theme="dark"] .sf-edit-table td.col-line-total [data-sf-line-total] {
  background: #1a1f1e !important;
  color: #ffffff !important;
}
html[data-bs-theme="dark"] .sf-doc-page,
html[data-bs-theme="dark"] .sf-doc-stage,
html[data-bs-theme="dark"] .sf-doc-viewer-page,
html[data-bs-theme="dark"] .sf-doc-lines th,
html[data-bs-theme="dark"] .sf-doc-lines tfoot td,
html[data-bs-theme="dark"] .sf-doc-lines tfoot .sf-doc-total-amount {
  background: var(--sf-panel-solid);
  color: #ffffff;
}
html[data-bs-theme="dark"] .sf-panel,
html[data-bs-theme="dark"] .sf-card,
html[data-bs-theme="dark"] .sf-table-wrap,
html[data-bs-theme="dark"] .sf-toolbar,
html[data-bs-theme="dark"] .sf-topbar,
html[data-bs-theme="dark"] .sf-content,
html[data-bs-theme="dark"] .sf-main,
html[data-bs-theme="dark"] .sf-edit-meta,
html[data-bs-theme="dark"] .sf-edit-options,
html[data-bs-theme="dark"] .sf-edit-summary {
  color: #ffffff;
  background-color: var(--sf-panel-solid);
}
html[data-bs-theme="dark"] .sf-btn-quiet,
html[data-bs-theme="dark"] .sf-btn-secondary {
  background: #2a3230;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Custom Fields / saved notes — force dark (overrides light gradients) */
html[data-bs-theme="dark"] .sf-edit-card,
html[data-bs-theme="dark"] .sf-custom-title,
html[data-bs-theme="dark"] .sf-notes,
html[data-bs-theme="dark"] .sf-logs-list,
html[data-bs-theme="dark"] .sf-note-picker-trigger,
html[data-bs-theme="dark"] .sf-note-picker-panel,
html[data-bs-theme="dark"] .sf-note-picker-search,
html[data-bs-theme="dark"] .sf-note-picker-search:focus {
  background: #121716 !important;
  background-image: none !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important;
}
html[data-bs-theme="dark"] .sf-note-picker-trigger:hover,
html[data-bs-theme="dark"] .sf-note-picker.is-open .sf-note-picker-trigger {
  background: #1a1f1e !important;
  border-color: rgba(126, 207, 191, 0.45) !important;
  box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.18) !important;
}
html[data-bs-theme="dark"] .sf-note-picker-kicker,
html[data-bs-theme="dark"] .sf-note-picker-value,
html[data-bs-theme="dark"] .sf-note-picker-option-name,
html[data-bs-theme="dark"] .sf-note-picker-option-preview,
html[data-bs-theme="dark"] .sf-note-picker-empty,
html[data-bs-theme="dark"] .sf-notes-label,
html[data-bs-theme="dark"] .sf-edit-card h2 {
  color: #ffffff !important;
}
html[data-bs-theme="dark"] .sf-note-picker-icon {
  background: rgba(42, 157, 143, 0.22);
  color: #7ecfbf;
}
html[data-bs-theme="dark"] .sf-note-picker-option:hover,
html[data-bs-theme="dark"] .sf-note-picker-option.is-active {
  background: rgba(255, 255, 255, 0.08) !important;
}
html[data-bs-theme="dark"] .sf-note-picker-badge {
  background: rgba(42, 157, 143, 0.22);
  color: #7ecfbf;
}
html[data-bs-theme="dark"] .sf-recurring-tab {
  background: #000000;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}
html[data-bs-theme="dark"] .sf-recurring-tab:hover {
  background: #111111;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.32);
}
html[data-bs-theme="dark"] .sf-recurring-tab.is-active {
  background: #000000;
  color: #ffffff;
  border-color: var(--sf-primary);
}

html[data-bs-theme="dark"] .sf-note-picker-chevron {
  border-color: #ffffff;
}
