* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f7f9;
  color: #111827;
  -webkit-font-smoothing: antialiased;
}
html, body { height: 100%; }
#app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }

.sf-progress { position: sticky; top: 0; z-index: 30; height: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.sf-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.25s ease; }
.sf-progress-pct {
  position: fixed; top: 10px; right: 16px; z-index: 31;
  font-size: 11.5px; font-weight: 700; color: #1d4ed8;
  background: #fff; padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: none;
}
.sf-progress-pct.active { display: block; }

.sf-appheader {
  background: #0f172a; color: #fff; padding: 11px 20px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0;
}
.sf-appheader-left { display: flex; align-items: center; gap: 6px; }
.sf-appheader-right { display: flex; align-items: center; gap: 14px; }
.sf-topbar-brand { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.sf-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 32px; height: 32px; border: none; background: transparent; cursor: pointer; padding: 0; margin-right: 4px;
}
.sf-hamburger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
.sf-lang-switch { display: flex; align-items: center; gap: 2px; background: rgba(255,255,255,0.08); border-radius: 7px; padding: 2px; }
.sf-lang-opt { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: #94a3b8; padding: 4px 8px; border-radius: 5px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.sf-lang-opt:hover { color: #fff; }
.sf-lang-opt.active { background: #2563eb; color: #fff; }
.sf-topbar-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.sf-appheader h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.sf-appheader .sf-user { font-size: 12.5px; color: #cbd5e1; }
.sf-appheader .sf-link { color: #94a3b8; font-size: 12.5px; cursor: pointer; transition: color 0.15s; }
.sf-appheader .sf-link:hover { color: #fff; }

/* Mail-client style shell: persistent left sidebar + scrollable content pane */
.sf-shell { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.sf-sidebar {
  width: 216px; flex-shrink: 0; background: #fff; border-right: 1px solid #eceef1;
  padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.sf-sidebar-cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-bottom: 14px;
}
.sf-sidebar-cta .sf-icon { width: 15px; height: 15px; }
.sf-sidebar > .sf-link { text-align: center; margin-bottom: 14px; font-size: 12.5px; }
.sf-sidebar-group { margin-bottom: 6px; }
.sf-sidebar-group-title {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #9ca3af; padding: 6px 10px 4px;
}
.sf-sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: #374151; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.sf-sidebar-item:hover { background: #f3f4f6; }
.sf-sidebar-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 700; }
.sf-sidebar-item .sf-icon { width: 16px; height: 16px; color: #9ca3af; flex-shrink: 0; }
.sf-sidebar-item.active .sf-icon { color: #2563eb; }

.sf-shell-main { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 28px 40px; }

.sf-sidebar-backdrop { display: none; }

.sf-main { flex: 1; padding: 26px 24px 40px; max-width: 1120px; margin: 0 auto; width: 100%; }

/* Narrow / phone-width viewports: sidebar becomes a slide-in drawer opened
   via the hamburger button, editor/stat grids stack to a single column. */
@media (max-width: 860px) {
  .sf-hamburger { display: flex; }
  .sf-appheader { padding: 10px 14px; }
  .sf-appheader .sf-user { display: none; }
  .sf-appheader-right { gap: 10px; }

  .sf-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 41; width: 240px;
    transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 2px 0 16px rgba(0,0,0,0.15);
  }
  .sf-shell.sf-sidebar-open .sf-sidebar { transform: translateX(0); }
  .sf-sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.4); z-index: 40;
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  }
  .sf-shell.sf-sidebar-open .sf-sidebar-backdrop { opacity: 1; pointer-events: auto; }

  .sf-shell-main { padding: 16px 14px 32px; }
  .sf-editor-grid { grid-template-columns: 1fr; }
  .sf-status-grid { grid-template-columns: 1fr; }
  .sf-stat-row { grid-template-columns: repeat(2, 1fr); }
  table.sf-table { display: block; overflow-x: auto; white-space: nowrap; }
  .sf-home-hero { padding: 22px 18px; }
  .sf-kpi-row { grid-template-columns: 1fr; }
}

.sf-row-between { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.sf-row-between h2 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }

.sf-icon { width: 15px; height: 15px; flex-shrink: 0; }

.sf-btn { border: none; border-radius: 8px; padding: 10px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.sf-btn-primary { background: #2563eb; color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,0.25); }
.sf-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.sf-btn-primary:disabled { background: #a8c3f5; cursor: not-allowed; box-shadow: none; }
.sf-btn-secondary { background: #eef0f3; color: #111827; }
.sf-btn-secondary:hover:not(:disabled) { background: #e2e5ea; }
.sf-btn-danger { background: #fff; color: #dc2626; border: 1px solid #fca5a5; }
.sf-btn-danger:hover { background: #fef2f2; }
.sf-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }

table.sf-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); }
table.sf-table th, table.sf-table td { text-align: left; padding: 13px 16px; font-size: 13px; border-bottom: 1px solid #f1f3f6; }
table.sf-table th { background: #fafbfc; font-weight: 600; color: #4b5563; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
table.sf-table tbody tr:last-child td { border-bottom: none; }
table.sf-table tbody tr:hover { background: #fafbff; }
.sf-doc-row { cursor: pointer; }
.sf-doc-title-cell { font-weight: 600; color: #111827; }
.sf-doc-row:hover .sf-doc-title-cell { color: #2563eb; text-decoration: underline; }
.sf-row-actions, .sf-row-checkbox { cursor: default; }
.sf-row-checkbox { width: 34px; text-align: center; }
.sf-row-checkbox input { width: 15px; height: 15px; cursor: pointer; }

.sf-bulk-bar {
  display: flex; align-items: center; gap: 14px; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 9px; padding: 10px 14px; margin: -6px 0 14px; font-size: 12.5px; color: #1e3a8a;
}

.sf-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.sf-badge-draft { background: #f1f3f6; color: #4b5563; }
.sf-badge-sent { background: #dbeafe; color: #1d4ed8; }
.sf-badge-completed { background: #dcfce7; color: #15803d; }
.sf-badge-declined { background: #fee2e2; color: #b91c1c; }

.sf-empty { text-align: center; padding: 70px 20px; color: #6b7280; background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); font-size: 13.5px; }

.sf-template-disclaimer { font-size: 12px; color: #6b7280; background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 9px; padding: 9px 13px; margin: -8px 0 18px; }
.sf-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.sf-template-card {
  background: #fff; border-radius: 12px; padding: 18px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
  border: 1px solid transparent; transition: border-color 0.15s, transform 0.15s;
}
.sf-template-card:hover { border-color: #93c5fd; transform: translateY(-1px); }
.sf-template-category { display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.sf-template-card h3 { font-size: 14.5px; margin: 0 0 6px; font-weight: 700; letter-spacing: -0.01em; }
.sf-template-card p { font-size: 12.5px; color: #6b7280; margin: 0 0 12px; line-height: 1.45; min-height: 34px; }

.sf-editor-grid { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.sf-status-grid { display: grid; grid-template-columns: minmax(420px, 1.3fr) 1fr; gap: 18px; align-items: start; }
.sf-panel { background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); }
.sf-panel h3 { font-size: 12px; margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; font-weight: 700; }

.sf-template-layout { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 20px; align-items: start; margin-top: 10px; }
.sf-template-form { width: 100%; }
.sf-template-preview-pane { background: #fff; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); overflow: hidden; position: sticky; top: 16px; }
.sf-template-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #f1f3f6; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; }
.sf-template-preview-status { text-transform: none; letter-spacing: normal; font-weight: 500; color: #9ca3af; }
.sf-template-preview-frame { display: block; width: 100%; height: 86vh; background: #f3f4f6; overflow-y: auto; padding: 16px; box-sizing: border-box; }
.sf-template-preview-page { display: block; margin: 0 auto 16px; box-shadow: 0 1px 4px rgba(0,0,0,0.15); border-radius: 2px; max-width: 100%; height: auto; }
@media (max-width: 860px) {
  .sf-template-layout { grid-template-columns: 1fr; }
  .sf-template-preview-pane { position: static; }
  .sf-template-preview-frame { height: 60vh; }
}

.sf-recipient-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 12.5px; cursor: pointer; border: 1px solid transparent; transition: background 0.15s; }
.sf-recipient-item:hover { background: #f8fafc; }
.sf-recipient-item.active { background: #eff6ff; border-color: #93c5fd; }
.sf-recipient-item .sf-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }
.sf-recipient-item .sf-remove { color: #dc2626; cursor: pointer; font-size: 11px; }
.sf-recipient-item .sf-order-num { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 4px; background: #eef2ff; color: #4338ca; font-size: 10px; font-weight: 700; margin-right: 6px; }
.sf-recipient-actions { display: flex; align-items: center; gap: 8px; }
.sf-reorder { color: #6b7280; cursor: pointer; font-size: 12px; font-weight: 700; padding: 0 2px; }
.sf-reorder:hover { color: #2563eb; }
.sf-reorder.sf-disabled { color: #d1d5db; pointer-events: none; }
.sf-checkbox-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: #1f2937; margin-top: 12px; cursor: pointer; }
.sf-checkbox-row input { width: 14px; height: 14px; }

label { display: block; font-size: 12px; margin: 10px 0 5px; color: #374151; font-weight: 500; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"] {
  width: 100%; padding: 8px 9px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 12.5px;
  font-family: inherit; transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="date"]:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

.sf-field-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.sf-field-tool { padding: 9px 4px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; font-size: 12px; font-weight: 500; cursor: pointer; text-align: center; transition: all 0.15s; }
.sf-field-tool:hover { border-color: #93c5fd; }
.sf-field-tool.active { background: #2563eb; color: #fff; border-color: #2563eb; }

.sf-pdf-area { max-height: 78vh; overflow-y: auto; }
.sf-page { position: relative; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.15); margin: 0 auto 16px; cursor: crosshair; border-radius: 2px; }
.sf-page canvas { display: block; pointer-events: none; }

.sf-field-box {
  position: absolute; border: 2px solid; border-radius: 5px; font-size: 10px;
  display: flex; align-items: center; justify-content: center; padding: 2px; text-align: center;
  user-select: none;
}
.sf-field-box .sf-field-x { position: absolute; top: -8px; right: -8px; background: #dc2626; color: #fff; border-radius: 50%; width: 16px; height: 16px; font-size: 11px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.2); z-index: 2; }
.sf-field-box .sf-field-resize {
  position: absolute; bottom: -6px; right: -6px; width: 14px; height: 14px; border-radius: 3px;
  background: #fff; border: 2px solid currentColor; cursor: nwse-resize; box-shadow: 0 1px 2px rgba(0,0,0,0.2); z-index: 2;
}

.sf-hint-box { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12.5px; padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; }

.sf-plan-card {
  border-radius: 12px; padding: 14px 16px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #eff6ff, #eef2ff); border: 1px solid #dbeafe;
}
.sf-plan-card.is-empty { background: linear-gradient(135deg, #fef2f2, #fff7ed); border-color: #fecaca; }
.sf-plan-card-status { font-size: 13px; color: #1e3a8a; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.sf-plan-card.is-empty .sf-plan-card-status { color: #991b1b; }
.sf-plan-card-detail { font-size: 11.5px; font-weight: 500; color: #3b5a9a; }
.sf-plan-card.is-empty .sf-plan-card-detail { color: #b45050; }
.sf-plan-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.sf-flat-price { font-size: 20px; font-weight: 800; color: #2563eb; margin: 4px 0 12px; }
.sf-qty-presets { display: flex; gap: 6px; margin-bottom: 8px; }
.sf-qty-preset {
  flex: 1; text-align: center; padding: 7px 4px; border-radius: 7px; border: 1px solid #d1d5db;
  background: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; color: #374151;
}
.sf-qty-preset:hover { border-color: #93c5fd; }
.sf-qty-preset.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.sf-buy-total { font-size: 15px; font-weight: 700; color: #111827; margin: 10px 0 4px; }
.sf-contact-note { font-size: 11.5px; color: #6b7280; margin: 14px 0 0; text-align: center; }
.sf-contact-note a { color: #2563eb; }

.sf-grant-row { display: flex; align-items: center; gap: 6px; }
.sf-grant-input { width: 56px; padding: 4px 6px; font-size: 12px; }

.sf-admin-user-cell { display: flex; flex-direction: column; gap: 2px; }
.sf-admin-user-name { font-weight: 600; color: #111827; }
.sf-admin-user-sub { font-size: 11.5px; color: #6b7280; }

.sf-purchase-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.sf-purchase-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f1f3f6; font-size: 12.5px; }
.sf-purchase-row:last-child { border-bottom: none; }
.sf-purchase-row > span:first-child { flex: 1; font-weight: 500; }
.sf-purchase-date { color: #9ca3af; font-size: 11.5px; }

.sf-home-hero {
  background: linear-gradient(135deg, #1d4ed8, #2563eb 55%, #3b82f6);
  border-radius: 16px; padding: 28px 26px; margin-bottom: 20px; color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37,99,235,0.45);
}
.sf-home-hero h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.sf-home-hero p { margin: 0; font-size: 13.5px; color: rgba(255,255,255,0.85); }

.sf-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.sf-kpi-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sf-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -6px rgba(16,24,40,0.15); }
.sf-kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sf-kpi-icon .sf-icon { width: 22px; height: 22px; }
.sf-kpi-blue .sf-kpi-icon { background: #dbeafe; color: #1d4ed8; }
.sf-kpi-amber .sf-kpi-icon { background: #fef3c7; color: #b45309; }
.sf-kpi-green .sf-kpi-icon { background: #dcfce7; color: #15803d; }
.sf-kpi-text { display: flex; flex-direction: column; gap: 2px; }
.sf-kpi-value { font-size: 26px; font-weight: 800; color: #0f172a; letter-spacing: -0.02em; line-height: 1; }
.sf-kpi-label { font-size: 12px; color: #6b7280; font-weight: 600; }

.sf-home-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.sf-home-panel { background: #fff; border-radius: 14px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); }
.sf-home-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sf-home-panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; color: #111827; }
.sf-home-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 4px; border-bottom: 1px solid #f1f3f6; cursor: pointer; }
.sf-home-row:last-child { border-bottom: none; }
.sf-home-row:hover .sf-home-row-title { color: #2563eb; }
.sf-home-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sf-home-row-title { font-size: 13.5px; font-weight: 600; color: #111827; transition: color 0.15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-home-row-sub { font-size: 11.5px; color: #6b7280; display: flex; align-items: center; gap: 6px; }
.sf-home-row-progress { color: #6b7280; }
.sf-home-row-date { font-size: 11.5px; color: #9ca3af; flex-shrink: 0; }
.sf-empty-sm { padding: 30px 16px; box-shadow: none; }

.sf-ticket-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 32px; }
.sf-ticket-card { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06); }
.sf-ticket-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.sf-ticket-message { white-space: pre-wrap; font-size: 13px; color: #374151; background: #f9fafb; border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; }
.sf-ticket-reply-box { white-space: pre-wrap; font-size: 12.5px; color: #1e3a8a; background: #eff6ff; border-radius: 8px; padding: 10px 12px; margin: 0 0 8px; border-left: 3px solid #2563eb; }
.sf-ticket-reply-textarea { width: 100%; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; margin-bottom: 8px; }
.sf-ticket-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.sf-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.sf-stat-tile {
  background: #fff; border-radius: 12px; padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
  display: flex; flex-direction: column; gap: 4px;
}
.sf-stat-value { font-size: 24px; font-weight: 800; color: #0f172a; letter-spacing: -0.02em; }
.sf-stat-label { font-size: 11.5px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

.sf-modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.5); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.sf-modal { background: #fff; border-radius: 14px; padding: 22px; width: 420px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.sf-modal h3 { margin-top: 0; font-size: 16px; }
.sf-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.sf-tab { padding: 7px 14px; border-radius: 8px; background: #f1f3f6; cursor: pointer; font-size: 13px; font-weight: 500; transition: background 0.15s; }
.sf-tab.active { background: #2563eb; color: #fff; }
.sf-sig-canvas { border: 1px solid #d1d5db; border-radius: 8px; width: 100%; height: 160px; touch-action: none; background: #fcfcfd; }
.sf-typed-input { width: 100%; padding: 11px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 22px; font-style: italic; }
.sf-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.sf-error { color: #dc2626; font-size: 12.5px; margin-top: 8px; }
.sf-notice { color: #2563eb; font-size: 12.5px; margin-top: 8px; }
.sf-sub-text { color: #6b7280; font-size: 13px; line-height: 1.5; }
.sf-verify-banner { background: #fffbeb; color: #92400e; font-size: 12.5px; padding: 8px 20px; text-align: center; border-bottom: 1px solid #fde68a; }
.sf-verify-banner .sf-link { color: #92400e; font-weight: 600; text-decoration: underline; margin-left: 4px; }

.sf-audit-list { font-size: 12.5px; }
.sf-audit-item { padding: 8px 0; border-bottom: 1px solid #f1f3f6; }
.sf-audit-item:last-child { border-bottom: none; }

#sf-status-actions { display: flex; align-items: center; gap: 14px; }
.sf-link-danger { color: #dc2626; }
.sf-link-danger:hover { color: #b91c1c; }
.sf-link-muted { color: #6b7280; }
.sf-link-muted:hover { color: #374151; }
.sf-confirm-text { font-size: 12.5px; color: #4b5563; margin-right: 6px; }
.sf-modal-message { font-size: 13px; color: #4b5563; line-height: 1.5; }

.sf-trash-warning {
  display: flex; align-items: center; gap: 10px; background: #fffbeb; border: 1px solid #fde68a;
  color: #92400e; font-size: 12.5px; padding: 11px 14px; border-radius: 9px; margin-bottom: 16px;
}
.sf-trash-expiry { color: #92400e; font-weight: 600; }
.sf-trash-expiry.sf-trash-expiry-soon { color: #b91c1c; }

@keyframes sf-field-pulse {
  0% { box-shadow: 0 0 0 0 rgba(37,99,235,0.55); }
  70% { box-shadow: 0 0 0 14px rgba(37,99,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(37,99,235,0); }
}
.sf-field-box.sf-field-pulse { animation: sf-field-pulse 1s ease-out 2; }
