:root {
  --ink: #172033;
  --muted: #687286;
  --line: #dfe4ec;
  --surface: #f5f7fa;
  --paper: #ffffff;
  --blue: #1359c4;
  --blue-soft: #eaf1ff;
  --red: #b63b4a;
  --red-soft: #fff0f2;
  --green: #187954;
  --green-soft: #e8f6ef;
  --amber: #926000;
  --amber-soft: #fff6db;
  --sidebar: #111a2b;
  --shadow: 0 18px 50px rgba(21, 35, 58, .18);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 1120px;
  background: var(--surface);
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: white;
  background: var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.3);
  font: 700 19px Georgia, serif;
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .03em; }
.brand small { margin-top: 3px; color: #9ca9bd; font-size: 12px; }

nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  color: #b7c1d0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}

.nav-item:hover { color: white; transform: translateX(2px); }
.nav-item.active { color: white; background: rgba(255,255,255,.09); }
.nav-item b { font-size: 12px; color: #8290a7; }
.nav-anchor { text-decoration: none; }

.sidebar-note {
  margin-top: auto;
  padding: 15px 10px 3px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-note strong,
.sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { margin-top: 5px; color: #8190a7; font-size: 10px; line-height: 1.45; }

.sidebar-status {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: auto;
  padding: 15px 10px 3px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.phone-status-block { margin-top: 10px; }

.sidebar-status strong, .sidebar-status small { display: block; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { margin-top: 3px; color: #8190a7; font-size: 10px; }
.sidebar-link {
  margin: 7px 0 0;
  padding: 0;
  color: #a9b8ce;
  border: 0;
  border-bottom: 1px solid #53627a;
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7c879a;
  box-shadow: 0 0 0 4px rgba(255,255,255,.05);
}
.status-dot.online { background: #49ca96; }
.status-dot.offline { background: #e06878; }

.phone-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0 15px;
  border-bottom: 1px solid var(--line);
}
.phone-toolbar span {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}
.button.phone-primary,
.button.call-accept {
  color: white;
  background: var(--green);
}
.button.call-reject {
  color: white;
  background: var(--red);
}

.call-history { display: grid; gap: 0; }
.call-history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.call-history-row:last-child { border-bottom: 0; }
.call-history-row strong,
.call-history-row small { display: block; }
.call-history-row small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.call-history-row > span { color: var(--muted); font-size: 11px; }

.incoming-call {
  position: fixed;
  z-index: 80;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(680px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 9px;
  color: white;
  background: #13243a;
  box-shadow: 0 22px 70px rgba(8, 18, 33, .3);
  transform: translateX(-50%);
  animation: incoming-enter .24s ease-out both;
}
.incoming-pulse {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4bd19b;
  box-shadow: 0 0 0 0 rgba(75,209,155,.5);
  animation: incoming-pulse 1.4s ease-out infinite;
}
.incoming-copy small,
.incoming-copy strong,
.incoming-copy span { display: block; }
.incoming-copy small { color: #9eb0c8; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.incoming-copy strong { margin-top: 2px; font-size: 15px; }
.incoming-copy span { margin-top: 2px; color: #c2cedd; font-size: 11px; }
.incoming-actions { display: flex; gap: 7px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.phone-permissions-note {
  margin-top: 18px;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@keyframes incoming-enter {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes incoming-pulse {
  70% { box-shadow: 0 0 0 9px rgba(75,209,155,0); }
  100% { box-shadow: 0 0 0 0 rgba(75,209,155,0); }
}

.workspace {
  min-width: 0;
  padding: 30px 36px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.faculty-context { min-width: min(560px, 52vw); }
.faculty-picker {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}
.faculty-picker > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.faculty-picker select {
  width: 100%;
  min-height: 46px;
  padding: 0 40px 0 14px;
  color: var(--ink);
  border: 1px solid #cbd4e2;
  border-radius: 7px;
  background: var(--paper);
  font-weight: 700;
  box-shadow: 0 5px 18px rgba(21, 35, 58, .06);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 29px; letter-spacing: -.025em; }
h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.015em; }
h3 { margin-bottom: 0; font-size: 15px; }

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.freshness { color: var(--muted); font-size: 12px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .5; cursor: wait; transform: none; }
.button.primary { color: white; background: var(--blue); }
.button.secondary { color: var(--ink); border-color: var(--line); background: white; }
.button.ghost { color: var(--blue); border-color: transparent; background: var(--blue-soft); }

.import-workspace { max-width: 1260px; }
.import-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.import-header > div { max-width: 760px; }
.import-lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.current-source {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}
.current-source h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-source p:not(.eyebrow) {
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.current-source dl,
.import-result dl {
  display: flex;
  gap: 34px;
  margin: 0;
}
.current-source dt,
.import-result dt { color: var(--muted); font-size: 10px; }
.current-source dd,
.import-result dd { margin: 5px 0 0; font-size: 13px; font-weight: 750; }
.import-flow { padding: 34px 0; border-bottom: 1px solid var(--line); }
.flow-copy {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: start;
}
.flow-copy p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.flow-number {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.dropzone {
  display: grid;
  place-items: center;
  min-height: 178px;
  margin: 25px 0 19px 53px;
  padding: 28px;
  border: 1px dashed #a9b7ca;
  border-radius: 8px;
  background: rgba(255,255,255,.6);
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone:hover,
.dropzone:focus,
.dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-1px); }
.dropzone.has-file { border-style: solid; border-color: #6cae91; background: var(--green-soft); }
.dropzone.locked { cursor: wait; opacity: .62; transform: none; }
.dropzone-icon {
  display: grid;
  width: 54px;
  height: 44px;
  place-items: center;
  margin-bottom: 13px;
  color: var(--green);
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
}
.dropzone strong { font-size: 15px; }
.dropzone > span:last-child { margin-top: 6px; color: var(--muted); font-size: 11px; }
.import-options {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-left: 53px;
}
.import-options label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}
.import-start { min-height: 40px; margin-bottom: 20px; }
.import-warning {
  margin: 18px 0 0 53px;
  padding-left: 12px;
  color: var(--amber);
  border-left: 2px solid #d5a42e;
  font-size: 11px;
  line-height: 1.5;
}
.job-status {
  padding: 6px 9px;
  color: var(--muted);
  border-radius: 5px;
  background: #e9edf3;
  font-size: 10px;
  font-weight: 750;
}
.job-status.running,
.job-status.queued { color: #174f9e; background: var(--blue-soft); }
.job-status.completed { color: var(--green); background: var(--green-soft); }
.job-status.failed { color: var(--red); background: var(--red-soft); }
.progress-track {
  overflow: hidden;
  height: 5px;
  margin: 26px 0 22px 53px;
  border-radius: 3px;
  background: #dfe5ed;
}
.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width .45s ease;
}
.stage-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 0 0 53px;
  padding: 0;
  list-style: none;
}
.stage-list li {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 8px;
  align-items: center;
  padding-right: 16px;
  color: #9aa4b4;
}
.stage-list li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #c8d0dc;
  border-radius: 50%;
  font-size: 9px;
}
.stage-list strong { font-size: 10px; line-height: 1.35; }
.stage-list li.active { color: var(--blue); }
.stage-list li.active > span { color: white; border-color: var(--blue); background: var(--blue); }
.stage-list li.done { color: var(--green); }
.stage-list li.done > span { border-color: var(--green); }
.stage-list li.failed { color: var(--red); }
.stage-list li.failed > span { color: white; border-color: var(--red); background: var(--red); }
.import-log { margin: 24px 0 0 53px; border-top: 1px solid var(--line); }
.import-log summary { padding: 14px 0; color: var(--muted); font-size: 11px; cursor: pointer; }
.import-log pre {
  max-height: 230px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  color: #cbd7e7;
  border-radius: 6px;
  background: #152034;
  font: 10px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}
.import-result {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 28px 48px;
  align-items: center;
  margin-top: 32px;
  padding: 25px 28px;
  border-left: 4px solid var(--green);
  background: var(--green-soft);
}
.import-result.failed { border-left-color: var(--red); background: var(--red-soft); }
.import-result p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.import-result dl { display: grid; grid-template-columns: repeat(3, auto); gap: 18px 30px; }
.import-result dd { font-size: 18px; }
.result-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  margin: 26px 0 0;
  border-bottom: 1px solid var(--line);
}

.metric {
  position: relative;
  min-height: 112px;
  padding: 6px 22px 22px 0;
}
.metric + .metric { padding-left: 22px; border-left: 1px solid var(--line); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 12px; font-weight: 600; }
.metric strong { display: block; margin: 8px 0 5px; font-size: 29px; letter-spacing: -.04em; }
.metric small { font-size: 11px; }
.metric.urgent strong { color: var(--blue); }
.metric.critical strong { color: var(--red); }

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(155px, .8fr));
  gap: 12px;
  align-items: end;
  margin: 24px 0 20px;
}

.email-template-selector {
  display: block;
  margin: 10px 0 12px;
}

label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: white;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input, select { height: 40px; padding: 0 11px; }
textarea { padding: 10px 11px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  border-color: #7aa7eb;
  box-shadow: 0 0 0 3px rgba(19,89,196,.1);
}

.table-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.table-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 20px 17px;
  border-bottom: 1px solid var(--line);
}
.table-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.result-count {
  padding: 5px 8px;
  color: var(--muted);
  border-radius: 5px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 700;
}

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 10px 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sort-column {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}
.sort-column span {
  color: #a6afbd;
  font-size: 12px;
  line-height: 1;
  transition: color .12s ease, transform .12s ease;
}
.sort-column:hover,
.sort-column:focus-visible,
.sort-column.active { color: var(--blue); }
.sort-column:hover span,
.sort-column:focus-visible span,
.sort-column.active span { color: var(--blue); transform: translateY(-1px); }
.sort-column:focus-visible { outline: 2px solid rgba(19,89,196,.28); outline-offset: 4px; }
td {
  padding: 12px 13px;
  border-bottom: 1px solid #edf0f4;
  font-size: 12px;
  vertical-align: middle;
}
tbody tr { cursor: pointer; transition: background .12s ease; }
tbody tr:hover { background: #f7f9fc; }

.person strong, .person small { display: block; }
.person strong { font-size: 12px; }
.person small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.priority-cell { display: flex; align-items: center; gap: 8px; }
.priority-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 7px;
  border-radius: 4px;
  color: #4a566a;
  background: #edf1f6;
  font-size: 10px;
  font-weight: 700;
}
.tag.blue { color: #174f9e; background: var(--blue-soft); }
.tag.green { color: var(--green); background: var(--green-soft); }
.tag.red { color: var(--red); background: var(--red-soft); }
.tag.amber { color: var(--amber); background: var(--amber-soft); }

.loading, .empty { padding: 48px; color: var(--muted); text-align: center; }
.load-more { display: block; margin: 16px auto; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  visibility: hidden;
  background: rgba(15,23,38,.22);
  opacity: 0;
  transition: opacity .18s ease, visibility .18s ease;
}
.drawer-backdrop.open { visibility: visible; opacity: 1; }

.drawer {
  position: fixed;
  z-index: 21;
  top: 0;
  right: 0;
  width: min(690px, 52vw);
  height: 100vh;
  overflow: hidden;
  background: white;
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform .22s cubic-bezier(.2,.8,.2,1);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 13px;
  align-items: center;
  min-height: 91px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-head .eyebrow { margin-bottom: 3px; }
.drawer-head h2 { font-size: 21px; }
.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  border: 0;
  border-radius: 50%;
  background: var(--surface);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.drawer-body {
  height: calc(100vh - 91px);
  overflow-y: auto;
  padding: 22px 26px 50px;
}

.contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--muted);
  font-size: 12px;
}
.contact-line a { color: var(--blue); text-decoration: none; }

.decision-strip {
  margin: 20px 0 0;
  padding: 15px 17px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 1.55;
}

.drawer-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.section-title span { color: var(--muted); font-size: 10px; }

.positions { border-top: 1px solid var(--line); }
.position-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) 68px 92px 108px 96px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.position-row.position-header {
  padding: 8px 0;
  color: var(--muted);
  background: #fafbfc;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.position-row .cutoff-safe strong { color: var(--green); }
.position-row strong, .position-row small { display: block; }
.position-row small { margin-top: 3px; color: var(--muted); }
.position-row.target { color: #0f4f9f; background: linear-gradient(90deg, var(--blue-soft), transparent 80%); }

.two-column {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 14px;
}

.messages {
  display: grid;
  gap: 9px;
  min-height: 44px;
  margin-bottom: 16px;
}
.message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 12px;
  line-height: 1.45;
}
.message a,
.batch-message a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.message.out { justify-self: end; background: var(--blue-soft); }
.message.in { justify-self: start; }
.message small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}
.messages-empty { color: var(--muted); font-size: 12px; }
.composer-tabs {
  display: inline-flex;
  gap: 3px;
  margin-top: 14px;
  padding: 3px;
  border-radius: 7px;
  background: var(--surface);
}
.composer-tab {
  padding: 7px 12px;
  color: var(--muted);
  border: 0;
  border-radius: 5px;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.composer-tab:hover { color: var(--ink); }
.composer-tab.active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(15, 23, 38, .12);
}
.composer-panel { margin-top: 10px; }
.message-meta {
  margin: 8px 0 0;
  padding-left: 11px;
  border-left: 2px solid var(--blue);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.message-meta strong { color: var(--text); }
.sms-recipient {
  display: block;
  max-width: 310px;
  margin-top: 10px;
}
.delivery-recipient { margin-bottom: 2px; }
.channel-template-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.composer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.delivery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  padding: 12px 15px;
  color: white;
  border-radius: 7px;
  background: #152238;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9e3040; }

dialog {
  width: min(470px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  border-radius: 9px;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(15,23,38,.42); }
.settings-dialog { padding: 24px; }
.wide-dialog { width: min(820px, calc(100vw - 40px)); }
.batch-dialog { padding: 24px; }
.settings-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.settings-copy {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.settings-dialog label { display: block; margin-top: 13px; }
.password-dialog { max-height: min(760px, calc(100vh - 40px)); overflow-y: auto; }
.password-dialog h2 { margin: 4px 0 0; }
.password-dialog label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.password-dialog input,
.password-dialog select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
.password-dialog input:focus,
.password-dialog select:focus { outline: 3px solid rgba(19,89,196,.12); border-color: var(--blue); }
.password-hint { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.password-feedback { margin: 12px 0 0; padding: 10px 12px; color: var(--green); background: var(--green-soft); border-radius: 7px; font-size: 11px; line-height: 1.45; }
.password-feedback.error { color: var(--red); background: var(--red-soft); }
.admin-password-section { margin-top: 24px; }
.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.full-width { width: 100%; }
.auth-step {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.auth-step .button { margin-top: 10px; }

.batch-controls {
  display: grid;
  grid-template-columns: 150px 220px 1fr;
  gap: 12px;
  align-items: end;
}
.batch-controls label { margin: 0; }
.batch-summary {
  margin-top: 18px;
  padding: 13px 15px;
  border-left: 3px solid var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  line-height: 1.5;
}
.batch-summary.warning {
  border-left-color: var(--red);
  background: #fff1f3;
}
.batch-preview {
  display: grid;
  gap: 10px;
  max-height: 330px;
  overflow-y: auto;
  margin-top: 14px;
}
.batch-preview-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.batch-preview-item strong,
.batch-preview-item small { display: block; }
.batch-preview-item small { margin-top: 4px; color: var(--muted); }
.batch-message {
  white-space: pre-wrap;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.5;
}
.batch-confirm {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
}
.batch-confirm input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 1px;
}
.batch-confirm span {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.4;
}

.mobile-workspace { max-width: 1280px; }
.mobile-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  padding: 42px 0 32px;
  border-bottom: 1px solid var(--line);
}
.mobile-header > div { max-width: 760px; }
.mobile-header h1 { margin: 5px 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.03; letter-spacing: -.035em; }
.mobile-header p:not(.eyebrow) { max-width: 660px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.mobile-download { flex: 0 0 auto; min-width: 215px; text-align: center; }
.desktop-downloads { display: grid; gap: 9px; flex: 0 0 auto; }
.desktop-downloads .mobile-download { box-sizing: border-box; width: 100%; }
.mobile-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.mobile-status > div { padding: 23px 30px 23px 0; }
.mobile-status > div + div { padding-left: 30px; border-left: 1px solid var(--line); }
.mobile-status span, .mobile-status strong, .mobile-status small { display: block; }
.mobile-status span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.mobile-status strong { margin-top: 7px; font-size: 18px; }
.mobile-status small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.mobile-devices { padding: 46px 0; border-bottom: 1px solid var(--line); }
.mobile-device-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 52px;
  margin-top: 30px;
}
.mobile-device-layout > * + * { padding-left: 52px; border-left: 1px solid var(--line); }
.mobile-device-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.mobile-device-list-head strong, .mobile-pair > div strong { font-size: 14px; }
.mobile-device-list { margin-top: 10px; border-top: 1px solid var(--line); }
.mobile-device-empty { margin: 0; padding: 24px 0; color: var(--muted); font-size: 13px; }
.mobile-device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.mobile-device-identity { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; align-items: start; }
.mobile-device-indicator { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: #a7b0bb; }
.mobile-device-indicator.online { background: #198754; box-shadow: 0 0 0 4px rgba(25,135,84,.1); }
.mobile-device-copy strong, .mobile-device-copy span, .mobile-device-copy small { display: block; }
.mobile-device-copy strong { font-size: 14px; }
.mobile-device-copy span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.mobile-device-copy small { margin-top: 5px; color: #78889a; font-size: 11px; }
.mobile-device-actions { display: flex; align-items: center; gap: 8px; }
.mobile-device-actions .button { padding: 8px 11px; font-size: 11px; }
.mobile-pair { display: grid; align-content: start; gap: 15px; }
.mobile-pair > div p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.mobile-pair label { display: grid; gap: 7px; }
.mobile-pair label span { color: var(--muted); font-size: 11px; font-weight: 750; }
.mobile-pair input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: white;
  color: var(--ink); font: 700 20px ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .18em;
}
.mobile-pair input:focus { outline: 3px solid rgba(33,102,167,.14); border-color: var(--blue); }
.mobile-pair .button { justify-self: start; }
.mobile-pair > small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.mobile-setup, .mobile-operation { padding: 46px 0; border-bottom: 1px solid var(--line); }
.mobile-section-heading { max-width: 690px; }
.mobile-section-heading h2 { margin: 5px 0 8px; font-size: 28px; letter-spacing: -.02em; }
.mobile-section-heading > p:not(.eyebrow) { margin: 0; color: var(--muted); }
.mobile-install-permission {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  gap: 10px 52px;
  margin-top: 30px;
  padding: 22px 0 22px 22px;
  border-left: 3px solid var(--blue);
}
.mobile-install-permission h3 { margin: 5px 0 8px; font-size: 20px; }
.mobile-install-permission > div > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.mobile-install-permission ol { margin: 0; padding-left: 20px; color: var(--ink); font-size: 12px; line-height: 1.65; }
.mobile-install-permission li + li { margin-top: 5px; }
.mobile-install-path { grid-column: 2; margin: 10px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.mobile-install-path p { margin: 0; }
.mobile-install-path p + p { margin-top: 7px; }
.mobile-install-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.mobile-install-links .text-action { margin-top: 0; text-decoration: none; }
.mobile-install-permission > .text-action { grid-column: 2; justify-self: start; margin-top: 5px; text-decoration: none; }
.mobile-steps { margin: 32px 0 0; padding: 0; list-style: none; }
.mobile-steps li { display: grid; grid-template-columns: 64px minmax(0, 720px); gap: 22px; padding: 23px 0; border-top: 1px solid var(--line); }
.mobile-steps li > span { color: var(--blue); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.mobile-steps h3, .mobile-copy-columns h3 { margin: 0 0 7px; font-size: 16px; }
.mobile-steps p, .mobile-copy-columns p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.58; }
.text-action { margin: 12px 0 0; padding: 0; border: 0; background: transparent; color: var(--blue); font: inherit; font-size: 12px; font-weight: 750; cursor: pointer; }
.mobile-copy-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 38px; margin-top: 30px; }
.mobile-security { margin: 34px 0 54px; padding: 20px 0 20px 22px; border-left: 3px solid var(--red); }
.mobile-security strong { font-size: 14px; }
.mobile-security p { max-width: 800px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.users-workspace { max-width: 1320px; }
.users-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.users-header h1 { margin: 5px 0 9px; font-size: 32px; letter-spacing: -.03em; }
.users-header p:not(.eyebrow) { max-width: 650px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.users-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) minmax(210px, 1.4fr);
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.users-summary > div { padding: 2px 24px; border-right: 1px solid var(--line); }
.users-summary > div:first-child { padding-left: 0; }
.users-summary span, .users-summary strong { display: block; }
.users-summary span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.users-summary strong { margin-top: 8px; font-size: 24px; }
.users-filter { display: grid; gap: 6px; align-content: center; padding-left: 28px; }
.users-filter select {
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
.users-list { padding: 32px 0 60px; }
.users-list-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.users-list-head h2 { margin: 0; font-size: 21px; }
.users-list-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.users-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.users-table { min-width: 900px; }
.users-table th { white-space: nowrap; }
.users-table td { padding: 15px 13px; vertical-align: middle; }
.users-table tbody tr { cursor: default; }
.users-table td > strong, .users-table td > small { display: block; }
.users-table td > strong { font-size: 12px; }
.users-table td > small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.user-row-inactive { opacity: .62; }
.user-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 750; }
.user-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.user-state.active { color: var(--green); }
.user-state.active::before { background: var(--green); }
.user-state.inactive { color: var(--muted); }
.user-state.inactive::before { background: #9aa4b3; }
.user-row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.user-row-actions .button { min-height: 32px; padding: 7px 10px; font-size: 10px; }
.button.danger-quiet { color: var(--red); border-color: #f0cbd1; background: var(--red-soft); }
.users-empty { padding: 38px 12px !important; color: var(--muted); text-align: center; }
#userDialog { width: min(700px, calc(100vw - 40px)); }
.user-dialog-content { max-height: min(780px, calc(100vh - 40px)); overflow-y: auto; }
.user-dialog-content h2 { margin: 4px 0 0; }
.user-dialog-content label { display: block; margin-top: 14px; }
.user-dialog-content label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 750; }
.user-dialog-content input:not([type="checkbox"]),
.user-dialog-content select {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}
.user-dialog-content input:focus,
.user-dialog-content select:focus { outline: 3px solid rgba(19,89,196,.12); border-color: var(--blue); }
.user-dialog-content label small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.user-form-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.user-active-field { display: flex !important; align-items: center; gap: 9px; padding-top: 4px; }
.user-active-field input { width: 17px; height: 17px; margin: 0; }
.user-active-field span { margin: 0 !important; color: var(--ink) !important; }

.desktop-header h1 { max-width: 720px; }
.desktop-purpose {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(420px, 1.15fr);
  gap: 64px;
  align-items: start;
  padding: 46px 0;
  border-bottom: 1px solid var(--line);
}
.desktop-capabilities { margin: 0; border-top: 1px solid var(--line); }
.desktop-capabilities > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.desktop-capabilities dt { color: var(--ink); font-size: 12px; font-weight: 750; }
.desktop-capabilities dd { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.mobile-steps code,
.desktop-windows code {
  padding: 2px 5px;
  color: #183e73;
  border-radius: 4px;
  background: var(--blue-soft);
  font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}
.desktop-windows {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
  gap: 54px;
  margin: 34px 0 54px;
  padding: 22px 0 22px 22px;
  border-left: 3px solid var(--blue);
}
.desktop-windows h2 { margin: 5px 0 9px; }
.desktop-windows p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.desktop-note { align-self: center; }

@media (max-width: 850px) {
  .mobile-header { align-items: flex-start; flex-direction: column; gap: 22px; }
  .mobile-status, .mobile-copy-columns { grid-template-columns: 1fr; }
  .mobile-status > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .mobile-device-layout { grid-template-columns: 1fr; gap: 32px; }
  .mobile-device-layout > * + * { padding: 30px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .mobile-install-permission { grid-template-columns: 1fr; gap: 18px; }
  .mobile-install-path, .mobile-install-permission > .text-action { grid-column: 1; }
  .desktop-purpose, .desktop-windows { grid-template-columns: 1fr; gap: 28px; }
  .users-header { align-items: flex-start; flex-direction: column; }
  .users-summary { grid-template-columns: repeat(3, 1fr); }
  .users-filter { grid-column: 1 / -1; margin-top: 20px; padding: 18px 0 0; border-top: 1px solid var(--line); }
}

@media (max-width: 560px) {
  .mobile-device-row { grid-template-columns: 1fr; }
  .mobile-device-actions { padding-left: 22px; }
}

@media (max-width: 1250px) {
  .workspace { padding-left: 24px; padding-right: 24px; }
  .filters { grid-template-columns: 1.4fr repeat(2, 1fr); }
  .filters .button { grid-column: 3; }
  .batch-preview-item { grid-template-columns: 140px 1fr; }
}
.login-page { min-height: 100vh; background: #edf2f7; color: #15263b; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.15fr) minmax(340px, .85fr); }
.login-intro { padding: clamp(44px, 8vw, 110px); background: #12365d; color: white; display: flex; flex-direction: column; justify-content: center; }
.login-intro .brand-mark { margin-bottom: 48px; }
.login-intro h1 { font-size: clamp(38px, 5.5vw, 76px); letter-spacing: -.045em; line-height: .96; margin: 8px 0 28px; }
.login-intro > p:not(.eyebrow) { max-width: 620px; font-size: 18px; line-height: 1.65; color: #d9e6f3; }
.login-intro > small { max-width: 620px; margin-top: 48px; color: #9fb7cf; line-height: 1.55; }
.login-card { align-self: center; width: min(430px, calc(100% - 48px)); margin: 24px auto; display: grid; gap: 22px; padding: clamp(28px, 5vw, 52px); background: white; border-radius: 18px; box-shadow: 0 24px 70px rgba(26, 46, 71, .15); }
.login-card h2 { margin: 4px 0 0; font-size: 30px; }
.login-card label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; color: #42566e; }
.login-card input { width: 100%; box-sizing: border-box; border: 1px solid #cad5e0; border-radius: 10px; padding: 13px 14px; font-size: 16px; }
.login-card a { color: #2166a7; line-height: 1.45; }
.login-error { margin: -6px 0; color: #a62929; background: #fff0f0; padding: 10px 12px; border-radius: 8px; }
@media (max-width: 760px) { .login-shell { grid-template-columns: 1fr; } .login-intro { padding: 34px 28px; } .login-intro .brand-mark, .login-intro > small { display: none; } .login-intro h1 { font-size: 42px; } }
.sidebar-account { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 4px; }
.sidebar-account span { color: #9fb7cf; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-account strong { color: white; }
.sidebar-account-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.sidebar-account button { border: 0; background: transparent; color: #bad5ee; padding: 0; cursor: pointer; }

@media (max-width: 760px) {
  body.mobile-page { min-width: 0; }
  .mobile-shell { display: block; }
  .mobile-shell .sidebar {
    position: static;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px 18px;
    padding: 14px 16px 12px;
  }
  .mobile-shell .brand { min-width: 0; padding: 0; }
  .mobile-shell .brand-mark { width: 34px; height: 34px; }
  .mobile-shell .brand strong { font-size: 13px; }
  .mobile-shell .brand small { font-size: 10px; }
  .mobile-shell nav {
    grid-column: 1 / -1;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-shell nav::-webkit-scrollbar { display: none; }
  .mobile-shell .nav-item { flex: 0 0 auto; width: auto; padding: 8px 10px; white-space: nowrap; }
  .mobile-shell .nav-item b { margin-left: 12px; font-size: 10px; }
  .mobile-shell .sidebar-note { display: none; }
  .mobile-shell .sidebar-account {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
  }
  .mobile-shell .sidebar-account span { display: none; }
  .mobile-shell .sidebar-account strong { font-size: 12px; }
  .mobile-shell .sidebar-account-actions { justify-content: flex-end; margin-top: 3px; }
  .mobile-shell .sidebar-account button { font-size: 10px; }
  .mobile-workspace { padding: 20px 18px 46px; }
  .mobile-header { padding: 18px 0 26px; }
  .mobile-header h1 { font-size: 34px; }
  .mobile-download { width: 100%; }
  .mobile-status > div { padding: 18px 0; }
  .mobile-devices, .mobile-setup, .mobile-operation { padding: 34px 0; }
  .mobile-section-heading h2 { font-size: 25px; }
  .mobile-steps li { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; }
}
