:root {
  --bg: #f5f7fa;
  --panel: #fff;
  --ink: #17212b;
  --muted: #657488;
  --line: #d9e1ea;
  --nav: #102832;
  --nav-hover: #1b3a45;
  --primary: #1d6f72;
  --primary-soft: #e2f1f1;
  --green: #247a55;
  --amber: #9a6417;
  --red: #a43e3e;
  --blue: #2d609b;
  --violet: #695b99;
  --shadow: 0 8px 22px rgba(22, 34, 45, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-screen.hidden { display: none; }
.login-card {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 14px;
}
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--muted); font-size: 13px; }
.login-card label {
  display: grid;
  gap: 6px;
  color: #344452;
  font-size: 13px;
  font-weight: 850;
}
.login-card input { width: 100%; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}

.app.sidebar-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  overflow: auto;
  background: var(--nav);
  color: #edf5f7;
  padding: 16px 12px;
  transition: transform .18s ease, opacity .18s ease;
}
.sidebar-edge { display: none; position: fixed; inset: 0 auto 0 0; width: 14px; z-index: 8; }
.app.sidebar-collapsed .sidebar { opacity: 0; transform: translateX(-100%); pointer-events: none; }
.app.sidebar-collapsed .sidebar-edge { display: block; }

.brand { padding: 10px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.13); margin-bottom: 10px; }
.brand-title { font-weight: 900; font-size: 17px; }
.brand-sub { margin-top: 4px; color: #abc0c7; font-size: 12px; }
.menu-label { color: #92aab3; font-size: 11px; text-transform: uppercase; font-weight: 900; padding: 13px 10px 6px; }

.nav {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: #dce9ed;
  background: transparent;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
}
.nav:hover, .nav.active { background: var(--nav-hover); color: #fff; }
.nav span { width: 22px; text-align: center; font-size: 13px; font-weight: 900; color: #b8cbd1; }
.nav b {
  min-width: 24px;
  height: 22px;
  border-radius: 12px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  background: rgba(255,255,255,.13);
  color: #d8e7eb;
  font-size: 12px;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  min-height: 76px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  padding: 13px 18px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: 21px; line-height: 1.2; }
.title-row p { margin-top: 4px; color: var(--muted); font-size: 13px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
select, input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  min-width: 140px;
}
#search { min-width: 250px; }
.user-chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 7px 11px;
  display: inline-grid;
  align-content: center;
  font-size: 13px;
  font-weight: 850;
}
.btn, .icon-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  font-weight: 850;
  cursor: pointer;
}
.btn { height: 38px; padding: 0 12px; }
.btn.secondary, .icon-btn {
  color: #164f54;
  border-color: #b8cbd2;
  background: #fff;
}
.btn.danger {
  color: #b4232c;
  border-color: #f0b8bd;
  background: #fff;
}
.btn.compact {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; font-size: 18px; }

.content { padding: 16px 18px 26px; display: grid; gap: 14px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.metric, .stage {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 12px;
  cursor: pointer;
}
.metric { min-height: 92px; }
.metric:hover, .stage:hover { border-color: #9bc2c6; box-shadow: 0 10px 24px rgba(22,34,45,.12); }
.metric.urgent { border-left: 6px solid var(--red); }
.metric-label { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 900; }
.metric-value { margin-top: 7px; font-size: 25px; font-weight: 950; font-variant-numeric: tabular-nums; }
.metric-note, .stage-note { margin-top: 4px; color: var(--muted); font-size: 12px; }
.workflow { display: grid; grid-template-columns: repeat(5, minmax(128px, 1fr)); gap: 8px; }
.stage { min-height: 92px; }
.stage.status-green { border-left: 6px solid var(--green); }
.stage.status-amber { border-left: 6px solid var(--amber); }
.stage.status-red { border-left: 6px solid var(--red); }
.stage.status-blue { border-left: 6px solid var(--blue); }
.stage.status-violet { border-left: 6px solid var(--violet); }
.stage.status-gray { border-left: 6px solid #5a6675; }
.stage-title { font-size: 12px; font-weight: 900; }
.stage-count { margin-top: 8px; font-size: 22px; font-weight: 950; }

.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.panel-head {
  min-height: 56px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}
.panel-head h2 { font-size: 15px; font-weight: 950; }
.panel-actions, .tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-toolbar {
  display: none;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-toolbar.visible { display: flex; }
.tab {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 850;
  cursor: pointer;
}
.tab.active { background: var(--primary-soft); border-color: #91bec1; color: #144e54; }
.filters {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  gap: 8px;
}
.filters select { width: 100%; min-width: 0; }

.bulk-email-page {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.bulk-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(190px, 1fr)) repeat(3, auto);
  gap: 10px;
  align-items: end;
}
.bulk-controls label,
.bulk-editor label {
  display: grid;
  gap: 6px;
  color: #344452;
  font-size: 12px;
  font-weight: 900;
}
.bulk-controls select,
.bulk-editor input,
.bulk-editor textarea { width: 100%; min-width: 0; }
.bulk-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}
.bulk-summary-row div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.bulk-summary-row strong {
  display: block;
  font-size: 20px;
  font-weight: 950;
}
.bulk-summary-row span { color: var(--muted); font-size: 12px; }
.bulk-warning,
.bulk-results {
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4b0c;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
}
.bulk-results {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  display: grid;
  gap: 6px;
}
.bulk-results div {
  border: 1px solid #e6ebf1;
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--muted);
}
.bulk-results .success { border-color: #bfe4d4; background: #ecfdf5; color: #146c43; }
.bulk-results .failed { border-color: #f0b8bd; background: #fff1f2; color: #b4232c; }
.bulk-grid {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  gap: 12px;
}
.bulk-list,
.bulk-editor {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}
.bulk-section-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 10px;
}
.bulk-section-head h3 {
  margin: 0;
  font-size: 15px;
}
.bulk-section-head span,
.placeholder-help {
  color: var(--muted);
  font-size: 12px;
}
.bulk-client-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e6ebf1;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  cursor: pointer;
}
.bulk-client-row:hover { border-color: #9bc2c6; background: #fbfcfd; }
.bulk-client-row input {
  min-width: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
}
.bulk-client-row strong { display: block; }
.bulk-client-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.bulk-editor { display: grid; gap: 10px; align-content: start; }
.bulk-editor textarea {
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
}
#bulkRequiredDetails { min-height: 92px; }
.bulk-preview {
  border: 1px dashed #b8cbd2;
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
  max-height: 210px;
  overflow: auto;
}
.bulk-preview p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.table-wrap { overflow: auto; max-height: calc(100vh - 338px); min-height: 330px; }
table { width: 100%; min-width: 1280px; border-collapse: separate; border-spacing: 0; }
.register-table { min-width: 2214px; table-layout: fixed; }
th, td {
  border-bottom: 1px solid #e6ebf1;
  border-right: 1px solid #edf1f5;
  padding: 6px 8px;
  text-align: left;
  vertical-align: middle;
  font-size: 12.5px;
  background: #fff;
  overflow-wrap: anywhere;
}
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fb;
  color: #526173;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 950;
}
th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 285px;
  min-width: 285px;
  max-width: 285px;
  box-shadow: 1px 0 0 #edf1f5;
}
th:first-child { z-index: 4; }
td strong { display: block; overflow-wrap: anywhere; line-height: 1.13; }
.small { color: var(--muted); font-size: 11.5px; margin-top: 1px; overflow-wrap: anywhere; }
.archived-row td,
.mobile-card.archived-row {
  background: #f8fafc;
  color: #526173;
}
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.register-table .row-actions {
  flex-wrap: nowrap;
  gap: 4px;
}
.register-table .row-actions .btn {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
  border-radius: 6px;
}
.register-table .row-actions .icon-only {
  width: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}
.action-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill, .tool-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 13px;
  padding: 2px 8px;
  font-size: 11.5px;
  font-weight: 900;
  white-space: nowrap;
}
.tool-pill { border: 1px solid #d7e1ea; background: #f8fafc; color: #354556; }
.green { background: #e4f4ec; color: var(--green); }
.amber { background: #fff0d8; color: var(--amber); }
.red { background: #fae7e7; color: var(--red); }
.blue { background: #e6effb; color: var(--blue); }
.violet { background: #eeeaf8; color: var(--violet); }
.gray { background: #eef2f6; color: #5a6675; }
.inline-select {
  width: 100%;
  min-width: 104px;
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, .08);
  padding: 3px 22px 3px 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.inline-select:focus {
  outline: 2px solid rgba(28, 124, 125, .25);
  border-color: var(--teal);
}
.inline-amount {
  width: 92px;
  min-width: 92px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, .12);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.inline-amount:focus {
  outline: 2px solid rgba(28, 124, 125, .25);
  border-color: var(--teal);
}
.inline-date {
  width: 124px;
  min-width: 124px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(16, 24, 40, .12);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 850;
}
.inline-date:focus {
  outline: 2px solid rgba(28, 124, 125, .25);
  border-color: var(--teal);
}
.inline-date.overdue-date {
  border-color: #efb6bc;
  background: #fff1f2;
  color: #a8323b;
  font-weight: 900;
}
.amount { font-weight: 900; font-variant-numeric: tabular-nums; }
.color-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 850; }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.swatch.green { background: var(--green); }
.swatch.amber { background: var(--amber); }
.swatch.red { background: var(--red); }
.swatch.blue { background: var(--blue); }
.swatch.violet { background: var(--violet); }
.swatch.gray { background: #5a6675; }

.mobile-list { display: none; gap: 10px; }
.mobile-list.backup-visible { display: grid; }
.mobile-list.bulk-visible { display: grid; }
.mobile-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 9px;
}
.mobile-card-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.mobile-card-head > div { min-width: 0; }
.mobile-card-title { font-size: 14px; font-weight: 950; overflow-wrap: anywhere; line-height: 1.2; }
.mobile-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; font-size: 12px; }
.mobile-card-grid span { color: var(--muted); display: block; margin-bottom: 2px; }
.mobile-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.backup-strip {
  border: 1px solid #bfe7d6;
  background: #eefaf4;
  color: #32745c;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 850;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(12,22,30,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(500px, 100vw);
  height: 100vh;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 30px rgba(15,28,39,.18);
  transform: translateX(100%);
  transition: transform .18s ease;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.drawer-head > div { min-width: 0; }
.drawer-head h2 { font-size: 16px; overflow-wrap: anywhere; line-height: 1.2; }
.drawer-head p { color: var(--muted); font-size: 12px; margin-top: 3px; overflow-wrap: anywhere; }
.drawer-body { overflow: auto; padding: 14px; display: grid; gap: 12px; align-content: start; }
.drawer-section { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; display: grid; gap: 9px; }
.drawer-section-title { font-size: 13px; font-weight: 950; }
.drawer-row { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.drawer-row.file-row { align-items: center; }
.drawer-row.file-row strong {
  display: block;
  color: var(--ink);
  max-width: 190px;
  overflow-wrap: anywhere;
}
.drawer-row.file-row small {
  display: block;
  margin-top: 2px;
}
.file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chat-thread {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
}
.chat-line {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  background: #fbfcfd;
}
.chat-line div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-line strong { color: var(--ink); font-size: 12px; }
.chat-line small { color: var(--muted); font-size: 11px; }
.chat-line p {
  margin-top: 5px;
  color: #344452;
  overflow-wrap: anywhere;
}
.chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}
.chat-compose textarea {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
}
.chat-modal-history {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}
.chat-modal-history .chat-thread { max-height: 260px; }
.email-log-line {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  gap: 3px;
  background: #fbfcfd;
}
.email-log-line strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}
.email-log-line span,
.email-log-line small {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.drawer-section label { display: grid; gap: 4px; }
.drawer-section select { width: 100%; }
.drawer-foot { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(12,22,30,.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.modal {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 31;
  width: min(980px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15,28,39,.24);
  transform: translate(-50%, -48%) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.modal.open,
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal.open { transform: translate(-50%, -50%) scale(1); }
.modal form { display: grid; grid-template-rows: auto 1fr auto; max-height: calc(100vh - 28px); }
.modal-head, .modal-foot {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.modal-foot { border-top: 1px solid var(--line); border-bottom: 0; justify-content: flex-end; }
.modal-head h2 { font-size: 17px; }
.modal-body {
  overflow: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.modal-field {
  display: grid;
  gap: 5px;
  color: #344452;
  font-size: 13px;
  font-weight: 850;
}
.modal-field.full { grid-column: 1 / -1; }
.multi-select {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}
.multi-select option {
  padding: 7px 8px;
  border-radius: 6px;
}
.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.modal-field textarea {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  resize: vertical;
}
.modal-field.tall textarea { min-height: 260px; }
.modal-field input,
.modal-field select { width: 100%; }

.import-modal {
  position: fixed;
  inset: 50% auto auto 50%;
  z-index: 32;
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 22px 52px rgba(15,28,39,.24);
  transform: translate(-50%, -48%) scale(.98);
  opacity: 0;
  pointer-events: none;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transition: opacity .18s ease, transform .18s ease;
}
.import-modal.open,
#importBackdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.import-modal.open { transform: translate(-50%, -50%) scale(1); }
.import-head,
.import-foot {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.import-head { border-bottom: 1px solid var(--line); }
.import-foot { border-top: 1px solid var(--line); color: var(--muted); font-weight: 800; }
.eyebrow {
  color: #63718a;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.import-head h2 { margin-top: 6px; font-size: 24px; }
.import-head p { margin-top: 8px; color: var(--muted); }
.import-head-actions { display: flex; gap: 8px; align-items: center; }
.import-body {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 14px;
}
.import-upload {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.4fr auto;
  gap: 14px;
  align-items: center;
}
.import-upload label {
  display: grid;
  gap: 8px;
  font-weight: 900;
  color: #526173;
}
.import-upload input { width: 100%; min-width: 0; padding-top: 7px; }
.import-upload p { margin-top: 5px; color: var(--muted); font-size: 12px; }
.import-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 8px;
}
.import-stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.import-stats strong { display: block; font-size: 22px; }
.import-stats span { color: var(--muted); font-size: 12px; }
.import-preview {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 150px;
  padding: 14px;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  overflow: auto;
}
.import-preview-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}
.import-errors {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}
.import-errors div {
  border: 1px solid #efb6bc;
  background: #fff1f2;
  color: #a8323b;
  border-radius: 8px;
  padding: 9px 10px;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  max-width: min(420px, calc(100vw - 36px));
  padding: 11px 14px;
  border: 1px solid #bfe4d4;
  border-radius: 8px;
  background: #ecfdf5;
  color: #146c43;
  box-shadow: 0 14px 32px rgba(15, 28, 39, .18);
  font-size: 13px;
  font-weight: 850;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.error {
  border-color: #f0b8bd;
  background: #fff1f2;
  color: #b4232c;
}

.content.register-expanded .summary,
.content.register-expanded .workflow { display: none; }
.app.register-focus .topbar { display: none; }
.content.register-expanded { padding-top: 10px; }
.content.register-expanded .panel { min-height: calc(100vh - 20px); }
.content.register-expanded .table-wrap { max-height: calc(100vh - 166px); }

@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 15;
    transform: translateX(-100%);
    opacity: 0;
    width: 278px;
    box-shadow: 12px 0 28px rgba(10,20,28,.2);
  }
  .app.mobile-sidebar-open .sidebar { transform: translateX(0); opacity: 1; pointer-events: auto; }
  .summary, .workflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-grid { grid-template-columns: 1fr; }
  .table-wrap { max-height: none; }
  .app.sidebar-collapsed { grid-template-columns: 1fr; }
  .app.sidebar-collapsed .sidebar-edge { display: none; }
}

@media (max-width: 760px) {
  .topbar { align-items: stretch; flex-direction: column; }
  .title-row { width: 100%; }
  .toolbar { justify-content: stretch; }
  select, input, .btn, .user-chip { width: 100%; min-width: 0; }
  .summary, .workflow, .filters { grid-template-columns: 1fr; }
  .bulk-controls, .bulk-summary-row { grid-template-columns: 1fr; }
  .bulk-section-head { align-items: stretch; flex-direction: column; }
  .content { padding: 12px; }
  .panel .table-wrap { display: none; }
  .mobile-list { display: grid; }
  .panel-head { align-items: stretch; flex-direction: column; }
  .drawer { width: 100vw; }
  .modal-body { grid-template-columns: 1fr; }
  .import-modal { width: calc(100vw - 18px); }
  .import-head, .import-foot { align-items: stretch; flex-direction: column; }
  .import-head-actions { width: 100%; justify-content: space-between; }
  .import-upload, .import-stats { grid-template-columns: 1fr; }
}
