/* WireWave agents portal v81a - dark NOC aesthetic, Kanban, Full Calendar, Mileage & Hardware. Pure ASCII. */
:root {
  --bg: #070b14;
  --card: #0c1220;
  --card-alt: #111a2e;
  --card-hover: #16223b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: #1e293b;
  --line-bright: #334155;
  --brand: #3b82f6;
  --brand-glow: rgba(59, 130, 246, 0.2);
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --purple: #a855f7;
  --ctx-x: 16px;
  --ctx-y: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}
body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }

/* Top Bar */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(12, 18, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); display: inline-block; }
.badge-live {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.35);
  letter-spacing: 0.05em;
}
.who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Main Container - Wide on Desktop for Kanban & Calendar, Fluid on Mobile */
main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Cards & Grid Layouts */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.card h2 { font-size: 16px; font-weight: 700; margin: 0 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi-box { background: var(--card-alt); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.kpi-val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.list { display: flex; flex-direction: column; }
.item { padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .t { font-weight: 600; font-size: 15px; }

/* Status Pills & Badges */
.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}
.pill.new { color: var(--bad); border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.12); }
.pill.quoted { color: var(--purple); border-color: rgba(168, 85, 247, 0.45); background: rgba(168, 85, 247, 0.12); }
.pill.provisioning { color: var(--warn); border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.12); }
.pill.complete { color: var(--ok); border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.12); }
.badge-web {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Forms & Buttons */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: #060a12;
  color: var(--text);
  font: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-glow);
}
input.checkbox-inline { width: auto; }
textarea { min-height: 70px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 0 4px; }
button, .btn {
  appearance: none;
  border: 1px solid var(--line-bright);
  background: var(--card-alt);
  color: var(--text);
  padding: 8px 13px;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
button:hover { background: var(--card-hover); border-color: #475569; }
button:active { transform: translateY(1px); }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover { background: #2563eb; }
button.success { background: rgba(16, 185, 129, 0.16); border-color: var(--ok); color: #34d399; }
button.danger { background: rgba(239, 68, 68, 0.12); color: #f87171; border-color: rgba(239, 68, 68, 0.45); }
button.sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }
button:disabled { opacity: 0.5; cursor: default; }

/* Pipeline Status Strip & Kanban Board (matches Admin Portal screenshot) */
.pipeline-banner {
  background: #080d1a;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(270px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}
.kanban-col {
  background: #050811;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, background 0.15s;
}
.kanban-col.col-new { border-top: 3px solid var(--bad); }
.kanban-col.col-quoted { border-top: 3px solid var(--purple); }
.kanban-col.col-provisioning { border-top: 3px solid var(--warn); }
.kanban-col.col-complete { border-top: 3px solid var(--ok); }
.kanban-col.drag-over {
  background: rgba(59, 130, 246, 0.07);
  border-color: var(--brand);
}
.kanban-col-head {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}
.kanban-count {
  background: #161f33;
  color: var(--muted);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.k-card {
  background: #0d1526;
  border: 1px solid #1e2d4a;
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
  user-select: none;
}
.k-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.k-card.dragging { opacity: 0.45; transform: scale(0.98); }
.k-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}
.k-card-title { font-weight: 700; font-size: 15px; color: #fff; }
.k-card-id { font-size: 11px; color: var(--muted); font-family: ui-monospace, monospace; white-space: nowrap; }
.k-card-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; line-height: 1.35; }
.k-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.k-menu-btn {
  padding: 2px 7px;
  font-size: 14px;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  border-radius: 4px;
}
.k-menu-btn:hover { background: var(--card-hover); border-color: var(--line-bright); color: #fff; }

/* Right-Click Context Menu (matches screenshot 2) */
.ctx-menu {
  position: fixed;
  left: var(--ctx-x);
  top: var(--ctx-y);
  z-index: 100;
  width: 280px;
  background: #0d1322;
  border: 1px solid #28354f;
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.75);
}
.ctx-head {
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}
.ctx-item {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.ctx-item:hover { background: #17223b; }
.ctx-item.ctx-accept { color: #34d399; font-weight: 700; }
.ctx-item.ctx-warn { color: #fbbf24; }
.ctx-item.ctx-danger { color: #f87171; font-weight: 700; }
.ctx-sep { height: 1px; background: var(--line); margin: 5px 0; }
.ctx-ico { width: 18px; text-align: center; display: inline-block; }

/* Full Month Calendar Grid */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px) {
  .cal-layout { grid-template-columns: 1fr; }
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.cal-month-title { font-size: 18px; font-weight: 700; }
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}
.cal-cell {
  min-height: 92px;
  background: #080d19;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.12s, background 0.12s;
}
.cal-cell:hover { border-color: var(--brand); background: #0d1527; }
.cal-cell.cal-other { opacity: 0.35; }
.cal-cell.cal-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-cell.cal-selected { background: rgba(59, 130, 246, 0.12); border-color: #60a5fa; }
.cal-day-num {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cal-today-tag {
  font-size: 9px;
  background: var(--brand);
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
}
.cal-ev-pill {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-left: 2px solid var(--brand);
}
.cal-ev-pill.ev-visit { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; border-left-color: var(--ok); }
.cal-ev-pill.ev-install { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-left-color: var(--warn); }
.cal-ev-pill.ev-busy { background: rgba(148, 163, 184, 0.12); color: var(--muted); border-left-color: var(--muted); }

/* Tables (Mileage & Hardware Inventory) */
.table-wrap { overflow-x: auto; }
table.ww-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.ww-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-bright);
}
table.ww-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.ww-table tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Modal Backdrop & Box */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-box {
  background: var(--card);
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  max-width: 620px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

/* Bottom Navigation Tabs */
.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(12, 18, 32, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
  overflow-x: auto;
}
.tabs button {
  flex: 1;
  min-width: 78px;
  border: 0;
  border-radius: 0;
  padding: 12px 6px;
  font-size: 12px;
  background: transparent;
  color: var(--muted);
}
.tabs button.on {
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 3px 0 var(--brand);
  background: rgba(59, 130, 246, 0.06);
}

.msg { margin-top: 8px; font-size: 13px; }
.msg.ok { color: var(--ok); }
.msg.bad { color: var(--bad); }
.timer { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.day { font-weight: 700; margin-top: 10px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.busy { opacity: 0.6; }
.login { max-width: 400px; margin: 40px auto; }
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden, [hidden] { display: none !important; }

/* v81b utility classes (replace inline styles - CSP style-src 'self') */
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; } .mb-8 { margin-bottom: 8px; }
.m0 { margin: 0; } .w-230 { width: 230px; max-width: 100%; } .pad-drop { padding: 24px 8px; } .gap-14 { gap: 14px; }
/* v81b: 7 tabs on a phone - let the bar scroll sideways instead of cutting Tasks / Time off */
@media (max-width: 640px) { .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; } .tabs button { flex: 1 0 auto; min-width: 72px; } }
