:root {
  color-scheme: dark;
  --bg: #06101e;
  --bg-2: #0a1829;
  --panel: rgba(15, 29, 47, .82);
  --panel-strong: rgba(16, 32, 52, .94);
  --panel-soft: rgba(255, 255, 255, .045);
  --line: rgba(198, 224, 255, .14);
  --line-strong: rgba(198, 224, 255, .24);
  --text: #f4f8ff;
  --muted: #a7b5c8;
  --faint: #6f8096;
  --blue: #3f93ff;
  --blue-2: #246fd8;
  --cyan: #47c6ff;
  --green: #35d07f;
  --amber: #ffbf4f;
  --red: #ff625f;
  --shadow: 0 22px 70px rgba(0, 0, 0, .46);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --sidebar: 250px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 64% -10%, rgba(63, 147, 255, .26), transparent 34%),
    radial-gradient(circle at 10% 104%, rgba(71, 198, 255, .08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f7fc;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, .98);
  --panel-strong: #ffffff;
  --panel-soft: rgba(20, 53, 93, .06);
  --line: rgba(31, 57, 88, .18);
  --line-strong: rgba(31, 57, 88, .28);
  --text: #132238;
  --muted: #43536a;
  --faint: #66758a;
  --blue: #276fe8;
  --blue-2: #1d5fcc;
  --green: #1da767;
  --amber: #b97812;
  --red: #d84343;
  --shadow: 0 16px 36px rgba(28, 52, 82, .11);
  background:
    radial-gradient(circle at 72% -10%, rgba(39, 111, 232, .12), transparent 30%),
    linear-gradient(180deg, #f3f7fc 0%, #ffffff 100%);
}

body[data-time="evening"][data-theme="dark"] {
  --bg: #081323;
}

body[data-time="night"][data-theme="dark"] {
  --bg: #040b15;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.is-active {
  display: block;
}

.splash-screen,
.login-screen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 100vh;
  --text: #f5f9ff;
  --muted: #c6d3e4;
  --faint: #92a3b8;
  --line: rgba(205, 228, 255, .15);
  --line-strong: rgba(205, 228, 255, .26);
  --blue: #63adff;
  color: var(--text);
}

.scene-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(3, 12, 24, .88) 0%, rgba(7, 17, 31, .62) 42%, rgba(7, 17, 31, .1) 78%),
    linear-gradient(180deg, rgba(4, 14, 25, .24), rgba(4, 14, 25, .82)),
    url("./assets/refinery-bg.svg") center / cover no-repeat;
  transform: scale(1.02);
}

.scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 62% 28%, rgba(86, 140, 214, .28), transparent 34%);
}

.splash-content {
  width: min(680px, calc(100vw - 48px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 0 56px clamp(28px, 7vw, 120px);
  text-shadow: 0 2px 18px rgba(0, 0, 0, .36);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-row--large {
  gap: 22px;
}

.brand-mark {
  width: 62px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-row--large .brand-mark {
  width: 116px;
  height: 84px;
}

.brand-row h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1;
  letter-spacing: 0;
  color: #f7fbff;
}

.brand-row p {
  margin: 12px 0 0;
  color: #d4e0ef;
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.35;
}

.splash-copy {
  display: grid;
  gap: 8px;
  margin-top: 174px;
  width: min(380px, 100%);
  line-height: 1.55;
}

.splash-copy strong {
  color: #ffffff;
  font-size: clamp(14px, 1vw, 16px);
}

.splash-copy span,
.loading-text {
  color: #d6e1ef;
  font-size: clamp(13px, .95vw, 15px);
}

.loader {
  width: 164px;
  height: 4px;
  margin-top: 34px;
  background: rgba(255, 255, 255, .24);
  border-radius: 999px;
  overflow: hidden;
}

.loader span {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f6fbff, #7bb7ff);
  animation: loading 1.8s ease-in-out infinite;
}

.loading-text {
  margin: 12px 0 0;
}

.login-screen {
  display: none;
  place-items: center;
  padding: 44px 28px;
  background:
    radial-gradient(circle at 76% 22%, rgba(55, 135, 255, .18), transparent 28%),
    radial-gradient(circle at 14% 18%, rgba(22, 89, 139, .22), transparent 34%),
    linear-gradient(135deg, #06111f 0%, #0a1a2c 46%, #081426 100%);
}

body[data-theme="light"] .login-screen,
body[data-theme="light"] .splash-screen {
  color: #f5f9ff;
}

.login-screen.is-active {
  display: grid;
}

.login-grid {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 470px) 1fr;
  align-items: center;
  gap: clamp(36px, 7vw, 90px);
}

.glass-panel {
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .032)),
    rgba(8, 21, 38, .84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card {
  width: 100%;
  border-radius: 24px;
  padding: 34px;
  text-align: center;
  color: var(--text);
}

.access-label {
  margin: 0 0 10px;
  color: #63adff;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: clamp(10px, .75vw, 12px);
  font-weight: 750;
}

.login-card h2 {
  margin: 0;
  color: #f8fbff;
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.1;
}

.login-subtitle {
  margin: 12px 0 26px;
  color: #c6d3e4;
  font-size: clamp(13px, 1.1vw, 16px);
  line-height: 1.45;
}

.login-form {
  display: grid;
  gap: 0;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  height: 50px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .035);
  color: #c6d3e4;
}

.field:first-of-type {
  border-radius: 10px 10px 0 0;
}

.field + .field {
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.field > .icon {
  width: 18px;
  height: 18px;
  margin-left: 16px;
  color: #b7c8dc;
}

.field input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  outline: 0;
  color: #f7fbff;
  background: transparent;
  font-size: 14px;
}

.field input::placeholder {
  color: #aebdd0;
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 22px;
  font-size: 12px;
}

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d4deec;
  cursor: pointer;
}

.login-row a {
  color: #6fb3ff;
  font-weight: 650;
}

.check-label input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
}

.check-label input:checked {
  background: var(--blue);
  box-shadow: inset 0 0 0 3px #092036;
}

.primary-button,
.secondary-button,
.face-button,
.filter-button,
.icon-button,
.command-action {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  background: linear-gradient(180deg, #378dff, #236ed8);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px rgba(255, 255, 255, .2), 0 14px 34px rgba(35, 110, 216, .24);
}

.primary-button:hover,
.secondary-button:hover,
.face-button:hover,
.filter-button:hover,
.icon-button:hover,
.command-action:hover {
  transform: translateY(-1px);
}

.primary-button.compact {
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 9px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .045);
  color: #e3edf9;
  font-size: 14px;
  font-weight: 700;
}

.secondary-button.compact {
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
}

body[data-theme="light"] .secondary-button {
  border-color: rgba(31, 57, 88, .2);
  background: #ffffff;
  color: #19314e;
  box-shadow: 0 8px 18px rgba(31, 57, 88, .07);
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 24px 0 16px;
  color: #aebdd0;
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .14));
}

.divider::after {
  background: linear-gradient(90deg, rgba(255, 255, 255, .14), transparent);
}

.face-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(280px, 100%);
  height: 48px;
  margin-inline: auto;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: #f4f8ff;
  font-size: 14px;
  font-weight: 650;
}

.secure-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  color: #aebdd0;
  font-size: clamp(11px, .82vw, 12px);
}

.login-benefits {
  display: grid;
  gap: 34px;
  max-width: 420px;
}

.benefit-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 18px;
  align-items: start;
}

.benefit-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #c4dcf7;
  background: rgba(255, 255, 255, .03);
}

.benefit-item strong {
  display: block;
  margin-bottom: 6px;
  color: #f8fbff;
  font-size: clamp(14px, 1.15vw, 16px);
}

.benefit-item span {
  display: block;
  color: #c2cfdf;
  font-size: clamp(12px, 1vw, 14px);
  line-height: 1.45;
}

.data-wave {
  position: absolute;
  right: -10vw;
  bottom: -16vh;
  width: min(760px, 62vw);
  aspect-ratio: 1.45;
  opacity: .62;
  background-image: radial-gradient(circle, rgba(63, 147, 255, .9) 1.2px, transparent 1.4px);
  background-size: 18px 18px;
  transform: perspective(520px) rotateX(58deg) rotateZ(-10deg);
  mask-image: radial-gradient(ellipse at center, black 18%, transparent 72%);
}

.dashboard-screen {
  display: none;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 74% 0%, rgba(63, 147, 255, .2), transparent 36%),
    linear-gradient(180deg, #081523 0%, #07101c 100%);
}

body[data-theme="light"] .dashboard-screen {
  background:
    radial-gradient(circle at 80% -10%, rgba(39, 111, 232, .11), transparent 34%),
    linear-gradient(180deg, #f3f7fc 0%, #ffffff 100%);
}

.dashboard-screen.is-active {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01)),
    rgba(5, 16, 29, .92);
  backdrop-filter: blur(18px);
}

body[data-theme="light"] .sidebar {
  background:
    linear-gradient(180deg, #ffffff, rgba(255, 255, 255, .92)),
    #ffffff;
  box-shadow: 8px 0 28px rgba(31, 57, 88, .06);
}

body[data-theme="light"] .sidebar .brand-row strong {
  color: #10213a;
}

body[data-theme="light"] .nav-item,
body[data-theme="light"] .bottom-nav button {
  color: #65758b;
}

body[data-theme="light"] .nav-item .icon,
body[data-theme="light"] .bottom-nav .icon {
  color: #73849b;
}

body[data-theme="light"] .nav-item:hover {
  color: #253b56;
  background: rgba(39, 111, 232, .07);
}

body[data-theme="light"] .nav-item.is-active {
  color: #1767d8;
  background: linear-gradient(90deg, rgba(39, 111, 232, .15), rgba(39, 111, 232, .04));
  box-shadow: inset 3px 0 0 #276fe8;
  font-weight: 750;
}

body[data-theme="light"] .nav-item.is-active .icon {
  color: #276fe8;
}

body[data-theme="light"] .user-card {
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 57, 88, .07);
}

.sidebar .brand-row {
  gap: 12px;
  margin-bottom: 28px;
}

.sidebar .brand-mark {
  width: 52px;
  height: 38px;
}

.sidebar .brand-row strong {
  font-size: 21px;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-item,
.bottom-nav button {
  border: 0;
  cursor: pointer;
  color: #b8c8db;
  background: transparent;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
  color: #b2c5dd;
}

.nav-item.is-active {
  color: #58a6ff;
  background: linear-gradient(90deg, rgba(63, 147, 255, .22), rgba(255, 255, 255, .035));
  box-shadow: inset 3px 0 0 #3f93ff;
}

.user-card {
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #10233b;
  background: linear-gradient(135deg, #fff7ea, #d9a178);
  font-size: 12px;
  font-weight: 800;
}

.user-card strong,
.user-card span {
  display: block;
}

.user-card strong {
  font-size: 12px;
}

.user-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.workspace {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  padding: 30px clamp(20px, 2.6vw, 40px) 34px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
  margin-bottom: 24px;
  min-width: 0;
}

.topbar-heading {
  min-width: 0;
}

.topbar h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.topbar p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.filter-button,
.icon-button,
.mode-button,
.time-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
  color: #dce8f7;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

body[data-theme="light"] .filter-button,
body[data-theme="light"] .icon-button,
body[data-theme="light"] .mode-button,
body[data-theme="light"] .time-chip {
  border-color: rgba(31, 57, 88, .2);
  background: #ffffff;
  color: #19314e;
  box-shadow: 0 8px 18px rgba(31, 57, 88, .07);
}

body[data-theme="light"] .filter-button:hover,
body[data-theme="light"] .icon-button:hover,
body[data-theme="light"] .mode-button:hover,
body[data-theme="light"] .time-chip:hover {
  border-color: rgba(39, 111, 232, .34);
  background: #fafdff;
}

.filter-button {
  gap: 14px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
  white-space: nowrap;
  flex: 0 1 auto;
}

#dateButton {
  min-width: 140px;
}

#regionButton,
#depoButton {
  min-width: 108px;
}

.mode-button {
  gap: 8px;
  height: 40px;
  min-width: 84px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, .035);
}

.time-chip {
  gap: 10px;
  height: 40px;
  min-width: 142px;
  padding: 0 12px;
  border-radius: 10px;
  justify-content: flex-start;
}

.time-chip strong,
.time-chip span {
  display: block;
  white-space: nowrap;
}

.time-chip strong {
  font-size: 12px;
  line-height: 1.05;
}

.time-chip div > span {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.icon-button.ghost {
  width: 34px;
  height: 34px;
  border-color: transparent;
  background: transparent;
  color: #98aabc;
  box-shadow: none;
}

.content-root {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(166px, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.module-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .02));
  box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
}

body[data-theme="light"] .metric-card,
body[data-theme="light"] .panel,
body[data-theme="light"] .module-card {
  border-color: rgba(31, 57, 88, .16);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 108px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: start;
  gap: 13px;
  padding: 16px;
  border-radius: 12px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .09);
  background: rgba(63, 147, 255, .13);
  color: #80bdff;
}

.metric-icon.green {
  background: rgba(53, 208, 127, .12);
  color: var(--green);
}

.metric-icon.amber {
  background: rgba(255, 191, 79, .12);
  color: var(--amber);
}

.metric-icon.red {
  background: rgba(255, 98, 95, .12);
  color: var(--red);
}

.metric-card p {
  margin: 0;
  color: #9fb0c5;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

body[data-theme="light"] .metric-card p,
body[data-theme="light"] .metric-foot,
body[data-theme="light"] .activity-row,
body[data-theme="light"] .alert-row span,
body[data-theme="light"] .alert-row time {
  color: var(--muted);
}

body[data-theme="light"] .metric-icon {
  border-color: rgba(39, 111, 232, .14);
  background: rgba(39, 111, 232, .09);
  color: #2b7fff;
}

.metric-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  margin: 9px 0 7px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0;
}

.metric-unit,
.delta {
  font-size: 12px;
  font-weight: 700;
}

.delta {
  color: var(--green);
}

.delta.red {
  color: var(--red);
}

.metric-foot {
  color: #7f8fa2;
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr 1.24fr 1.1fr;
  gap: 16px;
}

.lower-grid {
  display: grid;
  grid-template-columns: 1.02fr 1.18fr 1.08fr;
  gap: 16px;
}

.panel {
  min-width: 0;
  border-radius: 14px;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 16px;
}

.panel-link,
.live-indicator,
.period-control {
  color: var(--blue);
  font-size: 12px;
}

.period-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b9c8d8;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c7d8ea;
}

.live-indicator::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(53, 208, 127, .08);
}

.dispatch-wrap {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  --value: 78%;
  position: relative;
  display: grid;
  place-items: center;
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #102033 0 48%, transparent 49%),
    conic-gradient(#3f93ff 0 52%, #35d07f 52% 82%, #ffbf4f 82% 94%, #ff625f 94% 100%);
  box-shadow: inset 0 0 0 14px rgba(255, 255, 255, .035);
}

body[data-theme="light"] .donut {
  background:
    radial-gradient(circle, #ffffff 0 48%, transparent 49%),
    conic-gradient(#276fe8 0 52%, #1da767 52% 82%, #e39b25 82% 94%, #d84343 94% 100%);
  box-shadow: inset 0 0 0 14px rgba(31, 57, 88, .06), 0 12px 26px rgba(31, 57, 88, .1);
}

.donut strong,
.donut span {
  display: block;
  text-align: center;
}

.donut strong {
  font-size: 30px;
  line-height: 1;
}

.donut span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.status-list,
.alert-list,
.feed-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-row,
.alert-row,
.activity-row,
.spbu-row,
.depot-row,
.timeline-item {
  display: grid;
  align-items: center;
  gap: 12px;
}

.status-row {
  grid-template-columns: 10px 1fr auto auto;
  color: #d5e1ee;
  font-size: 12px;
}

body[data-theme="light"] .status-row,
body[data-theme="light"] .depot-row,
body[data-theme="light"] .spbu-row {
  color: #26384e;
}

body[data-theme="light"] .depot-row.header,
body[data-theme="light"] .spbu-row.header,
body[data-theme="light"] .recent-box h4,
body[data-theme="light"] .period-control,
body[data-theme="light"] .live-indicator {
  color: #65758b;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--blue);
}

.dot.green {
  background: var(--green);
}

.dot.amber {
  background: var(--amber);
}

.dot.red {
  background: var(--red);
}

.recent-box {
  margin-top: 14px;
  padding: 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

body[data-theme="light"] .recent-box {
  border: 1px solid rgba(31, 57, 88, .08);
}

.recent-box h4 {
  margin: 0 0 8px;
  color: #8fa0b5;
  font-size: 11px;
  font-weight: 600;
}

.activity-row {
  grid-template-columns: 8px 1fr auto;
  font-size: 12px;
  color: #aebdd0;
}

.activity-row time {
  color: #7f8fa2;
}

.depot-table,
.spbu-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 10px;
}

.depot-row,
.spbu-row {
  grid-template-columns: minmax(92px, 1fr) 78px 112px 70px 70px;
  min-height: 40px;
  padding: 0 11px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  color: #d5dfeb;
  font-size: 12px;
}

body[data-theme="light"] .depot-row,
body[data-theme="light"] .spbu-row {
  border-bottom-color: rgba(31, 57, 88, .08);
}

.spbu-row {
  grid-template-columns: minmax(120px, 1fr) 72px 88px 64px 68px;
}

.depot-row.header,
.spbu-row.header {
  min-height: 34px;
  color: #8799af;
  background: rgba(255, 255, 255, .04);
}

.bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
}

body[data-theme="light"] .bar {
  background: rgba(31, 57, 88, .12);
}

.bar span {
  display: block;
  width: var(--w, 50%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f93ff, #35d07f);
}

.bar.amber span {
  background: linear-gradient(90deg, #ffbf4f, #f5dc66);
}

.spark {
  width: 58px;
  height: 18px;
}

.spark path {
  stroke: var(--green);
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spark.red path {
  stroke: var(--red);
}

.alert-list {
  gap: 9px;
}

.alert-row {
  grid-template-columns: 34px 1fr auto;
  min-height: 58px;
  padding: 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
}

.alert-row.red {
  background: rgba(255, 98, 95, .09);
}

.alert-row.amber {
  background: rgba(255, 191, 79, .09);
}

.alert-row.blue {
  background: rgba(63, 147, 255, .08);
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.alert-row.red .alert-icon {
  color: var(--red);
}

.alert-row.amber .alert-icon {
  color: var(--amber);
}

.alert-row.blue .alert-icon {
  color: var(--blue);
}

.alert-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
}

.alert-row span,
.alert-row time {
  color: #9cadbf;
  font-size: 12px;
}

body[data-theme="light"] .alert-row {
  border: 1px solid rgba(31, 57, 88, .08);
}

body[data-theme="light"] .alert-row.red {
  background: #fff1f1;
}

body[data-theme="light"] .alert-row.amber {
  background: #fff8eb;
}

body[data-theme="light"] .alert-row.blue {
  background: #eff6ff;
}

.hse-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.hse-card {
  min-height: 98px;
  padding: 14px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
}

body[data-theme="light"] .hse-card {
  border: 1px solid rgba(31, 57, 88, .08);
}

.hse-card strong {
  display: block;
  font-size: 28px;
}

.hse-card span {
  display: block;
  margin-top: 4px;
  color: #aebdd0;
  font-size: 12px;
}

body[data-theme="light"] .hse-card span,
body[data-theme="light"] .insight-copy p {
  color: #43536a;
}

.hse-card small {
  display: block;
  margin-top: 14px;
  color: #74859a;
  font-size: 10px;
}

.hse-card.is-good small {
  color: var(--green);
}

.insight-layout {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
  align-items: end;
}

.insight-copy {
  min-height: 128px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
}

.insight-copy strong {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
}

.insight-copy p {
  margin: 0;
  color: #acbacb;
  font-size: 12px;
  line-height: 1.55;
}

.bar-chart {
  height: 128px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 9px;
  align-items: end;
  padding: 14px 8px 20px;
}

.bar-col {
  position: relative;
  display: block;
  height: var(--h, 60%);
  border-radius: 5px 5px 2px 2px;
  background: rgba(114, 146, 180, .32);
}

.bar-col.active {
  background: linear-gradient(180deg, #3f93ff, #276fd5);
}

.bar-col::after {
  content: attr(data-day);
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  color: #7f8fa2;
  font-size: 10px;
}

.module-page {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .72fr);
  gap: 16px;
  min-width: 0;
}

.module-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.module-card {
  border-radius: 14px;
  padding: 18px;
}

.module-card h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.module-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.module-summary .fleet-grid {
  margin-top: 16px;
}

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fleet-card {
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
}

body[data-theme="light"] .fleet-card,
body[data-theme="light"] .hse-card,
body[data-theme="light"] .recent-box,
body[data-theme="light"] .insight-copy,
body[data-theme="light"] .timeline-item,
body[data-theme="light"] .command-action {
  background: #f7faff;
}

body[data-theme="light"] .fleet-card,
body[data-theme="light"] .timeline-item,
body[data-theme="light"] .lane-column,
body[data-theme="light"] .lane-card,
body[data-theme="light"] .dispatch-queue > div,
body[data-theme="light"] .admin-table > div {
  border-color: rgba(31, 57, 88, .1);
  background-color: #f7faff;
}

.fleet-card strong {
  display: block;
  font-size: 22px;
}

.fleet-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.route-map {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(63, 147, 255, .16), rgba(53, 208, 127, .06)),
    radial-gradient(circle at 28% 36%, rgba(63, 147, 255, .24), transparent 22%),
    #091827;
}

.route-map::before {
  content: "";
  position: absolute;
  inset: 28px;
  border: 1px dashed rgba(126, 170, 219, .36);
  border-radius: 48% 38% 42% 46%;
  transform: rotate(-9deg);
}

.route-pin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--blue);
  box-shadow: 0 0 0 8px rgba(63, 147, 255, .12);
}

.route-pin span {
  transform: rotate(45deg);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.real-map-shell {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #081522;
}

.real-map-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(.88) contrast(.95) brightness(.72);
}

body[data-theme="light"] .real-map-shell iframe {
  filter: saturate(.92) contrast(.96) brightness(1.02);
}

.real-map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 13, 24, .18), rgba(5, 13, 24, .56)),
    radial-gradient(circle at 16% 22%, rgba(63, 147, 255, .25), transparent 16%),
    radial-gradient(circle at 87% 80%, rgba(53, 208, 127, .2), transparent 15%);
}

body[data-theme="light"] .real-map-shell::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .32)),
    radial-gradient(circle at 16% 22%, rgba(63, 147, 255, .18), transparent 16%),
    radial-gradient(circle at 87% 80%, rgba(53, 208, 127, .16), transparent 15%);
}

.real-map-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.map-route-shadow,
.map-route-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.map-route-shadow {
  stroke: rgba(0, 0, 0, .5);
  stroke-width: 7px;
  opacity: .32;
}

.map-route-line {
  stroke: #3f93ff;
  stroke-width: 4px;
  stroke-dasharray: 7 8;
  animation: routeFlow 1.8s linear infinite;
}

.map-route-pulse {
  fill: #35d07f;
  filter: drop-shadow(0 0 10px rgba(53, 208, 127, .72));
}

.real-map-pin {
  position: absolute;
  z-index: 3;
  left: var(--x);
  top: var(--y);
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate(-16px, -32px);
  white-space: nowrap;
}

.real-map-pin > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, .82);
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 8px rgba(63, 147, 255, .18), 0 12px 30px rgba(0, 0, 0, .34);
  font-size: 12px;
  font-weight: 900;
}

.real-map-pin > span b {
  display: block;
  transform: rotate(45deg);
}

.real-map-pin > strong {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  background: rgba(5, 14, 26, .78);
  color: #f5f9ff;
  font-size: 11px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
}

.real-map-pin.ujungberung > span {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(53, 208, 127, .18), 0 12px 30px rgba(0, 0, 0, .34);
}

.map-legend {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 11px;
  background: rgba(5, 14, 26, .84);
  color: #d6e5f7;
  font-size: 10.5px;
  line-height: 1.35;
  backdrop-filter: blur(16px);
}

.map-legend-title {
  grid-column: 1 / -1;
  color: #f6fbff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.map-legend span {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 7px;
  min-width: 0;
}

.map-legend b {
  color: #f6fbff;
  font-weight: 800;
}

.map-dot {
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(63, 147, 255, .14);
}

.map-dot.ujungberung-dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, .14);
}

.map-dot.route-dot {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(255, 196, 87, .14);
}

body[data-theme="light"] .map-legend,
body[data-theme="light"] .real-map-pin > strong {
  background: rgba(255, 255, 255, .84);
  color: #0b1a2c;
  border-color: rgba(15, 43, 76, .16);
}

body[data-theme="light"] .map-legend-title,
body[data-theme="light"] .map-legend b {
  color: #081527;
}

.dispatch-queue,
.admin-table {
  display: grid;
  gap: 10px;
}

.dispatch-queue > div,
.admin-table > div {
  display: grid;
  grid-template-columns: minmax(82px, .42fr) 1fr auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
}

.dispatch-queue strong,
.admin-table strong {
  font-size: 13px;
}

.dispatch-queue span,
.admin-table span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dispatch-queue em,
.admin-table em {
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.progress-list {
  display: grid;
  gap: 12px;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  min-width: 0;
}

.progress-row strong,
.lane-card strong {
  display: block;
  color: var(--text);
  font-size: 12px;
}

.progress-row span,
.lane-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.progress-row em {
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.progress-row > .bar {
  grid-column: 1 / -1;
  height: 8px;
}

.progress-row > .bar.green span {
  background: var(--green);
}

.lane-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lane-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.lane-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
}

.lane-column header strong {
  color: var(--text);
  font-size: 12px;
}

.lane-column header span {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(63, 147, 255, .16);
  color: var(--blue);
  font-weight: 800;
}

.lane-card {
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  background: rgba(5, 15, 28, .42);
}

.lane-card + .lane-card {
  margin-top: 8px;
}

.lane-card.green {
  border-left-color: var(--green);
}

.lane-card.amber {
  border-left-color: var(--amber);
}

.lane-card.red {
  border-left-color: var(--red);
}

.module-bars {
  min-height: 190px;
  padding-top: 34px;
}

.config-form {
  display: grid;
  gap: 16px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.config-form label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.config-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.config-form input,
.config-form select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  padding: 0 11px;
  outline: 0;
  font: inherit;
  font-size: 12px;
}

.config-form input:focus,
.config-form select:focus {
  border-color: rgba(63, 147, 255, .58);
  box-shadow: 0 0 0 3px rgba(63, 147, 255, .12);
}

body[data-theme="light"] .config-form input,
body[data-theme="light"] .config-form select {
  background: #ffffff;
  color: #132238;
}

.config-toggle {
  grid-template-columns: 18px 1fr;
  align-items: center;
  align-self: end;
  min-height: 40px;
}

.config-toggle input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.config-divider {
  height: 1px;
  background: var(--line);
}

.config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.code-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .035);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.55;
}

body[data-theme="light"] .code-block {
  background: #f7faff;
}

@keyframes routeFlow {
  to {
    stroke-dashoffset: -30;
  }
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  grid-template-columns: 16px 1fr auto;
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  font-size: 12px;
}

.timeline-item time {
  color: #8799ae;
}

.bottom-nav {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.modal-layer[hidden] {
  display: none !important;
}

.modal-layer.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 15, .72);
  backdrop-filter: blur(8px);
}

.command-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  border-radius: 22px;
  padding: 22px;
}

.command-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.command-header p {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
}

.command-header h2 {
  margin: 0;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.command-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  text-align: left;
  font-size: 13px;
}

.report-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(980px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  transform: translate(-50%, -50%);
  border-radius: 22px;
  padding: 22px;
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.report-header p {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
}

.report-header h2 {
  margin: 0;
  font-size: 24px;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.report-preview {
  min-height: 0;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbff;
  color: #0c1a2c;
}

.report-document {
  max-width: 840px;
  margin: 0 auto;
  color: #0c1a2c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.report-document header {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 2px solid #d8e5f3;
}

.report-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.report-brand img {
  width: 54px;
  filter: invert(1);
}

.report-document h1,
.report-document h2,
.report-document h3,
.report-document p {
  margin-top: 0;
}

.report-document h1 {
  margin-bottom: 6px;
  font-size: 26px;
}

.report-document .report-meta {
  text-align: right;
  color: #586c82;
  font-size: 12px;
  line-height: 1.5;
}

.report-section {
  margin-top: 22px;
}

.report-section h2 {
  margin-bottom: 10px;
  font-size: 16px;
}

.report-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.report-kpi,
.report-note {
  padding: 12px;
  border: 1px solid #d9e6f4;
  border-radius: 10px;
  background: #ffffff;
}

.report-kpi span,
.report-note span {
  display: block;
  color: #607389;
  font-size: 11px;
}

.report-kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.report-kpi small {
  color: #168552;
  font-weight: 700;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid #d9e6f4;
  border-radius: 10px;
  background: #ffffff;
  font-size: 12px;
}

.report-table th,
.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5eef8;
  text-align: left;
}

.report-table th {
  color: #51677f;
  background: #edf4fb;
  font-weight: 800;
}

.report-table tr:last-child td {
  border-bottom: 0;
}

.report-notes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.report-note strong {
  display: block;
  margin-bottom: 6px;
}

.report-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #d8e5f3;
  color: #63788e;
  font-size: 11px;
}

.command-feed {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 320px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(11, 25, 43, .94);
  color: #e9f3ff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 13px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-screen.is-focus {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-screen.is-focus .sidebar {
  display: none;
}

.dashboard-screen.is-focus .workspace {
  padding-inline: clamp(22px, 3.2vw, 52px);
}

.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes loading {
  0% {
    transform: translateX(-80%);
  }
  70%,
  100% {
    transform: translateX(72%);
  }
}

@media (max-width: 1540px) {
  .topbar h2 {
    font-size: 26px;
  }

  .topbar p {
    font-size: 13px;
  }

  .metric-card {
    padding: 15px;
  }

  .metric-value {
    font-size: 24px;
  }

  .panel-title {
    font-size: 15px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1280px) {
  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .dashboard-grid,
  .lower-grid,
  .module-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1020px) {
  :root {
    --sidebar: 230px;
  }

  .login-grid {
    grid-template-columns: 1fr;
    width: min(520px, 100%);
  }

  .login-benefits {
    grid-template-columns: repeat(3, 1fr);
    max-width: none;
    gap: 16px;
  }

  .benefit-item {
    grid-template-columns: 1fr;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 25px;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-button {
    flex: 1 1 150px;
  }
}

@media (max-width: 760px) {
  body {
    background: #07111d;
  }

  .splash-content {
    justify-content: flex-start;
    padding: 112px 24px 40px;
    width: min(100%, calc(100vw - 32px));
  }

  .brand-row--large {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-row--large .brand-mark {
    width: 86px;
    height: 62px;
  }

  .brand-row h1 {
    font-size: 36px;
    line-height: 1.05;
  }

  .brand-row p {
    font-size: 15px;
  }

  .splash-copy {
    margin-top: 140px;
  }

  .login-screen {
    padding: 22px 16px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 18px;
  }

  .login-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    text-align: left;
  }

  .login-benefits,
  .data-wave {
    display: none;
  }

  .dashboard-screen.is-active {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    padding: 18px 14px 92px;
  }

  .topbar {
    margin-bottom: 16px;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .topbar p {
    font-size: 12px;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .topbar-actions .primary-button {
    grid-column: span 2;
  }

  .time-chip,
  .mode-button,
  .filter-button {
    width: 100%;
    min-width: 0 !important;
  }

  .time-chip {
    grid-column: span 2;
  }

  .search-button {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .real-map-shell {
    min-height: 300px;
  }

  .lane-board {
    grid-template-columns: 1fr;
  }

  .dispatch-queue > div,
  .admin-table > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .config-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .map-legend {
    left: 8px;
    right: 8px;
    bottom: 8px;
    grid-template-columns: 1fr;
    font-size: 9.8px;
  }

  .metric-card {
    min-height: 112px;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 13px;
  }

  .metric-card:nth-child(n + 5) {
    display: none;
  }

  .metric-value {
    font-size: 23px;
  }

  .panel {
    padding: 14px;
  }

  .dashboard-grid,
  .lower-grid,
  .content-root {
    gap: 12px;
  }

  .dispatch-wrap,
  .insight-layout {
    grid-template-columns: 1fr;
  }

  .donut {
    margin-inline: auto;
  }

  .depot-row,
  .spbu-row {
    grid-template-columns: 1fr 68px 80px;
  }

  .depot-row > :nth-child(4),
  .depot-row > :nth-child(5),
  .spbu-row > :nth-child(4),
  .spbu-row > :nth-child(5) {
    display: none;
  }

  .hse-grid,
  .fleet-grid,
  .command-grid,
  .report-kpis,
  .report-notes {
    grid-template-columns: 1fr 1fr;
  }

  .report-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .report-preview {
    padding: 16px;
  }

  .report-document header {
    display: grid;
  }

  .report-document .report-meta {
    text-align: left;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(6, 15, 27, .94);
    backdrop-filter: blur(18px);
  }

  body[data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -10px 26px rgba(31, 57, 88, .08);
  }

  .bottom-nav button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 48px;
    color: #95a7ba;
    font-size: 10px;
  }

  .bottom-nav button.is-active {
    color: var(--blue);
  }

  .bottom-nav .icon {
    width: 20px;
    height: 20px;
  }

  .toast {
    right: 14px;
    bottom: 78px;
    left: 14px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .topbar-actions,
  .metric-grid,
  .hse-grid,
  .fleet-grid,
  .command-grid,
  .report-kpis,
  .report-notes {
    grid-template-columns: 1fr;
  }

  .topbar-actions .primary-button {
    grid-column: span 1;
  }

  .time-chip {
    grid-column: span 1;
  }

  .alert-row {
    grid-template-columns: 30px 1fr;
  }

  .alert-row time {
    grid-column: 2;
  }
}
