@import "./tokens.css";

/* Role accent overrides — applied after token defaults */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--sfms-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30rem),
    linear-gradient(180deg, #ffffff 0%, var(--sfms-bg) 40%, #eef3f8 100%);
  color: var(--sfms-text);
  font-family: var(--sfms-font);
  font-size: 13px;
  line-height: 1.5;
}

body[data-role="supervisor"] {
  --sfms-primary: #7c3aed;
  --sfms-primary-dark: #6d28d9;
  --sfms-soft: #f3e8ff;
}

body[data-role="admin"] {
  --sfms-primary: #0f766e;
  --sfms-primary-dark: #115e59;
  --sfms-soft: #ccfbf1;
}

body[data-role="super_admin"] {
  --sfms-primary: #1d4ed8;
  --sfms-primary-dark: #1e40af;
  --sfms-soft: #dbeafe;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

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

.tera-web.manager-web .shell,
.manager-web .shell {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--sfms-border);
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 6px 12px;
  border-bottom: 1px solid var(--sfms-border);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  box-sizing: border-box;
  padding: 5px;
  border-radius: calc(32px * 0.22);
  background-color: #ffffff;
  background-image: url("assets/branding/future_logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-origin: content-box;
  box-shadow: 0 6px 14px rgba(16, 185, 129, 0.2);
}

.brand strong {
  display: block;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand span,
.scope-label,
.subtle,
.note {
  color: var(--sfms-muted);
}

.scope-card {
  margin: 10px 0 14px;
  padding: 10px;
  border: 1px solid var(--sfms-border);
  border-radius: var(--sfms-radius);
  background: var(--sfms-surface-2);
}

.scope-card h3,
.scope-card p {
  margin: 0;
}

.scope-card h3 {
  margin-top: 3px;
  font-size: 14px;
}

.scope-card .note {
  margin-top: 4px;
  font-size: 12px;
}

.scope-chips,
.row,
.hero-actions,
.report-filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.row input,
.row select {
  width: auto;
  flex: 1;
  min-width: 140px;
  max-width: 260px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-label {
  margin: 0 8px 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link,
.ghost-link {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 9px;
  color: #334155;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-link:hover,
.ghost-link:hover {
  background: #eef4ff;
  color: var(--sfms-primary);
}

.nav-link.active {
  background: #dbeafe;
  color: var(--sfms-primary-dark);
}

.nav-link[data-section="inventory"] {
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1d4ed8;
}

.nav-link[data-section="inventory"].active {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.nav-sub {
  margin: -1px 0 3px 20px;
  padding-left: 10px;
  border-left: 1px solid #dbeafe;
  display: grid;
  gap: 4px;
}

.nav-sublink {
  display: block;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-decoration: none;
}

.nav-sublink:hover {
  background: #eef4ff;
  color: var(--sfms-primary);
}

.nav-sublink.active {
  background: #dbeafe;
  color: var(--sfms-primary-dark);
}

.ghost-link {
  margin-top: auto;
  border: 1px solid var(--sfms-border);
  background: #fff;
  color: var(--sfms-muted);
}

.main {
  min-width: 0;
  padding: 16px 22px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--sfms-border);
}

.hero-copy {
  max-width: 820px;
}

.kicker,
.role-label,
.login-eyebrow {
  margin: 0 0 4px;
  color: var(--sfms-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

.topbar h1,
.hero-copy h1 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.topbar .note {
  margin: 8px 0 0;
  max-width: 720px;
}

.badge,
.chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--sfms-border);
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.badge.warn {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.btn,
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--sfms-primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.btn:hover,
.login-submit:hover {
  background: var(--sfms-primary-dark);
}

.btn.secondary {
  border-color: var(--sfms-border);
  background: #fff;
  color: #1f2937;
  box-shadow: none;
}

.btn.secondary:hover {
  background: #f1f5f9;
}

.staff-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.icon {
  min-width: 38px;
  padding: 6px 10px;
  line-height: 0;
}

.btn.icon svg {
  display: block;
}

.station-picker-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 6px;
  align-items: center;
}

.station-picker-trigger svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.plate-picker-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.plate-picker-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.staff-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.staff-row-actions .btn {
  white-space: nowrap;
}

.station-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.station-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.station-picker-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(720px, 92vh);
  overflow: hidden;
  display: grid;
  gap: 12px;
  border: 1px solid var(--sfms-border);
  border-radius: 16px;
  background: var(--sfms-surface);
  padding: 16px;
  box-shadow: var(--sfms-shadow);
}

.station-picker-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.station-picker-head h2,
.station-picker-head p {
  margin: 0;
}

.station-picker-results {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
}

.station-picker-option {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #fff;
  color: var(--sfms-text);
  text-align: left;
  box-shadow: none;
}

.station-picker-option:hover,
.station-picker-option:focus {
  border-color: var(--sfms-primary);
  background: var(--sfms-soft);
}

.unit-toggle {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #fff;
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 42px;
}

.unit-toggle legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--sfms-text-soft);
}

.unit-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.unit-toggle input[type="radio"] {
  margin: 0;
}

.station-picker-option strong {
  color: #111827;
}

.station-picker-option span {
  color: var(--sfms-muted);
  font-size: 12px;
}

.compact-btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.section {
  display: block;
}

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

.grid.two > label,
.grid.two > .field {
  grid-column: span 6;
}

.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.camera-processing-panel,
.camera-dashboard-panel {
  width: 100%;
}

.camera-processing-card,
.camera-dashboard-grid,
.credential-grid {
  display: grid;
  gap: 12px;
}

.camera-processing-card {
  align-items: start;
}

.camera-proxy-frame,
.camera-dashboard-frame,
.camera-live-stream {
  width: 100%;
  border: 1px solid var(--sfms-border);
  border-radius: 8px;
  background: #050505;
}

.camera-proxy-frame {
  min-height: 620px;
}

.camera-live-stream {
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
}

.camera-dashboard-frame {
  margin-top: 14px;
  min-height: 560px;
}

.camera-dashboard-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.camera-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.camera-dashboard-actions {
  display: flex;
  align-items: center;
}

.camera-dashboard-actions .camera-actions {
  gap: 8px;
}

.credential-secret {
  letter-spacing: 2px;
}

@media (max-width: 900px) {
  .camera-dashboard-grid,
  .credential-grid {
    grid-template-columns: 1fr;
  }

  .camera-proxy-frame,
  .camera-dashboard-frame {
    min-height: 520px;
  }
}

@media (max-width: 760px) {
  .grid.two > label,
  .grid.two > .field {
    grid-column: span 12;
  }
}

.card,
.summary-card,
.module-card,
.quick-card,
.area-card {
  border: 1px solid var(--sfms-border);
  border-radius: var(--sfms-radius);
  background: var(--sfms-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card {
  padding: 13px;
}

.card:hover,
.summary-card:hover {
  border-color: var(--sfms-border-strong);
}

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

.section-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.section-head .note {
  margin: 4px 0 0;
  font-size: 12px;
}

.metric-grid,
.report-summary-strip,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.summary-card {
  padding: 10px;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.summary-card .note {
  margin-bottom: 0;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:hover td {
  background: #f8fbff;
}

.station-row-interactive {
  cursor: pointer;
}

.empty-state {
  margin: 0;
  padding: 16px;
  color: var(--sfms-muted);
  text-align: center;
}

.report-hub-web .topbar {
  align-items: center;
}

.report-workbench {
  display: grid;
  gap: 12px;
}

.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--sfms-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: var(--sfms-shadow);
}

.report-filter-card {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: max-height 0.22s ease, opacity 0.18s ease, transform 0.22s ease;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.report-hub-web .report-toolbar:hover .report-filter-card,
.report-hub-web .report-toolbar:focus-within .report-filter-card {
  max-height: 520px;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.report-filter-card .section-head {
  margin-bottom: 8px;
}

.report-filter-sections {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-filter-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #fff;
}

.report-filter-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.report-filter-group-head strong {
  color: #334155;
  font-size: 12px;
}

.report-filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.report-filter-dropdown {
  position: relative;
  min-width: 0;
}

.report-filter-label,
.report-date-field span {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-trigger,
.report-date-field input,
.login-input-shell input,
input,
select,
textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--sfms-border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--sfms-text);
  padding: 8px 10px;
  outline: none;
}

.filter-trigger {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  text-align: left;
  font-weight: 700;
}

.filter-trigger:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--sfms-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ── Keyboard focus ring for interactive controls ────────────── */
.btn:focus-visible,
.login-submit:focus-visible,
.nav-link:focus-visible,
.nav-sublink:focus-visible,
.ghost-link:focus-visible,
.station-picker-trigger:focus-visible,
.plate-picker-button:focus-visible,
.station-picker-option:focus-visible,
.compact-btn:focus-visible {
  outline: 2px solid var(--sfms-primary);
  outline-offset: 2px;
}

.filter-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: none;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--sfms-shadow);
  padding: 6px;
}

.filter-menu.open {
  display: grid;
}

.filter-option {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #334155;
  padding: 8px;
  text-align: left;
}

.filter-option:hover,
.filter-option.active {
  background: #eff6ff;
  color: var(--sfms-primary-dark);
}

.report-tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.report-tab {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--sfms-border);
  border-radius: 9px;
  background: #fff;
  color: #475569;
  padding: 0 12px;
  font-weight: 800;
}

.report-tab.active {
  border-color: var(--sfms-primary);
  background: var(--sfms-primary);
  color: #fff;
}

.report-message {
  min-height: 22px;
  color: var(--sfms-muted);
  font-size: 12px;
}

.report-message.ok {
  color: var(--sfms-teal);
}

.report-message.error {
  color: var(--sfms-red);
}

.message {
  min-height: 24px;
  color: var(--sfms-muted);
}

.success-message {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 10px;
  background: #ecfdf5;
  color: #166534;
  font-weight: 800;
}

.success-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--sfms-green);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  .success-message { animation: success-message-pop 240ms ease-out both; }
  .success-check   { animation: success-check-pop 520ms cubic-bezier(0.2, 1.6, 0.4, 1) both; }
}

@keyframes success-message-pop {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes success-check-pop {
  0% {
    opacity: 0;
    transform: scale(0.2) rotate(-35deg);
  }
  65% {
    opacity: 1;
    transform: scale(1.18) rotate(8deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.report-view-content {
  display: grid;
  gap: 14px;
}

.report-view-grid {
  margin-bottom: 0;
}

.report-chart {
  width: 100%;
  min-height: 280px;
}

.report-chart.compact {
  min-height: 230px;
}

.distribution-card > div[id],
.distribution-card .bar-list {
  min-height: 260px;
}

.distribution-shell {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
}

.donut-visual {
  position: relative;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  container-type: size;
}

.donut-visual--interactive {
  cursor: pointer;
}

button.legend-item {
  font: inherit;
  color: inherit;
  width: 100%;
  cursor: pointer;
}

.donut-center {
  position: absolute;
  inset: 28px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.08em;
  box-sizing: border-box;
  min-width: 0;
  padding: 6px 8px 8px;
  border-radius: 50%;
  background: #fff;
  text-align: center;
}

.donut-center strong {
  display: block;
  max-width: 100%;
  font-size: 16px;
  font-size: clamp(10px, 8.5cqmin, 22px);
  line-height: 1.1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.donut-center span {
  display: block;
  max-width: 100%;
  color: var(--sfms-muted);
  font-size: 9px;
  font-size: clamp(8px, 4.2cqmin, 10px);
  line-height: 1.25;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  overflow-wrap: break-word;
}

.distribution-legend {
  display: grid;
  gap: 7px;
}

.legend-item,
.bar-row {
  display: grid;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  background: #f8fafc;
  color: #334155;
  padding: 8px;
  text-align: left;
}

.legend-item {
  grid-template-columns: 12px 1fr;
  align-items: center;
}

.legend-item.interactive:hover,
.bar-row-button:hover,
.area-card:hover,
.quick-card:hover {
  background: #eff6ff;
  color: var(--sfms-primary-dark);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-copy strong,
.bar-meta strong {
  display: block;
  font-size: 13px;
}

.legend-copy span,
.bar-meta span {
  color: var(--sfms-muted);
  font-size: 12px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sfms-primary), #14b8a6);
}

.report-area-grid,
.module-grid,
.quick-grid,
.station-card-grid,
.report-priority-grid,
.inventory-fuel-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.area-card,
.quick-card,
.module-card {
  padding: 12px;
  text-align: left;
}

.area-card strong {
  display: block;
  margin: 3px 0;
  font-size: 22px;
}

.area-card small,
.quick-card span,
.module-card small,
.module-card span {
  display: block;
  color: var(--sfms-muted);
}

.area-card.active {
  border-color: var(--sfms-primary);
  background: #eff6ff;
}

.fuel-card-head,
.fuel-card-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.fuel-card-stats {
  margin-top: 10px;
}

.fuel-card-stats span {
  display: grid;
  gap: 3px;
}

.fuel-card-stats small {
  color: var(--sfms-muted);
  font-size: 11px;
}

.fuel-card-meter {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.fuel-card-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sfms-teal), var(--sfms-primary));
}

/* Bold dashboard-style fuel cards — solid hues, white type (tones cycle via data-inventory-fuel-tone) */
.summary-card.inventory-fuel-card[data-inventory-fuel-tone] {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.22);
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .subtle {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] strong {
  color: #fff;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .chip {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .fuel-card-meter {
  background: rgba(255, 255, 255, 0.3);
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .fuel-card-meter span {
  background: #fff;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .fuel-card-stats span {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .fuel-card-stats small {
  color: rgba(255, 255, 255, 0.78);
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone] .fuel-card-stats b {
  color: #fff;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="0"] {
  background: #14b8a6;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="1"] {
  background: #0ea5e9;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="2"] {
  background: #ca8a04;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="3"] {
  background: #f97316;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="4"] {
  background: #db2777;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="5"] {
  background: #9333ea;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="6"] {
  background: #65a30d;
}

.summary-card.inventory-fuel-card[data-inventory-fuel-tone="7"] {
  background: #4f46e5;
}

.inventory-fuel-card.inventory-fuel-card--interactive {
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.inventory-fuel-card.inventory-fuel-card--interactive:hover,
.inventory-fuel-card.inventory-fuel-card--interactive:focus-visible {
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45), 0 18px 44px rgba(15, 23, 42, 0.28);
  outline: none;
}

.inventory-fuel-detail-dialog {
  width: min(960px, 100%);
  max-height: min(92vh, 880px);
  overflow: auto;
}

.inventory-detail-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.inventory-detail-chart-card {
  border: 1px solid var(--sfms-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--sfms-surface);
}

.inventory-detail-chart-heading {
  margin: 0 0 10px;
  font-size: 15px;
}

.inventory-detail-chart-card .distribution-shell {
  grid-template-columns: minmax(140px, 180px) 1fr;
}

.inventory-detail-chart-card .donut-visual {
  width: 148px;
  height: 148px;
}

.executive-visuals {
  align-items: stretch;
}

.command-card {
  min-height: 160px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.07), transparent),
    #fff;
}

.orb-chart {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 8px auto;
  border: 10px solid #dbeafe;
  border-top-color: var(--sfms-primary);
  border-right-color: #14b8a6;
  border-radius: 50%;
  text-align: center;
}

.orb-chart strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.orb-chart span {
  color: var(--sfms-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-grid,
.feed-list,
.capability-list,
.data-list,
.staff-roster-list,
.config-list {
  display: grid;
  gap: 8px;
}

.signal-item,
.signal-card,
.feed-item,
.capability-item,
.data-item,
.staff-roster-item,
.config-item {
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.signal-item strong,
.signal-card strong,
.feed-item strong,
.data-item strong {
  display: block;
}

.station-card,
.station-card-grid article {
  border: 1px solid var(--sfms-border);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.station-card-grid h3,
.station-card h3 {
  margin: 0 0 4px;
}

.compact-scope-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  gap: 16px;
  align-items: center;
}

.hero-panel-copy h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

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

.hero-stats .metric {
  grid-column: auto;
}

form.card,
.form-grid {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  color: #475569;
  font-weight: 800;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.color-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
}

.color-field .color-swatch-input {
  width: 44px;
  min-width: 44px;
  height: 36px;
  min-height: 36px;
  padding: 3px;
  cursor: pointer;
}

.report-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.24);
}

.report-drawer.open {
  display: flex;
}

.report-drawer-panel {
  width: min(460px, 100%);
  height: 100%;
  overflow: auto;
  background: #fff;
  box-shadow: -24px 0 50px rgba(15, 23, 42, 0.18);
  padding: 20px;
}

.drawer-close {
  float: right;
  border: 0;
  background: #eef2f7;
  border-radius: 9px;
  padding: 8px 10px;
  font-weight: 900;
}

.drawer-metric-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.drawer-metric-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #edf2f7;
  padding: 9px 0;
}

.login-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(380px, 1fr);
  align-items: center;
  gap: 48px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 28px;
}

.login-brand-panel {
  display: grid;
  gap: 26px;
}

.login-brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--sfms-primary);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--sfms-primary);
  color: #fff;
}

.login-hero-copy h1 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

.login-hero-copy p {
  max-width: 560px;
  color: #475569;
  font-size: 17px;
}

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

.login-role-grid div,
.login-card {
  border: 1px solid var(--sfms-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--sfms-shadow);
}

.login-role-grid div {
  padding: 14px;
}

.login-role-grid strong,
.login-role-grid span {
  display: block;
}

.login-role-grid span {
  margin-top: 4px;
  color: var(--sfms-muted);
  font-size: 12px;
}

.login-card {
  max-width: 470px;
  margin-left: auto;
  padding: 28px;
}

.login-card-head p {
  margin: 0;
  color: var(--sfms-primary);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.login-card-head h2 {
  margin: 5px 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.login-card-head span,
.login-message,
.login-footnote {
  color: var(--sfms-muted);
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.login-form label {
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-input-shell input {
  min-height: 46px;
}

.login-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
}

.login-footnote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
}

.login-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sfms-green);
}

.login-trust-strip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #475569;
}

.login-trust-strip span {
  width: 44px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sfms-primary), #14b8a6);
}

.login-trust-strip p {
  margin: 0;
}

@media (max-width: 1100px) {
  .report-filter-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-3,
  .span-4,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 12;
  }
}

@media (max-width: 860px) {
  .tera-web.manager-web .shell,
  .manager-web .shell,
  .login-stage {
    grid-template-columns: 1fr;
  }

  .side {
    position: static;
    height: auto;
  }

  .main {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .report-filter-sections,
  .login-role-grid {
    grid-template-columns: 1fr;
  }

  .login-card {
    max-width: none;
    margin: 0;
  }
}

/* ── Form grid utilities ─────────────────────────────────────── */
.form-2col,
.form-3col {
  display: grid;
  gap: 12px;
}
.form-2col { grid-template-columns: repeat(2, 1fr); }
.form-3col { grid-template-columns: repeat(3, 1fr); }
.form-fullrow { grid-column: 1 / -1; }

.form-section-label {
  margin: 6px 0 -2px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--sfms-border);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

label.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
}
label.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: unset;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .form-2col,
  .form-3col { grid-template-columns: 1fr; }
  .form-fullrow { grid-column: auto; }
}

/* ── Nav icons ───────────────────────────────────────────────── */
.nav-link svg,
.ghost-link svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  opacity: 0.6;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.nav-link.active svg,
.nav-link:hover svg,
.ghost-link:hover svg { opacity: 1; }

/* ── Sidebar footer ──────────────────────────────────────────── */
.side-footer {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--sfms-border);
}
.side-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 9px;
}
.side-user-info {
  flex: 1;
  min-width: 0;
}
.side-user-info strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sfms-text);
}
.side-user-info span {
  display: block;
  font-size: 11px;
  color: var(--sfms-muted);
}

/* ── Signal card colours ─────────────────────────────────────── */
.signal-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--sfms-border);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.signal-card span { font-size: 11px; color: var(--sfms-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.signal-card strong { font-size: 22px; letter-spacing: -0.04em; }
.signal-card.green  { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.signal-card.amber  { border-color: #fed7aa; background: #fff7ed; color: #b45309; }
.signal-card.red    { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.signal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

/* ── Animations ──────────────────────────────────────────────── */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes orb-reveal {
  from { transform: rotate(-50deg) scale(0.88); opacity: 0; }
  to   { transform: rotate(0deg)   scale(1);    opacity: 1; }
}
@keyframes card-click {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.955); }
  100% { transform: scale(1); }
}
@keyframes count-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: fade-up 0.22s ease both;
  }
  .grid > .card:nth-child(2) { animation-delay: 0.04s; }
  .grid > .card:nth-child(3) { animation-delay: 0.08s; }
  .grid > .card:nth-child(4) { animation-delay: 0.12s; }
  .grid > .card:nth-child(5) { animation-delay: 0.16s; }
  .grid > .card:nth-child(6) { animation-delay: 0.18s; }

  .bar-fill {
    transform-origin: left;
    animation: bar-grow 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
  }

  .orb-chart {
    animation: orb-reveal 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
  }

  .summary-card strong,
  .area-card strong {
    animation: count-in 0.3s ease both;
  }

  /* hover lift for interactive cards */
  .quick-card,
  .area-card,
  .module-card,
  .summary-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .quick-card:hover,
  .area-card:hover,
  .module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.09);
  }
  .summary-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.07);
  }

  /* click burst — toggled by JS */
  .card-clicked {
    animation: card-click 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
  }
}

/* ── Pill colour variants ────────────────────────────────────── */
.pill.green  { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.pill.amber  { border-color: #fed7aa; background: #fff7ed; color: #b45309; }
.pill.red    { border-color: #fecaca; background: #fef2f2; color: #dc2626; }
.pill.blue   { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }

/* ── Danger button ───────────────────────────────────────────── */
.btn.danger {
  background: var(--sfms-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.18);
}
.btn.danger:hover { background: #b91c1c; }

.btn.check {
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18);
}
.btn.check:hover { background: #d97706; }

/* ── Request row cards (inside Exceptions table) ─────────────── */
.request-row-card {
  padding: 5px 0;
  border-bottom: 1px solid var(--sfms-border);
}
.request-row-card:last-child { border-bottom: 0; }

/* Single horizontal band: pill | plate | fields | meta | actions */
.request-row-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 34px;
}

.request-row-plate {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.request-row-meta {
  font-size: 11px;
  line-height: 1.4;
  color: var(--sfms-muted);
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.request-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-end;
  flex: 1 1 420px;
  min-width: 280px;
}

.request-row-fields-readonly {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  flex: 1 1 360px;
  min-width: 240px;
}

.request-inline-field {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex-shrink: 0;
}
.request-inline-field span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sfms-muted);
}
.request-inline-field input,
.request-inline-field select {
  width: 100px;
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
}
.request-inline-field-small input,
.request-inline-field-small select { width: 72px; }

.request-row-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.request-row-actions .btn {
  min-height: 24px;
  padding: 0 8px;
  font-size: 11px;
}

/* ── Requests table: keep actions column tight ───────────────── */
td.row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  vertical-align: middle;
}

/* ── Exception desk: 2018 fuel linkage report layout (per-request rows) ─── */
.exception-form-table-scroll-ui {
  position: relative;
  margin: 4px 0;
}

.exception-form-table-scroll-ui .exception-form-table-wrap {
  margin: 0;
}

.exception-form-table-scroll-ui[data-no-hscroll] .exception-scroll-btn {
  display: none;
}

.exception-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 64px;
  padding: 0;
  margin: 0;
  border: 1px solid #94a3b8;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 14px rgba(15, 23, 42, 0.14);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  color: #1e293b;
  opacity: 0.52;
  transition: opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.exception-scroll-btn:hover,
.exception-scroll-btn:focus-visible {
  opacity: 1;
  background: #fff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.2);
  outline: none;
}

.exception-form-table-scroll-ui:hover .exception-scroll-btn:not(:disabled) {
  opacity: 0.82;
}

.exception-scroll-left {
  left: 8px;
}

.exception-scroll-right {
  right: 8px;
}

.exception-scroll-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  box-shadow: none;
}

.exception-form-table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  margin: 4px 0;
  border: 1px solid var(--sfms-border);
  border-radius: 6px;
  background: #fff;
  /* Subtle scroll hint: stronger on hover so users notice horizontal overflow */
  box-shadow: inset -10px 0 14px -12px transparent;
  transition: box-shadow 0.2s ease;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.exception-form-table-wrap:hover {
  box-shadow: inset -14px 0 18px -12px rgba(15, 23, 42, 0.14);
  scrollbar-color: #94a3b8 #e2e8f0;
}

.exception-form-table-wrap::-webkit-scrollbar {
  height: 16px;
}

.exception-form-table-wrap::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 6px;
}

.exception-form-table-wrap::-webkit-scrollbar-thumb {
  background: #64748b;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
  min-width: 40px;
}

.exception-form-table-wrap:hover::-webkit-scrollbar-thumb {
  background: #475569;
}

.exc-company-docs {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--sfms-border, #cbd5e1);
  border-radius: 8px;
  background: #f8fafc;
}

.exc-company-docs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.exc-company-docs-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exc-company-docs-ul li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 12px;
}

.exc-doc-view-btn {
  margin-left: auto;
  padding: 4px 10px;
  font-size: 11px;
}

.exc-td-from,
.exc-td-to {
  min-width: 108px;
}

.exc-td-cooldown {
  min-width: 72px;
}

.exc-td-rowcomment {
  min-width: 120px;
}

.manager-web .exception-form-table-wrap {
  background: var(--sfms-surface, #fff);
}

.exception-form-table {
  border-collapse: collapse;
  table-layout: auto;
  width: max-content;
  min-width: 1280px;
  font-size: 11px;
  line-height: 1.35;
}

.exception-form-table th,
.exception-form-table td {
  border: 1px solid #94a3b8;
  padding: 4px 5px;
  vertical-align: top;
  word-wrap: break-word;
}

.exception-form-table thead th {
  background: #e2e8f0;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
}

.exception-form-caption-row th {
  background: #f1f5f9;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 6px;
  text-align: center;
}

.exception-form-table .exc-th-num { min-width: 40px; }
.exception-form-table .exc-th-wide { min-width: 168px; }
.exception-form-table .exc-th-sector { min-width: 120px; }
.exception-form-table .exc-th-sub { min-width: 100px; }
.exception-form-table .exc-th-woreda { min-width: 64px; }
.exception-form-table .exc-th-lic { min-width: 120px; }
.exception-form-table .exc-th-org-block {
  background: #cbd5e1;
  font-size: 10px;
}
.exception-form-table .exc-th-liters-head {
  background: #e2e8f0;
  font-size: 10px;
}
.exception-form-table .exc-th-fuel {
  font-size: 10px;
  background: #f8fafc;
  min-width: 88px;
}
.exception-form-table .exc-th-station,
.exception-form-table .exc-th-addr { min-width: 140px; font-size: 10px; }
.exception-form-table .exc-th-phone { min-width: 100px; font-size: 10px; }
.exception-form-table .exc-th-date { min-width: 108px; font-size: 10px; }
.exception-form-table .exc-th-insp { min-width: 104px; font-size: 10px; }
.exception-form-table .exc-th-actions {
  min-width: 120px;
  font-size: 10px;
  background: #f1f5f9;
}

.exception-form-table tbody.request-row-card {
  border-bottom: 2px solid #64748b;
}

.exception-form-table tbody.request-row-card:last-child {
  border-bottom: 0;
}

.exception-form-table tbody.exception-request-group {
  border-bottom: 2px solid #64748b;
}

.exception-form-table tbody.exception-request-group:last-child {
  border-bottom: 0;
}

.exception-official-form-table .exc-th-spec,
.exception-official-form-table .exc-td-spec {
  min-width: 72px;
  max-width: 110px;
}

.exception-official-form-table .exc-th-mach,
.exception-official-form-table .exc-td-machine {
  min-width: 120px;
}

.exception-official-form-table .exc-th-qty {
  min-width: 44px;
}

.exception-official-form-table .exc-th-hrs,
.exception-official-form-table .exc-th-mo {
  min-width: 64px;
}

.exception-official-form-table .exc-th-ltrpair {
  text-align: center;
  font-size: 10px;
}

.exc-inline-lic {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  font-size: 10px;
}

.exc-row-extra-block {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
}

.report-hub-web .fuel-linkage-report-card {
  margin-top: 28px;
}

.report-hub-web .fuel-linkage-report-card h2 {
  font-size: 1.12rem;
}

  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 26px;
  padding: 3px 5px;
  font-size: 11px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
}

.exception-form-table .exc-cell-input:focus {
  border-color: var(--sfms-accent, #2563eb);
  background: #fff;
  outline: none;
}

.exception-form-table .exc-cell-input:disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.exception-form-table .exc-ltr-input {
  text-align: right;
}

.exception-form-table .exc-plate-line {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.3;
}

.exception-form-table .exc-td-actions {
  background: #f8fafc;
  text-align: center;
  vertical-align: top;
}

.exception-form-table .exc-status-pill {
  display: inline-block;
  margin-bottom: 6px;
}

.exception-form-table .exception-form-meta {
  margin: 0 0 8px;
  font-size: 10px;
  text-align: left;
  word-break: break-word;
  white-space: normal;
}

.exception-form-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: stretch;
}

.exception-form-actions-stack .exc-act-btn {
  width: 100%;
  min-height: 28px;
  font-size: 11px;
}

.exception-form-extra {
  background: #fafafa;
  padding: 6px !important;
}

.exception-form-extra-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-end;
}

.exc-extra-field {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.exc-extra-field span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sfms-muted);
}

.exc-extra-field input,
.exc-extra-field select {
  min-height: 26px;
  padding: 3px 6px;
  font-size: 11px;
  min-width: 4.5rem;
  max-width: 100%;
}

.exc-extra-field.exc-extra-wide {
  flex: 1 1 220px;
}

.exc-extra-field.exc-extra-wide input {
  min-width: 0;
  width: 100%;
}

.exc-extra-field-btn {
  align-self: flex-end;
  margin-bottom: 1px;
}

#requests-body td:nth-child(4) {
  vertical-align: top;
}

.exception-form-table .exc-station-id-row {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 4px;
}

.exception-form-table .exc-station-id-input {
  flex: 1 1 auto;
  min-width: 72px;
}

.exception-form-table .exc-station-pick-btn {
  flex-shrink: 0;
  min-height: 26px;
  padding: 0 8px;
  font-size: 10px;
}

.exception-form-table .exc-readonly-gray,
.exception-form-table .exc-readonly-gray-cell {
  background: #e8eef4 !important;
  color: #475569 !important;
  cursor: not-allowed;
}

.exception-form-table .exc-readonly-value {
  padding: 6px 5px;
  font-size: 11px;
  min-height: 28px;
  border-radius: 3px;
  border: 1px solid #cbd5e1;
}

/* Super Admin — official fuel linkage allowance sheet (2018 bureau layout) */
.fuel-linkage-official-dialog {
  width: min(1120px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}

.fuel-linkage-official-scroll {
  overflow-x: auto;
}

.fuel-linkage-official-title {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 14px;
  color: #0f172a;
}

table.fuel-linkage-official-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
  background: #fff;
}

table.fuel-linkage-official-table th,
table.fuel-linkage-official-table td {
  border: 1px solid #111;
  padding: 6px 5px;
  vertical-align: middle;
  word-break: break-word;
}

table.fuel-linkage-official-table thead th {
  background: #f1f5f9;
  font-weight: 700;
}

table.fuel-linkage-official-table tbody td {
  background: #fff;
}

.fuel-linkage-permit-row {
  cursor: pointer;
}

.fuel-linkage-permit-row:hover {
  background: rgba(37, 99, 235, 0.06);
}

@media print {
  body * {
    visibility: hidden;
  }

  .fuel-linkage-print-root,
  .fuel-linkage-print-root * {
    visibility: visible;
  }

  .fuel-linkage-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 12px;
  }
}

.header-station-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  max-width: 260px;
  margin-right: 10px;
}

.manager-web .header-station-picker-wrap[data-hidden="true"],
.header-station-picker-wrap[hidden] {
  display: none !important;
}

.header-station-picker-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sfms-muted);
}

select.header-station-picker {
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--sfms-border);
  background: #fff;
  max-width: 260px;
}

.manager-web .hero-actions {
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.header-station-picker-field {
  margin-top: 4px;
}

.header-station-picker-field input {
  font: inherit;
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--sfms-border);
  background: #fff;
  min-width: 0;
  max-width: 220px;
}

.station-detail-modal-root {
  z-index: 85;
}

.station-detail-dialog {
  width: min(720px, 100%);
  max-height: min(92vh, 900px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.station-detail-scroll {
  min-height: 0;
  overflow: auto;
  max-height: min(62vh, 640px);
}

.station-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sfms-border);
}

.station-detail-section {
  margin-bottom: 1.1rem;
}

.station-detail-section:last-child {
  margin-bottom: 0;
}

.station-detail-subhead {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.station-detail-dl {
  display: grid;
  gap: 6px;
}

.station-detail-dl > div {
  display: grid;
  grid-template-columns: minmax(96px, 120px) 1fr;
  gap: 8px;
  font-size: 0.85rem;
  align-items: start;
}

.station-detail-dl dt {
  color: var(--sfms-muted);
  font-weight: 600;
}

.station-detail-dl dd {
  margin: 0;
}

.station-detail-list {
  margin: 0;
  padding-left: 1.2rem;
}

.station-detail-list li {
  margin-bottom: 4px;
}

.station-detail-pre {
  font-size: 0.75rem;
  overflow: auto;
  max-height: 220px;
  background: var(--sfms-soft);
  padding: 10px;
  border-radius: 8px;
  margin: 0;
}

.station-detail-superadmins {
  padding: 12px;
  border-radius: 12px;
  background: var(--sfms-soft);
  border: 1px solid var(--sfms-border);
}

.station-picker-cap-note {
  margin-bottom: 8px;
}
