:root {
  --bg: #f4f5f7;
  --card: #fff;
  --text: #1a1d21;
  --muted: #5c6570;
  --primary: #2563eb;
  --border: #e2e5ea;
  --success: #059669;
  --warn: #d97706;
  --danger: #dc2626;
  --admin-sidebar-width: 240px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }

.admin-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--admin-sidebar-width);
  background: #1e2128;
  color: #b4bcc8;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1.1rem 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
  text-align: center;
}
.sidebar-brand-logo-link {
  display: block;
  width: 100%;
  line-height: 0;
  text-decoration: none;
}
.sidebar-brand-logo-link picture {
  display: block;
  width: 100%;
}
.sidebar-brand-logo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 52px;
  margin: 0 auto;
  border-radius: 0;
  object-fit: contain;
  object-position: center;
}
@media (max-width: 768px) {
  .sidebar-brand-logo {
    max-height: 88px;
  }
}
.sidebar-brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f3f4f6;
  line-height: 1.3;
  width: 100%;
}
.sidebar-nav { flex: 1; padding: 0.25rem 0.5rem 1rem; overflow-y: auto; min-height: 0; }
.sidebar-footer {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.55rem 0.65rem 0.7rem;
}
.sidebar-footer-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
}
.sidebar-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #d1d5db;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-footer-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.sidebar-footer-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar-footer-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.sidebar-footer-btn[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
html.admin-sidebar-collapsed {
  --admin-sidebar-width: 4.5rem;
}
html.admin-sidebar-collapsed .sidebar-brand-name,
html.admin-sidebar-collapsed .nav-label,
html.admin-sidebar-collapsed .nav-add {
  display: none;
}
html.admin-sidebar-collapsed .sidebar-brand {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
html.admin-sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
html.admin-sidebar-collapsed .sidebar-item {
  justify-content: center;
}
html.admin-sidebar-collapsed .sidebar-footer-tools {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
}
html.admin-sidebar-collapsed .sidebar-footer-btn--collapse svg {
  transform: scaleX(-1);
}
html.admin-theme-dark {
  --bg: #0f1117;
  --card: #171a21;
  --text: #eef0f3;
  --muted: #9aa3af;
  --border: #2a2f3a;
}
html.admin-theme-dark body {
  background: var(--bg);
  color: var(--text);
}
html.admin-theme-dark .card,
html.admin-theme-dark .stat,
html.admin-theme-dark .client-panel,
html.admin-theme-dark .doc-grid-card {
  background: var(--card);
  border-color: var(--border);
  color: var(--text);
}
html.admin-theme-dark .muted {
  color: var(--muted);
}
html.admin-theme-dark h2,
html.admin-theme-dark h3 {
  color: var(--text);
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  color: #9ca3af;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f3f4f6;
}
.sidebar-link.active,
.sidebar-item.active .sidebar-link {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: bolder;
}
.sidebar-item {
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.sidebar-item.active { background: rgba(255, 255, 255, 0.1); }
.sidebar-item .sidebar-link { flex: 1; min-width: 0; }
.sidebar-item.active .sidebar-link { background: transparent; }
.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.nav-icon-wrap .nav-icon {
  width: 20px;
  height: 20px;
}
.sidebar-nav-unread-badge {
  position: absolute;
  top: -7px;
  right: -9px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.2rem;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.05rem;
  text-align: center;
  box-shadow: 0 0 0 2px #1e293b;
  pointer-events: none;
}
.sidebar-link.active .sidebar-nav-unread-badge,
.sidebar-link--has-unread.active .sidebar-nav-unread-badge {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.sidebar-link.active .nav-icon,
.sidebar-item.active .nav-icon { opacity: 1; }
.sidebar-link.active .nav-icon-wrap,
.sidebar-link--has-unread.active .nav-icon-wrap { opacity: 1; }
.sidebar-link .nav-icon-wrap { opacity: 0.85; }
.sidebar-link:hover .nav-icon-wrap { opacity: 1; }
.nav-icon svg { width: 20px; height: 20px; display: block; }
.nav-label { flex: 1; min-width: 0; }
.nav-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 0.35rem;
  color: #9ca3af;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1;
  border-radius: 4px;
  flex-shrink: 0;
}
.nav-add:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.sidebar-item.active .nav-add { color: #d1d5db; }
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin-bottom: 0.1rem;
  border-radius: 6px;
}
.sidebar-section.active {
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-subnav {
  padding: 0 0 0.15rem 2.35rem;
}
.sidebar-section--collapsible:not(.is-subnav-open) .sidebar-subnav {
  display: none;
}
.nav-subtoggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s ease;
}
.sidebar-section--collapsible.is-subnav-open .nav-subtoggle {
  transform: rotate(45deg);
}
html.admin-sidebar-collapsed .nav-subtoggle {
  display: none;
}
.sidebar-link--sub {
  padding: 0.42rem 0.65rem;
  font-size: 0.84rem;
}
.sidebar-link--sub .nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
}
.sidebar-link--sub .nav-icon svg {
  width: 16px;
  height: 16px;
}
html.admin-sidebar-collapsed .sidebar-subnav {
  display: none;
}
html.admin-sidebar-collapsed .sidebar-section.active {
  background: transparent;
}
.main { flex: 1; padding: 1.5rem 2rem; max-width: 1400px; min-width: 0; position: relative; }
.admin-main-version {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 0.78rem;
  line-height: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  user-select: none;
  pointer-events: none;
}

@media (min-width: 769px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 200;
    overflow: hidden;
  }

  .main {
    margin-left: var(--admin-sidebar-width);
    width: calc(100% - var(--admin-sidebar-width));
    max-width: none;
  }
}

.admin-mobile-topbar,
.admin-sidebar-backdrop {
  display: none;
}

.admin-menu-toggle {
  display: none;
}

.stat-money-pending strong { color: var(--danger); }
.stat-profit-positive strong { color: var(--success); }
.stat-profit-negative strong { color: var(--danger); }

.dashboard-mobile-list {
  display: none;
}
.dashboard-mobile-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.dashboard-mobile-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem 0.55rem;
}
.dashboard-mobile-panel-title {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.dashboard-mobile-panel-title:hover { text-decoration: underline; }
.dashboard-mobile-panel-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.dashboard-mobile-panel-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0 0.95rem 0.95rem;
}
.dashboard-mobile-panel-stats--single {
  grid-template-columns: 1fr;
}
.dashboard-mobile-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dashboard-mobile-stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dashboard-mobile-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
}
.dashboard-mobile-panel--activity {
  padding: 0.85rem 0.95rem;
}
.dashboard-mobile-activity-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.admin-list-search {
  margin-bottom: 0.85rem;
}
.admin-list-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.admin-list-search-input {
  width: 100%;
  max-width: 22rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.admin-list-search-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}
.admin-list-no-results {
  padding: 1rem 1.25rem;
}
.admin-list-no-results[hidden] {
  display: none !important;
}

.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.card-warn { border-color: #fcd34d; background: #fffbeb; }
h2 { margin-top: 0; font-size: 1.35rem; }
.stats--year-top {
  margin-bottom: 0.65rem;
}
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-message-alert {
  margin-bottom: 1.25rem;
  border-left: 4px solid #2563eb;
  background: #eff6ff;
}
.dashboard-message-alert-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.dashboard-message-alert-head h3 {
  margin: 0 0 0.25rem;
}
.dashboard-message-alert-summary {
  margin: 0;
  color: #1e3a8a;
  font-size: 0.92rem;
}
.dashboard-message-alert-link {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-message-alert-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.dashboard-message-alert-list a {
  font-size: 0.92rem;
}
.dashboard-recent { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) {
  .dashboard-recent { grid-template-columns: 1fr; }
}
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}
.stat .muted {
  display: block;
  line-height: 1.35;
}
.stat .muted::after {
  content: ':';
}
.stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-money-pending strong { color: var(--danger); }

.expense-month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.expense-month-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 1.35rem;
  line-height: 1;
}
.expense-month-arrow:hover {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
}
.expense-month-label {
  flex: 1;
  text-align: center;
}
.expense-month-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
}
.expense-month-total {
  display: block;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* Payments: year + clickable month statement */
.payments-period-nav {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.payments-year-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.payments-year-label {
  flex: 1;
  text-align: center;
}
.payments-month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
}
@media (min-width: 900px) {
  .payments-month-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}
.payments-month-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-height: 3.5rem;
  padding: 0.35rem 0.25rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.payments-month-chip:hover {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #14532d;
}
.payments-month-chip.is-active {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
  font-weight: 600;
}
.payments-month-chip.is-active .payments-month-chip-amount,
.payments-month-chip.is-active .payments-month-chip-count {
  color: rgba(255, 255, 255, 0.92);
}
.payments-month-chip.is-empty {
  opacity: 0.72;
}
.payments-month-chip-name {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.payments-month-chip-name--text {
  text-transform: uppercase;
}
.payments-month-chip-name--num {
  display: none;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
@media (max-width: 899px) {
  .payments-month-chip-name--text {
    display: none;
  }
  .payments-month-chip-name--num {
    display: block;
  }
  .payments-month-chip {
    min-height: 3rem;
    padding: 0.3rem 0.15rem;
  }
  .payments-month-chip-count {
    display: none;
  }
}
.payments-month-chip-amount {
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-size: 0.5rem;
}
.payments-month-chip-count {
  font-size: 0.62rem;
  color: var(--muted);
}
.payments-period-detail {
  margin: 0.75rem 0 0;
  font-size: 0.88rem;
}
.payments-date-note,
.payments-view-all-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }

.btn { display: inline-block; padding: 0.5rem 1rem; border-radius: 6px; border: none; font-size: 0.9rem; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-secondary,
.btn-success {
  background: #16a34a;
  color: #fff;
}
.btn-secondary:hover,
.btn-success:hover,
a.btn-secondary:hover {
  background: #15803d;
  color: #fff;
}
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.btn-pos {
  background: #1e4b7a;
  color: #fff;
  border: none;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.btn-pos:hover { background: #163352; color: #fff; }
.doc-list-actions { text-align: right; white-space: nowrap; }
.doc-actions {
  position: relative;
  display: inline-block;
}
.doc-actions-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 6px;
  background: #27272a;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}
.doc-actions-trigger:hover { background: #18181b; }
.doc-actions-chevron {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.85;
}
.doc-actions-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 30;
  min-width: 13.5rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.doc-actions-menu.is-floating {
  position: fixed;
  top: auto;
  right: auto;
  left: auto;
  bottom: auto;
  z-index: 10050;
}
.doc-actions-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  text-align: left;
}
.doc-actions-item:hover {
  background: #f4f4f5;
  color: var(--text);
}
.doc-actions-item--danger,
.doc-actions-item--danger:hover {
  color: #991b1b;
}
.doc-actions-item--danger:hover {
  background: #fef2f2;
}
.doc-actions-item.is-disabled,
.doc-actions-item.is-disabled:hover {
  color: #a1a1aa;
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.doc-actions-item.is-disabled .doc-actions-icon {
  color: #a1a1aa;
}
.doc-actions-sep {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border);
}
.doc-actions-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  color: #2563eb;
  flex-shrink: 0;
}
.doc-actions-icon .lb-doc-icon { display: inline-flex; }
.doc-actions-form {
  margin: 0;
  padding: 0;
}
button.doc-actions-item {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.doc-list-paid-open {
  color: var(--danger);
  font-weight: 600;
}

.service-list-table {
  width: 100%;
  max-width: 100%;
}
.service-list-table:not(.client-list-table) {
  table-layout: fixed;
}
.client-list-table.service-list-table {
  table-layout: auto;
}
.service-list-table th,
.service-list-table td {
  vertical-align: middle;
}
.service-list-col-name {
  width: 32%;
  min-width: 11rem;
}
.client-list-table.service-list-table .service-list-col-name {
  width: auto;
  min-width: 0;
}
.client-list-table.service-list-table .service-list-col-status,
.client-list-table.service-list-table .service-list-col-bookable,
.client-list-table.service-list-table .service-list-col-actions {
  width: 1%;
  white-space: nowrap;
}
.client-list-table.service-list-table .service-list-col-actions {
  text-align: right;
}
.service-list-col-name .doc-number-link {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-list-name-cell {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  max-width: 100%;
}
.service-list-name-cell .service-name-link {
  flex: 1 1 auto;
  min-width: 0;
}
.service-list-bookable-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  color: #16a34a;
  margin-top: 0.05rem;
}
.service-list-bookable-icon .lb-doc-icon {
  display: inline-flex;
}
.service-list-bookable-icon .lb-doc-icon svg {
  width: 1rem;
  height: 1rem;
}
.service-list-col-desc {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.service-list-col-price {
  width: 6.5rem;
  white-space: nowrap;
}
.service-list-col-unit {
  width: 5rem;
  white-space: nowrap;
}
.service-list-col-status {
  width: 5.5rem;
  white-space: nowrap;
}
.service-list-col-bookable {
  width: 7.5rem;
  white-space: nowrap;
}
button.service-name-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.service-list-table:not(.client-list-table) .service-list-col-actions {
  width: 5.25rem;
  text-align: right;
}
.service-list-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: nowrap;
}
.service-list-icon-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.service-list-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}
.service-list-icon-btn:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}
.service-list-icon-btn--danger {
  color: #dc2626;
}
.service-list-icon-btn--danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}
.service-list-icon-btn .lb-doc-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
}
.service-list-icon-btn .lb-doc-icon svg {
  width: 1rem;
  height: 1rem;
}

.group-list-col-actions,
.vendor-list-col-actions {
  width: 5.25rem;
  text-align: right;
  white-space: nowrap;
}
.group-list-table .group-list-col-actions,
.vendor-list-table .vendor-list-col-actions {
  vertical-align: middle;
}

.doc-mobile-panel-foot--icons {
  justify-content: flex-end;
}
.doc-mobile-panel-foot--icons .service-list-actions {
  width: auto;
}

.doc-payments-td-amount { text-align: right; }
.doc-payments-th-actions,
.doc-payments-td-actions {
  width: 5.25rem;
  text-align: right;
  white-space: nowrap;
}
.payment-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}
.doc-payments-edit-card {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}
.doc-payments-edit-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}
.doc-payments-stripe-note {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
}

.invoice-grid-card,
.doc-grid-card { padding: 0; overflow: hidden; }
.doc-grid-card--list[data-admin-list] .admin-list-search {
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--card, #fff);
}
html.admin-theme-dark .doc-grid-card--list[data-admin-list] .admin-list-search-input {
  background: var(--input-bg, #1e293b);
  color: var(--text);
  border-color: var(--border);
}
.doc-grid-card--list[data-admin-list] .admin-list-search-input {
  max-width: none;
}
.doc-grid-card--list[data-admin-list] .doc-list-empty,
.doc-grid-card--list[data-admin-list] .admin-list-no-results {
  padding: 1rem 1.25rem;
}
.invoice-grid-wrap,
.doc-grid-wrap { overflow-x: auto; }
.invoice-grid,
.doc-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.invoice-grid th,
.invoice-grid td,
.doc-grid th,
.doc-grid td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}
.invoice-grid th:not(:last-child),
.invoice-grid td:not(:last-child),
.doc-grid th:not(:last-child),
.doc-grid td:not(:last-child) {
  border-right: 1px solid var(--border);
}
.invoice-grid thead th,
.doc-grid thead th {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(161, 161, 170);
  text-transform: none;
  letter-spacing: 0;
  background: #fff;
  white-space: nowrap;
}
.invoice-grid-sort,
.doc-grid-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.invoice-grid-sort-icon,
.doc-grid-sort-icon {
  color: #9ca3af;
  font-size: 0.72rem;
  line-height: 1;
}
.invoice-grid-cal,
.doc-grid-cal {
  font-size: 0.85rem;
  line-height: 1;
}
.invoice-grid-link,
.doc-grid-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.invoice-grid-link:hover,
.doc-grid-link:hover { text-decoration: underline; }
.doc-grid-client {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.3;
}
.doc-grid-client-extra {
  display: block;
  color: var(--primary);
  font-weight: 500;
  font-size: 0.92em;
}
.doc-grid-completion-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.3;
}
.doc-grid-completion-item {
  display: block;
  white-space: nowrap;
}
.invoice-grid-status .badge,
.doc-grid-status .badge {
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.doc-grid-status .badge-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.doc-photo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.35rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}
.doc-photo-badge svg {
  flex: 0 0 auto;
}
.doc-number-with-badges {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.doc-client-viewed-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  line-height: 1;
  vertical-align: middle;
  flex: 0 0 auto;
}
.doc-client-viewed-badge svg {
  flex: 0 0 auto;
  display: block;
}
.doc-mobile-panel-head .doc-client-viewed-badge {
  margin-left: 0.15rem;
}
.invoice-grid-col-money,
.doc-grid-col-money { text-align: left; white-space: nowrap; }
.invoice-grid-amount,
.doc-grid-amount { color: var(--text); }
.invoice-grid-balance,
.doc-grid-balance { color: var(--text); }
.invoice-grid-balance-open,
.doc-grid-balance-open { color: var(--danger); font-weight: 600; }
.invoice-grid-date,
.doc-grid-date { color: var(--text); white-space: nowrap; }
.invoice-grid-col-actions,
.doc-grid-col-actions { width: 1%; white-space: nowrap; }
.doc-grid-method {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}
.doc-grid-muted { color: var(--muted); }

.vendor-list-name-btn {
  display: inline;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
}
.vendor-list-name-btn:hover {
  text-decoration: underline;
}

.doc-mobile-list {
  display: none;
}
.doc-mobile-panel {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}
.doc-mobile-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #94a3b8;
}
.doc-mobile-panel--draft::before { background: #94a3b8; }
.doc-mobile-panel--sent::before { background: #3b82f6; }
.doc-mobile-panel--approved::before,
.doc-mobile-panel--converted::before { background: #8b5cf6; }
.doc-mobile-panel--paid::before { background: #16a34a; }
.doc-mobile-panel--overdue::before { background: #dc2626; }
.doc-mobile-panel--closed::before { background: #64748b; }
.doc-mobile-panel--declined::before { background: #ef4444; }
.doc-mobile-panel--payment::before { background: #16a34a; }
.doc-mobile-panel--expense::before { background: #d97706; }
.doc-mobile-stat-value--paid {
  color: #15803d;
}
.doc-mobile-stat-value--expense {
  color: #b45309;
}
.doc-mobile-panel-number--muted {
  color: var(--muted);
  font-weight: 500;
}
.doc-mobile-panel-action {
  width: 100%;
  justify-content: center;
}
.doc-mobile-panel-foot--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.doc-mobile-panel-foot--split .doc-mobile-panel-action-form {
  margin: 0;
}
.doc-mobile-panel-badges .doc-grid-method {
  justify-content: flex-end;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.doc-mobile-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.8rem 1.1rem;
}
.doc-mobile-panel-main {
  min-width: 0;
}
.doc-mobile-panel-client-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}
.doc-mobile-panel-client {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
}
a.doc-mobile-panel-client:hover {
  color: var(--primary);
}
.doc-mobile-panel-client-extra {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--primary);
}
.doc-mobile-panel-completion {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.25rem;
}
.doc-mobile-panel-completion-item {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}
.doc-mobile-panel-number {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--primary);
  text-decoration: none;
}
.doc-mobile-panel-number:hover {
  text-decoration: underline;
}
.doc-mobile-panel-badges {
  flex-shrink: 0;
  text-align: right;
}
.doc-mobile-panel-badges .badge-group {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
}
.doc-mobile-panel-head--doc-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.doc-mobile-panel-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
}
.doc-mobile-panel-meta .doc-mobile-panel-number {
  margin-top: 0;
  font-size: inherit;
  font-weight: 600;
}
.doc-mobile-panel-meta-sep {
  color: #cbd5e1;
  font-weight: 400;
}
.doc-mobile-panel-date {
  font-weight: 500;
}
.doc-mobile-panel-badges--inline {
  text-align: left;
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
}
.doc-mobile-panel-badges--inline .badge-group {
  justify-content: flex-start;
  flex-direction: row;
}
.doc-mobile-panel-client-wrap {
  margin-top: 0.1rem;
}
.doc-mobile-panel-amount {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-top: 0.35rem;
}
.doc-mobile-panel-amount-stack {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.doc-mobile-panel-amount-total {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
.doc-mobile-panel-amount-balance {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.25;
  color: var(--muted);
}
.doc-mobile-panel-amount-balance--open {
  color: var(--danger);
}
.doc-mobile-panel-amount-balance--open .doc-mobile-panel-amount-balance-value {
  font-weight: 700;
}
.doc-mobile-panel-amount-balance-label {
  font-weight: 500;
}
.doc-mobile-panel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  padding: 0.75rem 1rem 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
}
.doc-mobile-panel-stats--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.doc-mobile-expense-lines {
  padding: 0.75rem 1rem 0.85rem 1.1rem;
  border-top: 1px solid var(--border);
}
.doc-mobile-expense-lines-head,
.doc-mobile-expense-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
}
.doc-mobile-expense-lines-head {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-mobile-expense-lines-head span:last-child,
.doc-mobile-expense-line-amount {
  text-align: right;
}
.doc-mobile-expense-line {
  padding: 0.4rem 0;
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.doc-mobile-expense-line + .doc-mobile-expense-line {
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}
.doc-mobile-expense-line--total {
  margin-top: 0.15rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border) !important;
}
.doc-mobile-expense-line-amount {
  color: #b45309;
}
.doc-mobile-stat {
  min-width: 0;
  text-align: center;
}
.doc-mobile-stat-label {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}
.doc-mobile-stat-value {
  display: block;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  word-break: break-word;
}
.doc-mobile-stat-value--due {
  color: var(--danger);
}
.doc-mobile-panel-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0.65rem 1rem 0.85rem 1.1rem;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.85);
}
.doc-mobile-panel-foot .doc-actions {
  width: 100%;
}
.doc-mobile-panel-foot .doc-actions-trigger,
.doc-mobile-panel-foot .doc-mobile-panel-action {
  width: 100%;
  justify-content: center;
}

.doc-mobile-summary {
  display: none;
}

.doc-mobile-panel-number-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.doc-mobile-panel-number--static {
  color: #6d28d9;
  font-weight: 700;
}

.doc-mobile-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
}

.doc-mobile-copy-btn svg {
  width: 0.9rem;
  height: 0.9rem;
}

.doc-mobile-copy-btn:hover {
  color: #334155;
  border-color: #cbd5e1;
  background: #f8fafc;
}

.doc-mobile-panel-highlight {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 1rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.doc-mobile-highlight-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.85rem 0.75rem;
  align-items: flex-start;
  min-width: 0;
}

.doc-mobile-highlight-item + .doc-mobile-highlight-item {
  border-left: 1px solid #e2e8f0;
}

.doc-mobile-highlight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.doc-mobile-highlight-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.doc-mobile-highlight-icon--date {
  background: #ede9fe;
  color: #7c3aed;
}

.doc-mobile-highlight-icon--amount {
  background: #dcfce7;
  color: #16a34a;
}

.doc-mobile-highlight-text {
  min-width: 0;
}

.doc-mobile-stat-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
}

.doc-actions-trigger-icon {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.doc-actions-trigger-icon svg {
  width: 100%;
  height: 100%;
}

.flash { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-warn { background: #fef3c7; color: #92400e; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel], textarea, select {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 0.75rem;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.line-items .line-row { display: grid; grid-template-columns: 2fr 80px 100px 100px 40px; gap: 0.5rem; align-items: end; margin-bottom: 0.75rem; }
.line-items .line-row .line-service-name { margin-bottom: 0.35rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
.gallery figure { margin: 0; }
.gallery img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.gallery figcaption { font-size: 0.75rem; color: var(--muted); margin-top: 0.35rem; }

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-lightbox[hidden] { display: none !important; }
.photo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
}
.photo-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 3;
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.photo-lightbox-prev { left: 0.75rem; }
.photo-lightbox-next { right: 0.75rem; }
.photo-lightbox-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  padding: 3rem 3.5rem 1.5rem;
  box-sizing: border-box;
}
.photo-lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.photo-lightbox-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}
.photo-lightbox-counter {
  margin: 0.75rem 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.client-header { text-align: center; margin-bottom: 1.5rem; }
.client-header img { max-height: 64px; }
.doc-totals { margin: 1rem 0; text-align: right; }
.doc-totals .total { font-size: 1.25rem; font-weight: 700; }
.actions-bar { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { width: 360px; background: var(--card); padding: 2rem; border-radius: 8px; border: 1px solid var(--border); }

.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: #e5e7eb; }
.badge-sent { background: #dbeafe; color: #1e40af; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-approved { background: #d1fae5; }
.badge-converted { background: #e0e7ff; color: #3730a3; }
.badge-closed { background: #e5e7eb; color: #374151; }
.badge-open { background: #dcfce7; color: #166534; font-weight: 600; }
.badge-archived { background: #e5e7eb; color: #374151; }
.badge-parked { background: #fef3c7; color: #92400e; }
.badge-group { display: inline-flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.dashboard-recent .badge {
  font-size: 0.75rem;
  font-weight: inherit;
  padding: 0.15rem 0.5rem;
}

.filter-tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.35rem; }
.filter-tabs-hint {
  margin: 0 0 1rem;
  font-size: 0.8rem;
}
.filter-tab--toggle.active {
  font-weight: 600;
}
.filter-tab {
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.filter-tab:hover { border-color: #16a34a; background: #bbf7d0; color: #14532d; }
.filter-tab.active { background: #16a34a; border-color: #15803d; color: #fff; }

/* Brand palette (invoice / quote filter tabs) */
.btn-doc-new {
  background: #007bff;
  border: 1px solid #0066d6;
}
.btn-doc-new:hover {
  background: #0066d6;
  color: #fff;
}

.filter-tabs--invoices .filter-tab--all {
  background: #e6f5e6;
  border-color: #66b366;
  color: #006600;
}
.filter-tabs--invoices .filter-tab--all:hover {
  background: #cce6cc;
  border-color: #009900;
  color: #004d00;
}
.filter-tabs--invoices .filter-tab--all.active {
  background: #009900;
  border-color: #007700;
  color: #fff;
}

.filter-tabs--invoices .filter-tab--draft {
  background: #fff0e6;
  border-color: #ffb366;
  color: #994d00;
}
.filter-tabs--invoices .filter-tab--draft:hover {
  background: #ffe0cc;
  border-color: #ff6600;
  color: #663300;
}
.filter-tabs--invoices .filter-tab--draft.active {
  background: #ff6600;
  border-color: #e55a00;
  color: #fff;
}

.filter-tabs--invoices .filter-tab--sent {
  background: #e6f2ff;
  border-color: #66b3ff;
  color: #004299;
}
.filter-tabs--invoices .filter-tab--sent:hover {
  background: #cce5ff;
  border-color: #007bff;
  color: #003366;
}
.filter-tabs--invoices .filter-tab--sent.active {
  background: #007bff;
  border-color: #0066d6;
  color: #fff;
}

.filter-tabs--invoices .filter-tab--open-balance {
  background: #f0e8ff;
  border-color: #a366ff;
  color: #4d1a99;
}
.filter-tabs--invoices .filter-tab--open-balance:hover {
  background: #e0d0ff;
  border-color: #662dcc;
  color: #331066;
}
.filter-tabs--invoices .filter-tab--open-balance.active {
  background: #662dcc;
  border-color: #5524b3;
  color: #fff;
}

.filter-tabs--invoices .filter-tab--paid {
  background: #e6f7f5;
  border-color: #66c4b8;
  color: #005c52;
}
.filter-tabs--invoices .filter-tab--paid:hover {
  background: #ccefed;
  border-color: #009485;
  color: #003d36;
}
.filter-tabs--invoices .filter-tab--paid.active {
  background: #009485;
  border-color: #007a6e;
  color: #fff;
}

.filter-tabs--quotes .filter-tab--all {
  background: #e6f5e6;
  border-color: #66b366;
  color: #006600;
}
.filter-tabs--quotes .filter-tab--all:hover,
.filter-tabs--quotes .filter-tab--all.active {
  background: #009900;
  border-color: #007700;
  color: #fff;
}
.filter-tabs--quotes .filter-tab--open {
  background: #fff0e6;
  border-color: #ffb366;
  color: #994d00;
}
.filter-tabs--quotes .filter-tab--open:hover,
.filter-tabs--quotes .filter-tab--open.active {
  background: #ff6600;
  border-color: #e55a00;
  color: #fff;
}
.filter-tabs--quotes .filter-tab--closed {
  background: #e6f2ff;
  border-color: #66b3ff;
  color: #004299;
}
.filter-tabs--quotes .filter-tab--closed:hover,
.filter-tabs--quotes .filter-tab--closed.active {
  background: #007bff;
  border-color: #0066d6;
  color: #fff;
}
.filter-tabs--quotes .filter-tab--archived {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}
.filter-tabs--quotes .filter-tab--archived:hover,
.filter-tabs--quotes .filter-tab--archived.active {
  background: #6b7280;
  border-color: #4b5563;
  color: #fff;
}
.filter-tabs--quotes .filter-tab--parked {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #92400e;
}
.filter-tabs--quotes .filter-tab--parked:hover,
.filter-tabs--quotes .filter-tab--parked.active {
  background: #d97706;
  border-color: #b45309;
  color: #fff;
}
.card-danger-zone { border-color: #fecaca; background: #fef2f2; }
.card-danger-zone h3 { color: var(--danger); margin-top: 0; }
.card-send { border-color: #93c5fd; background: #eff6ff; }
.card-send h3 { color: #1d4ed8; margin-top: 0; }

.line-total { background: #f3f4f6; color: var(--text); cursor: default; }
.form-locked input:disabled,
.form-locked textarea:disabled,
.form-locked select:disabled { background: #f3f4f6; color: var(--muted); cursor: not-allowed; }

.doc-number-link { font-weight: 600; color: var(--primary); text-decoration: none; }
.doc-number-link:hover { text-decoration: underline; }

.payment-gateway-intro { margin: 0 0 1rem; max-width: 52rem; }
.payment-gateway-status { margin-bottom: 1rem; }
.payment-gateway-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}
.payment-gateway-badge-on { background: #d1fae5; color: #065f46; }
.payment-gateway-badge-warn { background: #fef3c7; color: #92400e; }
.payment-gateway-badge-off { background: #f3f4f6; color: #6b7280; }
.payment-gateway-enable {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  font-weight: 500;
}
.payment-gateway-tip-hint {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}
.payment-gateway-enable--in-panel {
  margin-bottom: 0.35rem;
}
.payment-gateway-tip-pcts {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}
.payment-gateway-tip-pcts-label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.payment-gateway-tip-pct-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}
.payment-gateway-tip-pct-field {
  flex: 0 0 auto;
}
.payment-gateway-tip-pct-input-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.payment-gateway-tip-pct-suffix {
  color: var(--muted);
  font-weight: 500;
}
.payment-gateway-webhook {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.payment-gateway-url {
  display: inline-block;
  padding: 0.35rem 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  word-break: break-all;
}
.admin-account-card .payment-gateway-url {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border-color: #e5e7eb;
}
.payment-gateway-test {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.payment-gateway-test-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.payment-gateway-test p {
  margin: 0 0 0.75rem;
}
.stripe-mode-bar {
  margin: 1.15rem 0 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.stripe-mode-bar--panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}
.stripe-mode-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}
.stripe-mode-bar-label {
  font-weight: 600;
  font-size: 0.95rem;
}
.stripe-mode-bar-hint {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  max-width: 42rem;
}
.stripe-mode-toggle {
  display: inline-flex;
  padding: 0.2rem;
  border-radius: 999px;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
}
.stripe-mode-option {
  min-width: 5.5rem;
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #4b5563;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.stripe-mode-option:hover {
  color: #111827;
}
.stripe-mode-option.is-active.stripe-mode-option--test {
  background: #009900;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 153, 0, 0.25);
}
.stripe-mode-option.is-active.stripe-mode-option--live {
  background: #007bff;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.25);
}
.stripe-credentials-block {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.admin-account-card.stripe-credentials-block {
  margin-top: 0;
  padding: 1.15rem 1.25rem;
  background: #fff;
}
.admin-account-card.stripe-credentials-block:not(.is-running) {
  border-color: #e5e7eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-account-card .stripe-credentials-head {
  margin-bottom: 0;
  width: 100%;
}
.admin-account-card .stripe-credentials-title {
  font-size: 1rem;
  font-weight: 600;
}
.stripe-credentials-block.is-running {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: #fff;
}
.stripe-credentials-block--test.is-running {
  border-color: #86efac;
  box-shadow: 0 0 0 2px rgba(0, 153, 0, 0.12);
}
.stripe-credentials-block--live.is-running {
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.12);
}
.stripe-credentials-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}
.stripe-credentials-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.stripe-credentials-lead {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}
.stripe-running-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.stripe-running-badge--live {
  background: #dbeafe;
  color: #1e40af;
}
.form-grid-full {
  grid-column: 1 / -1;
}

.document-terms-editor { margin-top: 0; }
.document-terms-editor-hint { margin: 0 0 1rem; font-size: 0.85rem; }
.document-terms-editor--off .document-terms-list {
  opacity: 0.75;
}
.document-terms-list { display: flex; flex-direction: column; gap: 0.75rem; }
.document-terms-list--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.document-terms-list--grid .document-term-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto 1fr;
  gap: 0.65rem 0.75rem;
  align-content: start;
  padding: 1rem 1.05rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  min-height: 100%;
}
.document-terms-list--grid .document-term-row:not(.document-term-row--included) {
  opacity: 0.88;
  border-style: dashed;
  background: #fafafa;
}
.document-terms-list--grid .document-term-row-include {
  grid-column: 1;
  grid-row: 1;
  padding-top: 0;
}
.document-terms-list--grid .document-term-include-label {
  flex-direction: row;
  align-items: center;
  text-align: left;
}
.document-terms-list--grid .document-term-row-actions {
  grid-column: 2;
  grid-row: 1;
  padding-top: 0;
  align-self: start;
}
.document-terms-list--grid .document-term-row-icon {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.document-terms-list--grid .document-term-icon-label {
  width: 100%;
  margin-bottom: 0;
  font-size: 0.82rem;
  font-weight: 600;
}
.document-terms-list--grid .document-term-icon-preview {
  margin-bottom: 0;
}
.document-terms-list--grid .btn-pick-term-icon {
  width: auto;
  margin-bottom: 0;
  flex: 1;
  min-width: 7rem;
}
.document-terms-list--grid .document-term-icon-id {
  width: 100%;
  margin-top: 0;
}
.document-terms-list--grid .document-term-row-fields {
  grid-column: 1 / -1;
  grid-row: 3;
}
.document-terms-list--grid .document-term-row-fields label {
  font-size: 0.82rem;
  font-weight: 600;
}
.document-term-row {
  display: grid;
  grid-template-columns: 72px 140px 1fr auto;
  gap: 0.75rem 1rem;
  align-items: start;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.admin-account-card .document-term-row {
  background: #fff;
}
.document-term-row:not(.document-term-row--included) {
  opacity: 0.72;
  border-style: dashed;
}
.document-term-row-include {
  padding-top: 1.5rem;
}
.document-term-include-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}
.document-term-include-label input { margin: 0; }
.document-term-row-icon label,
.document-term-row-fields label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}
.document-term-icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 0.35rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.document-term-icon-preview .lb-doc-term-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
}
.document-term-icon-preview svg,
.document-term-icon-preview iconify-icon { width: 22px; height: 22px; }
.document-term-icon-id {
  display: block;
  font-size: 0.7rem;
  line-height: 1.2;
  word-break: break-all;
  margin-top: 0.25rem;
}
.btn-pick-term-icon { width: 100%; margin-bottom: 0; }
.document-icon-picker {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.document-icon-picker[hidden] { display: none !important; }
.document-icon-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.document-icon-picker-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(80vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.2);
  padding: 1rem 1.1rem 1.1rem;
}
.document-icon-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.document-icon-picker-header h4 { margin: 0; font-size: 1.05rem; }
.document-icon-picker-search {
  width: 100%;
  margin-bottom: 0.5rem;
}
.document-icon-picker-note {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
}
.document-icon-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 0.35rem;
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
  padding: 0.15rem;
}
.document-icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  padding: 0.35rem;
}
.document-icon-picker-item:hover {
  border-color: var(--accent, #2563eb);
  background: #eff6ff;
}
.document-icon-picker-status {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}
body.document-icon-picker-open { overflow: hidden; }
.document-term-row-fields input,
.document-term-row-fields textarea { margin-bottom: 0.5rem; }
.document-term-row-fields textarea { min-height: 56px; resize: vertical; }
.document-term-row-actions { padding-top: 1.5rem; }
.btn-remove-term {
  min-width: 2rem;
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
}
.document-terms-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
@media (max-width: 960px) {
  .document-terms-list--grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 720px) {
  .document-terms-list:not(.document-terms-list--grid) .document-term-row {
    grid-template-columns: 1fr;
  }
  .document-terms-list:not(.document-terms-list--grid) .document-term-row-actions {
    padding-top: 0;
  }
}

.settings-panel > h3 { display: none; }
.settings-panel-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 4px;
}
.settings-panel-toggle:hover { color: var(--primary, #2563eb); }
.settings-panel-toggle:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: 2px;
}
.settings-panel-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}
.settings-panel-arrow {
  display: block;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-top: -0.15rem;
}
.settings-panel:not(.is-open) .settings-panel-arrow {
  transform: rotate(-45deg);
  margin-top: 0;
}
.settings-panel:not(.is-open) .settings-panel-toggle {
  margin-bottom: 0;
}
.settings-panel-body {
  padding-top: 0;
}
.settings-panel:not(.is-open):not(.settings-panel--static) .settings-panel-body {
  display: none;
}
.settings-panel--static .settings-panel-heading,
.settings-panel--static .settings-panel-toggle--heading {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0;
  border: none;
  background: none;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
  text-align: left;
}
.settings-panel--static .settings-panel-toggle--heading {
  cursor: default;
  pointer-events: none;
}
.settings-panel--static .settings-panel-body {
  display: block;
}

.settings-form { margin-bottom: 0; }
.settings-panel-save {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.settings-panel-save .btn-primary {
  min-width: 180px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.settings-panel-save .btn-primary:hover {
  filter: brightness(1.05);
}

.settings-mobile-nav,
.settings-sidebar-backdrop,
.settings-tablist-mobile-head {
  display: none;
}
.settings-sidebar-drawer {
  display: contents;
}
.settings-tabs {
  display: grid;
  grid-template-columns: minmax(10.5rem, 12.75rem) minmax(0, 1fr);
  gap: 0;
  align-items: start;
  margin-top: 0.75rem;
}
.settings-tablist {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  margin: 0;
  padding: 0.65rem 0;
  border: 1px solid var(--border, #cbd5e1);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}
.settings-tab {
  appearance: none;
  border: none;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--muted, #64748b);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.3;
  padding: 0.55rem 0.85rem 0.55rem 0.7rem;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  position: static;
  box-shadow: none;
  text-align: left;
  white-space: normal;
}
.settings-tab:hover {
  color: var(--primary, #2563eb);
  background: rgba(255, 255, 255, 0.65);
}
.settings-tab.is-active {
  background: #fff;
  color: var(--text, #0f172a);
  font-weight: 600;
  border-left-color: var(--primary, #2563eb);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.settings-tab:focus-visible {
  outline: 2px solid var(--primary, #2563eb);
  outline-offset: -2px;
  z-index: 1;
}
.settings-tab-panels {
  background: #fff;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  min-height: 220px;
  min-width: 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.settings-tab-panel:not(.is-active) {
  display: none;
}
.settings-section-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
}
.settings-tab-subsection {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.settings-tab-subsection .settings-section-title {
  margin-top: 0;
}
.settings-fav-star {
  color: #f59e0b;
}
.settings-version-log {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
}
.settings-version-log-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}
.settings-email-login-hint {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  font-size: 0.9rem;
}
.settings-tab-link {
  appearance: none;
  border: none;
  padding: 0;
  background: none;
  color: var(--primary, #2563eb);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.settings-tab-link:hover {
  color: #1d4ed8;
}
@media (max-width: 1279px) {
  .settings-tabs {
    grid-template-columns: 1fr;
    position: relative;
  }
  .settings-mobile-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    grid-column: 1;
    margin-bottom: 0.65rem;
    position: relative;
    z-index: 2;
  }
  .settings-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    background: #fff;
    color: var(--text, #0f172a);
    cursor: pointer;
    flex-shrink: 0;
  }
  .settings-menu-toggle-bar {
    display: block;
    width: 1.125rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }
  .settings-mobile-nav-label {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text, #0f172a);
  }
  .settings-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    pointer-events: none;
  }
  .settings-sidebar-backdrop[hidden] {
    display: none !important;
  }
  .settings-tabs.settings-menu-open .settings-sidebar-backdrop {
    display: block;
    pointer-events: auto;
  }
  .settings-tabs.settings-menu-open .settings-mobile-nav {
    visibility: hidden;
    pointer-events: none;
  }
  .settings-tablist-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-shrink: 0;
    padding: calc(0.75rem + env(safe-area-inset-top, 0)) 0.85rem 0.65rem;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid var(--border, #cbd5e1);
  }
  .settings-tablist-mobile-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text, #0f172a);
  }
  .settings-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    background: #fff;
    color: var(--text, #0f172a);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
  }
  .settings-menu-close:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
  }
  .settings-sidebar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    width: min(16.5rem, 88vw);
    max-width: 100%;
    margin: 0;
    border: none;
    border-right: 1px solid var(--border, #cbd5e1);
    border-radius: 0;
    background: #fff;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.18);
    transform: translateX(-105%);
    transition: transform 0.22s ease, visibility 0.22s ease;
    visibility: hidden;
    pointer-events: none;
  }
  .settings-tabs.settings-menu-open .settings-sidebar-drawer {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .settings-sidebar-drawer .settings-tablist {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0 0 0.75rem;
  }
  .settings-tab {
    flex: 0 0 auto;
    border-left: 3px solid transparent;
    border-bottom: none;
    padding: 0.6rem 0.9rem 0.6rem 0.75rem;
    white-space: normal;
    border-radius: 0;
  }
  .settings-tab.is-active {
    border-left-color: var(--primary, #2563eb);
    border-bottom-color: transparent;
  }
  .settings-tab-panels {
    grid-column: 1;
    border-radius: 8px;
  }
  body.settings-menu-open {
    overflow: hidden;
  }
}

.settings-email-noreply {
  margin: 1rem 0 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.settings-email-noreply-hint {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 42rem;
}
.settings-email-noreply-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #059669;
  font-weight: 500;
}

/* Admin account settings (card layout) */
.admin-settings-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: auto;
}
.settings-tab-panels:has(.admin-settings-panel.is-active),
.settings-tab-panels:has(.sms-settings-panel.is-active),
.settings-tab-panels:has(.email-settings-panel.is-active),
.settings-tab-panels:has(.doc-email-settings),
.settings-tab-panels:has(.tax-settings-panel.is-active),
.settings-tab-panels:has(.terms-settings-panel.is-active),
.settings-tab-panels:has(.booking-settings-panel.is-active),
.settings-tab-panels:has(.stripe-settings-panel.is-active),
.settings-tab-panels:has(.zelle-settings-panel.is-active),
.settings-tab-panels:has(.backup-settings-panel.is-active) {
  background: #f9fafb;
  border-color: #e5e7eb;
}
.doc-email-settings .doc-email-textarea {
  min-height: 5rem;
  resize: vertical;
}
.doc-email-body-editor {
  margin-top: 0.15rem;
}
.doc-email-preview-editor.line-desc-editor {
  margin: 0;
}
.doc-email-preview-editor .line-desc-editor__body {
  min-height: 10rem;
  max-height: 42vh;
  overflow-y: auto;
}
.doc-email-preview-editor .line-desc-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
}
.doc-email-merge-tags {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}
.doc-email-merge-tags-title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.doc-email-merge-tags-lead {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}
.doc-email-merge-tags-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.85rem;
  line-height: 1.55;
}
.doc-email-merge-tags-list code {
  font-size: 0.82rem;
}

/* Document email send preview modal */
.doc-email-preview-dialog {
  max-width: 720px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 2rem);
  height: auto;
  display: flex;
  flex-direction: column;
}
.doc-email-preview-toolbar {
  padding: 1.1rem 1.35rem;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}
.doc-email-preview-toolbar .doc-preview-toolbar-text h2 {
  margin: 0 0 0.2rem;
  font-size: 1.2rem;
}
.doc-email-preview-toolbar .muted {
  margin: 0;
  font-size: 0.88rem;
}
.doc-email-preview-body {
  flex: 1;
  overflow: auto;
  padding: 1.1rem 1.35rem 1.25rem;
  background: #f1f5f9;
}
.doc-email-preview-loading {
  padding: 2.5rem 0;
  text-align: center;
}
.doc-email-preview-envelope {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.doc-email-preview-row {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0.65rem 1rem;
  align-items: start;
  padding: 0.55rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}
.doc-email-preview-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.doc-email-preview-row:first-child {
  padding-top: 0;
}
.doc-email-preview-row--subject {
  align-items: center;
}
.doc-email-preview-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-top: 0.15rem;
}
.doc-email-preview-value {
  min-width: 0;
  word-break: break-word;
  color: #0f172a;
  line-height: 1.45;
}
.doc-email-preview-from-name {
  display: block;
  font-weight: 600;
  color: #0f172a;
}
.doc-email-preview-from-email {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  color: #2563eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc-email-preview-from-email:only-child {
  margin-top: 0;
}
.doc-email-preview-muted {
  color: #94a3b8;
  font-style: italic;
}
.doc-email-preview-value--to,
.doc-email-preview-value--cc {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  color: #1e40af;
}
.doc-email-preview-value--subject {
  font-weight: 600;
  font-size: 0.95rem;
}
.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;
}
.doc-email-preview-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
}
.doc-email-preview-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
  border-color: #2563eb;
}
.doc-email-preview-textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 10rem;
  border: 0;
  border-radius: 0;
  padding: 1.25rem 1.35rem 1rem;
  resize: vertical;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #111;
  background: #fff;
}
.doc-email-preview-textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.28);
}
.doc-email-preview-message-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}
.doc-email-preview-message-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.doc-email-preview-message-body {
  padding: 1.25rem 1.35rem 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #111;
}
.doc-email-preview-message-body p {
  margin: 0 0 0.85rem;
}
.doc-email-preview-message-body p:last-child {
  margin-bottom: 0;
}
.doc-email-preview-company {
  margin: 0 0 1rem !important;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
}
.doc-email-preview-message-extras {
  padding: 1rem 1.35rem 1.15rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
}
.doc-email-preview-cta-note {
  margin: 0 0 0.75rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #64748b;
}
.doc-email-preview-cta-wrap {
  margin-bottom: 0.85rem;
}
.doc-email-preview-cta {
  display: inline-block;
  padding: 0.72rem 1.6rem;
  background: #0f172a;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 8px;
  line-height: 1.2;
}
.doc-email-preview-message-footer {
  font-size: 0.84rem;
  line-height: 1.5;
  color: #64748b;
}
.doc-email-preview-message-footer p {
  margin: 0 0 0.65rem;
}
.doc-email-preview-message-footer p:last-child {
  margin-bottom: 0;
}
.doc-email-preview-warnings .flash {
  margin-bottom: 0.65rem;
}
.doc-email-preview-photo-warn {
  margin-top: 0.85rem;
}
.doc-email-preview-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.35rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0 0 10px 10px;
}
.doc-email-preview-actions .btn-primary {
  min-width: 8.5rem;
}
.doc-email-send-form {
  display: none !important;
}
.doc-email-preview-modal.is-sending .doc-email-preview-content > :not(.doc-email-send-progress) {
  opacity: 0.55;
  pointer-events: none;
}

.doc-portal-share-dialog {
  max-width: 720px;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
}
.doc-portal-share-body {
  flex: 1;
  overflow: auto;
  padding: 1.1rem 1.35rem 0.75rem;
  background: #f1f5f9;
}
.doc-portal-share-loading {
  padding: 2rem 0;
  text-align: center;
}
.doc-portal-share-note,
.doc-portal-share-warning {
  margin-top: 0.85rem;
}
.doc-portal-share-cta table {
  margin: 0 !important;
}
.doc-portal-share-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 1rem 1.35rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0 0 10px 10px;
}
body.doc-portal-share-open {
  overflow: hidden;
}
.doc-email-send-progress {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.doc-email-send-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: #1e40af;
}
.doc-email-send-progress-head strong {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: #1d4ed8;
}
.doc-email-send-progress-track {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}
.doc-email-send-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width 0.2s ease;
}
.doc-email-send-progress-track.is-processing span {
  background-size: 2rem 2rem;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, #2563eb, #10b981);
  animation: backup-run-processing 0.85s linear infinite;
}
.doc-email-send-progress-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.tax-settings-panel,
.sms-settings-panel,
.email-settings-panel,
.terms-settings-panel,
.booking-settings-panel,
.stripe-settings-panel,
.zelle-settings-panel,
.backup-settings-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: auto;
}
.booking-settings-panel--has-fab.is-active {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}
.booking-settings-panel--has-fab .doc-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 125;
}
.booking-settings-panel--has-fab .doc-fab-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 13.75rem;
  padding: 0.4rem 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  pointer-events: none;
}
.booking-settings-panel--has-fab .doc-fab.is-open .doc-fab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.booking-settings-panel--has-fab .doc-fab.is-open .doc-fab-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.65rem;
}
.booking-settings-panel--has-fab .doc-fab-menu[hidden] {
  display: flex !important;
}
.booking-settings-panel--has-fab .doc-fab-sep {
  height: 1px;
  margin: 0.3rem 0;
  background: var(--border);
}
.booking-settings-panel--has-fab .doc-fab-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.booking-settings-panel--has-fab .doc-fab-item:hover:not(:disabled):not(.is-disabled) {
  background: #f4f4f5;
}
.booking-settings-panel--has-fab .doc-fab-item--primary {
  font-weight: 600;
  background: var(--primary, #2563eb);
  color: #fff;
}
.booking-settings-panel--has-fab .doc-fab-item--primary:hover:not(:disabled):not(.is-disabled) {
  background: #1d4ed8;
  color: #fff;
}
.booking-settings-panel--has-fab .doc-fab-item--primary .doc-fab-item-icon {
  color: #fff;
}
.booking-settings-panel--has-fab .doc-fab-item-icon {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.booking-settings-panel--has-fab .doc-fab-item-icon svg {
  width: 100%;
  height: 100%;
}
.booking-settings-panel--has-fab .doc-fab-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.5rem;
  min-height: 3.5rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #18181b;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
}
.booking-settings-panel--has-fab .doc-fab-trigger:hover {
  background: #09090b;
  transform: scale(1.04);
}
.booking-settings-panel--has-fab .doc-fab.is-open .doc-fab-trigger {
  background: #3f3f46;
}
.booking-settings-panel--has-fab .doc-fab-trigger-icon {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
}
.booking-settings-panel--has-fab .doc-fab-trigger-icon::before,
.booking-settings-panel--has-fab .doc-fab-trigger-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.15rem;
  height: 2px;
  margin-left: -0.575rem;
  margin-top: -1px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.18s ease;
}
.booking-settings-panel--has-fab .doc-fab-trigger-icon::after {
  transform: rotate(90deg);
}
.booking-settings-panel--has-fab .doc-fab.is-open .doc-fab-trigger-icon::before {
  transform: rotate(45deg);
}
.booking-settings-panel--has-fab .doc-fab.is-open .doc-fab-trigger-icon::after {
  transform: rotate(-45deg);
}
.booking-settings-panel--has-fab .doc-fab-trigger-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.booking-settings-panel--has-fab .doc-fab-sources {
  display: none !important;
}
.admin-account-settings {
  margin-top: 0;
}
.admin-account-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.admin-account-header .payment-gateway-badge {
  align-self: center;
  margin-left: auto;
}
.admin-account-header-icon--stripe {
  background: #eef2ff;
  color: #4f46e5;
}
.admin-account-header-icon {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ecfdf5;
  color: #059669;
}
.admin-account-header-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}
.admin-account-header-text {
  flex: 1;
  min-width: 0;
}
.admin-account-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}
.admin-account-header-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 42rem;
}
.admin-account-inline-notice {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.88rem;
}
.admin-account-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.admin-account-card--users {
  grid-column: 1 / -1;
}
.admin-users-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
}
.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.admin-users-table th,
.admin-users-table td {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}
.admin-users-meta {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.admin-users-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 10rem;
}
.admin-users-details summary {
  cursor: pointer;
  color: var(--primary, #2563eb);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.admin-users-inline-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
}
.admin-users-create-form {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}
.admin-users-create-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.admin-account-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.admin-account-card > form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  flex: 1;
}
.admin-account-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.admin-account-card-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #ecfdf5;
  color: #059669;
}
.admin-account-card-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}
.admin-account-card-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}
.admin-account-card-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.admin-account-card-body {
  min-width: 0;
}
.admin-account-card-hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}
.admin-account-card-hint:last-child {
  margin-bottom: 0;
}
.admin-account-card-meta {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--text);
}
.admin-account-reset-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #059669;
  text-decoration: none;
}
.admin-account-reset-link:hover {
  color: #047857;
  text-decoration: underline;
}
.admin-account-reset-link--button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.admin-account-password-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.5rem;
}
.admin-account-password-actions-sep {
  color: var(--muted);
}
.admin-account-inline-form {
  display: inline;
  margin: 0;
}
.admin-account-card-hint--tight {
  margin-top: 0.35rem;
  margin-bottom: 0;
}
.admin-account-password-reset {
  grid-column: 1 / -1;
}
.admin-account-password-reset[hidden] {
  display: none !important;
}
.admin-account-password-reset.is-open .admin-account-card--password-form {
  border-color: #a7f3d0;
  box-shadow: 0 0 0 1px #d1fae5;
}
.admin-account-card--password-form .admin-account-card-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.admin-account-card-warn {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.85rem;
  line-height: 1.45;
}
.admin-account-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 0.35rem;
}
.admin-account-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.admin-account-field-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text);
}
.admin-account-input {
  width: 100%;
  max-width: 100%;
  margin: 0;
}
.admin-account-textarea {
  min-height: 5.5rem;
  resize: vertical;
}
.admin-account-input--pin {
  max-width: 100%;
  letter-spacing: 0.12em;
}
.admin-account-input-wrap {
  position: relative;
  max-width: 100%;
}
.admin-account-card .admin-account-input-wrap--pin {
  max-width: 100%;
}
.admin-account-input-wrap .admin-account-input {
  padding-right: 2.5rem;
}
.admin-account-reveal {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.admin-account-reveal:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.05);
}
.admin-account-reveal svg {
  width: 1.05rem;
  height: 1.05rem;
}
.admin-account-field-grid {
  display: grid;
  gap: 0.75rem 1rem;
}
.admin-account-field-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-account-field-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-account-field {
  min-width: 0;
}
.admin-account-field--full {
  grid-column: 1 / -1;
}
.admin-account-input--pct {
  width: 4.25rem;
  max-width: 4.25rem;
  text-align: right;
}
.admin-account-card-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}
.admin-account-card-action--bottom {
  margin-top: auto;
  padding-top: 0.25rem;
}
.admin-account-card--action-bottom {
  min-height: 100%;
}
.admin-account-card--full {
  grid-column: 1 / -1;
}
.admin-account-overview-body--tax {
  grid-template-columns: minmax(0, 1.4fr) minmax(9rem, 12rem);
}
.btn-admin-account {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 185, 129, 0.25);
}
.btn-admin-account:hover {
  background: #059669;
}
.btn-admin-account--large {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
}
.backup-delivery-check {
  display: block;
  margin: 0.85rem 0 0.5rem;
}
.backup-run-form.is-running .admin-account-card-body > :not(.backup-run-progress) {
  opacity: 0.55;
  pointer-events: none;
}
.backup-run-progress {
  margin: 0 1.25rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}
.backup-run-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: #1e40af;
}
.backup-run-progress-head strong {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  color: #1d4ed8;
}
.backup-run-progress-track {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}
.backup-run-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #10b981);
  transition: width 0.2s ease;
}
.backup-run-progress-track.is-processing span {
  background-size: 2rem 2rem;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, #2563eb, #10b981);
  animation: backup-run-processing 0.85s linear infinite;
}
@keyframes backup-run-processing {
  from { background-position: 0 0, 0 0; }
  to { background-position: 2rem 0, 0 0; }
}
.backup-run-progress-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.btn-admin-account--large svg {
  width: 1rem;
  height: 1rem;
}
.admin-account-overview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 11rem);
  gap: 1rem 1.25rem;
  align-items: start;
}
.admin-account-overview-body--list-only {
  grid-template-columns: 1fr;
}
.admin-account-overview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.admin-account-overview-list--compact {
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}
.admin-account-overview-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
}
.admin-account-overview-check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  border-radius: 999px;
  background: #d1fae5;
  color: #059669;
  font-size: 0.65rem;
  font-weight: 700;
}
.admin-account-overview-callout {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.admin-account-overview-callout-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #dbeafe;
  color: #2563eb;
}
.admin-account-overview-callout-icon svg {
  width: 1rem;
  height: 1rem;
}
.admin-account-overview-callout p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e40af;
}
.admin-account-overview-callout strong {
  color: #1d4ed8;
}
.admin-account-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}
@media (max-width: 960px) {
  .admin-account-cards {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .admin-account-card-head {
    flex-wrap: wrap;
  }
  .admin-account-card-action {
    width: 100%;
    justify-content: stretch;
  }
  .admin-account-card-action .btn-admin-account {
    width: 100%;
  }
  .admin-account-field-grid--2,
  .admin-account-field-grid--3 {
    grid-template-columns: 1fr;
  }
  .admin-account-overview-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .admin-account-header {
    flex-direction: column;
    gap: 0.75rem;
  }
  .admin-account-card-icon {
    width: 2.35rem;
    height: 2.35rem;
  }
}

.doc-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0.5rem;
}
.doc-email-preview-modal {
  z-index: 10100;
}
.doc-preview-modal[hidden] {
  display: none !important;
}
.doc-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.doc-preview-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: calc(100vh - 1rem);
  height: calc(100vh - 1rem);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}
.doc-preview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}
.doc-preview-toolbar h2 {
  margin: 0;
  font-size: 1.05rem;
}
.doc-preview-toolbar-text p {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
}
.doc-preview-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.doc-preview-close {
  min-width: 2.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
}
.doc-preview-frame {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: #e8ecf1;
}

.settings-zelle-qr-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.settings-zelle-qr-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}
.settings-zelle-qr-upload {
  flex: 1;
  min-width: min(100%, 16rem);
}
.settings-zelle-qr-preview img {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem;
}
.settings-zelle-qr-remove {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}
.settings-log-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.settings-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.settings-log-table th,
.settings-log-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.settings-log-table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
}
.settings-log-table tbody tr:last-child td {
  border-bottom: none;
}
.settings-log-table td:last-child {
  word-break: break-word;
}
.domain-log-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0;
}
.domain-log-tab {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
}
.domain-log-tab.active {
  background: var(--primary, #2563eb);
  border-color: var(--primary, #2563eb);
  color: #fff;
}
.domain-log-panel[hidden] {
  display: none;
}
.btn-lg {
  padding: 0.65rem 1.35rem;
  font-size: 1rem;
}
button.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 768px) {
  .admin-wrap {
    flex-direction: column;
  }

  .admin-mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 900;
    padding: 0.65rem 0.85rem;
    background: #1e2128;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .admin-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    cursor: pointer;
    flex-shrink: 0;
  }

  .admin-menu-toggle-bar {
    display: block;
    width: 1.125rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
  }

  .admin-mobile-topbar-logo-link {
    display: block;
    flex: 1;
    min-width: 0;
    line-height: 0;
    text-decoration: none;
  }

  .admin-mobile-topbar-logo-link picture {
    display: block;
    width: 100%;
  }

  .admin-mobile-topbar-logo,
  .admin-mobile-topbar-logo-link img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 3.25rem;
    margin: 0 auto;
    object-fit: contain;
  }

  .admin-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
  }

  .admin-sidebar-backdrop[hidden] {
    display: none !important;
  }

  body.admin-menu-open {
    overflow: hidden;
  }

  .sidebar-brand--desktop {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(17.5rem, 88vw);
    z-index: 1001;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
  }

  .admin-wrap.admin-menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-nav {
    padding-top: 0.5rem;
  }

  .sidebar .nav-label {
    font-size: 1.4rem;
  }

  .sidebar-link {
    padding: 0.82rem 1rem;
  }

  .main {
    width: 100%;
    padding: 1rem;
  }

  .admin-main-version {
    top: 1rem;
    right: 1rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .stat {
    width: 100%;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .stat .muted {
    flex: 1 1 auto;
    min-width: 0;
  }

  .stat strong {
    flex: 0 0 auto;
    align-self: auto;
    text-align: right;
    margin-left: auto;
  }

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

  .doc-grid-wrap {
    display: none;
  }
  .doc-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem;
  }
  .doc-mobile-panel {
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  }
  .doc-mobile-panel::before {
    display: none;
  }
  .doc-mobile-panel-head {
    padding: 1rem 1rem 0.75rem;
    align-items: flex-start;
  }
  .doc-mobile-panel-head--doc-list {
    padding-bottom: 0.5rem;
  }
  .doc-mobile-panel-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }
  .doc-mobile-panel-badges--inline {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem;
  }
  .doc-mobile-panel-badges .badge-group {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
  }
  .doc-mobile-panel-badges--inline .badge-group {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
  }
  .doc-mobile-panel-badges .doc-photo-badge {
    margin-left: 0;
  }
  .doc-mobile-panel-badges--inline .doc-photo-badge > span {
    display: none;
  }
  .doc-mobile-panel-foot {
    padding: 0 1rem 1rem;
    border-top: none;
    background: transparent;
  }
  .doc-mobile-panel-foot::before {
    content: '';
    display: block;
    margin: 0 0 0.75rem;
    border-top: 2px dotted #e2e8f0;
  }
  .doc-mobile-panel-foot .doc-actions-trigger {
    width: 100%;
    justify-content: center;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    background: #27272a;
    font-size: 0.8125rem;
    gap: 0.4rem;
  }
  .doc-mobile-summary {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    overflow: hidden;
  }
  .doc-mobile-hero .doc-mobile-summary {
    display: block;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  .doc-mobile-summary .doc-mobile-panel-highlight {
    margin: 0 1rem 1rem;
  }
  .doc-mobile-summary-nav {
    padding: 0.65rem 0.85rem 0;
  }
  .doc-mobile-summary-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
  }
  .doc-mobile-summary-back:hover {
    background: #f1f5f9;
  }
  .doc-mobile-summary-back svg {
    width: 1.15rem;
    height: 1.15rem;
  }
  .doc-edit .doc-breadcrumb {
    display: none;
  }
  .doc-edit .doc-tabs-status .badge-group,
  .doc-edit .doc-tabs-status > .badge {
    display: none;
  }
  .doc-grid-card {
    background: #eef2f7;
  }

  .dashboard-table-wrap {
    display: none;
  }
  .dashboard-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .dashboard-data-card {
    background: #eef2f7;
  }

  .service-list-table thead th.service-list-col-desc,
  .service-list-table thead th.service-list-col-price,
  .service-list-table thead th.service-list-col-unit,
  .service-list-table thead th.service-list-col-status,
  .service-list-table thead th.service-list-col-actions,
  .service-list-table tbody td.service-list-col-desc,
  .service-list-table tbody td.service-list-col-price,
  .service-list-table tbody td.service-list-col-unit,
  .service-list-table tbody td.service-list-col-status,
  .service-list-table tbody td.service-list-col-actions {
    display: none;
  }
  .service-list-table tbody td.service-list-col-name {
    font-weight: 600;
  }

  .vendor-list-table thead th.vendor-list-col-contact,
  .vendor-list-table thead th.vendor-list-col-phone,
  .vendor-list-table thead th.vendor-list-col-email,
  .vendor-list-table thead th.vendor-list-col-expenses,
  .vendor-list-table thead th.vendor-list-col-status,
  .vendor-list-table thead th.vendor-list-col-actions,
  .vendor-list-table tbody td.vendor-list-col-contact,
  .vendor-list-table tbody td.vendor-list-col-phone,
  .vendor-list-table tbody td.vendor-list-col-email,
  .vendor-list-table tbody td.vendor-list-col-expenses,
  .vendor-list-table tbody td.vendor-list-col-status,
  .vendor-list-table tbody td.vendor-list-col-actions {
    display: none;
  }
  .vendor-list-table tbody td.vendor-list-col-name {
    font-weight: 600;
  }
}

.lb-dialog {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lb-dialog[hidden] {
  display: none !important;
}
body.lb-dialog-open {
  overflow: hidden;
}
.lb-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.lb-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  padding: 1.25rem 1.35rem 1.1rem;
}
.lb-dialog-title {
  margin: 0 0 0.65rem;
  font-size: 1.1rem;
  line-height: 1.35;
}
.lb-dialog-message {
  margin: 0 0 1.15rem;
  color: var(--text);
  white-space: pre-line;
}
.lb-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lb-dialog-actions .btn {
  min-width: 5.5rem;
}
.lb-dialog-actions [hidden] {
  display: none !important;
}
.lb-dialog-actions .lb-dialog-discard {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.lb-dialog-actions .lb-dialog-discard:hover {
  background: #c82333;
  border-color: #bd2130;
  color: #fff;
}

.lb-admin-pin-panel {
  width: min(420px, 100%);
}
.lb-admin-pin-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.lb-admin-pin-input {
  width: 100%;
  max-width: 11rem;
  margin-bottom: 1.15rem;
  padding: 0.5rem 0.65rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.admin-app-info-dialog .admin-app-info-panel {
  width: min(680px, 100%);
  max-height: min(88vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.admin-app-info-header {
  padding: 1.25rem 1.35rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.admin-app-info-header .lb-dialog-title {
  margin-bottom: 0.45rem;
}
.admin-app-info-lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.admin-app-info-body {
  padding: 1rem 1.35rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.admin-app-info-body section {
  margin-bottom: 1.15rem;
}
.admin-app-info-body section:last-of-type {
  margin-bottom: 0.75rem;
}
.admin-app-info-body h3 {
  margin: 0 0 0.45rem;
  font-size: 0.98rem;
  line-height: 1.35;
}
.admin-app-info-body p {
  margin: 0 0 0.55rem;
}
.admin-app-info-body ul {
  margin: 0.25rem 0 0.55rem;
  padding-left: 1.2rem;
}
.admin-app-info-body li {
  margin-bottom: 0.35rem;
}
.admin-app-info-body code {
  font-size: 0.85em;
}
.admin-app-info-body ol {
  margin: 0.25rem 0 0.55rem;
  padding-left: 1.35rem;
}
.admin-app-info-body ol li {
  margin-bottom: 0.3rem;
}
.admin-app-info-faq {
  margin: 0.25rem 0 0.55rem;
}
.admin-app-info-faq dt {
  font-weight: 600;
  margin-top: 0.55rem;
}
.admin-app-info-faq dt:first-child {
  margin-top: 0;
}
.admin-app-info-faq dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
}
.admin-app-info-footer-note {
  margin: 0.75rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-app-info-dialog .lb-dialog-actions {
  padding: 0.85rem 1.35rem 1.1rem;
  border-top: 1px solid var(--border);
  margin: 0;
}

.campaigns-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.campaigns-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.campaigns-lead {
  max-width: 42rem;
  margin: 0.35rem 0 0;
}
.campaigns-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.campaigns-subnav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.campaigns-subnav-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: var(--card, #fff);
}
.campaigns-subnav-link:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.campaigns-subnav-link.is-active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb;
  background: #eff6ff;
}
.campaigns-subnav-link strong {
  font-size: 0.92rem;
}
.campaigns-subnav-link .muted {
  font-size: 0.8rem;
  line-height: 1.35;
}
.campaigns-roadmap-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card, #fff);
}
.campaigns-roadmap-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}
.campaigns-roadmap-priority {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2563eb;
}
.campaigns-roadmap-list {
  margin: 0;
  padding-left: 1.2rem;
}
.campaigns-roadmap-list li {
  margin-bottom: 0.35rem;
}
.campaigns-roadmap-reuse,
.campaigns-roadmap-doc {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
}
.campaigns-reference-card {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.campaigns-reference-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.campaigns-reference-lead {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
}
.campaigns-reference-hint {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: #64748b;
}
.campaigns-reference-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.campaigns-reference-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid #e2e8f0;
  font-size: 0.88rem;
}
.campaigns-reference-item:first-child {
  border-top: none;
  padding-top: 0;
}
.campaigns-reference-label {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}
.campaigns-reference-status {
  flex-shrink: 0;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.campaigns-reference-status--on {
  background: #dcfce7;
  color: #166534;
}
.campaigns-reference-status--off {
  background: #e0f2fe;
  color: #0369a1;
}

.company-settings-panel {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: auto;
}
.settings-tab-panels:has(.company-settings-panel.is-active) {
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.company-settings-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.25rem;
}
.company-settings-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}
.company-settings-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}
.company-settings-updated {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
.company-settings-updated svg {
  width: 0.95rem;
  height: 0.95rem;
  flex-shrink: 0;
}
.company-settings-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}
.company-settings-subtab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.company-settings-subtab svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.company-settings-subtab:hover {
  color: #334155;
}
.company-settings-subtab.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}
.company-settings-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.company-settings-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.1rem 0.55rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.company-settings-stat-icon {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
}
.company-settings-stat-icon svg {
  width: 1.1rem;
  height: 1.1rem;
}
.company-settings-stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0f172a;
}
.company-settings-stat-value--text {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  word-break: break-word;
}
.company-settings-stat-label {
  font-size: 0.78rem;
  color: #64748b;
}
.company-settings-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 1rem;
  align-items: start;
}
.company-settings-columns--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 640px;
}
.company-settings-email-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.company-settings-email-layout .settings-email-login-hint {
  margin: 0;
}
.company-settings-email-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
.company-settings-email-grid .company-settings-email-callout {
  grid-column: 1 / -1;
}
.company-settings-fields-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.company-settings-fields-row input,
.company-settings-fields-row select {
  margin-bottom: 0;
}
.company-settings-field-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.45;
}
.company-settings-fields .settings-email-noreply-status {
  margin: 0;
}
.company-settings-email-summary {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #475569;
}
.company-settings-email-summary strong {
  color: #334155;
}
.company-settings-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem;
}
.company-settings-card-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.company-settings-card-head h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}
.company-settings-card-head p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}
.company-settings-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  flex-shrink: 0;
}
.company-settings-card-icon svg {
  width: 1.15rem;
  height: 1.15rem;
}
.company-settings-fields label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #64748b;
}
.company-settings-fields input,
.company-settings-fields select {
  margin-bottom: 0.85rem;
}
.company-settings-logo-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.company-settings-logo-current {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.company-settings-logo-preview {
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.5rem;
  background: #fff;
}
.company-settings-logo-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  text-align: center;
}
.company-settings-logo-upload-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  color: #64748b;
}
.company-settings-logo-btn {
  position: relative;
  overflow: hidden;
  margin-top: 0.35rem;
  cursor: pointer;
}
.company-settings-logo-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.company-settings-logo-filename {
  margin: 0;
  font-size: 0.82rem;
}
.company-settings-hours-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 1.25rem;
  align-items: start;
}
.company-settings-card--hours {
  padding: 1.15rem 1.25rem 1.25rem;
}
.company-settings-card-icon--blue {
  background: #eff6ff;
  color: #2563eb;
}
.company-settings-callout {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 0.85rem;
  line-height: 1.45;
}
.company-settings-callout--hours {
  padding: 1rem 1.05rem;
}
.company-settings-callout-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  color: #1e40af;
  font-size: 0.92rem;
}
.company-settings-callout-head svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}
.company-settings-callout-head strong {
  display: inline;
  margin: 0;
  color: inherit;
}
.company-settings-callout strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #1e40af;
}
.company-settings-callout p {
  margin: 0 0 0.5rem;
  color: #475569;
}
.company-settings-callout p:last-child {
  margin-bottom: 0;
}
.company-settings-panel .work-hours-block {
  margin: 0;
}
.company-settings-panel .work-hours-table {
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}
.company-settings-panel .work-hours-table thead th {
  padding: 0.55rem 0.65rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
}
.company-settings-panel .work-hours-table thead th:first-child {
  border-radius: 8px 0 0 0;
}
.company-settings-panel .work-hours-table thead th:last-child {
  border-radius: 0 8px 0 0;
}
.company-settings-panel .work-hours-table tbody td {
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.company-settings-panel .work-hours-table tbody tr:last-child td {
  border-bottom: 0;
}
.company-settings-panel .work-hours-table tbody tr.work-hours-row--closed {
  opacity: 0.55;
}
.company-settings-panel .work-hours-day {
  font-weight: 600;
  color: #334155;
  min-width: 6.5rem;
}
.company-settings-panel .work-hours-open {
  width: 3.5rem;
  text-align: center;
}
.company-settings-panel .work-hours-table input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}
.company-settings-panel .work-hours-table input[type="time"] {
  width: 100%;
  min-width: 7.5rem;
  max-width: 10rem;
  margin-bottom: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.88rem;
  color: #334155;
}
.company-settings-panel .work-hours-table input[type="time"]:disabled {
  background: #f8fafc;
  color: #94a3b8;
}
.company-settings-panel .work-hours-table tbody tr.work-hours-row--closed input[type="time"] {
  background: #f8fafc;
  color: #94a3b8;
}
.company-settings-inline-link {
  font-size: inherit;
  vertical-align: baseline;
}
.company-settings-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.company-settings-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.company-settings-save-btn svg {
  width: 1rem;
  height: 1rem;
}
.company-settings-panel .work-hours-block {
  margin: 0;
}
.company-settings-panel .work-hours-table input[type="time"] {
  margin-bottom: 0;
}
@media (max-width: 960px) {
  .company-settings-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .company-settings-columns,
  .company-settings-hours-layout,
  .company-settings-email-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .company-settings-stats {
    grid-template-columns: 1fr;
  }
  .company-settings-subtabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}
