:root {
  --navy-950: #071426;
  --navy-900: #0b1f3a;
  --navy-800: #132c50;
  --brand: #0e7fd1;
  --brand-600: #0b6cb3;
  --brand-50: #eaf4fd;
  --cyan: #22d3ee;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e3e8ef;
  --border-strong: #cfd7e3;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --faint: #8a98ad;
  --danger: #d23b3b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .06);
  --shadow-lg: 0 12px 40px rgba(7, 20, 38, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(90deg, var(--navy-950), var(--navy-900) 60%, var(--navy-800));
  color: #fff; position: sticky; top: 0; z-index: 20;
}
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand small { display: block; font-weight: 400; color: #9fb3cf; font-size: 12px; margin-top: -2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { color: #c4d2e6; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, .08); text-decoration: none; }
.userchip { display: flex; align-items: center; gap: 10px; color: #dbe6f5; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan), var(--brand)); display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 13px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #9fe8c5; background: rgba(34, 197, 94, .12); padding: 4px 10px; border-radius: 999px; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
.live.off { color: #f8c9c9; background: rgba(239, 68, 68, .14); }
.live.off::before { background: #ef4444; animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

/* ---------- layout ---------- */
.page { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } .nav { display: none; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card-head h3 .ico { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.card-body { padding: 18px 20px; }
.card-body.flush { padding: 0; }
.count { background: #eef2f7; color: var(--muted); font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 18px 20px; position: relative; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 30px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }
.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }

/* ---------- toolbar / table ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { border: 1px solid var(--border); background: #fff; color: var(--muted); padding: 5px 12px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.search { position: relative; }
.search input { padding-left: 34px; width: 260px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); }

table.calls { width: 100%; border-collapse: collapse; }
table.calls th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 11px 16px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.calls td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.calls tbody tr { cursor: pointer; transition: background .1s; }
table.calls tbody tr:hover { background: #f6f9fd; }
table.calls tbody tr:last-child td { border-bottom: 0; }
.call-title { font-weight: 600; }
.call-sub { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
@media (max-width: 760px) { table.calls .hide-sm { display: none; } .search input { width: 100%; } .search { flex: 1; } }

/* ---------- status pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-new { color: #1d4ed8; background: #e8efff; border-color: #cfdcfd; }
.s-scheduled { color: #6d28d9; background: #f1eaff; border-color: #e1d3fd; }
.s-in_progress { color: #0369a1; background: #e3f4fc; border-color: #c4e7f7; }
.s-awaiting_quote_approval { color: #9a3412; background: #fff0e6; border-color: #fdd9bf; }
.s-awaiting_po { color: #a16207; background: #fef6dc; border-color: #f7e3a3; }
.s-awaiting_parts { color: #b45309; background: #fff3e0; border-color: #fbdcae; }
.s-parts_shipped { color: #0f766e; background: #e0f7f4; border-color: #b9ebe4; }
.s-on_hold { color: #475569; background: #eef1f5; border-color: #dbe1e9; }
.s-completed { color: #15803d; background: #e4f8ea; border-color: #c0ebcd; }
.s-cancelled { color: #9f1239; background: #fde8ed; border-color: #f8cbd6; }
.prio { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.prio-urgent { color: #c01f1f; } .prio-high { color: #c2410c; } .prio-normal { color: var(--muted); } .prio-low { color: var(--faint); }
.tag { display: inline-block; font-size: 12px; background: #eef2f7; color: var(--muted); padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.tag.ok { background: #e4f8ea; color: #15803d; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; margin-bottom: 14px; }
.detail-hero { padding: 22px 24px; margin-bottom: 20px; }
.hero-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.hero-top h1 { font-size: 22px; font-weight: 700; margin-top: 4px; }
.callno { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.status-banner { margin-top: 18px; padding: 14px 16px; border-radius: 10px; display: flex; gap: 14px; align-items: center; }
.status-banner .big { font-weight: 700; font-size: 15px; }
.status-banner p { margin: 2px 0 0; font-size: 13px; opacity: .9; }
.status-banner.s-new, .status-banner.s-scheduled, .status-banner.s-in_progress, .status-banner.s-awaiting_quote_approval, .status-banner.s-awaiting_po,
.status-banner.s-awaiting_parts, .status-banner.s-parts_shipped, .status-banner.s-on_hold, .status-banner.s-completed, .status-banner.s-cancelled { border-width: 1px; border-style: solid; }

.stepper { display: flex; margin-top: 20px; gap: 0; overflow-x: auto; padding-bottom: 4px; }
.step { flex: 1; min-width: 92px; position: relative; text-align: center; font-size: 12px; color: var(--faint); font-weight: 500; }
.step .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; margin: 0 auto 6px; position: relative; z-index: 1; display: grid; place-items: center; }
.step::before { content: ""; position: absolute; top: 10px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); }
.step:first-child::before { display: none; }
.step.done { color: var(--text); }
.step.done .dot { background: var(--brand); border-color: var(--brand); }
.step.done .dot::after { content: ""; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.step.done::before, .step.current::before { background: var(--brand); }
.step.current { color: var(--brand); font-weight: 700; }
.step.current .dot { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(14, 127, 209, .15); }
.step.current .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }

dl.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
dl.kv dt { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
dl.kv dd { margin: 3px 0 0; font-weight: 500; word-break: break-word; }
dl.kv .full { grid-column: 1 / -1; }
.desc { white-space: pre-wrap; }

.pdf-view { height: 560px; overflow: auto; background: #e9edf3; padding: 16px; display: grid; gap: 12px; justify-items: center; border-bottom: 1px solid var(--border); }
.pdf-view canvas { width: 100%; max-width: 760px; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(15,27,45,.15); border-radius: 4px; }
.pdf-view .faint { align-self: center; }

.list { display: grid; }
.row { display: flex; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .amount { font-weight: 700; font-size: 15px; white-space: nowrap; }
.fileicon { width: 38px; height: 38px; border-radius: 9px; background: #fdecec; color: #c62828; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.fileicon.blue { background: var(--brand-50); color: var(--brand); }
.fileicon.green { background: #e4f8ea; color: #15803d; }
.fileicon.teal { background: #e0f7f4; color: #0f766e; }
.none { padding: 18px 20px; color: var(--faint); font-size: 13px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 6px 20px 16px; }
.timeline li { position: relative; padding: 12px 0 12px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline li:first-child::before { top: 18px; }
.timeline li:last-child::before { bottom: calc(100% - 18px); }
.timeline .tdot { position: absolute; left: 3px; top: 15px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--border-strong); }
.timeline .tdot.status { border-color: var(--brand); }
.timeline .tdot.po { border-color: #16a34a; }
.timeline .tdot.quote { border-color: #ea580c; }
.timeline .tdot.shipment { border-color: #0d9488; }
.timeline .tdot.note { border-color: #7c3aed; }
.timeline .tmsg { white-space: pre-wrap; }
.timeline .tmeta { font-size: 12px; color: var(--faint); margin-top: 2px; }
.timeline .tmsg .first { font-weight: 600; }

/* ---------- forms ---------- */
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: #334155; }
label.f span.req::after { content: " *"; color: var(--danger); }
input, select, textarea {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 9px 12px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 127, 209, .15); }
textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } dl.kv { grid-template-columns: 1fr; } }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.inline-form { display: grid; gap: 12px; padding: 16px 20px; background: #f8fafc; border-top: 1px solid var(--border); }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #334155; }
.checkbox input { width: auto; }

.btn {
  font: inherit; font-weight: 600; font-size: 14px; border-radius: 8px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; display: inline-flex; align-items: center; gap: 8px; justify-content: center; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-secondary { background: #fff; border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: #f6f8fb; }
.btn-ghost { background: transparent; color: var(--muted); padding: 6px 10px; }
.btn-ghost:hover { background: #f1f4f8; color: var(--text); }
.btn-danger { background: #fff; border-color: #f2c4c4; color: var(--danger); }
.btn-danger:hover { background: #fdf1f1; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.icon-btn { background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--danger); background: #fdf1f1; }

.dropzone { display: block; border: 2px dashed var(--border-strong); border-radius: 10px; padding: 22px; text-align: center; color: var(--muted); cursor: pointer; transition: all .15s; background: #fbfcfe; }
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.dropzone strong { color: var(--text); }
.dropzone.has-file { border-style: solid; border-color: #9fd3a9; background: #f1fbf3; color: #15803d; }
.dropzone.small { padding: 12px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(7, 20, 38, .55); backdrop-filter: blur(2px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 680px; max-height: calc(100vh - 40px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .18s; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 20px 24px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1200px 600px at 10% 10%, #12406f 0%, transparent 60%), linear-gradient(160deg, var(--navy-950), var(--navy-900) 50%, #0d3a66); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; right: -160px; bottom: -160px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .25), transparent 65%); }
.login-art h1 { font-size: 38px; line-height: 1.15; max-width: 460px; font-weight: 700; letter-spacing: -.02em; }
.login-art p { color: #a9bdd8; max-width: 440px; font-size: 15px; }
.login-feats { display: grid; gap: 12px; color: #c8d6ea; position: relative; z-index: 1; }
.login-feats div { display: flex; gap: 10px; align-items: center; }
.login-feats i { width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; font-style: normal; color: var(--cyan); }
.login-form { display: grid; place-items: center; padding: 40px; background: #fff; }
.login-form form { width: 100%; max-width: 360px; display: grid; gap: 16px; }
.login-form h2 { font-size: 24px; }
.err { color: var(--danger); font-size: 13px; background: #fdf1f1; border: 1px solid #f6d0d0; padding: 9px 12px; border-radius: 8px; }
@media (max-width: 860px) { .login-wrap { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--navy-900); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .2s; max-width: 360px; }
.toast.error { background: #b42318; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 0 16px; gap: 12px; height: 56px; }
  .brand { font-size: 14px; white-space: nowrap; }
  .brand img { width: 30px; height: 30px; }
  .brand small, .userchip > div:not(.avatar), .live { display: none; }
  .page { padding: 20px 16px 48px; }
  .page-head h1 { font-size: 21px; }
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 24px; }
  .toolbar { padding: 12px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; flex-basis: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .chip { flex-shrink: 0; }
  table.calls td, table.calls th { padding: 12px; }
  .detail-hero { padding: 18px 16px; }
  .status-banner { flex-wrap: wrap; }
  .pdf-view { height: 420px; }
}
@media (max-width: 640px) {
  table.calls thead { display: none; }
  table.calls, table.calls tbody { display: block; }
  table.calls tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.calls tbody tr:last-child { border-bottom: 0; }
  table.calls td { padding: 0; border: 0; }
  table.calls td.hide-sm { display: none; }
  table.calls td:nth-child(1) { grid-column: 1; font-size: 12px; color: var(--muted); }
  table.calls td:nth-child(3) { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  table.calls td:nth-child(2) { grid-column: 1; }
  table.calls td:last-child { grid-column: 1 / -1; font-size: 12px; }
}

/* ---------- work performed ---------- */
.resolution-body { border-left: 4px solid #16a34a; }
.res-meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.res-meta .faint { margin-left: auto; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; background: linear-gradient(135deg, #34d399, #16a34a); }

/* ---------- job photos ---------- */
.photo-cols { display: grid; grid-template-columns: 1fr 1fr; }
.photo-col { padding: 16px 20px; min-width: 0; }
.photo-col + .photo-col { border-left: 1px solid var(--border); }
@media (max-width: 640px) { .photo-cols { grid-template-columns: 1fr; } .photo-col + .photo-col { border-left: 0; border-top: 1px solid var(--border); } }
.photo-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; }
.ph-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 6px; }
.ph-before { background: #fff0e6; color: #c2410c; }
.ph-after { background: #e4f8ea; color: #15803d; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.thumb { margin: 0; position: relative; border-radius: 10px; overflow: hidden; background: #eef2f7; cursor: zoom-in; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.thumb:hover img { transform: scale(1.04); }
.thumb figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-del { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15, 27, 45, .7); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; padding: 0; }
.thumb-del svg { width: 14px; height: 14px; }
.thumb:hover .thumb-del { opacity: 1; }
@media (hover: none) { .thumb-del { opacity: 1; } }
.photo-empty { border: 2px dashed var(--border); border-radius: 10px; padding: 26px 10px; text-align: center; color: var(--faint); font-size: 13px; }
.timeline .tdot.photo { border-color: #0ea5e9; }
.timeline .tdot.resolution { border-color: #16a34a; background: #16a34a; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(5, 12, 24, .92); display: grid; place-items: center; padding: 50px 70px; animation: fade .15s; }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100%; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #e5edf7; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.lb-btn { position: absolute; background: rgba(255, 255, 255, .1); color: #fff; border: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lightbox { padding: 60px 10px; } }

/* ---------- Excel import ---------- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.how p { margin: 0 0 10px; color: #334155; font-size: 13.5px; }
.how p:last-child { margin: 0; }
table.calls.plain tbody tr { cursor: default; }
table.calls.plain tbody tr:hover { background: transparent; }
.imp-file { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.imp-file .grow { flex: 1; min-width: 0; }
.imp-file .title { font-weight: 600; }
.imp-file .sub { font-size: 13px; color: var(--muted); }
.inline-select { width: auto; padding: 3px 8px; font-size: 13px; font-weight: 600; }
.grid-imp { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid-imp { grid-template-columns: 1fr; } }
.mapt { width: 100%; border-collapse: collapse; }
.mapt td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.mapt tr:last-child td { border-bottom: 0; }
.mapt td:first-child { padding-right: 12px; width: 45%; }
.mapt .hname { font-weight: 600; font-size: 13px; }
.mapt .hsample { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.mapt select { font-size: 13px; padding: 6px 8px; color: var(--faint); }
.mapt select.mapped { color: var(--text); border-color: #9fd3a9; background: #f6fcf7; }
.act { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.act-create { background: #e8efff; color: #1d4ed8; }
.act-update { background: #fef6dc; color: #a16207; }
.act-same { background: #eef1f5; color: #64748b; }
.act-skip { background: #fde8ed; color: #9f1239; }
.imp-rows td { vertical-align: top; }
.chg { font-size: 13px; line-height: 1.6; }
.chg-f { color: var(--muted); font-weight: 500; }
.chg-f::after { content: ":"; }
.chg-from { color: var(--faint); text-decoration: line-through; }
.chg-to { font-weight: 600; }
.chg-warn { font-size: 12.5px; color: #b45309; margin-top: 2px; }
.imp-bar { position: sticky; bottom: 0; margin: 20px -24px -60px; padding: 14px 24px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; z-index: 5; }
.timeline .tdot.import { border-color: #16a34a; }
@media (max-width: 640px) { .imp-bar { margin: 20px -16px -48px; padding: 12px 16px; } .head-actions .btn { flex: 1; } }
.card-head .chips { flex: none; flex-wrap: nowrap; }
.chip { white-space: nowrap; }
@media (max-width: 640px) { .card-head:has(.chips) { flex-wrap: wrap; } .card-head .chips { overflow-x: auto; max-width: 100%; } }

/* ---------- brand (Stingray + Nummax) ---------- */
.brand { gap: 14px; }
.brand img.brand-customer { width: auto; height: 26px; }
.brand-div { width: 1px; height: 26px; background: rgba(255, 255, 255, .22); }
.brand-label { color: #c4d2e6; font-weight: 500; font-size: 14px; white-space: nowrap; }
.site-foot { border-top: 1px solid var(--border); background: #fff; }
.foot-inner { max-width: 1280px; margin: 0 auto; padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.foot-by { display: inline-flex; align-items: center; gap: 10px; }
.foot-by img { height: 24px; width: auto; }
.login-brand { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.login-brand img { height: 40px; width: auto; }
.login-brand span { color: #c4d2e6; font-size: 16px; font-weight: 500; padding-left: 16px; border-left: 1px solid rgba(255, 255, 255, .25); line-height: 32px; }
.login-by { margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex !important; align-items: center; gap: 12px; color: #9fb3cf; font-size: 13px; }
.login-by img { height: 28px; width: auto; }
.login-logos { display: none; align-items: center; gap: 16px; margin-bottom: 8px; }
.login-logos img:first-child { height: 30px; width: auto; }
.login-logos img:last-child { height: 24px; width: auto; }
.login-logos span { width: 1px; height: 26px; background: var(--border-strong); }
@media (max-width: 860px) { .login-logos { display: flex; } }
@media (max-width: 640px) {
  .brand img.brand-customer { height: 22px; }
  .brand-label { display: none; }
  .brand-div { display: none; }
  .foot-inner { padding: 16px; justify-content: center; text-align: center; }
}
.brand img.brand-customer { height: 32px; }
.head-nummax { height: 24px; width: auto; padding-right: 18px; border-right: 1px solid rgba(255, 255, 255, .18); }
@media (max-width: 980px) { .head-nummax { display: none; } }

/* ---------- status path (real history) ---------- */
.step { max-width: 190px; }
.step-l { line-height: 1.3; }
.step-d { font-size: 11px; color: var(--faint); font-weight: 400; margin-top: 2px; }
.step.goal::before { background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); }
.step.goal .dot { border-style: dashed; }
.step.final .dot { background: #16a34a; border-color: #16a34a; }
.step.final { color: #15803d; font-weight: 700; }
.step.cancel::before { background: var(--brand); }
.step.cancel .dot { background: #e11d48; border-color: #e11d48; }
.step.cancel .dot::after { content: "×"; color: #fff; font-size: 15px; line-height: 1; font-weight: 700; }
.step.cancel { color: #be123c; font-weight: 700; }
.step.more { color: var(--faint); }
.step.more .dot { font-size: 12px; line-height: 1; }

/* ---------- PDF auto-fill ---------- */
.fill-note { font-size: 13px; padding: 10px 14px; border-radius: 8px; background: #ecfdf3; border: 1px solid #b7ebc9; color: #14532d; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fill-note.warn { background: #fff8e6; border-color: #f5dc9b; color: #7a4b00; }
input.autofilled, textarea.autofilled, select.autofilled { background: #f3fbf5; border-color: #8fd3a4; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #9fd3b0; border-top-color: #15803d; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fill-note { display: block; line-height: 1.5; }
.fill-note .spinner { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.timeline .tdot.reset { border-color: #1d4ed8; background: #dbe6ff; }
