:root {
  --bg: #07111f;
  --bg-soft: #0d1b30;
  --panel: rgba(12, 22, 38, 0.86);
  --panel-strong: rgba(16, 27, 46, 0.96);
  --line: rgba(176, 199, 255, 0.16);
  --line-strong: rgba(176, 199, 255, 0.28);
  --text: #f2f6ff;
  --muted: #92a3c5;
  --muted-2: #6780ab;
  --accent: #79a7ff;
  --accent-2: #5fe0c9;
  --warn: #ffcf5a;
  --danger: #ff7d7d;
  --good: #69e29c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(121, 167, 255, 0.18), transparent 30%),
    radial-gradient(circle at top right, rgba(95, 224, 201, 0.12), transparent 28%),
    linear-gradient(180deg, #06101d 0%, #091427 45%, #07111f 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1540px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 20px;
}

.topbar,
.subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 12px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(24, 52, 99, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.auth-brand-mark {
  margin-bottom: 8px;
}

.eyebrow {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05;
}

.muted {
  color: var(--muted);
}

.chips,
.toolbar,
.topbar-actions,
.drawer-actions,
.job-meta,
.card-meta,
.login-actions,
.login-role-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.search {
  min-width: min(480px, 100%);
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 14, 25, 0.72);
  color: var(--text);
}

.search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.search input::placeholder {
  color: var(--muted-2);
}

.btn,
.btn-ghost,
.btn-soft,
.btn-danger,
.role-card button,
.auth-submit {
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.btn,
.btn-ghost,
.btn-soft,
.btn-danger,
.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  font-weight: 700;
}

.btn {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent), #9cc0ff);
  box-shadow: 0 10px 24px rgba(121, 167, 255, 0.25);
}

.btn-soft {
  color: var(--text);
  background: rgba(121, 167, 255, 0.12);
  border-color: var(--line);
}

.btn-ghost {
  padding: 11px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(135deg, #ff7d7d, #e85f6c);
}

.btn:hover,
.btn-soft:hover,
.btn-ghost:hover,
.btn-danger:hover,
.role-card button:hover,
.auth-submit:hover {
  transform: translateY(-1px);
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.stat .label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat .value {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 232px);
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  align-items: start;
}

.column {
  min-height: calc(100vh - 230px);
  background: rgba(6, 12, 22, 0.66);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--line);
}

.column-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.column-title strong {
  font-size: 16px;
}

.column-title span {
  color: var(--muted);
  font-size: 12px;
}

.count-pill,
.status-pill,
.mini-pill {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.column-drop {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.column-drop.drag-over {
  background: rgba(121, 167, 255, 0.08);
}

.job-card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: grab;
}

.job-card:active {
  cursor: grabbing;
}

.job-card.dragging {
  opacity: 0.5;
}

.job-card .title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.job-card h3 {
  font-size: 15px;
  line-height: 1.2;
}

.job-card .customer {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.job-card .details {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.job-card .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.job-card .actions .mini-pill {
  cursor: pointer;
}

.dispatch-shell {
  width: min(1640px, calc(100vw - 18px));
}

.dispatch-page {
  background:
    linear-gradient(180deg, #4d88db 0 74px, #edf3fb 74px 100%);
  color: #132238;
}

.dispatch-page .shell {
  width: min(1880px, calc(100vw - 14px));
  padding-top: 10px;
}

.dispatch-page .dispatch-shell {
  padding-bottom: 10px;
}

.dispatch-page .brand .eyebrow,
.dispatch-page .brand h1,
.dispatch-page .brand .muted,
.dispatch-page .topbar-actions .btn-ghost,
.dispatch-page .subnav-link,
.dispatch-page .dispatch-subnav,
.dispatch-page .dispatch-toolbar,
.dispatch-page .dispatch-search-row,
.dispatch-page .dispatch-metrics,
.dispatch-page .status-pill,
.dispatch-page .count-pill,
.dispatch-page .day-pill,
.dispatch-page .mini-toggle,
.dispatch-page .day-nav,
.dispatch-page .search,
.dispatch-page .search input,
.dispatch-page .tray-filter,
.dispatch-page .tech-badge,
.dispatch-page .dispatch-head-corner,
.dispatch-page .dispatch-time-head,
.dispatch-page .dispatch-tech-cell,
.dispatch-page .dispatch-slot,
.dispatch-page .dispatch-tray,
.dispatch-page .rail-card,
.dispatch-page .tech-card,
.dispatch-page .drawer,
.dispatch-page .detail,
.dispatch-page .timeline-item,
.dispatch-page .stat {
  color: #132238;
}

.dispatch-page .status-pill,
.dispatch-page .count-pill,
.dispatch-page .mini-pill {
  background: #fff;
  border-color: rgba(75, 111, 169, 0.18);
  color: #1b2c45;
}

.dispatch-page .topbar {
  padding: 10px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #4d88db, #3f77c9);
  box-shadow: 0 10px 30px rgba(33, 68, 128, 0.16);
}

.dispatch-page .brand .eyebrow,
.dispatch-page .brand h1,
.dispatch-page .brand .muted {
  color: #fff;
}

.dispatch-page .topbar-actions .btn-ghost,
.dispatch-page .mini-toggle,
.dispatch-page .day-nav {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(33, 68, 128, 0.12);
  color: #1b2c45;
  box-shadow: 0 4px 12px rgba(28, 49, 86, 0.08);
}

.dispatch-page .btn-ghost:hover,
.dispatch-page .mini-toggle:hover,
.dispatch-page .day-nav:hover {
  background: #fff;
}

.dispatch-page .dispatch-subnav,
.dispatch-page .dispatch-toolbar,
.dispatch-page .dispatch-search-row,
.dispatch-page .dispatch-metrics,
.dispatch-page .dispatch-tray {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(75, 111, 169, 0.16);
  box-shadow: 0 8px 24px rgba(28, 49, 86, 0.07);
}

.dispatch-page .dispatch-subnav,
.dispatch-page .dispatch-toolbar,
.dispatch-page .dispatch-search-row {
  padding: 8px 10px;
  border-radius: 14px;
}

.dispatch-page .dispatch-metrics {
  border-radius: 14px;
  overflow: hidden;
}

.dispatch-page .stat {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(75, 111, 169, 0.12);
  box-shadow: none;
}

.dispatch-page .search {
  background: #fff;
}

.dispatch-page .search input::placeholder,
.dispatch-page .muted,
.dispatch-page .tech-meta,
.dispatch-page .dispatch-tech-meta,
.dispatch-page .dispatch-job-body,
.dispatch-page .dispatch-job-title span,
.dispatch-page .dispatch-job-foot,
.dispatch-page .timeline-item .muted,
.dispatch-page .drawer-subtitle,
.dispatch-page .detail .k,
.dispatch-page .detail .v {
  color: #63748f;
}

.dispatch-page .dispatch-layout {
  align-items: start;
}

.dispatch-page .dispatch-tech-rail {
  position: sticky;
  top: 10px;
  align-self: start;
}

.dispatch-page .rail-card,
.dispatch-page .tech-card,
.dispatch-page .dispatch-head-corner,
.dispatch-page .dispatch-time-head,
.dispatch-page .dispatch-tech-cell,
.dispatch-page .dispatch-slot,
.dispatch-page .drawer {
  background: #fff;
  border-color: rgba(75, 111, 169, 0.16);
}

.dispatch-page .dispatch-head-corner,
.dispatch-page .dispatch-tech-cell {
  position: sticky;
  left: 0;
  z-index: 2;
}

.dispatch-page .dispatch-board-head .dispatch-head-corner {
  z-index: 4;
}

.dispatch-page .dispatch-board-head .dispatch-time-head {
  position: sticky;
  top: 0;
  z-index: 3;
}

.dispatch-page .dispatch-tech-cell {
  z-index: 2;
}

.dispatch-page .dispatch-tech-cell.on_call,
.dispatch-page .dispatch-tech-cell.paused {
  background: #f6fbff;
}

.dispatch-page .dispatch-slot {
  min-height: 66px;
}

.dispatch-page .dispatch-job {
  background: #f8fbff;
  border-color: rgba(79, 134, 219, 0.28);
  box-shadow: 0 3px 10px rgba(31, 60, 114, 0.06);
}

.dispatch-page .dispatch-job.good {
  border-color: rgba(95, 224, 201, 0.45);
}

.dispatch-page .dispatch-job.warn {
  border-color: rgba(255, 207, 90, 0.45);
}

.dispatch-page .dispatch-tray {
  padding: 8px 10px;
}

.dispatch-page .tray-filter {
  background: #fff;
}

.dispatch-page .drawer-backdrop {
  background: rgba(13, 28, 54, 0.28);
}

.dispatch-page .drawer {
  color: #132238;
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.dispatch-page .drawer .btn,
.dispatch-page .drawer .btn-ghost,
.dispatch-page .drawer .btn-soft,
.dispatch-page .drawer .btn-danger {
  color: inherit;
}

.dispatch-topbar {
  margin-bottom: 8px;
}

.dispatch-nav {
  gap: 8px;
}

.dispatch-subnav,
.dispatch-toolbar,
.dispatch-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dispatch-subnav {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.dispatch-subnav-left,
.dispatch-subnav-right,
.dispatch-toolbar-left,
.dispatch-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subnav-link {
  font-size: 13px;
  color: var(--muted);
}

.subnav-link.active {
  color: var(--text);
  font-weight: 700;
}

.mini-toggle,
.day-nav {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
}

.mini-toggle.active,
.day-nav.active {
  background: rgba(121, 167, 255, 0.18);
  border-color: rgba(121, 167, 255, 0.32);
}

.day-pill {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 700;
}

.dispatch-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.dispatch-layout {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr);
  gap: 10px;
}

.dispatch-tech-rail {
  display: grid;
  gap: 10px;
}

.rail-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 10px;
}

.rail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tech-list,
.tray-filters,
.tray-cards {
  display: grid;
  gap: 8px;
}

.tech-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.tech-card.on_call {
  border-color: rgba(95, 224, 201, 0.3);
}

.tech-card.paused {
  border-color: rgba(255, 207, 90, 0.34);
}

.tech-card.off {
  opacity: 0.78;
}

.tech-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tech-name {
  font-weight: 800;
  font-size: 14px;
}

.tech-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.tech-badge {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--line);
  color: var(--text);
}

.tech-badge.on {
  background: rgba(95, 224, 201, 0.12);
}

.tech-badge.paused {
  background: rgba(255, 207, 90, 0.12);
}

.tech-badge.off {
  background: rgba(255, 125, 125, 0.12);
}

.tech-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dispatch-board-shell {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.board-scroll {
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 6px;
}

.dispatch-board {
  display: grid;
  gap: 6px;
  min-width: 1180px;
}

.dispatch-board-head,
.dispatch-row {
  display: grid;
  gap: 6px;
}

.dispatch-head-corner {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.dispatch-head-title {
  font-weight: 800;
}

.dispatch-time-head {
  min-height: 64px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.dispatch-row {
  align-items: stretch;
}

.dispatch-tech-cell,
.dispatch-slot {
  min-height: 74px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.dispatch-tech-cell {
  padding: 10px;
  display: grid;
  gap: 4px;
}

.dispatch-tech-cell.on_call {
  background: rgba(95, 224, 201, 0.08);
}

.dispatch-tech-cell.paused {
  background: rgba(255, 207, 90, 0.08);
}

.dispatch-tech-cell.off {
  opacity: 0.82;
}

.dispatch-tech-name {
  font-weight: 800;
  font-size: 14px;
}

.dispatch-tech-meta,
.dispatch-tech-status {
  color: var(--muted);
  font-size: 12px;
}

.dispatch-tech-status {
  color: var(--accent-2);
  font-weight: 700;
}

.dispatch-slot {
  padding: 6px;
  display: grid;
  gap: 6px;
  min-height: 74px;
}

.dispatch-slot.drag-over {
  border-color: rgba(121, 167, 255, 0.55);
  background: rgba(121, 167, 255, 0.08);
}

.dispatch-job {
  border: 1px solid rgba(121, 167, 255, 0.38);
  border-radius: 12px;
  background: rgba(88, 136, 255, 0.10);
  padding: 8px 9px;
  cursor: grab;
  display: grid;
  gap: 5px;
}

.dispatch-job.good {
  border-color: rgba(95, 224, 201, 0.35);
}

.dispatch-job.warn {
  border-color: rgba(255, 207, 90, 0.35);
}

.dispatch-job-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.dispatch-job-title {
  display: grid;
  gap: 2px;
}

.dispatch-job-title strong {
  font-size: 12px;
  line-height: 1.1;
}

.dispatch-job-title span,
.dispatch-job-body,
.dispatch-job-foot {
  color: var(--muted);
  font-size: 11px;
}

.dispatch-job-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dispatch-tray {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  padding: 10px;
}

.dispatch-tray-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tray-filter {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.tray-filter strong {
  color: var(--accent-2);
}

.tray-filter.active {
  border-color: rgba(121, 167, 255, 0.45);
  background: rgba(121, 167, 255, 0.14);
}

.tray-cards {
  min-height: 86px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.dispatch-search-row {
  margin-bottom: 10px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 7, 14, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  background: linear-gradient(180deg, rgba(13, 22, 37, 0.98), rgba(8, 15, 27, 0.98));
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.38);
  transform: translateX(102%);
  transition: transform 180ms ease;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-body {
  padding: 18px 20px 24px;
  overflow: auto;
  display: grid;
  gap: 18px;
}

.drawer-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.drawer-section h4 {
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.detail {
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.detail .k {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.detail .v {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.3;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(121, 167, 255, 0.14);
  color: var(--accent-2);
  border: 1px solid rgba(121, 167, 255, 0.28);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.section-box {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  overflow: clip;
}

.section-box + .section-box {
  margin-top: 10px;
}

.section-box > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid transparent;
}

.section-box[open] > summary {
  border-bottom-color: var(--line);
}

.section-box > summary::-webkit-details-marker {
  display: none;
}

.section-box > summary::after {
  content: "›";
  float: right;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}

.section-box[open] > summary::after {
  transform: rotate(270deg);
}

.section-box > .editor-form,
.section-box > .timeline {
  padding: 10px;
}

.compact-form {
  margin-top: 0;
}

.job-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.job-form-grid .span-2 {
  grid-column: 1 / -1;
}

.job-actions button {
  min-width: 76px;
}

.job-actions {
  gap: 6px;
  margin-top: 10px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  padding: 12px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.timeline-item .when {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.timeline-item .who {
  color: var(--accent-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.field-wrap {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.field-route {
  display: grid;
  gap: 14px;
}

.route-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.route-card .header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.route-card h2 {
  font-size: 20px;
  line-height: 1.15;
}

.route-card .subline {
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.route-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.route-actions button {
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  width: 100%;
}

.secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.secondary-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  width: 100%;
}

.route-actions button.primary {
  background: linear-gradient(135deg, var(--accent), #9cbefc);
  color: #07111f;
  border-color: transparent;
}

.route-actions button.success {
  background: linear-gradient(135deg, var(--accent-2), #8ff0d1);
  color: #07111f;
  border-color: transparent;
}

.route-actions button.warn {
  background: linear-gradient(135deg, var(--warn), #ffe08d);
  color: #07111f;
  border-color: transparent;
}

.empty-state,
.auth-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.empty-state {
  padding: 22px;
  color: var(--muted);
}

.auth-wrap {
  width: min(1040px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 40px;
}

.auth-hero {
  margin-bottom: 20px;
  display: grid;
  gap: 8px;
}

.auth-hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.98;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 16px;
}

.auth-panel {
  padding: 18px;
}

.role-card {
  display: grid;
  gap: 12px;
}

.role-card h2 {
  font-size: 22px;
}

.role-card p {
  color: var(--muted);
  line-height: 1.5;
}

.role-card button {
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--accent), #9cbefc);
  color: #07111f;
  border: 0;
  font-weight: 800;
}

.role-list {
  display: grid;
  gap: 12px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(95, 224, 201, 0.1);
  border: 1px solid rgba(95, 224, 201, 0.25);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-row {
  display: grid;
  gap: 10px;
}

.input-row label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.input-row input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

.input-row input:focus,
.search:focus-within {
  border-color: rgba(121, 167, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(121, 167, 255, 0.1);
}

.small-note {
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.5;
}

.workspace-shell {
  width: min(1360px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 24px;
}

.workspace-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(77, 143, 224, 0.95), rgba(63, 110, 193, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.workspace-top .eyebrow {
  color: rgba(255, 255, 255, 0.88);
}

.workspace-top .muted {
  color: rgba(240, 246, 255, 0.82);
}

.workspace-top .status-pill,
.workspace-top .btn-ghost {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.workspace-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.create-menu {
  position: relative;
}

.create-menu > summary {
  list-style: none;
}

.create-menu > summary::-webkit-details-marker {
  display: none;
}

.create-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(10, 18, 32, 0.98);
  border: 1px solid rgba(125, 154, 255, 0.18);
  box-shadow: 0 18px 44px rgba(2, 6, 23, 0.35);
  z-index: 20;
}

.viktor-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(125, 154, 255, 0.26);
  background: rgba(13, 24, 42, 0.96);
  color: #f8fbff;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.35);
  z-index: 40;
}

.viktor-fab:hover {
  background: rgba(20, 34, 56, 0.98);
  border-color: rgba(125, 154, 255, 0.42);
}

.viktor-fab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #58d68d;
  box-shadow: 0 0 0 4px rgba(88, 214, 141, 0.16);
}

.menu-item {
  width: 100%;
  display: block;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  margin: 0 0 6px;
}

.menu-item:hover {
  background: rgba(88, 136, 255, 0.16);
  border-color: rgba(88, 136, 255, 0.25);
}

.chip.active {
  background: rgba(88, 136, 255, 0.18);
  border-color: rgba(88, 136, 255, 0.35);
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  overflow-x: auto;
}

.tab-button {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent), #9cbefc);
  color: #07111f;
  border-color: transparent;
}

.workspace-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.summary-card .k,
.editor-card .k {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-card .v {
  font-size: 18px;
  font-weight: 800;
}

.summary-source {
  grid-column: 1 / -1;
  color: var(--muted-2);
  font-size: 12px;
  padding: 0 4px 0;
}

.summary-card .k {
  font-size: 11px;
}

@media (max-width: 1200px) {
  .summary-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 10px;
}

.workspace-grid.home-mode {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid.home-mode .workspace-sidebar {
  display: none;
}

.workspace-grid.schedule-mode {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-grid.schedule-mode .workspace-sidebar {
  display: none;
}

.workspace-shell.focus-mode .workspace-summary {
  display: none;
}

.workspace-shell.focus-mode .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-shell.focus-mode .workspace-sidebar {
  display: none;
}

.workspace-shell.focus-mode .workspace-main {
  grid-column: 1 / -1;
}

.home-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 280px;
  gap: 12px;
  align-items: start;
}

.home-main,
.home-side {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.home-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
}

.home-alert .title {
  font-size: 15px;
  font-weight: 800;
  margin: 2px 0;
}

.home-alert .action-row {
  margin: 0;
}

.home-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-launch-list {
  display: grid;
  gap: 8px;
}

.home-launch-card {
  min-height: 92px;
  padding: 14px 14px 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.home-launch-card strong {
  font-size: 16px;
}

.home-launch-card span {
  margin-top: 10px;
  line-height: 1.2;
}

.home-launch-grid-more {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.launch-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.launch-card strong {
  font-size: 14px;
}

.launch-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.home-panel {
  min-width: 0;
}

.home-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-quick-list {
  display: grid;
  gap: 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 10px;
}

.record-list {
  display: grid;
  gap: 6px;
}

.record-card {
  text-align: left;
  padding: 9px 11px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.record-card.active {
  border-color: rgba(88, 136, 255, 0.5);
  background: rgba(88, 136, 255, 0.18);
}

.record-card:hover,
.summary-card:hover,
.compact-row:hover,
.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(121, 167, 255, 0.45);
}

.record-card .title {
  font-weight: 700;
}

.record-card .subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.record-main {
  min-width: 0;
}

.record-arrow {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.chip strong {
  color: var(--accent-2);
}

.compact-list {
  display: grid;
  gap: 6px;
}

.compact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.compact-row.active {
  border-color: rgba(88, 136, 255, 0.45);
  background: rgba(88, 136, 255, 0.16);
}

.compact-left {
  min-width: 0;
}

.compact-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.customers-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.jobs-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.billing-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.pricebook-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.reputation-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.calls-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.media-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.team-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.activity-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.customers-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.customers-record-panel {
  min-width: 0;
}

.jobs-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.pricebook-list-panel,
.calls-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.reputation-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.pricebook-record-panel,
.calls-record-panel {
  min-width: 0;
}

.reputation-record-panel {
  min-width: 0;
}

.pricebook-layout,
.calls-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.reputation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 12px;
  margin-top: 12px;
}

.pricebook-stack,
.calls-stack {
  display: grid;
  gap: 12px;
}

.reputation-stack {
  display: grid;
  gap: 12px;
}

.pricebook-panel,
.calls-panel {
  min-width: 0;
}

.thread-list {
  display: grid;
  gap: 10px;
}

.thread-message {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 29, 0.45);
}

.thread-message.outbound {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}

.thread-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
}

.thread-subject {
  margin-top: 6px;
  font-weight: 700;
}

.thread-body {
  margin-top: 6px;
  white-space: pre-wrap;
  color: var(--text);
}

.reputation-panel {
  min-width: 0;
}

.estimate-entry,
.estimate-item-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(8, 16, 29, 0.55);
  overflow-x: auto;
}

.estimate-entry {
  margin-bottom: 12px;
}

.estimate-entry-grid,
.estimate-item-grid {
  display: grid;
  min-width: 760px;
  grid-template-columns: 130px minmax(0, 1.6fr) 96px 110px 92px minmax(0, 1fr);
  gap: 8px;
}

.estimate-item-grid {
  min-width: 640px;
  grid-template-columns: 130px minmax(0, 1.7fr) 96px 110px minmax(0, 1fr);
}

.estimate-entry input,
.estimate-entry select,
.estimate-item-row input,
.estimate-item-row select {
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 10px 12px;
}

.estimate-items {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.estimate-item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.estimate-item-total {
  margin-right: auto;
  font-weight: 700;
  color: var(--accent-2);
}

.pricebook-summary,
.calls-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reputation-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.jobs-record-panel {
  min-width: 0;
}

.billing-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.billing-record-panel {
  min-width: 0;
}

.media-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.media-record-panel {
  min-width: 0;
}

.team-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.activity-list-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.team-record-panel {
  min-width: 0;
}

.activity-record-panel {
  min-width: 0;
}

.customer-file {
  display: grid;
  gap: 12px;
}

.job-file {
  display: grid;
  gap: 12px;
}

.billing-file {
  display: grid;
  gap: 12px;
}

.media-file {
  display: grid;
  gap: 12px;
}

.team-panel {
  min-width: 0;
}

.activity-file {
  display: grid;
  gap: 12px;
}

.activity-panel {
  min-width: 0;
}

.customer-file-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-file-header h3 {
  font-size: 24px;
}

.customer-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 12px;
}

.job-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.billing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.media-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.activity-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 12px;
}

.billing-stack {
  display: grid;
  gap: 12px;
}

.media-stack {
  display: grid;
  gap: 12px;
}

.team-stack {
  display: grid;
  gap: 12px;
}

.activity-stack {
  display: grid;
  gap: 12px;
}

.customer-panel {
  min-width: 0;
}

.job-panel {
  min-width: 0;
}

.billing-panel {
  min-width: 0;
}

.media-panel {
  min-width: 0;
}

.team-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.team-form-grid .span-2 {
  grid-column: 1 / -1;
}

.job-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.media-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.team-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.activity-facts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.billing-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.media-section-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.media-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.media-form-grid .span-2 {
  grid-column: 1 / -1;
}

.customer-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.customer-form-grid .span-2 {
  grid-column: 1 / -1;
}

.compact-timeline {
  gap: 8px;
}

.editor-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
  padding: 10px;
}

.schedule-layout {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(180px, 200px) minmax(0, 1fr);
}

.schedule-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
}

.schedule-tech-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px;
  display: grid;
  gap: 4px;
}

.schedule-tech-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.schedule-tech-header .title {
  font-weight: 700;
  font-size: 12px;
}

.schedule-tech-header .subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.schedule-tech-jobs {
  display: grid;
  gap: 4px;
}

.schedule-side,
.schedule-main {
  min-width: 0;
}

.schedule-toolbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.schedule-controls {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.schedule-board {
  display: grid;
  gap: 4px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 6px;
}

.schedule-head,
.schedule-time {
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 700;
}

.schedule-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(18, 28, 44, 0.96);
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.1;
}

.schedule-head span {
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
}

.schedule-time {
  color: var(--accent-2);
  font-size: 12px;
}

.schedule-cell {
  min-height: 44px;
  border-radius: 12px;
  border: 1px dashed rgba(137, 169, 245, 0.4);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  display: grid;
  gap: 4px;
}

.schedule-empty,
.schedule-dropzone {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed rgba(137, 169, 245, 0.35);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 6px;
  text-align: center;
  font-size: 12px;
}

.schedule-dropzone {
  margin-top: 6px;
}

.schedule-job {
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border-radius: 10px;
  border: 1px solid rgba(121, 167, 255, 0.45);
  background: rgba(88, 136, 255, 0.12);
  color: var(--text);
  cursor: grab;
}

.compact-schedule-job {
  cursor: grab;
}

.schedule-job .title {
  font-weight: 700;
  font-size: 11px;
  line-height: 1.15;
}

.schedule-job .subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.schedule-summary {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.editor-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.editor-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.editor-form input,
.editor-form select,
.editor-form textarea {
  width: 100%;
  min-width: 0;
}

.editor-form textarea {
  min-height: 88px;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 34, 0.52);
  z-index: 40;
}

.modal-backdrop[hidden],
.modal-shell[hidden] {
  display: none !important;
}

.modal-shell {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  z-index: 41;
}

.modal-card {
  width: min(640px, calc(100% - 24px));
  max-height: min(88vh, 820px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
  padding: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.modal-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.modal-chip {
  background: rgba(59, 130, 246, 0.10);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.18);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  padding: 6px 10px;
}

.advanced-block {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
}

.advanced-block > summary {
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.advanced-grid .span-2 {
  grid-column: 1 / -1;
}

.modal-form .span-2 {
  grid-column: 1 / -1;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.action-row button {
  min-width: 88px;
}

.hidden { display: none !important; }

@media (max-width: 1200px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board {
    grid-auto-columns: minmax(210px, 220px);
  }

  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-tech-grid {
    grid-template-columns: 1fr;
  }

  .dispatch-layout {
    grid-template-columns: 1fr;
  }

  .dispatch-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .shell,
  .field-wrap,
  .auth-wrap {
    width: calc(100vw - 20px);
  }

  .topbar,
  .toolbar,
  .subbar,
  .field-top {
    flex-direction: column;
    align-items: stretch;
  }

  .search {
    min-width: 0;
  }

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

  .board {
    grid-auto-columns: minmax(200px, 210px);
  }

  .column {
    min-height: 460px;
  }

  .drawer {
    width: 100vw;
  }

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

  .route-actions {
    grid-template-columns: 1fr;
  }

  .workspace-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .home-shell,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .home-launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customers-shell,
  .jobs-shell,
  .billing-shell,
  .pricebook-shell,
  .calls-shell,
  .media-shell,
  .team-shell,
  .activity-shell,
  .customer-layout,
  .customer-facts,
  .job-layout,
  .job-facts,
  .billing-layout,
  .billing-facts,
  .pricebook-layout,
  .pricebook-facts,
  .calls-layout,
  .calls-facts,
  .reputation-shell,
  .reputation-layout,
  .reputation-facts,
  .media-layout,
  .media-facts,
  .team-layout,
  .team-facts,
  .activity-layout,
  .activity-facts,
  .estimate-entry-grid,
  .estimate-item-grid {
    grid-template-columns: 1fr;
  }

  .job-form-grid {
    grid-template-columns: 1fr;
  }

  .job-form-grid .span-2 {
    grid-column: auto;
  }

  .schedule-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-top {
    flex-direction: column;
  }

  .dispatch-subnav,
  .dispatch-toolbar,
  .dispatch-search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .dispatch-board {
    min-width: 960px;
  }

  .dispatch-metrics {
    grid-template-columns: 1fr;
  }

  .customers-list-panel {
    position: static;
  }

  .jobs-list-panel {
    position: static;
  }

  .billing-list-panel {
    position: static;
  }

  .media-list-panel {
    position: static;
  }

  .team-list-panel {
    position: static;
  }

  .activity-list-panel {
    position: static;
  }
}

/* ── Softphone widget ──────────────────────────────────────────────── */
.softphone-bar {
  grid-column: 1 / -1;
  margin-bottom: 12px;
}
.sp-widget {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 13px;
}
.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}
.sp-idle .sp-dot  { background: var(--muted); }
.sp-ready .sp-dot { background: var(--good); }
.sp-ringing .sp-dot { background: var(--warn); animation: sp-blink 0.7s infinite; }
.sp-incall .sp-dot  { background: var(--good); animation: sp-blink 1.2s infinite; }
.sp-calling .sp-dot { background: var(--accent); animation: sp-blink 0.7s infinite; }
@keyframes sp-blink { 0%,100%{opacity:1} 50%{opacity:0.3} }
.sp-status { color: var(--muted); font-size: 12px; min-width: 80px; }
.sp-caller { font-weight: 600; }
.sp-dial-input {
  flex: 1;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
}
.sp-btn-call   { padding: 6px 16px; font-size: 13px; }
.sp-btn-answer { padding: 6px 16px; font-size: 13px; background: var(--good); color: #07111f; }
.sp-btn-hangup { padding: 6px 14px; font-size: 13px; color: var(--danger); }
