:root {
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --text: #162033;
  --muted: #66748f;
  --line: rgba(22, 32, 51, 0.1);
  --line-strong: rgba(22, 32, 51, 0.16);
  --primary: #295cff;
  --primary-dark: #1739a6;
  --accent: #14b8a6;
  --soft: #eef4ff;
  --soft-2: #f6f9ff;
  --shadow: 0 18px 45px rgba(10, 18, 40, 0.14);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(41, 92, 255, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.18), transparent 20%),
    linear-gradient(180deg, #11182b 0%, #0a1020 100%);
  color: var(--text);
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  padding: 28px;
}

.sidebar {
  color: white;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), #7ea3ff);
  font-weight: 800;
  letter-spacing: 0.06em;
  margin-bottom: 18px;
}

.sidebar h1 { margin: 0 0 10px; font-size: 2rem; line-height: 1.05; }
.sidebar-copy { color: rgba(255,255,255,0.78); line-height: 1.6; margin: 0; }
.sidebar-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(10px);
}
.sidebar-card h2 { margin: 0 0 12px; font-size: 1rem; }
.sidebar-card ul { margin: 0; padding-left: 18px; line-height: 1.7; color: rgba(255,255,255,0.82); }
.sidebar-card p { margin: 0; line-height: 1.65; color: rgba(255,255,255,0.82); }
.sidebar-card.muted { background: rgba(255,255,255,0.05); }

.main-content {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero, .panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.65);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.eyebrow {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.hero h2 { margin: 0 0 10px; font-size: 2rem; }
.hero p { margin: 0; max-width: 760px; line-height: 1.65; color: var(--muted); }
.hero-actions { display: flex; gap: 12px; align-items: center; }
.hero-actions.wrap { flex-wrap: wrap; justify-content: flex-end; }

.primary-button,
.secondary-button,
.ghost-button,
.text-button,
.import-button {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.import-button:hover { transform: translateY(-1px); }
.primary-button {
  background: linear-gradient(135deg, var(--primary), #4d7dff);
  color: white;
  box-shadow: 0 14px 24px rgba(41, 92, 255, 0.22);
}
.secondary-button {
  background: #e8efff;
  color: var(--primary-dark);
}
.ghost-button, .import-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.text-button {
  padding: 0;
  background: transparent;
  color: var(--primary);
}

.status-banner {
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.6);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.status-banner.info { border-left: 4px solid var(--primary); }
.status-banner.success { border-left: 4px solid var(--accent); }
.status-banner.warning { border-left: 4px solid #f59e0b; }
.hidden { display: none !important; }

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

.panel { padding: 24px; }
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-header h3 { margin: 0; font-size: 1.2rem; }
.panel-header p { margin: 6px 0 0; color: var(--muted); }
.panel-tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}
.panel-tag.accent { color: var(--accent); background: rgba(20,184,166,0.1); }

.form-grid {
  display: grid;
  gap: 16px;
}
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.compact { gap: 14px; }
label span {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  padding: 12px 14px;
  color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid rgba(41, 92, 255, 0.14);
  border-color: rgba(41, 92, 255, 0.35);
}
input[readonly], select[readonly] {
  background: #f8fbff;
  color: var(--muted);
}

.metric-strip {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.metric-card {
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
}
.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.metric-card strong { font-size: 1.05rem; }

.accessorial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.accessorial-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}
.accessorial-topline {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.accessorial-topline input { width: 18px; height: 18px; margin-top: 2px; }
.accessorial-name { display: block; margin-bottom: 4px; }
.accessorial-type { color: var(--muted); font-size: 0.85rem; }
.accessorial-inputs { display: flex; gap: 8px; align-items: center; }
.accessorial-inputs .accessorial-value { flex: 1; }
.accessorial-qty-wrap { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.accessorial-qty-wrap.hidden { display: none !important; }
.accessorial-qty-label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.accessorial-qty { width: 60px; text-align: center; }

.summary-stack {
  display: grid;
  gap: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
}
.summary-row span { color: var(--muted); }
.summary-row.total {
  background: linear-gradient(135deg, rgba(41,92,255,0.08), rgba(20,184,166,0.08));
  border-color: rgba(41,92,255,0.18);
}
.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}
.quote-preview {
  margin-top: 20px;
  border-radius: 20px;
  background: #0f172a;
  color: white;
  padding: 18px;
}
.quote-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.quote-preview-header h4 { margin: 0; }
#quotePreview {
  min-height: 280px;
  resize: vertical;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: white;
}
.note-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.08);
  color: #7c5a14;
  border: 1px solid rgba(245, 158, 11, 0.18);
  line-height: 1.55;
}

.history-header { align-items: center; }
.history-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.history-actions input[type="search"] { width: 340px; }
.empty-state {
  padding: 24px;
  border-radius: 18px;
  background: white;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}
.history-list {
  display: grid;
  gap: 14px;
}
.history-item {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}
.history-item-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}
.history-item-head { min-width: 0; flex: 1 1 auto; }
.history-title { margin: 0 0 4px; font-size: 1rem; }
.history-meta, .history-submeta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.history-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft-2);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.history-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  align-items: center;
}
.history-buttons button {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
}
.history-buttons button.primary-mini {
  background: var(--soft);
  color: var(--primary-dark);
  border-color: rgba(41, 92, 255, 0.12);
}

.history-status-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.history-status-control span {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.history-status-control select {
  width: auto;
  min-width: 136px;
  padding: 10px 12px;
}
.status-chip {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  border: 1px solid transparent;
}
.status-chip.pending {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.3);
}
.status-chip.accepted {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.28);
}
.status-chip.denied {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.28);
}



.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(520px, 100%);
  background: rgba(255,255,255,0.95);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 34px;
}

.brand-mark.large {
  width: 68px;
  height: 68px;
  border-radius: 22px;
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 2.1rem;
}

.login-copy {
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 22px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-button {
  width: 100%;
  margin-top: 6px;
}

.login-error {
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.18);
  color: #b91c1c;
  padding: 12px 14px;
  font-weight: 600;
}

.login-note {
  margin-top: 18px;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
}

.compact-button {
  padding: 8px 12px;
  border-radius: 999px;
}
@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
}

@media (max-width: 980px) {
  .workspace-grid, .form-grid.two-col, .form-grid.three-col, .form-grid.four-col, .accessorial-grid {
    grid-template-columns: 1fr;
  }
  .hero { flex-direction: column; align-items: flex-start; }
  .history-actions input[type="search"] { width: 100%; }
}


.two-col-span { grid-column: span 2; }

select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  padding: 12px 14px;
  color: var(--text);
}

.manager-panel .panel-header { margin-bottom: 18px; }
.manager-grid { grid-template-columns: 340px 1fr; }
.manager-card {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: white;
  padding: 18px;
}
.manager-card h4 { margin: 0 0 12px; }
.manager-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.manager-actions, .table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.tariff-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.tariff-table th,
.tariff-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.tariff-table th {
  font-size: 0.84rem;
  color: var(--muted);
  background: #f8fbff;
  position: sticky;
  top: 0;
}
.tariff-table td input {
  min-width: 88px;
  padding: 10px 12px;
}
.table-code {
  background: #f8fbff;
  color: var(--muted);
}

@media (max-width: 1200px) {
  .manager-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .two-col-span { grid-column: auto; }
}


.powered-by, .sidebar-footer, .version-tag { color: rgba(255,255,255,0.82); }
.powered-by { margin: 10px 0 0; color: var(--muted); font-weight: 600; }
.sidebar-footer { margin: auto 0 0; font-size: 0.95rem; font-weight: 600; }
.version-tag { margin: 0 0 10px; font-size: 0.9rem; font-weight: 700; }
.manager-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.table-wrap { overflow-x: auto; margin-top: 18px; }
.tariff-table { width: 100%; border-collapse: collapse; }
.tariff-table th, .tariff-table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; }
.tariff-table th { color: var(--muted); font-size: 0.85rem; }
.two-col-span { grid-column: span 2; }



.assigned-panel {
  border: 2px solid #ef4444;
  background: #fff7f7;
}
.assigned-panel.ready {
  border-color: rgba(20,184,166,0.35);
  background: rgba(20,184,166,0.08);
}
.assigned-panel-top {
  display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin-bottom:16px;
}
.eyebrow.warning { background: rgba(239,68,68,0.12); color:#b91c1c; }
.assigned-panel h3 { margin:0 0 8px; color:#111827; }
.assigned-panel p { margin:0; color:#1f2937; }
.assigned-panel label span { color:#111827; }
.required-star { color:#dc2626; }
.assigned-state {
  padding:8px 12px; border-radius:999px; font-size:.85rem; font-weight:800; background:#fee2e2; color:#b91c1c;
}
.assigned-panel.ready .assigned-state { background:#d1fae5; color:#047857; }
#assignedUser { border:2px solid #ef4444; background:#fff; color:#0f172a; font-weight:600; }
#assignedUser::placeholder { color:#64748b; }
.assigned-panel.ready h3,
.assigned-panel.ready p,
.assigned-panel.ready label span { color:#ffffff; }
.assigned-panel.ready #assignedUser { border-color:#10b981; }
#quoteFormWrap.form-locked { opacity:0.55; }
#quoteFormWrap.form-locked input,
#quoteFormWrap.form-locked select,
#quoteFormWrap.form-locked textarea,
#quoteFormWrap.form-locked button { pointer-events:none; }


#quoteFormWrap > .workspace-grid + .workspace-grid,
#quoteFormWrap > .workspace-grid + .panel,
#quoteFormWrap > .panel + .panel {
  margin-top: 12px;
}

.area-cell { display:flex; align-items:center; gap:8px; }
.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.icon-button:hover { transform: translateY(-1px); }
.danger-button { color: #b91c1c; border-color: rgba(185,28,28,0.25); background: #fff5f5; }

.tariff-table .delete-col, .tariff-table td.delete-col { width: 70px; text-align: right; }
.tariff-table td.delete-col { padding-right: 14px; }
.tariff-table td.delete-col .icon-button { margin-left: auto; }


.version-tag { color: #111827; font-weight: 800; margin: 0 0 10px; }
.powered-by { color: #111827; }

.dimension-builder {
  display: grid;
  gap: 12px;
}
.dimension-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
}
.dimension-toolbar strong { display: block; margin-bottom: 4px; }
.helper-text { color: var(--muted); margin: 0; line-height: 1.5; }
.dimension-header-grid,
.dimension-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 60px 46px;
  gap: 12px;
  align-items: center;
}
.dimension-header-grid {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  padding: 0 2px;
}
.dim-row-remove-label { text-align: center; }
.dimension-rows { display: grid; gap: 12px; }
.dimension-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.dimension-remove {
  padding: 12px 0;
  min-height: 48px;
}
.pricing-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.toggle-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}
.toggle-topline {
  display: flex;
  align-items: center;
  gap: 10px;
}
.toggle-topline input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.login-card .version-tag { color: #111827; }
.sidebar .version-tag { color: rgba(255,255,255,0.94); }

@media (max-width: 980px) {
  .pricing-toggle-grid,
  .dimension-header-grid,
  .dimension-row {
    grid-template-columns: 1fr;
  }
  .dim-row-remove-label { display: none; }
}


/* Beta 1.4 logo layout polish */
.brand-logo {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.sidebar-brand .brand-logo {
  width: 230px;
  max-width: 100%;
  margin: 0 0 2px;
}

.sidebar .version-tag {
  color: rgba(255,255,255,0.94);
  margin: 0;
}

.login-card {
  text-align: center;
}

.login-card .brand-logo.large {
  width: min(100%, 340px);
  margin: 0 auto 10px;
}

.login-card .version-tag {
  color: #111827;
  font-weight: 800;
  margin: 0 0 14px;
}

@media (max-width: 980px) {
  .sidebar-brand {
    align-items: center;
    text-align: center;
  }
}

.readonly-input {
  background: #f8fbff;
  color: var(--muted);
  font-weight: 600;
}


/* Integrated TMS module */
.ops-panel { margin-top: 22px; }
.ops-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.ops-metric {
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
}
.ops-metric-label { display:block; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.ops-metric-value { font-size: 1.5rem; font-weight: 800; }
.ops-metric-sub { margin-top: 8px; color: var(--muted); font-size: 0.88rem; }
.ops-top-grid, .ops-grid { margin-top: 4px; }
.ops-table { min-width: 760px; }
.ops-list { display:grid; gap: 12px; }
.ops-list.compact { gap: 10px; }
.ops-item {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: white;
  padding: 14px 16px;
}
.ops-item-head {
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items:flex-start;
}
.ops-item-title { margin:0 0 4px; font-size: 1rem; }
.ops-item-copy, .ops-muted { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.ops-dispatch-board {
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.ops-lane {
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
  padding: 14px;
  min-height: 220px;
}
.ops-lane h5 { margin: 0 0 10px; font-size: 0.95rem; }
.ops-lane-stack { display:grid; gap: 10px; }
.ops-dispatch-card {
  border-radius: 14px;
  background: var(--soft-2);
  border: 1px solid var(--line);
  padding: 12px;
}
.ops-dispatch-card strong { display:block; margin-bottom: 6px; }
.ops-select {
  width: auto;
  min-width: 118px;
  padding: 10px 12px;
}
.ops-action-row {
  display:flex;
  gap: 8px;
  align-items:center;
  flex-wrap: wrap;
}
.ops-mini-button {
  border: 1px solid var(--line-strong);
  background: transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 700;
}
.doc-chip {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 80px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid transparent;
}
.doc-chip.ready { background: rgba(245, 158, 11, 0.12); color: #9a6700; border-color: rgba(245, 158, 11, 0.22); }
.doc-chip.complete { background: rgba(20, 184, 166, 0.12); color: #0f766e; border-color: rgba(20, 184, 166, 0.22); }
.doc-chip.waiting { background: rgba(41, 92, 255, 0.1); color: var(--primary-dark); border-color: rgba(41, 92, 255, 0.18); }
.ops-report-grid {
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.ops-report-card {
  border-radius: 16px;
  background: white;
  border: 1px solid var(--line);
  padding: 16px;
}
.ops-report-card h5 { margin:0 0 8px; font-size: 0.95rem; }
.ops-report-card p { margin:0; color: var(--muted); line-height: 1.55; }

@media (max-width: 1280px) {
  .ops-metric-grid,
  .ops-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-dispatch-board { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .ops-metric-grid,
  .ops-report-grid { grid-template-columns: 1fr; }
}


/* ---- V1.6 layout shell ---- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}
.sidebar {
  background: rgba(11, 16, 32, 0.78);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 20px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  overflow: auto;
  color: #eef4ff;
}
.main-content { display:flex; flex-direction:column; gap:18px; min-width:0; }
.card-like, .topbar { background: var(--panel); border: 1px solid rgba(255,255,255,0.65); border-radius: var(--radius); box-shadow: var(--shadow); }
.topbar { padding: 24px 28px; display:flex; justify-content:space-between; align-items:flex-start; gap:20px; }
.topbar-actions { justify-content:flex-end; }
.nav-brand { display:flex; gap:12px; align-items:center; margin-bottom:20px; }
.nav-brand h1 { margin:0; font-size:1.15rem; color:white; }
.nav-brand p { margin:4px 0 0; color:rgba(255,255,255,0.7); font-size:0.85rem; }
.nav-logo { width:64px; height:auto; display:block; }
.nav-section { color: rgba(255,255,255,0.5); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin: 18px 0 8px; }
.nav-item { width:100%; border:1px solid transparent; background:transparent; color:#eef4ff; padding:12px 14px; border-radius:14px; text-align:left; display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.nav-item:hover, .nav-item.active { background: rgba(41,92,255,0.18); border-color: rgba(126,163,255,0.24); }
.app-view { display:block; }
.compact-panel { padding:20px; }
.single-top-grid { grid-template-columns: 1fr; }
.settings-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:16px; }
.nav-help-card { margin-top: 18px; }
.sidebar-copy.small { font-size: 0.85rem; }
@media (max-width: 1180px) { .settings-grid { grid-template-columns: 1fr; } }
@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; padding: 16px; }
  .sidebar { position: relative; top: 0; height: auto; }
  .topbar { flex-direction: column; }
}


.helper-text {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.compact-button {
  padding: 11px 14px;
  white-space: nowrap;
}
.selection-meta {
  grid-column: 1 / -1;
  margin-top: -6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--soft-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 25, 0.62);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(88vh, 900px);
  overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.modal-header,
.modal-toolbar {
  padding: 22px 24px 0;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.modal-header h3 { margin: 0 0 6px; font-size: 1.35rem; }
.modal-header p { margin: 0; color: var(--muted); }
.customer-picker-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 18px;
}
.customer-picker-toolbar input { flex: 1 1 auto; }
.customer-picker-table-wrap {
  overflow: auto;
  padding: 0 24px 24px;
}
.customer-picker-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}
.customer-picker-table th,
.customer-picker-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.customer-picker-table th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}
.table-subtext {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}
@media (max-width: 900px) {
  .input-action-row { grid-template-columns: 1fr; }
  .modal-shell { padding: 12px; }
  .customer-picker-toolbar { flex-direction: column; align-items: stretch; }
}


.selection-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -6px;
}
.customer-directory-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 160px auto;
  gap: 12px;
  margin-bottom: 14px;
}
.customer-directory-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.customer-form-actions {
  grid-column: 1 / -1;
}
.table-subtext {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}
@media (max-width: 980px) {
  .customer-directory-toolbar {
    grid-template-columns: 1fr;
  }
}


.driver-form-actions {
  grid-column: 1 / -1;
}


.customer-directory-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}
@media (max-width: 980px) {
  .customer-directory-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

.quote-browser-actions { display:flex; gap:8px; flex-wrap:wrap; }


.login-role-toggle{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px;}
.role-toggle-button{border:1px solid var(--line-strong);background:transparent;color:var(--text);border-radius:14px;padding:12px 14px;font-weight:700;}
.role-toggle-button.active{background:#e8efff;color:var(--primary-dark);}
.full-width{grid-column:1 / -1;}
.driver-updates-list{display:grid;gap:14px;}
.driver-update-card{border:1px solid var(--line);border-radius:18px;padding:16px;background:var(--soft-2);}
.driver-update-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;}
.driver-update-head h5{margin:0 0 6px;font-size:1rem;}
.driver-update-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px;}
.driver-update-grid span{display:block;color:var(--muted);font-size:.8rem;}
.driver-update-note{margin-top:10px;line-height:1.5;}
.driver-update-preview-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px;}
.driver-update-thumb{width:96px;height:96px;object-fit:cover;border-radius:12px;border:1px solid var(--line);background:white;}
.signature-thumb{object-fit:contain;padding:6px;}
.proof-status-tag{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;font-size:.8rem;font-weight:700;}
.proof-status-delivered{background:rgba(20,184,166,.12);color:#0f766e;}
.proof-status-needs-review{background:rgba(245,158,11,.14);color:#b45309;}
.proof-status-closed{background:rgba(41,92,255,.12);color:#1739a6;}
.compact-driver-select{min-width:150px;max-width:180px;padding:10px 12px;}
@media (max-width: 900px){.driver-update-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width: 640px){.login-role-toggle{grid-template-columns:1fr;}.driver-update-grid{grid-template-columns:1fr;}}

/* Driver delivery notification popup */
.driver-notification-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  pointer-events: none;
}
.driver-notification-panel.hidden { display: none; }
.driver-notification {
  pointer-events: auto;
  background: white;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(10,18,40,.18);
  padding: 16px 18px;
  animation: notifSlideIn .35s ease-out;
}
.driver-notification.fade-out {
  animation: notifFadeOut .4s ease-in forwards;
}
@keyframes notifSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes notifFadeOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}
.driver-notification-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.driver-notification-head h5 {
  margin: 0;
  font-size: .95rem;
  color: var(--text);
}
.driver-notification-head .notif-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--muted);
  padding: 0 2px;
  line-height: 1;
}
.driver-notification-body {
  font-size: .87rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
}
.driver-notification-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.driver-notification-actions button {
  font-size: .82rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: white;
  cursor: pointer;
  font-weight: 600;
}
.driver-notification-actions .notif-primary {
  background: linear-gradient(135deg, var(--primary), #4d7dff);
  color: white;
  border: none;
}

/* Driver accessorial summary in update cards */
.driver-acc-summary { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.driver-acc-summary .chip { font-size: .82rem; }
.driver-acc-summary .chip.accent { background: rgba(20,184,166,.12); color: #0f766e; font-weight: 700; }

/* Formula accessorial inputs - editable but auto-calculated */
.formula-input {
  background: #f0f6ff;
  border-style: dashed;
}

/* Accessorial view toggle */
.acc-view-toggle {
  display: flex;
  gap: 4px;
}
.acc-view-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
  line-height: 1;
}
.acc-view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.accessorial-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.accessorial-grid.cols-1 {
  grid-template-columns: 1fr;
}

/* Unit converter panel */
/* Right column stacking wrapper */
.right-stack {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.converter-panel { }
.converter-grid {
  display: grid;
  gap: 14px;
  margin-top: 10px;
}
.converter-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}
.converter-arrow {
  font-size: 1.3rem;
  color: var(--muted);
  padding-bottom: 12px;
  text-align: center;
}

/* Fuel charge % vs $ inputs */
.fuel-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.fuel-input-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fuel-input-label input {
  flex: 1;
  min-width: 0;
}
.fuel-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--primary);
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

/* Greeting editor */
.greeting-editor {
  margin-bottom: 14px;
}
.greeting-editor label span {
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .converter-row { grid-template-columns: 1fr; }
  .converter-arrow { display: none; }
  .fuel-inputs { grid-template-columns: 1fr; }
}

/* Nav collapse */
.nav-collapse-btn {
  position: fixed;
  bottom: 24px;
  left: 274px;
  z-index: 40;
  background: var(--primary);
  border: none;
  color: white;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(41,92,255,.3);
  transition: left .3s ease, transform .3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-collapse-btn:hover { transform: scale(1.1); }
.app-shell.nav-collapsed {
  grid-template-columns: 0px 1fr;
  gap: 0;
  transition: grid-template-columns .3s ease;
}
.app-shell.nav-collapsed .sidebar {
  overflow: hidden;
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.app-shell.nav-collapsed .nav-collapse-btn {
  left: 8px;
}

/* Fuel inputs stacked vertically */
.fuel-inputs-stacked {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.fuel-inputs-stacked .fuel-input-label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fuel-inputs-stacked .fuel-input-label input {
  flex: 1;
  min-width: 0;
}

/* Accessorial grid scrollable */
.accessorial-grid {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Modal body scrollable (fixes Edit Load cutoff) */
#opsModalBody {
  overflow-y: auto;
  max-height: calc(88vh - 140px);
  padding: 0 24px 22px;
}

/* Converter dimension rows */
.converter-divider {
  border-top: 1px solid var(--line);
  margin: 14px 0 4px;
}
.converter-dim-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.converter-dim-results input {
  background: #f0f6ff;
}

/* Archived delivery history card */
.archived-card {
  border-left: 3px solid var(--muted);
  opacity: 0.85;
}
.archived-card:hover { opacity: 1; }

@media (max-width: 900px) {
  .converter-dim-row { grid-template-columns: 1fr; }
  .app-shell.nav-collapsed { grid-template-columns: 1fr; }
}

/* Bottom-right toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
}
.tb-toast {
  pointer-events: auto;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 12px 32px rgba(10,18,40,.18);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--text);
  animation: toastSlideIn .3s ease-out;
}
.tb-toast.success { border-left-color: var(--accent); }
.tb-toast.warning { border-left-color: #f59e0b; }
.tb-toast.fade-out { animation: toastFadeOut .4s ease-in forwards; }
@keyframes toastSlideIn { from { opacity:0; transform:translateX(40px); } to { opacity:1; transform:translateX(0); } }
@keyframes toastFadeOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(40px); } }

/* Dimension vertical view */
.dim-view-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: white;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  padding: 0;
}
.dim-view-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.dim-vertical .dimension-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  margin-bottom: 10px;
}
.dim-vertical .dimension-row input {
  width: 100%;
}
.dim-vertical .dimension-row::before {
  display: none;
}

/* Draggable summary rows */
.summary-row-drag {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
  user-select: none;
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .15s;
}
.summary-row-drag:hover { background: rgba(41,92,255,.04); }
.summary-row-drag.dragging { opacity: 0.35; background: var(--soft); }
.sr-handle {
  color: var(--muted);
  font-size: .85rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  cursor: grab;
}
.sr-label { flex: 1; min-width: 0; }
.summary-row-drag strong { flex-shrink: 0; }
.sr-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.summary-row-drag:hover .sr-remove { opacity: 1; }
.sr-remove:hover { color: #ef4444; }

/* Manual adjustment + Internal notes stacked beside Special */
.toggle-card-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* PDF accessorial format toggle */
.acc-pdf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  margin-right: 6px;
}
.acc-pdf-toggle input { width: 16px; height: 16px; margin: 0; }

/* Dimension qty input */
.dimension-qty {
  width: 100%;
  text-align: center;
  padding: 10px 4px;
}

/* Quote preview action buttons */
.quote-preview-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
