:root {
  --bg: #f4f1ec;
  --bg2: #ede9e2;
  --surface: #ffffff;
  --surface2: #f9f7f4;
  --border: #ddd9d0;
  --border-dark: #c8c3b8;
  --accent: #2d6a5f;
  --accent-hover: #235549;
  --accent-dim: rgba(45,106,95,0.10);
  --accent-mid: rgba(45,106,95,0.20);
  --amber: #b45309;
  --amber-dim: rgba(180,83,9,0.10);
  --red: #b91c1c;
  --red-dim: rgba(185,28,28,0.10);
  --green: #166534;
  --green-dim: rgba(22,101,52,0.10);
  --blue: #1d4ed8;
  --blue-dim: rgba(29,78,216,0.10);
  --text: #1c1a17;
  --text-muted: #6b6457;
  --text-dim: #a89f93;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 8px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; }
body::before { content: ''; position: fixed; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"); pointer-events: none; z-index: 0; }

/* AUTH */
#auth-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: relative; z-index: 1; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 52px 48px; width: 400px; text-align: center; box-shadow: var(--shadow-card); position: relative; }
.auth-card::before { content: ''; position: absolute; top: 0; left: 48px; right: 48px; height: 3px; background: var(--accent); border-radius: 0 0 3px 3px; }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 28px; }
.auth-logo-mark { width: 38px; height: 38px; background: var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; font-weight: 500; font-size: 13px; color: white; letter-spacing: -0.5px; }
.auth-logo-text { font-family: 'Lora', serif; font-size: 20px; font-weight: 600; letter-spacing: 0.5px; color: var(--text); }
.auth-divider { width: 40px; height: 1px; background: var(--border-dark); margin: 0 auto 24px; }
.auth-title { font-family: 'Lora', serif; font-size: 22px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.auth-sub { color: var(--text-muted); font-size: 13px; margin-bottom: 32px; line-height: 1.6; }
.btn-signin { width: 100%; padding: 13px 20px; background: var(--accent); color: white; border: none; border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; transition: background 0.2s, transform 0.1s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-signin:hover { background: var(--accent-hover); }
.btn-signin:active { transform: scale(0.99); }
.btn-signin:disabled { opacity: 0.6; cursor: not-allowed; }

/* APP SHELL */
#app { display: none; min-height: 100vh; position: relative; z-index: 1; }
header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 32px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0,0,0,0.04); }
.header-left { display: flex; align-items: center; gap: 14px; }
.logo-mark { width: 32px; height: 32px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: white; letter-spacing: -0.5px; }
.logo-text { font-family: 'Lora', serif; font-size: 16px; font-weight: 600; letter-spacing: 0.3px; color: var(--text); }
.logo-divider { width: 1px; height: 20px; background: var(--border-dark); }
.logo-sub { font-size: 13px; color: var(--text-muted); font-weight: 400; }
.header-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 8px; background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 5px 14px 5px 6px; font-size: 13px; color: var(--text-muted); }
.user-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-dim); border: 1.5px solid var(--accent-mid); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: var(--accent); font-family: 'DM Mono', monospace; }

/* NAV */
.nav-tabs { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 32px; display: flex; gap: 2px; overflow-x: auto; }
.nav-tab { padding: 13px 20px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.15s; display: flex; align-items: center; gap: 7px; white-space: nowrap; margin-bottom: -1px; }
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* MAIN */
main { max-width: 820px; margin: 0 auto; padding: 36px 24px; }

/* DASHBOARD */
.dashboard-header { margin-bottom: 32px; }
.dashboard-eyebrow { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.dashboard-title { font-family: 'Lora', serif; font-size: 26px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.dashboard-sub { color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.form-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 40px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; cursor: pointer; transition: all 0.2s; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.form-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--card-color, var(--accent)); transform: scaleX(0); transform-origin: left; transition: transform 0.25s ease; }
.form-card:hover { border-color: var(--border-dark); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.form-card:hover::after { transform: scaleX(1); }
.form-card-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; background: var(--icon-bg, var(--accent-dim)); }
.form-card-title { font-family: 'Lora', serif; font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.form-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* DASHBOARD — collapsible category groups */
.dash-group { margin-bottom: 12px; }
.dash-group-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 4px;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s;
}
.dash-group-header:hover { border-bottom-color: var(--border-dark); }
.dash-group-header:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}
.dash-group-marker { width: 4px; height: 22px; border-radius: 2px; flex-shrink: 0; }
.dash-group-title {
  font-family: 'Lora', serif;
  font-size: 17px; font-weight: 600;
  color: var(--text);
}
.dash-group-count {
  font-family: 'DM Mono', monospace;
  font-size: 11px; font-weight: 500;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px;
  background: var(--bg2); color: var(--text-muted);
}
.dash-group-chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  display: flex; align-items: center;
}
.dash-group-header.collapsed .dash-group-chevron { transform: rotate(-90deg); }
.dash-group-body {
  overflow: hidden;
  max-height: 2000px; opacity: 1;
  transition: max-height 0.35s ease, opacity 0.2s ease, padding 0.2s ease;
  padding: 20px 0 24px;
}
.dash-group-header.collapsed + .dash-group-body {
  max-height: 0; opacity: 0;
  padding-top: 0; padding-bottom: 0;
}
.dash-group-body .form-cards { margin-bottom: 0; }

/* Mobile responsive — single-column cards on narrow screens */
@media (max-width: 640px) {
  .form-cards { grid-template-columns: 1fr; }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .dash-group-body, .dash-group-chevron { transition: none; }
}

/* FORM VIEW */
.form-header { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.btn-back { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; gap: 6px; transition: all 0.15s; box-shadow: var(--shadow); }
.btn-back:hover { color: var(--text); border-color: var(--border-dark); }
.form-title-block h2 { font-family: 'Lora', serif; font-size: 21px; font-weight: 600; color: var(--text); }
.form-title-block p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* FORM SECTIONS */
.form-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.section-header { padding: 13px 20px; background: var(--surface2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.9px; color: var(--text-muted); }
.section-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.section-body { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section-body.single { grid-template-columns: 1fr; }
.section-body.triple { grid-template-columns: 1fr 1fr 1fr; }
.field-full { grid-column: 1 / -1; }

/* FIELDS */
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-muted); display: flex; align-items: center; gap: 4px; letter-spacing: 0.2px; }
.field-label .required { color: var(--red); }
.field-label .hint { font-size: 11px; font-weight: 400; color: var(--text-dim); font-style: italic; margin-left: 4px; }
.field-locked { opacity: 0.45; pointer-events: none; }
.field-locked .field-label::after { content: ' · HR only'; font-size: 10px; color: var(--text-dim); font-style: italic; }
input[type="text"], input[type="date"], input[type="number"], input[type="email"], input[type="tel"], input[type="month"], select, textarea { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 13px; padding: 9px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; outline: none; appearance: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); background: var(--surface); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg2); }
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6457' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.4; cursor: pointer; }
.person-field { position: relative; }
.person-field input { padding-left: 34px; }
.person-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13px; pointer-events: none; }
.currency-field { position: relative; }
.currency-field input { padding-left: 28px; }
.currency-symbol { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; font-weight: 500; pointer-events: none; }

/* STATUS BADGE */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 500; font-family: 'DM Mono', monospace; }
.status-draft { background: var(--amber-dim); color: var(--amber); }
.status-pending { background: var(--accent-dim); color: var(--accent); }
.status-complete { background: var(--green-dim); color: var(--green); }
.status-questions { background: var(--red-dim); color: var(--red); }

/* ROLE INDICATOR */
.role-indicator { background: var(--accent-dim); border: 1px solid var(--accent-mid); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.role-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.role-text { color: var(--text-muted); }
.role-text strong { color: var(--accent); }

/* SUBMIT BAR */
.submit-bar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; margin-top: 8px; box-shadow: var(--shadow); }
.submit-info { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.submit-info strong { color: var(--text); }
.submit-actions { display: flex; gap: 10px; }
.btn { padding: 9px 20px; border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--border-dark); }
.btn-danger { background: var(--surface2); color: var(--red); border: 1px solid var(--border); }
.btn-danger:hover { background: var(--red-dim); border-color: var(--red); }

/* TOAST */
#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 18px; font-size: 13px; display: flex; align-items: center; gap: 10px; min-width: 280px; animation: slideIn 0.2s ease; box-shadow: var(--shadow-card); }
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--amber); }
@keyframes slideIn { from { transform: translateX(16px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* SPINNER */
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.25); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; flex-shrink: 0; }
.spinner-dark { border-color: var(--border); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

/* SUBMISSIONS */
.submissions-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.submissions-eyebrow { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.submissions-title { font-family: 'Lora', serif; font-size: 26px; font-weight: 600; color: var(--text); }
.submissions-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table-header { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1fr 24px; padding: 11px 18px; background: var(--surface2); border-bottom: 1px solid var(--border); font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); }
.table-row { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1fr 24px; padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; transition: background 0.1s; cursor: pointer; }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: var(--surface2); }
.table-empty { padding: 56px; text-align: center; color: var(--text-dim); font-size: 13px; }
.loading-state { padding: 56px; text-align: center; color: var(--text-muted); font-size: 13px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.form-type-chip { font-size: 11px; padding: 3px 9px; border-radius: 4px; font-family: 'DM Mono', monospace; background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }

/* DETAIL PANEL */
.detail-panel { border-bottom: 1px solid var(--border); background: var(--surface2); }
.detail-panel-inner { padding: 20px 18px 24px; display: flex; flex-direction: column; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 24px; }
.detail-field { display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-family: 'DM Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); }
.detail-value { font-size: 13px; color: var(--text); font-weight: 500; }
.detail-block { display: flex; flex-direction: column; gap: 6px; }
.detail-text { font-size: 13px; color: var(--text); line-height: 1.6; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; }
.submission-row:hover { background: var(--bg2) !important; }

/* INFO BANNER */
.info-banner { background: var(--blue-dim); border: 1px solid rgba(29,78,216,0.2); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--blue); line-height: 1.5; }

/* SITE INVOICE — toggle switch */
.si-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; background: none; border: none; padding: 0; color: var(--text); font-family: 'DM Sans', sans-serif; }
.si-toggle-track { width: 36px; height: 20px; border-radius: 20px; position: relative; background: var(--border-dark); transition: background 0.2s; flex-shrink: 0; }
.si-toggle-track.on { background: var(--accent); }
.si-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.si-toggle-track.on .si-toggle-thumb { left: 19px; }
.si-toggle-label { font-size: 13px; color: var(--text-muted); }

/* SITE INVOICE — collapsible section */
.si-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; box-shadow: var(--shadow); transition: border-color 0.2s; }
.si-section.active { border-color: var(--accent-mid); }
.si-section-head { display: flex; align-items: center; gap: 12px; padding: 13px 18px; background: var(--surface2); cursor: pointer; user-select: none; border-bottom: 1px solid transparent; }
.si-section.active .si-section-head { background: var(--accent-dim); border-bottom-color: var(--accent-mid); }
.si-section-icon { font-size: 18px; flex-shrink: 0; }
.si-section-title { flex: 1; display: flex; align-items: center; gap: 10px; }
.si-section-title-text { font-family: 'Lora', serif; font-size: 15px; font-weight: 600; color: var(--text); }
.si-section-badge { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: var(--accent-dim); color: var(--accent); font-weight: 500; font-family: 'DM Mono', monospace; }
.si-section-chevron { color: var(--text-muted); font-size: 11px; transition: transform 0.2s; }
.si-section-chevron.open { transform: rotate(180deg); }
.si-section-body { padding: 18px; display: none; }
.si-section-body.show { display: block; }
.si-section-empty { padding: 14px 18px; color: var(--text-muted); font-size: 13px; font-style: italic; background: var(--surface); }
.si-section-desc { padding: 0 18px 14px; color: var(--text-muted); font-size: 12px; font-style: italic; background: var(--surface); border-bottom: 1px solid var(--border); }

/* SITE INVOICE — repeatable card */
.si-repeat-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; background: var(--surface2); }
.si-repeat-card.external { border-left: 3px solid var(--amber); }
.si-repeat-card.internal { border-left: 3px solid var(--accent); }
.si-repeat-card.callout  { border-left: 3px solid var(--blue); }
.si-repeat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.si-repeat-num { font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.si-repeat-tag { font-family: 'DM Mono', monospace; font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 10px; margin-left: 8px; letter-spacing: 0.05em; }
.si-repeat-tag.internal { background: var(--accent-dim); color: var(--accent); }
.si-repeat-tag.external { background: var(--amber-dim); color: var(--amber); }
.si-repeat-tag.callout  { background: var(--blue-dim);   color: var(--blue); }
.si-btn-remove { padding: 4px 10px; border: 1px solid var(--red); border-radius: var(--radius-sm); background: none; color: var(--red); font-size: 11px; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.si-btn-remove:hover { background: var(--red-dim); }
.si-btn-add { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px dashed var(--border-dark); border-radius: var(--radius-sm); background: none; color: var(--accent); font-size: 13px; cursor: pointer; font-weight: 500; font-family: 'DM Sans', sans-serif; }
.si-btn-add:hover { background: var(--accent-dim); border-color: var(--accent); }

/* SITE INVOICE — file input */
.si-file { border: 1px dashed var(--border-dark); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; background: var(--surface); }
.si-file label { cursor: pointer; flex: 1; }
.si-file input[type="file"] { display: none; }
.si-file-clear { background: none; border: none; cursor: pointer; color: var(--red); font-size: 16px; padding: 0 4px; line-height: 1; }
.si-file.has-file { border-style: solid; border-color: var(--accent); color: var(--text); background: var(--accent-dim); }

/* SITE INVOICE — chip-style multi-select */
.si-chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.si-chip { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.15s; }
.si-chip:hover { border-color: var(--border-dark); }
.si-chip.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); font-weight: 500; }

/* SITE INVOICE — radio buttons (billing method) */
.si-radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.si-radio-btn { padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: none; color: var(--text-muted); font-size: 13px; cursor: pointer; font-family: 'DM Sans', sans-serif; }
.si-radio-btn.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); font-weight: 500; }

/* SITE INVOICE — progress overlay during submit */
.si-overlay { position: fixed; inset: 0; background: rgba(28,26,23,0.5); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.si-overlay-card { background: var(--surface); border-radius: var(--radius); padding: 28px 32px; min-width: 360px; max-width: 460px; box-shadow: var(--shadow-card); }
.si-overlay-title { font-family: 'Lora', serif; font-size: 17px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.si-overlay-step { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }
.si-overlay-progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.si-overlay-progress-fill { height: 100%; background: var(--accent); transition: width 0.3s; }

/* SITE INVOICE — duplicate warning */
.si-warn { background: var(--amber-dim); border: 1px solid rgba(180,83,9,0.25); color: var(--amber); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-top: 12px; line-height: 1.5; }

/* SITE INVOICE — auto-save indicator */
.si-autosave { font-size: 11px; color: var(--text-dim); font-family: 'DM Mono', monospace; }
.si-autosave.saved { color: var(--accent); }

/* SITE INVOICE — edit mode banner */
.si-edit-banner { background: var(--amber-dim); border: 1px solid rgba(180,83,9,0.25); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--amber); line-height: 1.5; }

/* ACCOUNTING THREAD */
.acct-thread { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 4px; }
.acct-thread-head { padding: 12px 18px; background: var(--surface2); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.9px; color: var(--text-muted); }
.acct-thread-head .section-dot { background: var(--red); }
.acct-thread-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.acct-thread-empty { padding: 14px 0; color: var(--text-dim); font-size: 13px; font-style: italic; text-align: center; }
.acct-msg { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px; }
.acct-msg.finance { border-left: 3px solid var(--red); background: var(--red-dim); }
.acct-msg.submitter { border-left: 3px solid var(--accent); background: var(--accent-dim); }
.acct-msg-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-family: 'DM Mono', monospace; }
.acct-msg-role { font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.acct-msg-role.finance { color: var(--red); }
.acct-msg-role.submitter { color: var(--accent); }
.acct-msg-time { color: var(--text-dim); }
.acct-msg-body { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }
.acct-thread-input { border-top: 1px solid var(--border); padding: 14px 18px; background: var(--surface2); display: flex; flex-direction: column; gap: 10px; }
.acct-thread-input textarea { min-height: 70px; }
.acct-thread-input-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* ── PROMOTION REQUEST — form-specific styles ───────────────────────────── */

/* Supporting Criteria: two-column checkbox grid (collapses to one on narrow screens) */
.pr-criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
@media (max-width: 640px) {
  .pr-criteria-grid { grid-template-columns: 1fr; }
}

.pr-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  background: rgba(124, 58, 237, 0.03);
  transition: background 0.12s ease, border-color 0.12s ease;
}
.pr-check:hover {
  background: rgba(124, 58, 237, 0.07);
  border-color: rgba(124, 58, 237, 0.35);
}
.pr-check input[type="checkbox"] {
  margin: 1px 0 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: #7c3aed;
  cursor: pointer;
}
.pr-check span { flex: 1; }

/* Salary delta — computed, display-only line under the salary fields */
.pr-delta {
  display: inline-block;
  margin-top: 2px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

/* Approvals chain — read-only blocks per approver */
.pr-appr-block {
  padding: 12px 14px;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-left: 3px solid #7c3aed;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.03);
  margin-bottom: 10px;
}
.pr-appr-block:last-child { margin-bottom: 0; }

.pr-appr-role {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #7c3aed;
  margin-bottom: 3px;
}
.pr-appr-name {
  font-size: 14px;
  color: var(--text, #1a1a1a);
}

/* Status pills */
.pr-appr-status {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.3px;
}
.pr-appr-status.signed {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.3);
}
.pr-appr-status.pending {
  background: rgba(180, 83, 9, 0.10);
  color: #b45309;
  border: 1px solid rgba(180, 83, 9, 0.28);
}
.pr-appr-status.auto {
  background: rgba(124, 58, 237, 0.10);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.28);
}