:root {
  --ink: #0b1720;
  --muted: #5f6f7b;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --line: #d9e2e4;
  --cyan: #00b8c8;
  --cyan-deep: #087986;
  --green: #16a34a;
  --neon: #8cff3f;
  --orange: #f97316;
  --red: #dc2626;
  --yellow: #f59e0b;
  --shadow: 0 12px 34px rgba(11, 23, 32, 0.08);
  --radius: 8px;
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(0, 184, 200, 0.12), transparent 270px),
    var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  line-height: 1.15;
  overflow-wrap: anywhere;
}

img,
svg {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

body.auth-pending .topbar,
body.auth-pending .module-tabs,
body.auth-pending .app-shell {
  display: none;
}

body:not(.auth-pending) .login-screen {
  display: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 24px 12px;
}

.login-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.login-copy,
.login-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.login-copy {
  min-height: 340px;
  display: grid;
  align-content: end;
  justify-items: start;
  padding: 22px;
  color: #06262a;
  background:
    linear-gradient(145deg, rgba(0, 184, 200, 0.9), rgba(22, 163, 74, 0.76)),
    linear-gradient(315deg, rgba(140, 255, 63, 0.4), rgba(249, 115, 22, 0.18));
}

.platform-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 14px rgba(11, 23, 32, 0.18));
}

.platform-logo.is-large {
  width: 108px;
  height: 86px;
  margin-bottom: 18px;
  border-radius: 18px;
}

.login-copy .eyebrow {
  color: #053037;
}

.login-copy p:not(.eyebrow) {
  margin: 10px 0 0;
  font-weight: 900;
}

.login-panel {
  padding: 16px;
}

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

.role-option {
  position: relative;
  display: block;
}

.role-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.role-option span {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  padding: 10px;
  color: var(--ink);
  cursor: pointer;
}

.role-option strong,
.role-option em {
  display: block;
  font-style: normal;
}

.role-option strong {
  font-size: 14px;
}

.role-option em {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.role-option input:checked + span {
  border-color: var(--cyan);
  background: rgba(0, 184, 200, 0.11);
  box-shadow: inset 0 -4px 0 rgba(140, 255, 63, 0.72);
}

.pin-hint {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border: 1px dashed rgba(0, 184, 200, 0.36);
  border-radius: var(--radius);
  background: rgba(0, 184, 200, 0.07);
  padding: 10px;
}

.pin-hint strong,
.pin-hint span {
  min-height: 28px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.pin-hint strong {
  grid-column: 1 / -1;
  color: var(--cyan-deep);
  text-transform: uppercase;
}

.pin-hint span {
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
}

.topbar {
  width: min(var(--max), calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--cyan-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

h2 {
  font-size: 18px;
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.status-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.is-online {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.11);
  color: #087437;
}

.status-pill.is-offline {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.status-pill.is-waiting {
  border-color: rgba(249, 115, 22, 0.32);
  background: rgba(249, 115, 22, 0.1);
  color: #9a4512;
}

.role-pill {
  border-color: rgba(0, 184, 200, 0.35);
  background: rgba(0, 184, 200, 0.12);
  color: var(--cyan-deep);
}

.logout-btn {
  min-height: 34px;
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.11);
  color: #9a4512;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.module-tabs {
  width: min(var(--max), calc(100% - 24px));
  margin: 0 auto 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px 0;
  background: rgba(244, 247, 245, 0.92);
  backdrop-filter: blur(10px);
  overflow-x: visible;
}

.module-tabs button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.module-tabs button.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #05252a;
  box-shadow: inset 0 -4px 0 rgba(140, 255, 63, 0.75);
}

.module-tabs button[hidden] {
  display: none;
}

.app-shell {
  width: min(var(--max), calc(100% - 24px));
  margin: 0 auto 40px;
  min-width: 0;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
  gap: 12px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.metric {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(22px, 4vw, 32px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric.is-alert {
  border-color: rgba(249, 115, 22, 0.35);
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.11), #fff);
}

.metric.is-name strong {
  font-size: clamp(17px, 3vw, 24px);
  line-height: 1.14;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 12px;
  margin-bottom: 12px;
}

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

.dashboard-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-chart-grid.is-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.chart-panel {
  min-width: 0;
}

.chart-shell {
  min-height: 260px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 250px;
}

.chart-axis,
.chart-grid-line {
  stroke: #dbe7e7;
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 12px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}

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

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subnav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
}

.subnav-grid button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.subnav-grid button.is-active {
  border-color: var(--cyan);
  background: rgba(0, 184, 200, 0.12);
  color: var(--cyan-deep);
  box-shadow: inset 0 -3px 0 rgba(140, 255, 63, 0.72);
}

.icon-btn,
.primary-action,
.tap-action {
  min-height: 44px;
  border: 0;
  border-radius: var(--radius);
  font-weight: 900;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #eef6f6;
  color: var(--cyan-deep);
  font-size: 13px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px;
}

.input-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
}

.input-grid.is-readonly,
form.is-readonly {
  position: relative;
  opacity: 0.58;
}

.input-grid.is-readonly::after,
form.is-readonly::after {
  content: "Read only untuk role ini";
  grid-column: 1 / -1;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(249, 115, 22, 0.42);
  border-radius: var(--radius);
  background: rgba(249, 115, 22, 0.08);
  color: #9a4512;
  font-size: 12px;
  font-weight: 900;
}

[data-field-module].is-field-readonly {
  opacity: 0.52;
}

[data-field-module].is-field-readonly::after {
  content: "Role Driver/Admin";
  color: #9a4512;
  font-size: 11px;
  font-weight: 900;
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

textarea {
  min-height: 96px;
  padding-block: 10px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 184, 200, 0.18);
}

.primary-action {
  grid-column: 1 / -1;
  background: var(--cyan);
  color: #06262a;
}

.tap-action {
  grid-column: 1 / -1;
  background: var(--green);
  color: #fff;
  box-shadow: inset 0 -4px 0 rgba(140, 255, 63, 0.6);
}

.check-row {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.check-row legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.check-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.cycle-row {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px solid rgba(0, 184, 200, 0.28);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  background: rgba(0, 184, 200, 0.05);
}

.cycle-row legend {
  padding: 0 6px;
  color: var(--cyan-deep);
  font-size: 12px;
  font-weight: 900;
}

.cycle-row label {
  color: var(--muted);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.quick-grid button,
.delay-grid button {
  min-height: 56px;
  border: 1px solid #263844;
  border-radius: var(--radius);
  background: #172533;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.quick-grid button.is-ready {
  background: var(--green);
  border-color: var(--green);
}

.quick-grid button.is-pending {
  background: var(--orange);
  border-color: var(--orange);
  color: #2b1505;
}

.quick-grid button:disabled,
.delay-grid button:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.delay-grid button.is-active {
  background: var(--red);
  border-color: var(--red);
}

.delay-grid button.is-done {
  background: var(--green);
  border-color: var(--green);
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

.table-wrap.is-wide {
  max-height: 70vh;
}

.checker-kpi-block {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.section-title-row h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.section-title-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

table {
  width: 100%;
  min-width: max-content;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  min-width: 110px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #eef6f6;
  color: var(--cyan-deep);
  font-size: 11px;
  text-transform: uppercase;
  z-index: 1;
}

.event-list {
  display: grid;
  gap: 8px;
}

.breakdown-list {
  display: grid;
  gap: 8px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: minmax(72px, 110px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  padding: 9px;
}

.breakdown-row strong,
.breakdown-row span {
  display: block;
}

.breakdown-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  min-height: 10px;
  border-radius: 999px;
  background: #e8f0f0;
  overflow: hidden;
}

.bar-fill {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--neon));
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  background: #fbfdfd;
}

.cost-list {
  display: grid;
  gap: 8px;
}

.formula-list {
  display: grid;
  gap: 8px;
}

.cost-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  padding: 10px;
}

.cost-row > div,
.cost-row > span {
  min-width: 0;
}

.cost-row > span {
  overflow-wrap: anywhere;
  text-align: right;
}

.cost-row strong,
.cost-row span {
  display: block;
}

.cost-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cost-row.is-positive strong {
  color: var(--green);
}

.cost-row.is-warning strong {
  color: var(--orange);
}

.formula-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(180px, 1.2fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfd;
  padding: 10px;
}

.formula-row strong,
.formula-row span,
.formula-row code {
  display: block;
}

.formula-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-top: 3px;
}

.formula-row code {
  color: var(--cyan-deep);
  font-weight: 900;
  white-space: normal;
}

.event-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #fbfdfd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.event-row strong,
.event-row span {
  display: block;
  overflow-wrap: anywhere;
}

.event-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.event-actions {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 98px;
}

.mini-action {
  min-height: 30px;
  border: 1px solid rgba(22, 163, 74, 0.35);
  border-radius: var(--radius);
  background: rgba(22, 163, 74, 0.12);
  color: #087437;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(420px, calc(100% - 24px));
  min-height: 42px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: #10202a;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.toast.is-visible {
  display: flex;
}

@media (max-width: 860px) {
  .login-screen {
    align-items: start;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: 220px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .status-stack {
    justify-content: flex-start;
  }

  .module-tabs {
    width: 100%;
    margin: 0 0 12px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 12px;
    scroll-padding-inline: 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .module-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-tabs button {
    flex: 0 0 auto;
    min-width: 112px;
    padding-inline: 10px;
    scroll-snap-align: start;
  }

  .insight-grid,
  .analysis-grid,
  .dashboard-chart-grid,
  .dashboard-chart-grid.is-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .insight-grid,
  .analysis-grid,
  .dashboard-chart-grid,
  .dashboard-chart-grid.is-compact,
  .input-grid,
  .input-grid.compact,
  .check-row,
  .cycle-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .app-shell {
    width: min(var(--max), calc(100% - 18px));
  }

  .panel-head {
    flex-direction: column;
  }

  .panel-actions {
    width: 100%;
  }

  .panel-actions .icon-btn {
    flex: 1 1 0;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-shell {
    min-height: 220px;
  }

  .chart-svg {
    min-height: 210px;
  }

  .breakdown-row {
    grid-template-columns: 1fr;
  }

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

  .cost-row > span,
  .section-title-row span {
    text-align: left;
  }

  .section-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-screen {
    padding: 12px 8px;
  }

  .login-panel,
  .panel {
    padding: 12px;
  }

  .login-copy {
    min-height: 180px;
    padding: 16px;
  }

  .platform-logo {
    width: 44px;
    height: 44px;
  }

  .platform-logo.is-large {
    width: 92px;
    height: 74px;
  }

  .role-grid,
  .pin-hint,
  .formula-row,
  .metric-grid,
  .insight-grid,
  .analysis-grid,
  .dashboard-chart-grid,
  .dashboard-chart-grid.is-compact,
  .input-grid,
  .input-grid.compact,
  .check-row,
  .cycle-row {
    grid-template-columns: 1fr;
  }

  .role-option span {
    min-height: 58px;
  }

  .status-stack {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .status-pill,
  .logout-btn {
    width: 100%;
    min-height: 38px;
    padding-inline: 8px;
  }

  .module-tabs {
    padding-inline: 8px;
    scroll-padding-inline: 8px;
  }

  .module-tabs button {
    min-width: 104px;
    min-height: 40px;
    font-size: 12px;
  }

  .metric {
    min-height: 78px;
    padding: 12px;
  }

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

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

  .quick-grid button,
  .delay-grid button {
    min-height: 50px;
    padding-inline: 8px;
  }

  th,
  td {
    min-width: 96px;
    padding: 8px;
    font-size: 12px;
  }

  .event-row {
    align-items: stretch;
    flex-direction: column;
  }

  .event-actions {
    justify-items: start;
  }
}

@media (max-width: 380px) {
  .topbar,
  .app-shell {
    width: calc(100% - 12px);
  }

  .topbar {
    padding-top: 12px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .status-stack {
    grid-template-columns: 1fr;
  }

  .panel,
  .login-panel {
    padding: 10px;
  }

  .subnav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-tabs button {
    min-width: 96px;
  }

  .metric-grid.compact {
    grid-template-columns: 1fr;
  }
}

/* Mine 360 deployment branding */
.platform-logo{object-fit:contain;background:transparent}.platform-logo.is-large{max-width:320px;width:min(72vw,320px);height:auto}

.helper-text{color:var(--muted);font-size:13px;font-weight:700;margin:0 0 14px;line-height:1.45}.action-row .row-actions,.row-actions{display:grid;justify-items:end;gap:8px;min-width:140px}.row-actions .icon-btn{min-height:34px}

/* =========================================================
   Mine 360 Production - clean professional skin v5
   Purpose: remove pasted-logo look, align favicon/brand, improve role UI
   ========================================================= */
:root {
  --ink: #0b1720;
  --muted: #65727c;
  --paper: #f6f8f8;
  --panel: #ffffff;
  --line: #dde6e8;
  --cyan: #00aebc;
  --cyan-deep: #056a75;
  --green: #16a34a;
  --neon: #8cff3f;
  --orange: #d99a16;
  --red: #dc2626;
  --yellow: #f59e0b;
  --shadow: 0 12px 30px rgba(10, 27, 36, 0.07);
  --shadow-soft: 0 8px 18px rgba(10, 27, 36, 0.045);
  --radius: 16px;
  --max: 1180px;
}

body {
  background:
    radial-gradient(circle at 14% 0%, rgba(0, 174, 188, 0.12), transparent 34%),
    linear-gradient(180deg, #f8fbfb 0%, #f2f6f6 48%, #f6f8f8 100%);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.login-screen {
  padding: 28px 14px;
  background:
    radial-gradient(circle at 10% 15%, rgba(0, 174, 188, 0.16), transparent 32%),
    radial-gradient(circle at 90% 5%, rgba(217, 154, 22, 0.13), transparent 28%),
    #f6f8f8;
}

.login-shell {
  width: min(1040px, 100%);
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1fr);
  gap: 18px;
}

.login-copy,
.login-panel,
.panel,
.metric,
.module-tabs,
.topbar {
  border-color: rgba(11, 23, 32, 0.09);
}

.login-copy {
  min-height: 480px;
  align-content: center;
  justify-items: start;
  padding: clamp(22px, 4vw, 38px);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,255,255,0.72)),
    linear-gradient(150deg, rgba(0, 174, 188, 0.22), rgba(217, 154, 22, 0.12));
  overflow: hidden;
  position: relative;
}

.login-copy::before {
  content: "";
  position: absolute;
  inset: auto -64px -96px auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(0, 174, 188, 0.12);
}

.login-copy::after {
  content: "";
  position: absolute;
  inset: 26px auto auto -42px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  border: 22px solid rgba(217, 154, 22, 0.12);
}

.platform-logo,
.platform-logo.is-large {
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: none;
}

.brand-lockup .platform-logo {
  width: 128px;
  height: auto;
  max-height: 44px;
  padding: 0;
  flex-basis: 128px;
}

.login-copy .platform-logo.is-large {
  position: relative;
  z-index: 1;
  width: min(390px, 82vw);
  height: auto;
  max-height: none;
  margin: 0 0 28px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(11, 23, 32, 0.08);
  box-shadow: 0 22px 55px rgba(11, 23, 32, 0.10);
}

.login-copy .eyebrow,
.login-copy h1,
.login-copy p:not(.eyebrow) {
  position: relative;
  z-index: 1;
}

.login-copy .eyebrow,
.eyebrow {
  letter-spacing: .04em;
  color: var(--cyan-deep);
}

.login-copy h1 {
  max-width: 540px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: .96;
}

.login-copy p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.login-panel {
  padding: 20px;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

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

.role-option span {
  min-height: 68px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fbfdfd);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.role-option span:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.role-option input:checked + span {
  border-color: rgba(0, 174, 188, 0.68);
  background: linear-gradient(180deg, rgba(0, 174, 188, 0.11), #fff);
  box-shadow: inset 4px 0 0 var(--cyan), var(--shadow-soft);
}

.pin-hint {
  border-color: rgba(0, 174, 188, 0.22);
  background: #f8fbfb;
}

.pin-hint span {
  border: 1px solid rgba(11, 23, 32, 0.06);
}

.topbar {
  margin-top: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(11, 23, 32, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  gap: 16px;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-lockup h1 {
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.05;
}

.status-stack {
  align-items: center;
}

.status-pill,
.logout-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  box-shadow: none;
}

.module-tabs {
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 8px;
  border: 1px solid rgba(11, 23, 32, 0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.82);
  box-shadow: var(--shadow-soft);
}

.module-tabs button {
  min-height: 42px;
  border-radius: 12px;
  border-color: transparent;
  background: transparent;
  color: #596673;
  font-weight: 900;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.module-tabs button:hover {
  background: #f2f7f7;
  color: var(--ink);
}

.module-tabs button.is-active {
  background: #07171d;
  border-color: #07171d;
  color: #fff;
  box-shadow: 0 10px 22px rgba(7, 23, 29, 0.16);
}

.metric {
  min-height: 104px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #fcfefe);
  box-shadow: var(--shadow-soft);
}

.metric.is-alert {
  border-color: rgba(217, 154, 22, 0.32);
  background: linear-gradient(180deg, rgba(217, 154, 22, 0.075), #fff 72%);
}

.metric span {
  color: #566676;
  letter-spacing: .015em;
}

.metric strong {
  color: #07171d;
  font-weight: 950;
}

.panel {
  border-radius: 20px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(11, 23, 32, 0.06);
  margin-bottom: 14px;
}

.primary-action,
.icon-btn,
.mini-action,
button.primary-action {
  border-radius: 12px;
  font-weight: 900;
}

.primary-action {
  background: linear-gradient(135deg, #00aebc, #06717c);
  color: #fff;
  border: 0;
  box-shadow: 0 12px 22px rgba(0, 174, 188, 0.16);
}

input,
select,
textarea {
  border-radius: 12px;
  border-color: rgba(11, 23, 32, 0.13);
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 174, 188, 0.16);
  border-color: rgba(0, 174, 188, 0.58);
}

.event-row,
.table-wrap,
.chart-shell {
  border-radius: 14px;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-copy {
    min-height: 300px;
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .brand-lockup .platform-logo {
    width: 118px;
    flex-basis: 118px;
  }
  .status-stack {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    width: calc(100% - 16px);
    padding: 12px;
    border-radius: 18px;
  }
  .brand-lockup {
    width: 100%;
    gap: 10px;
  }
  .brand-lockup .platform-logo {
    width: 96px;
    flex-basis: 96px;
    max-height: 34px;
  }
  .brand-lockup h1 {
    font-size: 19px;
  }
  .login-copy .platform-logo.is-large {
    width: min(320px, 88vw);
    padding: 12px 14px;
    margin-bottom: 18px;
  }
  .login-copy h1 {
    font-size: clamp(28px, 10vw, 42px);
  }
  .module-tabs {
    width: calc(100% - 16px);
    border-radius: 16px;
    margin-left: auto;
    margin-right: auto;
  }
  .module-tabs button {
    min-width: 112px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric {
    min-height: 90px;
    padding: 12px;
  }
  .role-grid,
  .pin-hint {
    grid-template-columns: 1fr;
  }
}


/* One-click demo login refinement */
.login-note{margin:.25rem 0 0;color:#496579;font-size:.9rem;line-height:1.45;}
.role-option{cursor:pointer;transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;}
.role-option:hover{transform:translateY(-1px);box-shadow:0 14px 30px rgba(15,23,42,.08);border-color:#08b6c8;background:linear-gradient(180deg,#ffffff,#eefcff);}
.one-click-submit{margin-top:1rem;width:100%;}
.one-click-hint{margin-top:1rem;}
.one-click-hint span{white-space:normal;line-height:1.35;}
.role-option.is-logging-in{opacity:.72;pointer-events:none;}
@media (max-width:640px){.one-click-submit{position:sticky;bottom:.75rem;z-index:5}.login-note{font-size:.84rem}.one-click-hint{display:block}.one-click-hint span{display:block;margin:.35rem 0}}


/* Mechanic dashboard v8: maintenance-focused and mobile safe */
.mechanic-dashboard[hidden] { display: none !important; }
.mechanic-dashboard { display: grid; gap: 18px; }
.mechanic-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(0, 188, 195, .12), rgba(230, 165, 42, .08));
  border: 1px solid rgba(0, 188, 195, .24);
}
.mechanic-hero h2 { margin: 2px 0 8px; font-size: clamp(1.35rem, 4vw, 2rem); }
.role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  color: #074f57;
  background: rgba(0, 188, 195, .16);
  border: 1px solid rgba(0, 188, 195, .32);
}
.mechanic-kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mechanic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.mechanic-row { align-items: flex-start; }
.mechanic-row > div:first-child { min-width: 0; }
.mechanic-row strong, .mechanic-row span { overflow-wrap: anywhere; }
.mechanic-row.is-warning { border-left: 4px solid #e6a52a; background: rgba(230, 165, 42, .08); }
.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.scope-card {
  border: 1px solid rgba(15, 40, 48, .12);
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 6px;
}
.scope-card strong { color: #062935; }
.scope-card span { color: #5b6975; line-height: 1.5; }
@media (max-width: 860px) {
  .mechanic-grid, .scope-grid { grid-template-columns: 1fr; }
  .mechanic-hero { flex-direction: column; }
  .role-badge { align-self: flex-start; }
}
@media (max-width: 560px) {
  .mechanic-dashboard { gap: 14px; }
  .mechanic-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mechanic-row { grid-template-columns: 1fr; gap: 8px; }
  .mechanic-row > div:last-child { text-align: left; }
}
