:root {
  --ink: #eef7f7;
  --muted: #87a3a8;
  --paper: #f4f7f4;
  --deep: #061922;
  --panel: #0b2730;
  --panel-2: #102f37;
  --line: rgba(255, 255, 255, .11);
  --teal: #24d3b5;
  --lime: #d8f46b;
  --amber: #ffb84d;
  --red: #ff6b5f;
  --blue: #64a8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, .34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 0%, rgba(36, 211, 181, .22), transparent 32rem),
    radial-gradient(circle at 82% 10%, rgba(255, 184, 77, .18), transparent 30rem),
    linear-gradient(140deg, #041118 0%, #061d27 52%, #102019 100%);
  font-family: "Maison Neue", "Inter", "SF Pro Display", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 1rem;
  text-align: center;
  background: #061922;
  transition: opacity .25s ease, visibility .25s ease;
}

.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
}

.gear-loader {
  width: 56px;
  height: 56px;
  margin: auto;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, .16);
  border-top-color: var(--teal);
  border-right-color: var(--amber);
  animation: spin 850ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.app-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 94px;
}

.topbar {
  min-height: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(13, 73, 88, .92), rgba(5, 26, 34, .82)),
    radial-gradient(circle at 82% 20%, rgba(216, 244, 107, .34), transparent 20rem);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, auto);
  align-items: start;
  gap: 1.4rem;
  position: relative;
  z-index: 100;
  overflow: visible;
}

.topbar > div:first-child {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.topbar::after {
  content: "";
  position: absolute;
  right: -100px;
  top: -140px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 80px rgba(255, 255, 255, .06);
}

.eyebrow,
.section-kicker {
  margin: 0 0 .55rem;
  color: var(--lime);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.topbar h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(1.8rem, 3.4vw, 3.35rem);
  line-height: .95;
  letter-spacing: -.055em;
}

.topbar-copy {
  max-width: 640px;
  margin: .75rem 0 0;
  color: #c5d8d8;
  font-size: .95rem;
  line-height: 1.35;
}

.topbar-actions {
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 560px;
}

.pill-button,
.live-chip,
.filter {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .75rem 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}

.pill-button.primary {
  border-color: rgba(216, 244, 107, .7);
  color: #061922;
  background: var(--lime);
  font-weight: 900;
}

.pill-button.ghost:hover,
.filter:hover,
.filter.active {
  border-color: rgba(36, 211, 181, .6);
  background: rgba(36, 211, 181, .16);
}

.tools-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: stretch;
}

#toolsMenuBtn[aria-expanded="true"] {
  border-color: rgba(36, 211, 181, .72);
  background: rgba(36, 211, 181, .2);
}

.tools-menu {
  position: absolute;
  top: calc(100% + .55rem);
  right: 0;
  z-index: 110;
  width: min(260px, 82vw);
  padding: .45rem;
  border: 1px solid rgba(172, 245, 229, .22);
  border-radius: 18px;
  background: rgba(6, 20, 29, .96);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .34);
  backdrop-filter: blur(18px);
}

.tools-menu button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: .78rem .85rem;
  color: var(--ink);
  background: transparent;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}

.tools-menu button:hover,
.tools-menu button:focus-visible {
  outline: none;
  color: #061922;
  background: var(--lime);
}

.tools-menu button:disabled {
  color: rgba(232, 246, 243, .54);
  background: rgba(255, 255, 255, .04);
}

.tools-menu button[hidden] {
  display: none;
}

.live-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  margin-left: auto;
}

.live-chip span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 18px var(--lime);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 1rem;
  margin: 1rem 0 22px;
  position: relative;
  z-index: 1;
}

.hero-main,
.hero-radar,
.ship-rail,
.board,
.insight-panel,
.port-section,
.admin-data-section,
.activity-section {
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(7, 26, 36, .78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .24);
  backdrop-filter: blur(20px);
}

.hero-main {
  padding: 26px;
}

.schedule-banner {
  display: block;
  margin: 1rem 0 0;
  border: 1px solid rgba(216, 244, 107, .32);
  border-radius: 22px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(36, 211, 181, .16), rgba(216, 244, 107, .1)),
    rgba(7, 26, 36, .86);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .2);
}

.schedule-banner.pending {
  border-color: rgba(255, 202, 97, .55);
  background:
    linear-gradient(135deg, rgba(255, 202, 97, .18), rgba(36, 211, 181, .1)),
    rgba(7, 26, 36, .9);
}

.schedule-banner h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2.25rem);
  letter-spacing: 0;
}

.schedule-banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .65rem;
}

.schedule-banner-meta span {
  padding: .45rem .65rem;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
}

.schedule-list {
  display: grid;
  gap: .65rem;
  margin-top: .75rem;
}

.schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: .6rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  padding: .75rem;
  background: rgba(255, 255, 255, .05);
}

.schedule-row.pending {
  border-color: rgba(255, 202, 97, .36);
}

.schedule-row strong,
.schedule-row small {
  display: block;
}

.schedule-row small {
  margin-top: .2rem;
  color: var(--muted);
}

.schedule-row > span {
  border-radius: 999px;
  padding: .42rem .62rem;
  color: #061922;
  background: var(--lime);
  font-weight: 900;
  font-size: .72rem;
}

.schedule-row .pill-button {
  padding: .58rem .72rem;
}

.hero-main h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.9rem);
  letter-spacing: -.05em;
}

.hero-meta {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  color: var(--muted);
}

.meta-pill {
  padding: .52rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
}

.hero-radar {
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  text-align: center;
}

.radar-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 1px solid rgba(36, 211, 181, .5);
  animation: pulse 2.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(.86); opacity: .55; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: .95; }
}

.radar-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4.5rem;
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.08em;
  color: var(--teal);
  z-index: 1;
}

.hero-radar p {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28px;
  margin: 0;
  color: var(--muted);
  z-index: 1;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
}

.metric {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
}

.metric-clickable {
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.metric-clickable:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 211, 181, .48);
  background: linear-gradient(180deg, rgba(36, 211, 181, .13), rgba(255, 255, 255, .045));
}

.metric-clickable::after {
  content: "Klik detail";
  display: inline-flex;
  margin-top: .65rem;
  border-radius: 999px;
  padding: .25rem .48rem;
  color: #061922;
  background: var(--lime);
  font-size: .68rem;
  font-weight: 900;
}

.metric strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 3rem);
  letter-spacing: -.06em;
}

.metric span {
  color: var(--muted);
  font-size: .9rem;
}

.ship-analysis-section {
  margin: 0 0 1rem;
  padding: 20px;
  border: 1px solid rgba(216, 244, 107, .18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 0%, rgba(216, 244, 107, .13), transparent 18rem),
    linear-gradient(135deg, rgba(7, 26, 36, .84), rgba(6, 20, 29, .68));
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  backdrop-filter: blur(20px);
}

.ship-analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.35fr 1.35fr 2fr;
  gap: .75rem;
}

.ship-analysis-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
}

.ship-analysis-card.status {
  border-color: rgba(36, 211, 181, .28);
  background: linear-gradient(160deg, rgba(36, 211, 181, .14), rgba(255, 255, 255, .045));
}

.ship-analysis-card.status.warning {
  border-color: rgba(250, 166, 40, .4);
  background: linear-gradient(160deg, rgba(250, 166, 40, .16), rgba(255, 255, 255, .045));
}

.ship-analysis-card.status.critical {
  border-color: rgba(255, 83, 83, .48);
  background: linear-gradient(160deg, rgba(255, 83, 83, .17), rgba(255, 255, 255, .045));
}

.ship-analysis-card span,
.ship-analysis-card small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.35;
}

.ship-analysis-card span {
  margin-bottom: .5rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.ship-analysis-card strong {
  display: block;
  margin-bottom: .45rem;
  font-size: 1.02rem;
  line-height: 1.22;
}

.queue-slicer-section {
  margin: 0 0 1rem;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(7, 26, 36, .72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .22);
  backdrop-filter: blur(20px);
}

.section-note {
  margin: .35rem 0 0;
  color: var(--muted);
}

.slicer-form {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: .65rem;
  flex-wrap: wrap;
}

.slicer-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.slicer-form input,
.slicer-form select {
  min-width: 124px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 15px;
  padding: .78rem .85rem;
  color: var(--ink);
  background: rgba(0, 0, 0, .24);
  outline: none;
}

.slicer-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 2fr;
  gap: .75rem;
  margin-bottom: .9rem;
}

.slicer-card {
  min-height: 92px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035));
}

.slicer-card span,
.slicer-card small {
  display: block;
  color: var(--muted);
  font-size: .82rem;
}

.slicer-card strong {
  display: block;
  margin-top: .35rem;
  font-size: 1rem;
  line-height: 1.25;
}

.power-visual {
  position: relative;
  margin-bottom: 1rem;
  padding: 18px;
  border: 1px solid rgba(36, 211, 181, .18);
  border-radius: 26px;
  background:
    radial-gradient(circle at 0% 0%, rgba(36, 211, 181, .16), transparent 24rem),
    linear-gradient(135deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  overflow: hidden;
}

.power-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent 85%);
}

.power-visual-head,
.power-filter-row,
.power-stage {
  position: relative;
  z-index: 1;
}

.power-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.power-visual-head h3 {
  margin: 0;
}

.power-tabs,
.power-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

.power-tab,
.power-chip {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .58rem .82rem;
  color: var(--ink);
  background: rgba(0, 0, 0, .22);
  font-weight: 900;
}

.power-tab.active,
.power-tab:hover,
.power-chip.active,
.power-chip:hover {
  border-color: rgba(216, 244, 107, .7);
  color: #061922;
  background: var(--lime);
}

.power-filter-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .8rem;
  align-items: start;
  margin-bottom: 1rem;
}

.power-filter-row > span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding-top: .65rem;
}

.power-chip-row {
  max-height: 86px;
  overflow: auto;
}

.power-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
}

.power-chart,
.power-detail {
  min-height: 320px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: rgba(0, 0, 0, .22);
}

.power-chart {
  position: relative;
  padding: 18px;
  overflow: hidden;
}

.power-grid-bg {
  position: absolute;
  inset: 0;
  opacity: .45;
  background:
    radial-gradient(circle at 70% 18%, rgba(100, 168, 255, .16), transparent 20rem),
    linear-gradient(90deg, rgba(36, 211, 181, .08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 211, 181, .07) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}

.power-chart-title {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.power-chart-title strong,
.power-chart-title span {
  display: block;
}

.power-chart-title span {
  color: var(--muted);
}

.power-timeline {
  position: relative;
  z-index: 1;
  height: 236px;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(14px, 1fr));
  gap: .3rem;
  align-items: end;
}

.power-bar {
  height: 100%;
  min-width: 14px;
  display: grid;
  align-items: end;
  gap: .35rem;
  border: 0;
  color: var(--muted);
  background: transparent;
  padding: 0;
}

.power-bar span {
  display: block;
  width: 100%;
  height: var(--h);
  min-height: 5px;
  border-radius: 999px 999px 5px 5px;
  background: linear-gradient(180deg, var(--lime), var(--teal) 68%, rgba(36, 211, 181, .25));
  box-shadow: 0 0 22px rgba(36, 211, 181, .22);
  transition: transform .18s ease, filter .18s ease;
}

.power-bar small {
  min-height: 16px;
  font-size: .64rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.power-bar:hover span,
.power-bar.active span {
  filter: brightness(1.25);
  transform: translateY(-4px);
  background: linear-gradient(180deg, #fff2a8, var(--amber));
}

.power-compare {
  position: relative;
  z-index: 1;
  display: grid;
  gap: .65rem;
}

.compare-row {
  display: grid;
  grid-template-columns: 42px 150px minmax(120px, 1fr) 220px;
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: .75rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
  text-align: left;
}

.compare-row:hover {
  border-color: rgba(36, 211, 181, .5);
  background: rgba(36, 211, 181, .09);
}

.compare-rank {
  color: var(--lime);
  font-weight: 900;
}

.compare-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  overflow: hidden;
}

.compare-track span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
}

.compare-row small {
  color: var(--muted);
}

.power-orbs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .85rem;
}

.power-orb {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  color: var(--ink);
  background:
    radial-gradient(circle at center, #071a22 0 53%, transparent 54%),
    conic-gradient(var(--lime) 0 var(--pct), rgba(255, 255, 255, .08) var(--pct) 360deg);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 1rem;
  text-align: center;
  box-shadow: inset 0 0 30px rgba(36, 211, 181, .1);
}

.power-orb span {
  font-size: 2rem;
  font-weight: 900;
  color: var(--lime);
}

.power-orb small {
  color: var(--muted);
}

.power-detail {
  padding: 18px;
}

.detail-kicker {
  color: var(--lime);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.power-detail h4 {
  margin: .45rem 0;
  font-size: 1.45rem;
}

.detail-total {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: -.07em;
}

.detail-total small {
  font-size: .9rem;
  color: var(--muted);
  letter-spacing: 0;
}

.power-detail p {
  color: var(--muted);
}

.detail-list {
  display: grid;
  gap: .5rem;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.detail-list span {
  color: var(--muted);
  white-space: nowrap;
}

.queue-heatmap-wrap,
#queueHeatmap,
.heatmap-grid {
  display: none !important;
}

.whisker-toolbar {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin: .85rem 0 1rem;
}

.whisker-slicer-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: .65rem;
  align-items: end;
  margin: 1rem 0 .8rem;
  padding: .85rem;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  background: rgba(0, 0, 0, .18);
}

.whisker-slicer-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.whisker-slicer-form input,
.whisker-slicer-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  padding: .72rem .78rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  color-scheme: dark;
  letter-spacing: 0;
  text-transform: none;
}

.whisker-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: .75rem;
  align-items: stretch;
}

.whisker-chart-wrap {
  min-height: 470px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  background: #061922;
}

.whisker-chart-wrap svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
}

.whisker-insight {
  display: grid;
  gap: .5rem;
  align-content: start;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 22px;
  padding: 14px;
  background: rgba(0, 0, 0, .22);
}

.whisker-insight div {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: .62rem;
}

.whisker-insight .smart-insight {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px;
  padding: .72rem .78rem;
}

.whisker-insight .smart-insight.good {
  border-color: rgba(36, 211, 181, .25);
  background: linear-gradient(160deg, rgba(36, 211, 181, .13), rgba(255, 255, 255, .045));
}

.whisker-insight .smart-insight.warning {
  border-color: rgba(250, 166, 40, .34);
  background: linear-gradient(160deg, rgba(250, 166, 40, .14), rgba(255, 255, 255, .045));
}

.whisker-insight .smart-insight.critical {
  border-color: rgba(255, 83, 83, .46);
  background: linear-gradient(160deg, rgba(255, 83, 83, .16), rgba(255, 255, 255, .045));
}

.whisker-insight .smart-insight.empty {
  border-color: rgba(135, 163, 168, .18);
  background: rgba(135, 163, 168, .08);
}

.whisker-insight .smart-insight.recommendation {
  border-color: rgba(216, 244, 107, .24);
  background: linear-gradient(160deg, rgba(216, 244, 107, .12), rgba(255, 255, 255, .045));
}

.whisker-insight span {
  display: block;
  margin-bottom: .35rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.whisker-insight strong,
.whisker-insight small {
  display: block;
}

.whisker-insight strong {
  color: var(--lime);
  font-size: .92rem;
  line-height: 1.25;
}

.whisker-insight small {
  margin-top: .24rem;
  color: var(--muted);
  line-height: 1.32;
}

.whisker-table-wrap {
  margin-top: 1rem;
  max-height: 420px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  background: rgba(0, 0, 0, .18);
}

.whisker-shell.matrix-first {
  margin-top: 1rem;
}

.whisker-table-wrap.compact {
  max-height: 320px;
}

.whisker-stat-details {
  margin-top: 1rem;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  background: rgba(0, 0, 0, .14);
}

.whisker-stat-details summary {
  cursor: pointer;
  padding: .9rem 1rem;
  color: var(--lime);
  font-weight: 900;
}

.whisker-stat-details .whisker-table-wrap {
  margin-top: 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-radius: 0 0 20px 20px;
}

.whisker-table-title {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .82rem .9rem;
  color: var(--ink);
  background: #071a22;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.whisker-table-title small {
  color: var(--muted);
}

.whisker-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.whisker-table th,
.whisker-table td {
  padding: .72rem .8rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-align: right;
  white-space: nowrap;
}

.whisker-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--lime);
  background: #071a22;
  font-size: .78rem;
  text-transform: uppercase;
}

.whisker-table th:first-child,
.whisker-table td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  background: #071a22;
}

.whisker-table td:first-child {
  color: var(--ink);
  font-weight: 900;
}

.whisker-table .average-row td {
  position: sticky;
  bottom: 0;
  color: #061922;
  background: var(--lime);
  font-weight: 900;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  text-align: left;
}

.heatmap-grid {
  display: grid;
  gap: 1px;
  min-width: max-content;
}

.heatmap-head,
.heatmap-point,
.heat-cell {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
  font-size: .78rem;
  font-weight: 800;
}

.heatmap-head {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--muted);
  background: #071a22;
}

.heatmap-sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  justify-content: start;
  padding: 0 .85rem;
  background: #071a22;
}

.heatmap-point {
  color: var(--ink);
}

.heat-cell.zero {
  color: rgba(238, 247, 247, .36);
  background: rgba(255, 255, 255, .035);
}

.heat-cell.cool {
  background: rgba(36, 211, 181, .18);
}

.heat-cell.warm {
  color: #071a22;
  background: rgba(255, 184, 77, .76);
}

.heat-cell.hot {
  color: #071a22;
  background: var(--lime);
}

.heat-cell.missing {
  color: rgba(238, 247, 247, .26);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .03) 6px, rgba(255, 255, 255, .06) 6px, rgba(255, 255, 255, .06) 12px);
}

.heat-cell.selected {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
  filter: brightness(1.18);
}

.queue-heatmap-wrap,
#queueHeatmap,
.heatmap-grid {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.ship-rail,
.board,
.insight-panel,
.port-section,
.admin-data-section,
.activity-section {
  padding: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h3 {
  margin: 0;
  font-size: 1.25rem;
}

.compact {
  margin-bottom: .8rem;
}

.ship-list,
.driver-list,
.activity-list {
  display: grid;
  gap: .7rem;
}

.driver-item,
.activity-item,
.point-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: rgba(255, 255, 255, .055);
}

.ship-choice-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ship-choice {
  width: 100%;
  border: 1px solid rgba(36, 211, 181, .25);
  border-radius: 18px;
  padding: .95rem 1rem;
  color: var(--ink);
  background: rgba(0, 0, 0, .24);
  outline: none;
}

.ship-choice:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 211, 181, .12);
}

.ship-selected-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 20px;
  background: rgba(255, 255, 255, .055);
}

.ship-selected-card span,
.ship-selected-card small {
  display: block;
  color: var(--muted);
}

.ship-selected-card strong,
.driver-item strong,
.activity-item strong {
  display: block;
}

.live-only-card {
  border-color: rgba(36, 211, 181, .22);
  background: linear-gradient(135deg, rgba(36, 211, 181, .1), rgba(255, 255, 255, .045));
}

.ship-selected-card small,
.driver-item small,
.activity-item small {
  display: block;
  margin-top: .35rem;
  color: var(--muted);
}

.board-filter {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.filter {
  padding: .55rem .82rem;
  font-size: .85rem;
}

.point-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .55rem;
}

.point-card {
  padding: 11px 12px;
  min-height: 104px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border-radius: 16px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.point-card:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 211, 181, .42);
  background: rgba(255, 255, 255, .075);
}

.point-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--teal);
}

.point-card.blocked::before { background: var(--red); }
.point-card.warn::before { background: var(--amber); }

.point-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}

.point-top h4 {
  margin: 0;
  font-size: .95rem;
  line-height: 1.15;
}

.point-top small {
  font-size: .72rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: .28rem;
  background: var(--teal);
  box-shadow: 0 0 16px currentColor;
}

.status-dot.blocked { background: var(--red); }
.status-dot.warn { background: var(--amber); }

.point-value {
  margin: .55rem 0 .35rem;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -.08em;
}

.queue-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}

.queue-bar span {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--lime));
}

.point-foot {
  display: flex;
  justify-content: space-between;
  gap: .45rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: .4rem;
  color: var(--muted);
  font-size: .72rem;
}

.point-foot span:first-child {
  color: #d8eceb;
  font-weight: 800;
}

.readonly-detail {
  margin-top: 1rem;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
}

.readonly-detail strong,
.readonly-detail small {
  display: block;
}

.readonly-detail small {
  margin-top: .55rem;
  color: var(--muted);
}

.driver-item,
.activity-item {
  padding: 14px;
}

.driver-rank {
  color: var(--lime);
  font-weight: 900;
}

.trend-box {
  margin-top: 1.2rem;
}

.trend-bars {
  height: 190px;
  display: flex;
  gap: .38rem;
  align-items: end;
  padding-top: .8rem;
}

.trend-bar {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, var(--amber), var(--teal));
  height: var(--h);
  position: relative;
}

.trend-bar:hover::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap;
  padding: .35rem .5rem;
  border-radius: 10px;
  background: #011014;
  color: var(--ink);
  font-size: .75rem;
}

.port-section {
  margin-top: 1rem;
}

.port-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.port-tools input {
  min-width: 220px;
  border: 1px solid rgba(36, 211, 181, .25);
  border-radius: 999px;
  padding: .82rem 1rem;
  color: var(--ink);
  background: rgba(0, 0, 0, .24);
  outline: none;
}

.port-tools input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 211, 181, .11);
}

.port-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin-bottom: .75rem;
}

.port-summary-card,
.port-card {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .055);
}

.port-summary-card {
  padding: 13px;
}

.port-summary-card span,
.port-summary-card small,
.port-card small {
  display: block;
  color: var(--muted);
}

.port-summary-card strong {
  display: block;
  margin: .25rem 0;
  font-size: 1.1rem;
}

.port-list {
  display: grid;
  gap: .55rem;
}

.port-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(150px, .8fr) auto;
  gap: .75rem;
  align-items: center;
  padding: 13px;
}

.port-card strong {
  display: block;
  margin: .2rem 0;
  font-size: 1.35rem;
  letter-spacing: -.035em;
}

.port-status {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: .22rem .48rem;
  color: #071a22;
  background: var(--amber);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.port-time span {
  display: block;
  color: var(--lime);
  font-weight: 900;
}

.port-confirm {
  border: 0;
  border-radius: 999px;
  padding: .78rem 1rem;
  color: #061922;
  background: var(--teal);
  font-weight: 900;
}

.port-confirm:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: rgba(255, 255, 255, .08);
}

.admin-data-section {
  margin-top: 1rem;
}

.admin-data-tools,
.admin-card-actions {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-data-tools.drawer-tools {
  justify-content: flex-start;
  margin-bottom: .85rem;
}

.admin-data-list {
  display: grid;
  gap: .65rem;
}

.admin-user-list {
  display: grid;
  gap: .7rem;
}

.admin-user-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(280px, auto);
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, .045);
}

.admin-user-card.pending {
  border-color: rgba(255, 184, 77, .36);
  background:
    linear-gradient(135deg, rgba(255, 184, 77, .11), rgba(255, 255, 255, .035));
}

.admin-user-card strong,
.admin-user-card small {
  display: block;
}

.admin-user-card small {
  color: var(--muted);
}

.role-status {
  border-radius: 999px;
  padding: .35rem .6rem;
  color: #061922;
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.role-status.active {
  background: var(--lime);
}

.role-status.pending {
  background: var(--amber);
}

.admin-user-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  justify-content: flex-end;
  align-items: center;
}

.admin-user-controls select {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .68rem .85rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  color-scheme: dark;
}

.admin-user-controls .secondary-submit {
  margin-top: 0;
}

.admin-activity-filter {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto auto;
  gap: .55rem;
  align-items: center;
  margin-bottom: .9rem;
}

.admin-activity-filter input,
.admin-activity-filter select {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 999px;
  padding: .78rem .9rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  outline: none;
  color-scheme: dark;
}

.activity-log-list {
  display: grid;
  gap: .7rem;
}

.activity-log-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(180px, .55fr) minmax(220px, .75fr);
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, .045);
}

.activity-log-card.failed {
  border-color: rgba(255, 107, 95, .34);
  background: linear-gradient(135deg, rgba(255, 107, 95, .1), rgba(255, 255, 255, .035));
}

.activity-log-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
}

.activity-log-card strong,
.activity-log-card small {
  display: block;
}

.activity-log-card small {
  color: var(--muted);
}

.activity-log-detail summary {
  cursor: pointer;
  color: var(--teal);
  font-weight: 900;
}

.activity-log-detail pre {
  max-height: 170px;
  overflow: auto;
  margin: .5rem 0 0;
  padding: .75rem;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(0, 0, 0, .22);
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-ship-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(180px, auto) auto;
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, .055);
}

.admin-ship-card strong,
.admin-ship-card small,
.admin-counts span {
  display: block;
}

.admin-ship-card small,
.admin-counts {
  color: var(--muted);
}

.admin-check {
  display: grid;
  place-items: center;
}

.admin-check input {
  width: 22px;
  height: 22px;
  accent-color: var(--lime);
}

.admin-counts {
  font-size: .82rem;
}

.admin-edit-form {
  margin-top: 1rem;
}

.admin-detail-grid {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
}

.admin-detail-section {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, .045);
}

.admin-detail-section h3 {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 .65rem;
}

.admin-detail-section h3 span {
  color: var(--lime);
}

.admin-detail-list {
  display: grid;
  gap: .45rem;
}

.admin-detail-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .6rem;
  align-items: center;
  border-radius: 13px;
  padding: .58rem .68rem;
  background: rgba(0, 0, 0, .16);
}

.admin-detail-list article span {
  color: #dcecec;
  font-size: .84rem;
}

.mini-danger {
  border: 0;
  border-radius: 999px;
  padding: .38rem .62rem;
  color: #fff;
  background: var(--red);
  font-size: .72rem;
  font-weight: 900;
}

.danger-zone {
  border-color: rgba(255, 107, 95, .35);
}

.cycle-list {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}

.cycle-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
  gap: .75rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  padding: 13px;
  background: rgba(255, 255, 255, .055);
}

.cycle-rank {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #061922;
  background: var(--lime);
  font-weight: 900;
}

.cycle-item strong,
.cycle-duration span {
  display: block;
  font-weight: 900;
}

.cycle-item small,
.cycle-duration small {
  display: block;
  color: var(--muted);
}

.cycle-duration {
  text-align: right;
}

.cycle-duration span {
  color: var(--teal);
  font-size: 1.05rem;
}

.activity-section {
  margin-top: 1rem;
}

.activity-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.activity-item {
  min-height: 112px;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  background: rgba(0, 0, 0, .52);
  backdrop-filter: blur(10px);
  padding: 20px;
}

.drawer.show {
  display: grid;
  place-items: end center;
}

.drawer-panel {
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #071a22;
  padding: 24px;
  box-shadow: var(--shadow);
}

.drawer-panel.wide {
  width: calc(100vw - 12px);
  max-height: calc(100vh - 12px);
  padding: 18px;
  border-radius: 22px;
}

.drawer-close {
  float: right;
  border: 0;
  border-radius: 999px;
  padding: .65rem .9rem;
  color: var(--deep);
  background: var(--lime);
  font-weight: 900;
}

.drawer-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .8rem;
  margin-top: 1rem;
}

.operation-head {
  clear: both;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: end;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.operation-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  letter-spacing: 0;
}

.operation-stats {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .55rem;
}

.operation-layout {
  clear: both;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem;
  margin-top: .65rem;
}

.action-stack {
  display: none;
  gap: .65rem;
  align-content: start;
}

.operation-layout > div:not(.action-stack) {
  display: grid;
  gap: .65rem;
}

#truckInForm,
#moveTruckForm {
  display: none;
}

.action-tab,
.action-submit,
.secondary-submit {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .72rem .8rem;
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  text-align: left;
  font-weight: 900;
}

.action-tab.active,
.action-tab:hover {
  border-color: rgba(216, 244, 107, .7);
  color: #061922;
  background: var(--lime);
}

.action-pane {
  display: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, .055);
}

.action-pane.active {
  display: block;
  animation: drawerIn .22s ease both;
}

.loading-timer-card {
  margin-bottom: .65rem;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(36, 211, 181, .12), rgba(255, 255, 255, .035)),
    rgba(0, 0, 0, .18);
}

.loading-timer-card.active {
  border-color: rgba(36, 211, 181, .55);
  box-shadow: inset 0 0 0 1px rgba(36, 211, 181, .12), 0 16px 38px rgba(36, 211, 181, .08);
}

.truck-out-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
  margin: .55rem 0;
}

.truck-out-quick-actions .secondary-submit {
  text-align: center;
}

.truck-out-quick-actions .action-submit {
  text-align: center;
}

.timer-reset-button {
  width: 100%;
  text-align: center;
  padding-block: .55rem;
}

.loading-timer-card span,
.loading-timer-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.loading-timer-card span {
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.loading-timer-card strong {
  display: block;
  margin: .12rem 0;
  font-size: clamp(1.75rem, 5vw, 2.8rem);
  line-height: .95;
  letter-spacing: -.07em;
  color: var(--lime);
}

@keyframes drawerIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.form-grid-span {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: .28rem;
}

.field label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: .72rem .8rem;
  color: var(--ink);
  background: rgba(0, 0, 0, .24);
  outline: none;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(36, 211, 181, .11);
}

.field-help {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: auto;
  justify-self: start;
  min-width: 22px;
  min-height: 22px;
}

.whatsapp-admin-tools {
  align-items: stretch;
  margin-top: .35rem;
}

.whatsapp-admin-tools .action-submit,
.whatsapp-admin-tools .secondary-submit {
  margin-top: .65rem;
}

.whatsapp-status-panel {
  margin-top: 1rem;
}

.whatsapp-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.whatsapp-status-grid div {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: .9rem;
  background: rgba(255, 255, 255, .05);
}

.whatsapp-status-grid span {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.whatsapp-status-grid strong {
  display: block;
  margin-top: .35rem;
  overflow-wrap: anywhere;
}

.whatsapp-qr-box {
  display: grid;
  justify-items: center;
  gap: .7rem;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, .05);
}

.whatsapp-qr-box img {
  width: min(320px, 100%);
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: .5rem;
}

.whatsapp-qr-box p {
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.action-submit {
  margin-top: 1rem;
  color: #061922;
  background: var(--teal);
  border-color: transparent;
  text-align: center;
}

.secondary-submit {
  margin-top: 1rem;
  text-align: center;
}

.danger-submit {
  background: var(--red);
  color: #fff;
}

.form-note {
  margin: .6rem 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.toast-area {
  position: fixed;
  z-index: 260;
  right: 18px;
  bottom: 92px;
  display: grid;
  gap: .6rem;
  width: min(360px, calc(100% - 36px));
}

.toast {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: .9rem 1rem;
  background: rgba(4, 17, 24, .94);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.toast.success {
  border-color: rgba(36, 211, 181, .55);
}

.toast.error {
  border-color: rgba(255, 107, 95, .65);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 10;
  width: min(520px, calc(100% - 24px));
  transform: translateX(-50%);
  display: none;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(4, 17, 24, .84);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  backdrop-filter: blur(20px);
}

.public-live-only .bottom-nav a[href="#activitySection"] {
  display: none;
}

.bottom-nav a {
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  padding: .9rem .3rem;
  font-weight: 800;
  font-size: .82rem;
}

.bottom-nav a.active {
  color: var(--lime);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, .05);
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .live-chip {
    margin-left: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .schedule-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .slicer-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ship-analysis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ship-analysis-card.wide {
    grid-column: 1 / -1;
  }

  .power-stage {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .activity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 18px, 620px);
    padding-top: 9px;
    padding-bottom: 92px;
  }

  .topbar {
    min-height: 0;
    padding: 10px;
    border-radius: 22px;
  }

  .topbar::after,
  .topbar > div:first-child,
  .metric-strip,
  .queue-slicer-section,
  .activity-section,
  .hero-radar {
    display: none !important;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    align-items: stretch;
  }

  .topbar-actions .pill-button {
    width: 100%;
    min-height: 42px;
    padding: .65rem .45rem;
    justify-content: center;
    font-size: .74rem;
  }

  .tools-menu-wrap {
    width: 100%;
  }

  .tools-menu {
    right: 0;
    width: min(240px, calc(100vw - 34px));
  }

  .live-chip {
    grid-column: 1 / -1;
    order: -1;
    width: 100%;
    justify-content: center;
    border-radius: 16px;
    padding: .75rem .8rem;
    font-size: .86rem;
    background: rgba(36, 211, 181, .12);
  }

  .hero-panel {
    grid-template-columns: 1fr;
    margin: .65rem 0 .7rem;
    gap: .65rem;
  }

  .hero-main {
    padding: 15px;
    border-radius: 22px;
  }

  .hero-main h2 {
    font-size: clamp(1.35rem, 8vw, 2.2rem);
    line-height: 1;
  }

  .hero-meta {
    margin-top: .75rem;
    gap: .45rem;
  }

  .meta-pill {
    padding: .46rem .58rem;
    font-size: .76rem;
  }

  .metric-strip,
  .ship-analysis-grid,
  .slicer-summary,
  .workspace,
  .point-grid,
  .activity-list,
  .drawer-grid,
  .operation-layout,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .truck-out-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace {
    gap: .7rem;
  }

  .slicer-form {
    justify-content: stretch;
  }

  .slicer-form label,
  .slicer-form .pill-button {
    width: 100%;
  }

  .power-visual-head,
  .power-filter-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .power-visual-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .power-tabs,
  .power-chip-row {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .2rem;
  }

  .power-tab,
  .power-chip {
    white-space: nowrap;
  }

  .compare-row {
    grid-template-columns: 36px minmax(120px, 1fr);
  }

  .compare-track,
  .compare-row small {
    grid-column: 1 / -1;
  }

  .power-timeline {
    overflow-x: auto;
    min-width: 640px;
  }

  .power-chart {
    overflow-x: auto;
  }

  .whisker-toolbar,
  .whisker-shell,
  .whisker-slicer-form {
    grid-template-columns: 1fr;
  }

  .whisker-toolbar .pill-button,
  .whisker-slicer-form .pill-button {
    width: 100%;
  }

  .whisker-chart-wrap {
    min-height: 300px;
    overflow-x: auto;
  }

  .whisker-chart-wrap svg {
    min-width: 760px;
    max-height: none;
  }

  .operation-head {
    grid-template-columns: 1fr;
  }

  .action-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-tab {
    text-align: center;
    padding: .85rem .65rem;
  }

  .ship-rail,
  .board,
  .port-section,
  .admin-data-section {
    padding: 14px;
    border-radius: 22px;
  }

  .ship-rail {
    order: 1;
  }

  .board {
    order: 2;
  }

  .port-section {
    order: 3;
    margin-top: 0;
  }

  .admin-data-section {
    order: 4;
    margin-top: 0;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: .55rem;
    margin-bottom: .7rem;
  }

  .section-heading h3 {
    font-size: 1.05rem;
  }

  .ship-choice {
    border-radius: 15px;
    padding: .78rem .85rem;
  }

  .ship-selected-card {
    padding: 12px;
    border-radius: 16px;
  }

  .board-filter {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .35rem;
  }

  .filter {
    padding: .52rem .35rem;
    font-size: .7rem;
    text-align: center;
  }

  .point-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .5rem;
  }

  .point-card {
    min-height: 98px;
    padding: 10px 11px;
    border-radius: 15px;
  }

  .point-top h4 {
    font-size: .9rem;
  }

  .point-top small,
  .point-foot {
    font-size: .68rem;
  }

  .point-value {
    margin: .45rem 0 .3rem;
    font-size: 1.45rem;
  }

  .port-tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .port-tools input {
    min-width: 0;
    width: 100%;
  }

  .port-summary {
    grid-template-columns: 1fr;
  }

  .port-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cycle-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .cycle-duration {
    grid-column: 1 / -1;
    text-align: left;
  }

  .port-confirm {
    width: 100%;
  }

  .admin-data-tools,
  .admin-card-actions {
    width: 100%;
    justify-content: stretch;
  }

  .admin-data-tools .pill-button,
  .admin-card-actions button {
    flex: 1;
  }

  .admin-ship-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-counts,
  .admin-card-actions {
    grid-column: 1 / -1;
  }

  .admin-detail-list article {
    grid-template-columns: 1fr;
  }

  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .admin-user-controls {
    justify-content: stretch;
  }

  .admin-user-controls select,
  .admin-user-controls button {
    flex: 1;
    min-width: 140px;
  }

  .admin-activity-filter,
  .activity-log-card {
    grid-template-columns: 1fr;
  }

  .admin-activity-filter .pill-button {
    width: 100%;
  }

  .activity-log-main {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .bottom-nav a[href="#activitySection"] {
    display: none;
  }

  .bottom-nav a {
    padding: .78rem .25rem;
    font-size: .78rem;
  }
}
