/* NASA Space Apps Cairo - Unified Operations Design System
   Brand: Munake / abeatbyKai local fonts, Space Apps blue #0323b2, indigo #514bb4, orange #fb9746 */
@font-face {
  font-family: 'Munake';
  src: url('../../assets/fonts/Munake-Demo.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'abeatbyKai';
  src: url('../../assets/fonts/abeatbyKaiRegular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090d18;
  --surface: #0f1628;
  --card: #121a30;
  --card-2: #172140;
  --ink: #e2e8f4;
  --ink-bright: #ffffff;
  --mut: #8d9bb5;
  --line: #243256;
  --line-strong: #34477a;
  --pri: #2548e6;
  --pri-hover: #3a5df0;
  --accent: #fb9746;
  --ok: #10b981;
  --warn: #f5c542;
  --bad: #ef4444;
  --info: #22d3ee;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --font-title: 'Munake', 'abeatbyKai', sans-serif;
  --font-body: 'abeatbyKai', sans-serif;
  --map-bg: #0b1226;
  --bg-img-opacity: 0.36;
  --bg-img-blur: 3px;
  --bg-overlay: radial-gradient(circle at 50% 25%, rgba(9, 13, 24, 0.52) 0%, rgba(9, 13, 24, 0.90) 100%);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --card: #ffffff;
  --card-2: #f1f4fb;
  --ink: #17213a;
  --ink-bright: #050a1c;
  --mut: #566480;
  --line: #d6deee;
  --line-strong: #b2c0de;
  --pri: #0323b2;
  --pri-hover: #021a8a;
  --accent: #d96a14;
  --ok: #047857;
  --warn: #a16207;
  --bad: #dc2626;
  --info: #0e7490;
  --shadow: 0 8px 24px rgba(15, 30, 80, .14);
  --map-bg: #e8edf7;
  --bg-img-opacity: 0.18;
  --bg-img-blur: 3px;
  --bg-overlay: radial-gradient(circle at 50% 25%, rgba(245, 247, 251, 0.65) 0%, rgba(245, 247, 251, 0.93) 100%);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; overflow-x: hidden; width: 100%; max-width: 100vw; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font-body); font-family: var(--font-body); min-height: 100vh; overflow-x: hidden; width: 100%; max-width: 100vw; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; font-family: var(--font-body); color: inherit; }
h1, h2, h3 { font-family: var(--font-title); color: var(--ink-bright); font-weight: 400; letter-spacing: .03em; }
.mobile-only-badge, .mobile-only-lbl, .status-text-mobile { display: none; }
.status-text-full { display: inline; }

/* Space backdrop (Unified with Overview & Maps) */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg::before {
  content: '';
  position: absolute;
  top: -12px; left: -12px; right: -12px; bottom: -12px;
  background: url('../../assets/images/hero-optimized.jpg') center / cover no-repeat;
  filter: blur(var(--bg-img-blur));
  transform: scale(1.02);
  opacity: var(--bg-img-opacity);
  transition: opacity 0.3s ease;
}
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  transition: background 0.3s ease;
}
.app { position: relative; z-index: 1; }

/* Header */
header.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand img.logo-light { display: none; }
:root[data-theme="light"] .brand img.logo-dark { display: none; }
:root[data-theme="light"] .brand img.logo-light { display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; border-left: 1px solid var(--line-strong); padding-left: 12px; }
.brand-title { font-family: var(--font-title); font-size: 15px; color: var(--ink-bright); letter-spacing: .08em; }
.brand-sub { font-size: 10.5px; color: var(--accent); letter-spacing: .12em; font-weight: 600; }
.sp { flex: 1; }

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--mut);
  white-space: nowrap;
  flex-shrink: 0;
}
.pill-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--mut); display: inline-block; }
.pill-status.live i { background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.pill-status.demo i { background: var(--warn); }

.desktop-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.who { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mut); }
.who select { max-width: 150px; }

/* Borderless Icon Buttons for clean, uncluttered mobile bar */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--ink);
  cursor: pointer;
  border-radius: 12px;
  transition: background .15s, color .15s, transform .1s;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--ink-bright); }
.icon-btn:active { transform: scale(.92); background: rgba(255, 255, 255, .15); }
.icon-btn.is-open { color: var(--accent); background: rgba(251, 151, 70, .15); }
.icon-btn svg { display: block; flex-shrink: 0; }
.icon-btn.is-open .icon-bars { display: none !important; }
.icon-btn.is-open .icon-close { display: block !important; }

/* Mobile Menu Toggle button */
.mobile-menu-btn {
  display: none;
}

/* Standardized Right Slide-Over Mobile Drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  justify-content: flex-end;
}
.mobile-drawer[hidden] {
  display: none !important;
}
.mobile-drawer-card {
  width: min(310px, 86vw);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--line-strong);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: -12px 0 32px rgba(0, 0, 0, 0.5);
  animation: drawerSlideRight .2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@keyframes drawerSlideRight {
  from { opacity: 0; }
  to { opacity: 1; }
}
.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.mobile-user-chip {
  flex: 1;
  min-width: 0;
}
.mobile-drawer-close {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 8px !important;
  border: 1px solid var(--line-strong) !important;
  background: var(--card) !important;
  font-size: 20px;
  line-height: 1;
}
.mobile-drawer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-drawer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start !important;
  gap: 8px;
  min-height: 44px;
  height: 44px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  text-decoration: none;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  box-sizing: border-box;
}
.mobile-drawer-btn:hover { background: var(--card-2); border-color: var(--accent); }
.mobile-drawer-btn.bad { border-color: rgba(239, 68, 68, 0.45); color: #fca5a5; }
html[data-theme="light"] .mobile-drawer-btn.bad { color: #dc2626; }

/* Controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  min-height: 38px;
}
.btn:hover { background: var(--card-2); border-color: var(--accent); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--pri-hover); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(1.08); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1a0f05; }
.btn.route-btn { border-color: rgba(251, 151, 70, 0.45); color: var(--accent); background: rgba(251, 151, 70, 0.08); }
.btn.route-btn:hover:not(:disabled):not(.is-disabled) { background: rgba(251, 151, 70, 0.20); border-color: var(--accent); color: var(--ink-bright); }
.btn.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--pri) 22%, var(--card)); color: var(--ink-bright); }
.btn.small { padding: 5px 11px; font-size: 12.5px; min-height: 34px; }
.btn.ghost { background: transparent; }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible, .tab:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input:not([type="radio"]):not([type="checkbox"]), select, textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  width: 100%;
  color: var(--ink-bright);
  box-sizing: border-box;
}
input[type="radio"], input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}
select {
  width: auto;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 38px !important;
  cursor: pointer;
}
.field select, .field input, .field textarea { width: 100%; }
textarea { resize: vertical; min-height: 84px; }
label.lbl { display: block; font-size: 12px; font-weight: 600; color: var(--mut); margin: 12px 0 5px; }

.bell { position: relative; }
.bell .count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--bad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

/* Layout */
main { max-width: 1480px; margin: 0 auto; padding: 18px 22px 60px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { background: none; border: none; padding: 10px 16px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--mut); white-space: nowrap; display: flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--ink-bright); }
.tab.on { color: var(--ink-bright); box-shadow: inset 0 -2px 0 var(--accent); }
.tab .n { font-size: 11px; background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 7px; }
.tab .n.hot { background: var(--bad); border-color: var(--bad); color: #fff; }

.page-title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title h2 { font-size: 21px; }
.page-title p { color: var(--mut); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--mut); }

/* Chips / badges */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.dim { opacity: .45; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.b-new { background: rgba(239,68,68,.16); color: #ff8a8a; border-color: rgba(239,68,68,.45); }
.b-ack { background: rgba(245,197,66,.14); color: #f5c542; border-color: rgba(245,197,66,.4); }
.b-prog { background: rgba(34,211,238,.13); color: #5be0f5; border-color: rgba(34,211,238,.4); }
.b-done { background: rgba(16,185,129,.14); color: #34d399; border-color: rgba(16,185,129,.4); }
:root[data-theme="light"] .b-new { color: #b91c1c; } :root[data-theme="light"] .b-ack { color: #8a5a00; }
:root[data-theme="light"] .b-prog { color: #0e6c82; } :root[data-theme="light"] .b-done { color: #047857; }
.b-net { background: rgba(37,72,230,.2); color: #8fa5ff; border-color: rgba(100,130,255,.45); }
.b-power { background: rgba(251,151,70,.16); color: #ffb06b; border-color: rgba(251,151,70,.45); }
.b-help { background: rgba(167,139,250,.16); color: #c4b5fd; border-color: rgba(167,139,250,.45); }
.b-other { background: rgba(141,155,181,.14); color: var(--mut); border-color: var(--line-strong); }
:root[data-theme="light"] .b-net { color: #1d3bb8; } :root[data-theme="light"] .b-power { color: #a8500a; } :root[data-theme="light"] .b-help { color: #5b3bc4; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--mut); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line-strong); background: var(--card-2); position: sticky; top: 0; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: color-mix(in srgb, var(--card-2) 60%, transparent); }
tr.is-new td { box-shadow: inset 3px 0 0 var(--bad); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px; text-align: center; color: var(--mut); }

/* Floor maps */
.map-layout { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
.map-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { background: none; border: none; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--mut); transition: background .15s, color .15s; }
.seg button.on { background: var(--pri); color: #fff; }
.seg button + button { border-left: 1px solid var(--line-strong); }

.map { position: relative; height: min(66vh, 640px); min-height: 380px; border-radius: var(--radius); overflow: hidden; background: var(--map-bg); border: 1px solid var(--line); cursor: grab; touch-action: none; user-select: none; }
.map.drag { cursor: grabbing; }
.stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 1673px; height: 940px; }
.stage img.plan { width: 1673px; height: 940px; display: block; pointer-events: none; transition: filter .3s; border-radius: 4px; }
.stage svg { position: absolute; left: 0; top: 0; width: 1673px; height: 940px; overflow: visible; }
.map.heat .stage img.plan { filter: grayscale(1) brightness(.34) contrast(1.15); }
:root[data-theme="light"] .map.heat .stage img.plan { filter: grayscale(1) brightness(.28) contrast(1.2); }
.rm { cursor: pointer; transition: fill-opacity .15s, stroke-width .15s; }
.rm:hover { fill-opacity: .8; }
.rm.sel { stroke: #111 !important; stroke-width: 6; stroke-opacity: 1 !important; }
.map.heat .rm.sel { stroke: #fff !important; }
.rm.dim { fill-opacity: .12; stroke-opacity: .25; }
.heat-glow { pointer-events: none; }
.heat-tag { font: 700 22px var(--font-body); fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 5px; text-anchor: middle; pointer-events: none; }
.pin { cursor: pointer; }
.pin .ring { fill: none; stroke: var(--bad); stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(2.4); opacity: 0; } }
.map-zoom { position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.map-zoom .btn { width: 34px; height: 34px; padding: 0; font-size: 18px; }
.map-tip { position: absolute; pointer-events: none; z-index: 6; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 240px; display: none; }
.map-tip b { color: var(--ink-bright); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.heat-scale { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--mut); }
.heat-bar { height: 12px; width: 280px; border-radius: 6px; background: linear-gradient(90deg, #ff2d2d, #ff7a1a 22%, #ffd23f 45%, #b7e34a 70%, #22e07a); box-shadow: 0 0 12px rgba(34,224,122,.25); }

.panel { padding: 16px; }
.panel h3 { font-size: 16px; margin-bottom: 4px; }
.panel .sub { color: var(--mut); font-size: 12.5px; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; margin: 10px 0; }
.kv dt { color: var(--mut); }
.qr-box { background: #fff; border-radius: 8px; padding: 8px; display: inline-block; line-height: 0; }
.qr-box svg, .qr-box img { width: 140px; height: 140px; display: block; }
.mini-issue { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-size: 12.5px; }

/* Route bar component */
.route-bar-card { margin-bottom: 14px; padding: 14px 18px; }
.route-bar-inner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.route-header { display: flex; align-items: center; gap: 8px; }
.route-title { font-weight: 700; color: var(--accent); display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.route-inputs-wrap { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 280px; }
.route-field { flex: 1; min-width: 130px; }
.rt-input { width: 100%; }
.rt-swap-btn { padding: 4px 8px; font-size: 13px; flex-shrink: 0; }
.route-actions { display: flex; gap: 8px; align-items: center; }

/* Route polylines and animated dashed line */
.rt-active-line {
  stroke-dasharray: 12 7;
  animation: routeDash 1s linear infinite;
}
@keyframes routeDash {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -38; }
}

/* Route directions panel */
.route-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 10px;
}
.route-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.route-step:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--card) 85%, var(--accent));
}
.route-step.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.route-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pri);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
.route-summary {
  font-weight: 700;
  color: var(--accent);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Team */
.my-status-box {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.my-status-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.my-status-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.my-status-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pri), #514bb4);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}
.my-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--card);
}
.my-status-details {
  min-width: 0;
}
.my-status-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-bright);
  display: flex;
  align-items: center;
  gap: 6px;
}
.my-status-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(37, 72, 230, .2);
  color: #7ba2ff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.my-status-loc {
  font-size: 13px;
  color: var(--mut);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-status-edit-btn {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 42px;
  transition: all .15s ease;
}
.my-status-edit-btn:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--ink-bright);
}
.my-status-editor {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.my-status-editor[hidden] {
  display: none !important;
}
.ms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.ms-grid label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--mut);
  margin-bottom: 4px;
  display: block;
}
.ms-grid select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--ink-bright);
  font-weight: 600;
  padding: 0 12px;
}
.ms-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.ms-actions button {
  min-height: 42px;
  height: 42px;
  padding: 0 18px;
  font-weight: 600;
}

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.member { text-align: left; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; width: 100%; }
.member:hover { border-color: var(--accent); transform: translateY(-2px); }
.avatar { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--font-title); font-size: 17px; color: #fff; background: linear-gradient(135deg, var(--pri), #514bb4); flex: none; }
.member .name { font-weight: 700; color: var(--ink-bright); font-size: 15px; }
.member .role { color: var(--mut); font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.status i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.st-available i { background: var(--ok); } .st-busy i { background: var(--bad); } .st-task i { background: var(--warn); } .st-off i { background: var(--mut); }
.loc { font-size: 12.5px; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.meet-list { margin-top: 22px; }
.meet-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.meet-item:last-child { border-bottom: none; }

/* Inventory */
.inv-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.inv-sum { padding: 14px 16px; }
.inv-sum .t { font-weight: 700; color: var(--ink-bright); }
.inv-sum .m { color: var(--mut); font-size: 12.5px; margin-top: 2px; }
.bar { height: 6px; border-radius: 3px; background: var(--card-2); margin-top: 8px; overflow: hidden; display: flex; }
.bar span { display: block; height: 100%; }
.bar .own { background: var(--ok); } .bar .lent { background: var(--accent); }

/* Modal / drawer / toast */
.backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(3,6,16,.66); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal .mh { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { font-size: 18px; flex: 1; }
.modal .mb { padding: 8px 20px 20px; }
.modal .mf { padding: 14px 20px 20px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.x { background: none; border: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--mut); padding: 4px 8px; border-radius: 8px; }
.x:hover { color: var(--ink-bright); background: var(--card-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .col { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px 14px; }
.two .col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-top: 10px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.radio-row label { border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 13px; display: flex; gap: 8px; align-items: center; background: var(--card); }
.radio-row input { width: auto; accent-color: var(--accent); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); animation: slide .25s ease-out; cursor: pointer; }
.toast.bad { border-left-color: var(--bad); } .toast.ok { border-left-color: var(--ok); }
.toast b { color: var(--ink-bright); display: block; margin-bottom: 2px; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-radius: var(--radius); margin-bottom: 16px; flex-wrap: wrap; }
.banner b { color: var(--ink-bright); }
.note { font-size: 12.5px; color: var(--mut); padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: 8px; margin-top: 14px; }

/* ============================================================
   PUBLIC REPORT FORM (.form-shell, .form-card, .issue-opts)
   ============================================================ */
.form-shell {
  max-width: 620px;
  margin: 36px auto 70px;
  padding: 0 18px;
  width: 100%;
  box-sizing: border-box;
}
.form-card {
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 34px 32px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}
.form-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  background: rgba(251, 151, 70, 0.12);
  border: 1px solid rgba(251, 151, 70, 0.3);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.form-card h2 {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink-bright);
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.form-card p.form-sub {
  font-size: 14px;
  line-height: 1.5;
  color: var(--mut);
  margin-bottom: 22px;
}
.form-card .lbl {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-bright);
  margin: 16px 0 7px;
}
.form-card .field {
  width: 100%;
}
.form-card select,
.form-card input:not([type="radio"]):not([type="checkbox"]),
.form-card textarea {
  min-height: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1.5px solid var(--line-strong);
  font-size: 14.5px;
  color: var(--ink-bright);
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-sizing: border-box;
  width: 100%;
}
.form-card select {
  padding-right: 40px !important;
}
.form-card textarea {
  min-height: 96px;
  height: auto;
  padding: 12px 14px;
  resize: vertical;
}
.form-card select:focus,
.form-card input:not([type="radio"]):not([type="checkbox"]):focus,
.form-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(251, 151, 70, 0.22);
  background: var(--surface);
  outline: none;
}

/* Problem Choice Option Tiles */
.issue-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}
.issue-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--card-2);
  border: 1.5px solid var(--line-strong);
  cursor: pointer;
  transition: all .15s ease;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  user-select: none;
}
.issue-opt:hover {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.16);
}
.issue-opt.is-selected,
.issue-opt:has(input:checked) {
  background: color-mix(in srgb, var(--pri) 14%, var(--card-2));
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(251, 151, 70, 0.25);
}
.issue-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.issue-opt-body {
  flex: 1;
  min-width: 0;
}
.issue-opt .t {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-bright);
}
.issue-opt .opt-icon {
  font-size: 18px;
  line-height: 1;
}
.issue-opt .h {
  display: block;
  font-size: 12.5px;
  color: var(--mut);
  margin-top: 3px;
}
.issue-opt.is-selected .t,
.issue-opt:has(input:checked) .t {
  color: #fff;
}
.issue-opt.is-selected .h,
.issue-opt:has(input:checked) .h {
  color: var(--ink);
}

/* Custom Radio Indicator */
.issue-opt-radio {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s ease;
}
.issue-opt:hover .issue-opt-radio {
  border-color: var(--mut);
}
.issue-opt.is-selected .issue-opt-radio,
.issue-opt:has(input:checked) .issue-opt-radio {
  border-color: var(--accent);
  background: var(--accent);
}
.issue-opt-radio .radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  opacity: 0;
  transform: scale(0.4);
  transition: all .15s ease;
}
.issue-opt.is-selected .issue-opt-radio .radio-dot,
.issue-opt:has(input:checked) .issue-opt-radio .radio-dot {
  opacity: 1;
  transform: scale(1);
}

/* Submit button */
.form-card button[type="submit"] {
  min-height: 50px;
  height: 50px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 22px;
  box-shadow: 0 4px 16px rgba(37, 72, 230, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.form-card button[type="submit"]:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.form-card button[type="submit"]:active {
  transform: scale(0.98);
}

/* Success Card */
.form-card.success {
  text-align: center;
  padding: 48px 32px;
}
.form-card.success .tick {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.16);
  border: 2px solid var(--ok);
  color: var(--ok);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.25);
}
.form-card.success h2 {
  font-size: 24px;
  color: var(--ink-bright);
  margin-bottom: 8px;
}
.form-card.success b#done-id {
  display: inline-block;
  padding: 4px 14px;
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--accent);
  letter-spacing: .08em;
}

@media (max-width: 640px) {
  .form-shell {
    margin: 14px auto 36px;
    padding: 0 12px;
  }
  .form-card {
    padding: 22px 16px;
    border-radius: 16px;
  }
  .form-card h2 {
    font-size: 21px;
  }
  .form-card .two {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .issue-opt {
    padding: 12px 14px;
    gap: 12px;
  }
  .issue-opt .t {
    font-size: 14px;
  }
  .issue-opt .h {
    font-size: 12px;
  }
}

/* Universal QR Poster */
.universal-hero {
  max-width: 680px;
  margin: 0 auto 30px;
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(180deg, var(--card) 0%, var(--surface) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .35);
}
.universal-hero h2 { font-size: 26px; color: var(--ink-bright); margin-bottom: 6px; }
.universal-hero p.sub { font-size: 14px; color: var(--mut); margin-bottom: 20px; }
.universal-qr-frame {
  display: inline-block;
  background: #ffffff;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  line-height: 0;
  margin: 12px 0 20px;
}
.universal-qr-frame svg, .universal-qr-frame img { width: 260px; height: 260px; display: block; }
.universal-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 22px; text-align: left; }
.u-step { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12.5px; }
.u-step b { display: block; color: var(--accent); margin-bottom: 3px; font-size: 13px; }

/* Bottom Sheet for Map Details (Native iOS / Android feel) */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 16, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 110;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 111;
  background: var(--surface);
  border-top: 1px solid var(--line-strong);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  padding: 12px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%);
  transition: transform .3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 82vh;
  overflow-y: auto;
}
.bottom-sheet.is-open {
  transform: translateY(0);
}
.sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 0 auto 14px;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.sheet-category {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: 2px;
}
.sheet-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-bright);
  margin: 0;
}
.sheet-meta {
  font-size: 13px;
  color: var(--mut);
  margin-top: 3px;
}
.sheet-close {
  background: var(--card-2);
  border: 1px solid var(--line-strong);
  color: var(--mut);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all .15s ease;
}
.sheet-close:hover {
  color: var(--ink-bright);
  background: var(--card);
}
.sheet-body {
  font-size: 14px;
  margin-bottom: 16px;
}
.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-btn {
  width: 100%;
  min-height: 48px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (min-width: 769px) {
  .bottom-sheet, .sheet-backdrop {
    display: none !important;
  }
}

/* Mobile Bottom Navigation Bar */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-strong);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .4);
  justify-content: space-around;
  align-items: center;
  padding: 0 4px calc(env(safe-area-inset-bottom, 0px) + 4px);
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--mut);
  font-size: 11px;
  font-weight: 600;
  height: 52px;
  min-height: 48px;
  cursor: pointer;
  position: relative;
  transition: color .15s, transform .1s;
}
.mobile-nav-btn:active { transform: scale(.96); }
.mobile-nav-btn svg { width: 20px; height: 20px; margin-bottom: 2px; }
.mobile-nav-btn.on { color: var(--accent); }
.mobile-nav-btn .m-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  background: var(--bad);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

/* ------------------------------------------------------------
   User chip & Auth header elements
   ------------------------------------------------------------ */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pri), var(--accent));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.user-meta {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.user-meta b {
  font-size: 12.5px;
  color: var(--ink-bright);
  font-weight: 600;
}
.user-meta small {
  font-size: 10.5px;
  color: var(--mut);
}

/* Mobile drawer user item */
.mobile-drawer-section.mobile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mobile-drawer-section.mobile-user .user-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}
.mobile-drawer-section.mobile-user .user-meta b {
  font-size: 14px;
}
.mobile-drawer-section.mobile-user .user-meta small {
  font-size: 12px;
}

/* ------------------------------------------------------------
   Login screen & Logistics placeholder
   ------------------------------------------------------------ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 24px 16px;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.login-logo img {
  height: 40px;
  width: auto;
  display: block;
}
.login-logo img.logo-light { display: none; }
:root[data-theme="light"] .login-logo img.logo-dark { display: none; }
:root[data-theme="light"] .login-logo img.logo-light { display: block; }

.login-card h1 {
  font-size: 24px;
  margin-bottom: 8px;
}
.login-card .form-sub {
  color: var(--mut);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.5;
}
.login-card form {
  text-align: left;
  margin-top: 18px;
}
.login-card form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--mut);
  margin-bottom: 6px;
}
.login-card form input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  color: var(--ink-bright);
  letter-spacing: .04em;
  margin-bottom: 12px;
  box-sizing: border-box;
}
.login-card form input:focus {
  outline: none;
  border-color: var(--pri);
  box-shadow: 0 0 0 3px rgba(37, 72, 230, 0.25);
}
.login-error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--bad);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
}
.login-note {
  margin-top: 18px;
  font-size: 12px;
  color: var(--mut);
  line-height: 1.5;
  background: var(--card-2);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.login-note b {
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 12px;
}

/* ------------------------------------------------------------
   Unified RBAC Access Denied Screen
   ------------------------------------------------------------ */
.denied-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 24px 16px;
}
.denied-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 18px;
  padding: 34px 30px;
  box-shadow: var(--shadow);
  text-align: center;
}
.denied-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: rgba(239, 68, 68, 0.14);
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  color: var(--bad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.denied-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #ff8a8a;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
:root[data-theme="light"] .denied-badge { color: #b91c1c; }
.denied-card h1 {
  font-size: 24px;
  margin-bottom: 10px;
}
.denied-card p {
  color: var(--mut);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 22px;
}
.denied-card p b {
  color: var(--ink-bright);
}
.denied-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   Unified Request Cards (.req-grid, .req-card) across ALL Panels
   ------------------------------------------------------------ */
#issue-search {
  max-width: 320px;
}
.req-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 16px;
  width: 100%;
}
.req-card {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 18px 20px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--line-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  transition: border-color .15s ease, transform .15s ease;
}
.req-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-strong));
}
.req-card.is-new {
  border-left-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 4%, var(--card));
}
.req-card.is-mine {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}
.req-card.is-done {
  border-left-color: var(--ok);
  opacity: .76;
}
.req-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.req-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.team-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 7px;
  font-family: var(--font-title);
  font-size: 11.5px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
}
.team-pill.t-TechOps { background: #2548e6; }
.team-pill.t-Logistics { background: #d97706; }
.team-pill.t-Competition { background: #6d28d9; }
.req-card-id {
  font-size: 11.5px;
  color: var(--mut);
  white-space: nowrap;
}
.req-card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink-bright);
  line-height: 1.3;
}
.req-card-loc {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink);
}
.req-card-loc b {
  color: var(--accent);
  letter-spacing: .03em;
}
.req-card-loc.is-remote {
  color: var(--mut);
}
.req-card-desc {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.48;
}
.req-from {
  display: block;
  font-size: 12px;
  color: var(--mut);
  margin-top: 4px;
}
.req-card-who {
  font-size: 12.5px;
  color: var(--mut);
}
.req-card-who b {
  color: var(--ink-bright);
}
.req-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.req-card-actions input {
  flex: 1 1 170px;
  min-width: 140px;
  min-height: 34px;
  height: 34px;
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 8px;
}
.req-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 42px 18px;
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--mut);
}

/* ------------------------------------------------------------
   Task 1-Click Action Stack & Buttons
   ------------------------------------------------------------ */
.action-stack {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.claim-btn {
  background: var(--pri) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(37, 72, 230, .35);
}
.claim-btn:hover {
  background: var(--pri-hover) !important;
  transform: translateY(-1px);
}
.resolve-btn {
  background: var(--ok) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border: none !important;
  padding: 7px 14px !important;
  border-radius: 8px !important;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, .35);
}
.resolve-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.assignee {
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
}
.assignee.me {
  color: var(--accent);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.assignee.me::before {
  content: '●';
  font-size: 9px;
  color: var(--accent);
}
tr.is-mine {
  border-left: 3px solid var(--accent);
  background: rgba(251, 151, 70, 0.05);
}

/* ============================================================
   MOBILE & TOUCH-FIRST RESPONSIVENESS (<= 768px)
   ============================================================ */
@media (max-width: 1000px) {
  .map-layout { grid-template-columns: 1fr; }
  .panel { margin-top: 12px; }
}

@media (max-width: 768px) {
  /* Navigation switch: Desktop tabs hide, mobile bottom nav shows */
  .tabs { display: none !important; }
  .mobile-nav { display: flex; }
  .desktop-controls, .desktop-only { display: none !important; }
  .mobile-menu-btn { display: inline-flex !important; }

  /* Body & Page Container: Add clean margins (mx-4 = 16px) */
  body { overflow-x: hidden; width: 100%; max-width: 100vw; }
  body.has-mobile-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .req-grid { grid-template-columns: 1fr; gap: 14px; }
  .req-card { padding: 16px; }
  .req-card-actions .btn { flex: 1 1 auto; }
  .app { overflow-x: hidden; width: 100%; max-width: 100vw; }
  .login-screen { padding: 16px 12px; min-height: calc(100vh - 80px); }
  .login-card { padding: 24px 18px; border-radius: 16px; max-width: 100%; }
  main { padding: 14px 16px 40px; width: 100%; max-width: 100vw; box-sizing: border-box; overflow-x: hidden; }

  /* Banners on mobile: clean column layout with touch-friendly buttons */
  .banner {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  .banner > div {
    min-width: 0 !important;
    width: 100% !important;
  }
  .banner > button, .banner > .btn {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* 1. Header Optimization: Uncluttered 56px top bar */
  header.top {
    padding: 8px 12px;
    gap: 8px;
    height: 56px;
    min-height: 56px;
    flex-wrap: nowrap;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
  }
  .brand { gap: 6px; }
  .brand-text { display: none !important; }
  .brand img { height: 26px; max-width: 95px; object-fit: contain; }
  .pill-status { padding: 4px 8px; font-size: 11px; flex-shrink: 0; }
  .status-text-full { display: none !important; }
  .status-text-mobile { display: inline !important; font-weight: 700; }
  .icon-btn.bell, .icon-btn.mobile-menu-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    display: inline-flex !important;
  }

  /* 2. Maps & Route Tab: Stacking inputs & scrollable floor buttons */
  .route-bar-card {
    padding: 16px !important;
    border-radius: 14px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .route-bar-inner {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: stretch;
  }
  .route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
  }
  .route-title { font-size: 14px; white-space: nowrap; }
  .rt-btn-myroom {
    min-height: 36px !important;
    height: 36px;
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 8px;
    white-space: nowrap;
  }
  .route-inputs-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
  }
  .route-field {
    width: 100%;
    min-width: 0;
    max-width: 100% !important;
  }
  .rt-input {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    height: 44px;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    box-sizing: border-box;
  }
  .rt-swap-btn {
    align-self: center;
    width: 100%;
    max-width: 140px;
    min-height: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--card-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
  }
  .route-actions {
    display: flex;
    gap: 10px;
    width: 100%;
  }
  .rt-btn-calc {
    flex: 1;
    min-height: 44px !important;
    height: 44px;
    font-size: 14.5px;
    font-weight: 700;
    border-radius: 10px;
  }
  .rt-btn-clear {
    min-width: 80px;
    min-height: 44px !important;
    height: 44px;
    font-size: 13.5px;
    border-radius: 10px;
  }

  /* Floor selection buttons as horizontally scrollable segmented control */
  .map-tools {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 14px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .map-tools::-webkit-scrollbar { display: none; }
  
  #floor-seg {
    display: inline-flex;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 10px;
  }
  #floor-seg button {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  #layer-seg {
    display: inline-flex;
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 10px;
  }
  #layer-seg button {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  #pins-chip {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 13px;
    white-space: nowrap;
  }
  .map {
    height: clamp(240px, 35dvh, 300px);
    min-height: 240px;
    border-radius: 14px;
  }

  /* 3. Issues Tab: Fix clipping, double red line, and card layout */
  .issues-filter-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .chips-scroll-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 6px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .chips-scroll-row::-webkit-scrollbar { display: none; }
  .chips-scroll-row .chip {
    flex-shrink: 0;
    min-height: 44px;
    padding: 8px 16px;
    font-size: 13.5px;
  }
  #issue-search {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px;
    height: 44px;
    font-size: 14px;
    border-radius: 10px;
    padding: 10px 14px;
    box-sizing: border-box;
  }

  /* Outer table wrapper reset: remove double card border & clipping */
  .table-wrap {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .table-wrap table {
    display: block;
    width: 100%;
  }
  .table-wrap thead {
    display: none;
  }
  .table-wrap tbody {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Spacing between stacked cards */
    width: 100%;
  }

  /* Each table row becomes an independent card (p-4 padding = 16px) */
  .table-wrap tr {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--line-strong);
    border-left: 5px solid var(--line-strong);
    border-radius: 14px;
    padding: 16px; /* p-4 consistent internal padding */
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
    margin: 0;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    overflow: hidden;
  }

  /* Red accent indicator on left edge (clean, unclipped) */
  .table-wrap tr.is-new {
    border-left: 5px solid var(--bad) !important;
    background: color-mix(in srgb, var(--bad) 4%, var(--card));
  }
  .table-wrap tr.is-mine {
    border-left: 5px solid var(--accent) !important;
    background: color-mix(in srgb, var(--accent) 6%, var(--card));
  }
  /* CRITICAL: Kill the desktop inset box-shadow on td that caused the double red line! */
  tr.is-new td, tr.is-mine td {
    box-shadow: none !important;
  }

  .table-wrap td {
    padding: 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    width: 100%;
  }

  .mobile-only-badge { display: inline-block !important; }
  .mobile-only-lbl { display: inline !important; font-size: 12.5px; font-weight: 600; color: var(--mut); margin-right: 6px; }

  .td-room {
    background: var(--card-2);
    padding: 10px 12px !important;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .td-desc {
    padding: 2px 0 !important;
    color: var(--ink);
    line-height: 1.45;
  }
  .td-inv-item {
    background: var(--card-2);
    padding: 10px 12px !important;
    border-radius: 10px;
    border: 1px solid var(--line);
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Dropdowns inside cards: full width, 44px min-height, never cramped */
  .table-wrap select {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    background: var(--card-2) !important;
    border: 1px solid var(--line-strong) !important;
    padding: 8px 12px !important;
    box-sizing: border-box;
  }

  /* Action buttons inside cards: full width, 44px height */
  .action-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .table-wrap button.btn, .action-stack button.btn {
    width: 100% !important;
    min-height: 44px !important;
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-top: 4px;
  }

  /* 4. Touch Targets & Spacing: minimum 44px height for interactive elements */
  .btn {
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 10px;
  }
  .btn.small {
    min-height: 38px;
    padding: 6px 12px;
  }
  input[type="text"], input[type="search"], select {
    min-height: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
  }

  /* Inventory tab mobile adjustments */
  .inv-summary {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .inv-sum {
    min-width: 0;
    padding: 12px;
    box-sizing: border-box;
  }
  .inv-sum .t {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inv-sum .m {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .inv-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .inv-selects-scroll {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .inv-selects-scroll select {
    width: 100%;
    min-height: 44px;
    height: 44px;
    border-radius: 10px;
  }

  /* Team tab mobile adjustments */
  .team-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .member {
    padding: 16px;
    border-radius: 14px;
  }
  .meet-item {
    padding: 14px 16px;
    gap: 10px;
  }
  .meet-item button {
    min-height: 40px;
  }

  /* Request cards mobile polish (Competition, Logistics, TechOps) */
  .req-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .req-card {
    padding: 15px 16px;
    border-radius: 14px;
    max-width: 100%;
    overflow: hidden;
  }
  .req-card-actions {
    gap: 8px;
  }
  .req-card-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 42px;
    font-size: 13px;
  }
  .req-handout {
    flex-wrap: wrap;
    width: 100%;
  }
  .req-handout input {
    min-width: 140px;
    min-height: 42px;
  }
  .req-handout .btn {
    min-height: 42px;
  }

  /* Modals on mobile */
  .modal {
    width: calc(100vw - 24px);
    max-height: 90vh;
    border-radius: 16px;
  }
  .modal .mb {
    padding: 8px 16px 16px;
  }
  .modal .mf {
    padding: 12px 16px 16px;
  }
  .two {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media print {
  .bg, header.top, .mobile-nav, .mobile-drawer, .noprint, .toasts { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .universal-hero { border: 2px solid #000 !important; box-shadow: none !important; background: #fff !important; }
  .universal-hero h2, .universal-hero p, .u-step { color: #000 !important; }
  .universal-qr-frame { box-shadow: none !important; border: 1px solid #ccc !important; }
  .u-step { border: 1px solid #777 !important; background: #fff !important; }
  .qr-card { border: 1px solid #999; background: #fff; }
  .qr-card .code { color: #000; } .qr-card .meta { color: #333; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .pin .ring, .toast, .rt-active-line { animation: none; } }
