:root {
  --navy: #0b2239;
  --navy-2: #173a58;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --ink: #17212b;
  --muted: #64748b;
  --line: #dce4ea;
  --panel: #ffffff;
  --page: #f4f7f9;
  --critical: #c2413b;
  --high: #d97706;
  --medium: #2563eb;
  --low: #64748b;
  --green: #087f5b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 1120px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 72px;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 2px 12px rgba(11, 34, 57, 0.2);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.45);
  border-radius: 9px; display: grid; place-items: center; font-weight: 800;
}
.brand div:last-child { display: flex; flex-direction: column; line-height: 1.25; }
.brand span { color: #bdd0df; font-size: 13px; }
.topbar-actions { display: flex; gap: 10px; }

.button {
  border: 0; border-radius: 8px; padding: 10px 15px; font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: #4f7cff; color: white; box-shadow: 0 5px 14px rgba(37,99,235,.28); }
.button-primary:disabled { background: #7890a5; box-shadow: none; cursor: default; transform: none; }
.button-ghost { color: white; background: transparent; border: 1px solid rgba(255,255,255,.3); }
.button-light { margin-left: auto; background: white; color: var(--navy); white-space: nowrap; }
.button-secondary { color: var(--navy); background: #edf2f5; }
.button-danger { color: #9f2e2a; background: #fff0ee; }
.button-full { width: 100%; }

main { padding: 32px; max-width: 1600px; margin: 0 auto; }
.hero { display: flex; justify-content: space-between; gap: 40px; align-items: flex-end; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .11em; font-weight: 800;
  color: #50708c; font-size: 11px; margin-bottom: 7px;
}
h1 { margin: 0; color: var(--navy); font-size: 32px; letter-spacing: -.035em; }
.hero p { color: var(--muted); max-width: 760px; margin: 9px 0 0; font-size: 15px; }
.shift-card {
  min-width: 330px; background: white; border: 1px solid var(--line);
  border-radius: 12px; padding: 15px 18px; display: grid; grid-template-columns: 1fr 1fr;
  box-shadow: 0 7px 24px rgba(22, 50, 76, .05);
}
.shift-card div { display: flex; flex-direction: column; gap: 3px; }
.shift-card div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.shift-card span { color: var(--muted); font-size: 12px; }
.shift-card strong { color: var(--navy); font-size: 14px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 14px; }
.metric {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.metric span { color: var(--muted); font-size: 12px; font-weight: 700; }
.metric strong { color: var(--navy); font-size: 22px; }
.metric em { font-style: normal; color: var(--green); font-size: 12px; font-weight: 800; }

.decision-strip {
  border-radius: 10px; padding: 12px 14px; background: #fff5e8; border: 1px solid #f3d3a4;
  display: flex; align-items: center; gap: 12px; color: #673c07; margin-bottom: 18px;
}
.decision-strip.ready { background: #eaf8f2; border-color: #b5dfd0; color: #075c44; }
.decision-icon {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #f1b04a; color: white; font-weight: 900;
}
.ready .decision-icon { background: var(--green); }
.decision-strip div:nth-child(2) { display: flex; flex-direction: column; gap: 2px; }
.decision-strip span { font-size: 13px; }

.workspace { display: grid; grid-template-columns: 390px 1fr; gap: 18px; align-items: start; }
.backlog-panel, .plan-panel {
  background: white; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(22, 50, 76, .05);
}
.backlog-panel { overflow: hidden; }
.plan-panel { padding: 18px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px; }
.plan-panel > .section-heading { padding: 0 0 16px; }
h2 { margin: 0; color: var(--navy); font-size: 20px; letter-spacing: -.02em; }
.count-pill { border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 800; padding: 5px 10px; }
.legend { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 7px; }
.legend span { width: 11px; height: 11px; background: #9ab5ff; border-radius: 3px; }

.filter-row { display: flex; gap: 7px; padding: 0 18px 14px; border-bottom: 1px solid var(--line); }
.filter {
  border: 1px solid var(--line); color: #536578; background: white; border-radius: 999px;
  padding: 6px 10px; font-size: 12px; font-weight: 700;
}
.filter.active { background: var(--navy); color: white; border-color: var(--navy); }
.work-list { max-height: 660px; overflow-y: auto; padding: 10px; }
.work-card {
  border: 1px solid var(--line); border-left: 4px solid var(--medium); border-radius: 9px;
  padding: 12px; margin-bottom: 9px; background: white; transition: box-shadow .15s ease, transform .15s ease;
}
.work-card:hover { box-shadow: 0 6px 18px rgba(22,50,76,.11); transform: translateY(-1px); }
.work-card[data-severity="critical"] { border-left-color: var(--critical); }
.work-card[data-severity="high"] { border-left-color: var(--high); }
.work-card[data-severity="low"] { border-left-color: var(--low); }
.card-top, .card-meta, .card-actions { display: flex; align-items: center; }
.card-top { justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.asset { color: var(--navy); font-weight: 850; }
.source {
  font-size: 10px; font-weight: 850; letter-spacing: .06em; color: #52677a;
  background: #edf2f5; padding: 4px 6px; border-radius: 5px;
}
.work-card h3, .scheduled-card h3 { margin: 0; font-size: 14px; line-height: 1.35; color: #22313f; }
.card-meta { gap: 10px; margin: 9px 0; color: var(--muted); font-size: 11px; }
.card-meta span:first-child { color: #8b4b00; font-weight: 800; }
.card-actions { justify-content: space-between; margin-top: 10px; }
.link-button { border: 0; padding: 0; color: var(--blue); font-size: 12px; font-weight: 800; background: none; }
.assign-button { border: 0; border-radius: 6px; background: var(--navy); color: white; padding: 7px 10px; font-size: 11px; font-weight: 800; }
.empty-state { color: var(--muted); text-align: center; padding: 50px 24px; }

.technician-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tech-column { border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; min-height: 520px; overflow: hidden; }
.tech-header { padding: 14px; background: white; border-bottom: 1px solid var(--line); }
.tech-identity { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: white; display: grid;
  place-items: center; font-size: 12px; font-weight: 850;
}
.tech-identity strong { display: block; color: var(--navy); font-size: 14px; }
.skills { color: var(--muted); font-size: 10px; margin-top: 2px; }
.capacity-line { height: 7px; background: #e4eaf0; border-radius: 999px; overflow: hidden; margin-top: 13px; }
.capacity-line div { height: 100%; background: #7898ef; border-radius: inherit; }
.capacity-copy { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 10px; }
.capacity-copy .over { color: var(--critical); font-weight: 800; }
.scheduled-list { padding: 10px; }
.scheduled-card { background: white; border: 1px solid var(--line); border-radius: 8px; padding: 11px; margin-bottom: 9px; }
.scheduled-card .card-meta { margin-bottom: 0; }
.scheduled-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; }
.sequence { font-size: 10px; font-weight: 800; color: #6f8191; }

.drawer-backdrop, .modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 20, 32, .48); z-index: 20;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 470px; background: white; z-index: 21;
  padding: 28px; overflow-y: auto; box-shadow: -14px 0 38px rgba(7, 26, 40, .2);
}
.drawer-close {
  position: absolute; right: 18px; top: 14px; border: 0; background: transparent;
  color: #64748b; font-size: 28px; line-height: 1;
}
.detail-kicker { color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.drawer h2, .modal h2 { margin: 8px 35px 8px 0; font-size: 24px; }
.detail-asset { color: var(--muted); margin-bottom: 20px; }
.reason-box { border-radius: 9px; background: #eff5ff; padding: 13px; color: #24456d; font-size: 13px; line-height: 1.45; }
.detail-section { margin-top: 24px; }
.detail-section h3 { color: var(--navy); font-size: 13px; margin: 0 0 9px; }
.detail-section ul { padding-left: 19px; color: #445666; font-size: 13px; line-height: 1.55; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-field { padding: 10px; background: #f5f7f9; border-radius: 7px; }
.detail-field span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.detail-field strong { color: var(--navy); font-size: 13px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 25px; }

.modal-backdrop { display: grid; place-items: center; z-index: 30; }
.modal { width: 520px; background: white; border-radius: 13px; padding: 27px; position: relative; box-shadow: 0 20px 70px rgba(5,20,30,.3); }
.modal p { color: var(--muted); line-height: 1.5; }
.form-field { margin: 15px 0; }
.form-field label { display: block; font-size: 12px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.form-field select, .form-field textarea, .form-field input {
  width: 100%; border: 1px solid #cbd6df; border-radius: 8px; padding: 11px; color: var(--ink); background: white;
}
.form-field textarea { resize: vertical; min-height: 88px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 50;
  background: var(--navy); color: white; padding: 11px 16px; border-radius: 8px;
  box-shadow: 0 10px 28px rgba(5,20,30,.26); font-weight: 700; font-size: 13px;
}
.hidden { display: none !important; }

@media (max-width: 1200px) {
  main { padding: 24px; }
  .workspace { grid-template-columns: 350px 1fr; }
  .technician-grid { gap: 8px; }
}
