:root {
  --bg: #0c121b;
  --panel: rgba(19, 29, 43, .94);
  --panel-2: rgba(26, 39, 56, .96);
  --panel-3: #101a27;
  --line: #2c3d52;
  --text: #eef5fb;
  --muted: #9dafc2;
  --accent: var(--sede-accent, #2ed3b7);
  --accent-2: var(--sede-accent-2, #4aa3ff);
  --ok: #3ddc97;
  --warn: #f7c948;
  --danger: #ff6370;
  --radius: 8px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-x: hidden;
}

body[data-page="login"] {
  background:
    radial-gradient(circle at 18% 18%, rgba(36, 208, 197, .16), transparent 32%),
    radial-gradient(circle at 76% 28%, rgba(255, 157, 35, .13), transparent 28%),
    linear-gradient(135deg, #050910 0%, #071422 46%, #02050a 100%);
}

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

button { cursor: pointer; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap-value {
  display: inline-block;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.numeric-value,
.gal-value,
.money-value {
  text-align: right;
}

.money-value.strong {
  color: var(--text);
  font-weight: 900;
}

.login-shell {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(320px, 720px);
  gap: 22px;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    linear-gradient(110deg, rgba(1, 5, 11, .92) 0%, rgba(7, 20, 34, .88) 42%, rgba(3, 7, 13, .94) 100%),
    radial-gradient(circle at 20% 24%, rgba(38, 212, 195, .2), transparent 34%),
    radial-gradient(circle at 72% 18%, rgba(255, 177, 64, .17), transparent 26%),
    radial-gradient(circle at 86% 78%, rgba(66, 158, 255, .13), transparent 30%);
  overflow: hidden;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.login-shell::before {
  background:
    linear-gradient(115deg, transparent 0 52%, rgba(255, 161, 36, .22) 52.35%, transparent 53.1%),
    linear-gradient(115deg, transparent 0 58%, rgba(255, 255, 255, .12) 58.15%, transparent 58.55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 72px);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, .45), rgba(0, 0, 0, .9));
}

.login-shell::after {
  inset: 8% 0 auto auto;
  width: min(760px, 58vw);
  height: min(760px, 58vw);
  border: 1px solid rgba(255, 164, 28, .18);
  border-left-color: rgba(235, 243, 255, .16);
  border-bottom-color: rgba(46, 211, 183, .13);
  border-radius: 50%;
  transform: translate(28%, -18%) rotate(-18deg);
  box-shadow:
    -34px 28px 90px rgba(255, 141, 16, .09),
    inset 28px -20px 80px rgba(17, 151, 178, .08);
}

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

.login-card {
  position: relative;
  overflow: hidden;
  padding: 30px;
  background:
    linear-gradient(145deg, rgba(18, 29, 44, .88), rgba(10, 16, 25, .78)),
    radial-gradient(circle at 0 0, rgba(46, 211, 183, .12), transparent 38%);
  border-color: rgba(115, 144, 179, .34);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(255, 255, 255, .035) inset;
  backdrop-filter: blur(18px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 169, 38, .36), transparent 22% 78%, rgba(46, 211, 183, .2)),
    linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 36%);
  opacity: .55;
  pointer-events: none;
  mask-image: linear-gradient(#000 0 0), linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.login-card h1 { margin: 8px 0 12px; font-size: 30px; line-height: 1.1; letter-spacing: 0; }
.login-card p { line-height: 1.5; }

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 180, 55, .95), rgba(255, 132, 0, .78) 42%, rgba(46, 211, 183, .9));
  color: #061018;
  font-weight: 900;
  box-shadow:
    0 12px 28px rgba(255, 139, 20, .18),
    0 0 0 1px rgba(255, 255, 255, .18) inset;
}

.form-stack { display: grid; gap: 14px; margin-top: 18px; }

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

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: auto;
  accent-color: var(--accent);
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-weight: 800;
}

input, select, textarea {
  width: 100%;
  color: var(--text);
  background: rgba(4, 10, 18, .72);
  border: 1px solid rgba(96, 126, 160, .72);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: none;
}

select {
  appearance: none;
  background:
    linear-gradient(135deg, rgba(46, 211, 183, .07), rgba(74, 163, 255, .05)),
    rgba(4, 10, 18, .88);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23eef5fb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(46, 211, 183, .07), rgba(74, 163, 255, .05));
  background-repeat: no-repeat, no-repeat;
  background-position: right 12px center, center;
  background-size: 18px, 100%;
  padding-right: 42px;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

select:hover {
  border-color: rgba(46, 211, 183, .78);
  box-shadow: 0 0 0 1px rgba(46, 211, 183, .08);
}

select:focus {
  box-shadow:
    0 0 0 3px rgba(46, 211, 183, .13),
    0 12px 28px rgba(0, 0, 0, .18);
}

select option {
  color: var(--text);
  background: #101a27;
}

select option:checked,
select option:hover {
  color: #061018;
  background: var(--accent);
}

textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 34px;
  height: 34px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border: 1px solid rgba(76, 99, 126, .7);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13, 22, 34, .8);
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.password-toggle:hover,
.password-toggle.active {
  color: var(--accent);
  border-color: rgba(46, 211, 183, .7);
  background: rgba(46, 211, 183, .1);
  box-shadow: 0 0 0 3px rgba(46, 211, 183, .08);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s ease;
}

.password-toggle.active svg {
  transform: scale(1.04);
}

.button-row {
  min-height: 34px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 210px;
}

.action-hint {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.action-add {
  width: auto;
  min-width: 132px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(52, 211, 211, .12);
}

.action-cell {
  min-width: 174px;
  white-space: nowrap;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 -2px;
  color: #bfe0ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.form-section-title::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(83, 111, 145, .55);
}

.password-cell {
  min-width: 194px;
  white-space: nowrap;
}

.password-mask {
  display: inline-block;
  width: 112px;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.password-mask.visible-password {
  color: var(--text);
  font-weight: 800;
}

.fixed-action {
  width: 92px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  border: 1px solid rgba(76, 99, 126, .7);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13, 22, 34, .8);
  transition: color .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.icon-button:hover,
.icon-button.active {
  color: var(--accent);
  border-color: rgba(46, 211, 183, .7);
  background: rgba(46, 211, 183, .1);
  box-shadow: 0 0 0 3px rgba(46, 211, 183, .08);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-weight: 800;
  color: var(--text);
  background: var(--panel-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary { color: #061018; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn.ghost { border-color: var(--line); background: rgba(15, 24, 36, .7); }
.btn.danger { color: #26090d; background: var(--danger); }
.btn.small { padding: 7px 10px; font-size: 12px; }

.site-selector { padding: 24px; }
.section-heading h2, .panel-title h2, .panel-title h3 { margin: 0; letter-spacing: 0; }
.section-heading { margin-bottom: 18px; }

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

.site-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(12, 18, 27, .3), rgba(12, 18, 27, .72)),
    linear-gradient(135deg, rgba(46, 211, 183, .24), rgba(74, 163, 255, .2));
  padding: 18px;
  text-align: left;
  color: var(--text);
  display: grid;
  align-content: end;
}

.site-card h3 { margin: 0 0 6px; font-size: 22px; }
.site-card p { color: var(--muted); margin: 0; }

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  transition: grid-template-columns .2s ease;
}

.app-layout.sidebar-collapsed { grid-template-columns: 0 1fr; }
.app-layout.sidebar-collapsed .sidebar { padding: 0; border-right: 0; overflow: hidden; }

.sidebar-backdrop {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: rgba(10, 17, 27, .94);
  border-right: 1px solid var(--line);
  padding: 18px;
}

.brand-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.brand-row strong { display: block; font-size: 14px; }
.brand-row span { color: var(--muted); font-size: 12px; }

.nav { display: grid; gap: 8px; }
.nav button {
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 12px;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav button:hover, .nav button.active { color: var(--text); background: var(--panel-2); }

.nav-group {
  display: grid;
  gap: 0;
}

.nav-group-toggle {
  width: 100%;
  justify-content: space-between;
}

.nav-group-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-group-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transition: transform .2s ease, color .2s ease;
}

.nav-group.open .nav-group-arrow {
  color: var(--accent);
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-left: 14px;
  transform: translateY(-4px);
  transition: max-height .24s ease, opacity .18s ease, transform .2s ease, padding-top .2s ease;
}

.nav-group.open .nav-submenu {
  max-height: 320px;
  opacity: 1;
  padding-top: 6px;
  transform: translateY(0);
}

.nav-submenu button {
  position: relative;
  padding: 10px 12px 10px 14px;
  font-size: 13px;
}

.nav-submenu button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 999px;
  background: rgba(96, 126, 160, .45);
}

.nav-submenu button.active::before {
  background: var(--accent);
}

.main { min-width: 0; padding: 24px; overflow-x: hidden; }

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.topbar h1 { margin: 0 0 4px; font-size: 24px; }
.topbar p { margin: 0; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.menu-toggle {
  min-width: 42px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}
.user-pill { min-width: 210px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); }
.user-pill strong { color: var(--text); }

.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(4, minmax(170px, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.management-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.management-panel .card {
  min-height: 82px;
  padding: 12px;
  box-shadow: none;
}

.management-panel .card strong { font-size: 18px; }

.panel, .card { padding: 16px; }
.card { min-height: 112px; display: grid; align-content: space-between; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { font-size: 25px; }
.card small { color: var(--muted); }

.dashboard-cards {
  margin-bottom: 16px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(520px, .95fr) minmax(460px, 1.05fr);
  gap: 16px;
  align-items: start;
}

.dashboard-tank-panel,
.dashboard-movement-panel {
  min-width: 0;
  box-shadow: none;
}

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

.dashboard-tanks .tank {
  min-width: 0;
}

.dashboard-tanks .tank-shell {
  height: 138px;
}

.dashboard-tanks .tank h3 {
  min-height: 42px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.movement-list {
  display: grid;
  gap: 10px;
}

.movement-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(76, 99, 126, .62);
  border-radius: var(--radius);
  background: rgba(13, 22, 34, .72);
}

.movement-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.movement-main strong {
  overflow-wrap: anywhere;
}

.movement-main small,
.movement-side small {
  color: var(--muted);
}

.movement-side {
  min-width: 116px;
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.decision-alert-panel {
  margin-top: 16px;
}

.decision-actions {
  min-width: 150px;
}

.decision-actions .btn {
  width: 100%;
  min-height: 34px;
}

.performance-bars {
  display: grid;
  gap: 12px;
}

.performance-bar {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(160px, 1.4fr) minmax(110px, auto);
  gap: 12px;
  align-items: center;
}

.performance-bar span {
  color: var(--muted);
  font-size: 13px;
}

.performance-bar div {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(76, 99, 126, .55);
  border-radius: 999px;
  background: rgba(7, 13, 22, .72);
}

.performance-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.performance-bar strong {
  text-align: right;
  font-size: 13px;
}

.report-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.report-summary strong,
.report-summary span {
  padding: 7px 9px;
  border: 1px solid rgba(76, 99, 126, .55);
  border-radius: var(--radius);
  background: rgba(10, 18, 28, .62);
}

.report-summary strong {
  color: var(--text);
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(13, 22, 34, .56);
}

.assistant-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: 48px;
  height: 48px;
  pointer-events: none;
}

.assistant-toggle,
.assistant-panel {
  pointer-events: auto;
}

.assistant-toggle {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(74, 163, 255, .42);
  border-radius: 50%;
  color: #061018;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .35);
  touch-action: none;
  user-select: none;
}

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(380px, calc(100vw - 36px));
  max-height: min(720px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(76, 99, 126, .74);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(18, 30, 45, .98), rgba(9, 16, 26, .98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
  overflow: hidden;
  transform-origin: bottom right;
  transition: opacity .18s ease, transform .18s ease;
}

.assistant-widget.panel-below .assistant-panel {
  top: 58px;
  bottom: auto;
  transform-origin: top right;
}

.assistant-widget.panel-left .assistant-panel {
  left: 0;
  right: auto;
}

.assistant-widget.panel-below.panel-left .assistant-panel {
  transform-origin: top left;
}

.assistant-widget:not(.open) .assistant-panel {
  opacity: 0;
  transform: translateY(8px) scale(.96);
  pointer-events: none;
}

.assistant-coach {
  position: absolute;
  right: 60px;
  bottom: 0;
  width: min(300px, calc(100vw - 92px));
  padding: 12px;
  border: 1px solid rgba(74, 163, 255, .38);
  border-radius: var(--radius);
  background: rgba(16, 26, 39, .98);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.assistant-coach::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 16px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 8px solid rgba(16, 26, 39, .98);
}

.assistant-widget.open .assistant-coach {
  display: none;
}

.assistant-coach span {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.assistant-coach p {
  margin: 0 0 10px;
  line-height: 1.4;
}

.assistant-coach div {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.assistant-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(25, 42, 62, .96), rgba(11, 20, 32, .96));
}

.assistant-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #061018;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.assistant-avatar.big {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  font-size: 24px;
}

.assistant-head span,
.assistant-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.assistant-head strong {
  display: block;
  margin: 3px 0;
  font-size: 18px;
}

.assistant-head select {
  margin-left: auto;
  width: 118px;
  padding: 8px;
}

.assistant-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.assistant-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 163, 255, .48) rgba(7, 13, 22, .62);
}

.assistant-scroll::-webkit-scrollbar {
  width: 9px;
}

.assistant-scroll::-webkit-scrollbar-track {
  background: rgba(7, 13, 22, .62);
}

.assistant-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(46, 211, 183, .55), rgba(74, 163, 255, .55));
  border: 2px solid rgba(7, 13, 22, .82);
  border-radius: 999px;
}

.assistant-welcome,
.assistant-current-help,
.assistant-nickname {
  border: 1px solid rgba(76, 99, 126, .54);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(10, 18, 28, .68);
}

.assistant-welcome span,
.assistant-current-help span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.assistant-welcome p,
.assistant-current-help p {
  margin: 0;
  line-height: 1.5;
}

.assistant-nickname {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.assistant-nickname input {
  padding: 8px;
}

.assistant-settings {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(76, 99, 126, .54);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(10, 18, 28, .68);
}

.assistant-settings select {
  padding: 8px;
}

.assistant-tips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.assistant-tips button {
  border: 1px solid rgba(74, 163, 255, .28);
  border-radius: 999px;
  padding: 8px 10px;
  color: #bfe0ff;
  background: rgba(74, 163, 255, .12);
}

.assistant-messages {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: 330px;
  overflow: auto;
}

.assistant-message {
  border: 1px solid rgba(76, 99, 126, .6);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(10, 18, 28, .76);
}

.assistant-message span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.assistant-message p {
  margin: 0;
  line-height: 1.4;
}

.assistant-message.warn { border-left-color: var(--warn); }
.assistant-message.danger { border-left-color: var(--danger); }

.assistant-question {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  background: rgba(7, 13, 22, .95);
}

.assistant-question input {
  padding: 9px;
}

.assistant-answer {
  margin: 0 14px 14px;
  padding: 12px;
  border: 1px solid rgba(74, 163, 255, .34);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(46, 211, 183, .1), rgba(74, 163, 255, .08));
  color: #d9edff;
  line-height: 1.5;
  white-space: pre-line;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.assistant-feedback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.assistant-feedback button {
  border: 1px solid rgba(174, 207, 255, .28);
  border-radius: 7px;
  background: rgba(10, 18, 30, .74);
  color: var(--text);
  padding: 7px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.assistant-feedback button:hover {
  border-color: rgba(46, 211, 183, .7);
}

.assistant-teach {
  display: grid;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 12px;
  border-top: 1px solid var(--line);
  border: 1px solid rgba(76, 99, 126, .54);
  border-radius: var(--radius);
  background: rgba(13, 22, 34, .72);
}

.assistant-teach strong {
  color: var(--accent);
}

.assistant-teach input,
.assistant-teach textarea {
  padding: 9px;
}

.assistant-teach textarea {
  min-height: 74px;
  resize: vertical;
}

.assistant-setup {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .62);
  pointer-events: auto;
}

.assistant-setup-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(16, 26, 39, .98);
  box-shadow: var(--shadow);
}

.assistant-setup-card h2 {
  margin: 0 0 8px;
  text-align: center;
}

.assistant-setup-card p {
  margin: 0 0 14px;
  color: var(--muted);
  text-align: center;
}

.assistant-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.assistant-choice button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--text);
  text-align: left;
  background: rgba(10, 18, 28, .74);
}

.assistant-choice button.active {
  border-color: var(--accent);
  background: rgba(46, 211, 183, .12);
}

.assistant-choice span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title p { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.inline-filter {
  width: min(260px, 100%);
  min-width: 220px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(83, 111, 145, .75);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(8, 15, 25, .6);
  font-size: 12px;
  font-weight: 700;
}
.archive-detail-modal {
  width: min(920px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  overflow: auto;
}
.archive-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.archive-json {
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(4, 10, 18, .82);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.inline-edit-row td {
  background: rgba(46, 211, 183, .045);
}
.inline-edit-row.selected td {
  background: linear-gradient(90deg, rgba(46, 211, 183, .10), rgba(73, 169, 252, .055));
  box-shadow: inset 0 1px 0 rgba(46, 211, 183, .16), inset 0 -1px 0 rgba(46, 211, 183, .16);
}
.inline-edit-row.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent), inset 0 1px 0 rgba(46, 211, 183, .16), inset 0 -1px 0 rgba(46, 211, 183, .16);
}
.inline-table-input {
  min-width: 92px;
  padding: 8px 9px;
}
.inline-edit-actions {
  display: grid;
  gap: 10px;
  min-width: 260px;
  max-width: 320px;
}
.inline-edit-actions textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.35;
  border-color: rgba(46, 211, 183, .75);
  background: rgba(4, 10, 18, .88);
}
.inline-edit-actions .button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.inline-edit-actions .btn {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  white-space: nowrap;
}
.inline-correction-panel {
  margin: 14px;
  padding: 16px;
  border: 1px solid rgba(46, 211, 183, .42);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(46, 211, 183, .08), rgba(73, 169, 252, .045)),
    rgba(8, 18, 31, .92);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .26);
  animation: correction-panel-in .18s ease-out both;
}
.inline-correction-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.inline-correction-head span:first-child {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.inline-correction-head h3 {
  margin: 3px 0 0;
  font-size: 18px;
}
.inline-correction-reason {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
}
.inline-correction-reason textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
  border-color: rgba(46, 211, 183, .62);
  background: rgba(3, 10, 18, .86);
}
.inline-correction-actions {
  justify-content: flex-end;
  margin-top: 12px;
}
.inline-correction-actions .btn {
  min-width: 150px;
}
.inspection-alerts.compact {
  padding: 10px 0 0;
}
@keyframes correction-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.inspection-bars {
  display: grid;
  gap: 10px;
}
.inspection-bar {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 14px;
  align-items: center;
}
.inspection-bar strong,
.inspection-bar span {
  display: block;
}
.inspection-bar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.inspection-bar-track {
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(83, 111, 145, .7);
  border-radius: 999px;
  background: rgba(6, 12, 20, .78);
}
.inspection-bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.audit-filter {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
}

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; -webkit-overflow-scrolling: touch; }
.table-wrap::-webkit-scrollbar { height: 10px; }
.table-wrap::-webkit-scrollbar-track { background: rgba(7, 13, 22, .88); }
.table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 13, 22, .88);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(46, 211, 183, .72), rgba(74, 163, 255, .72));
}
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; }
th { color: var(--muted); background: #101927; position: sticky; top: 0; z-index: 1; }
tr:last-child td { border-bottom: 0; }

.turn-history-wrap {
  background: rgba(8, 15, 25, .58);
}

.turn-history-table {
  min-width: 920px;
}

.turn-history-table th {
  color: #bfe0ff;
  font-size: 12px;
  text-transform: uppercase;
}

.turn-history-table td {
  vertical-align: middle;
}

.turn-history-table tbody tr {
  background: rgba(15, 24, 36, .42);
}

.turn-history-table tbody tr:nth-child(even) {
  background: rgba(18, 29, 44, .54);
}

.turn-history-table tbody tr:hover {
  background: rgba(46, 211, 183, .08);
}

.turn-date,
.turn-shift {
  white-space: nowrap;
}

.turn-date {
  color: #d9edff;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.turn-shift {
  color: var(--text);
}

.credit-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.credit-flow-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.credit-flow-note span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(76, 105, 139, .58);
  border-radius: 8px;
  background: rgba(8, 16, 26, .54);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.credit-flow-note strong {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 22px;
  border-radius: 999px;
  color: #061018;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-size: 12px;
}

.credit-ledger-panel {
  overflow: hidden;
  border-color: rgba(86, 125, 166, .62);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
}

.credit-ledger-panel .panel-title {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(96, 132, 171, .24);
}

.credit-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.credit-metric {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(75, 111, 151, .58);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 30, 47, .82), rgba(8, 16, 26, .72));
}

.credit-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.credit-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.credit-table-wrap {
  overflow: auto;
  max-height: 520px;
  border: 1px solid rgba(83, 111, 145, .72);
  border-radius: 8px;
  background: rgba(5, 12, 20, .44);
  -webkit-overflow-scrolling: touch;
}

.credit-ledger-table {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
}

.credit-ledger-table th,
.credit-ledger-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(76, 105, 139, .52);
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
}

.credit-ledger-table th {
  color: #bfe0ff;
  background: linear-gradient(180deg, rgba(18, 33, 51, .98), rgba(12, 24, 38, .98));
  font-weight: 900;
  letter-spacing: 0;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

.credit-ledger-table tbody tr {
  background: rgba(13, 24, 38, .54);
  transition: background .16s ease, box-shadow .16s ease;
}

.credit-ledger-table tbody tr:nth-child(even) {
  background: rgba(17, 30, 47, .68);
}

.credit-ledger-table tbody tr:hover {
  background: rgba(28, 54, 78, .72);
}

.credit-ledger-table tbody tr.needs-review {
  box-shadow: inset 4px 0 0 rgba(247, 201, 72, .78);
}

.credit-ledger-table tbody tr.is-muted {
  opacity: .68;
}

.credit-ledger-table .number-cell,
.credit-ledger-table .money-cell {
  text-align: right;
  white-space: nowrap;
}

.credit-ledger-table .money-cell.strong {
  color: #f4fbff;
  font-weight: 900;
}

.credit-ledger-table .date-cell,
.credit-ledger-table .code-cell {
  white-space: nowrap;
  font-weight: 800;
}

.credit-ledger-table .action-cell {
  min-width: 148px;
}

.credit-ledger-table .button-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.credit-ledger-table .btn.small {
  min-width: 76px;
  justify-content: center;
  padding: 8px 10px;
}

.credit-ledger-table .empty-cell {
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

.cash-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.cash-overview-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(76, 105, 139, .62);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 30, 47, .84), rgba(8, 16, 26, .72));
}

.cash-overview-card.status {
  border-color: rgba(52, 211, 211, .34);
  background: linear-gradient(180deg, rgba(18, 41, 55, .86), rgba(8, 16, 26, .74));
}

.cash-overview-card span,
.cash-overview-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.cash-overview-card strong {
  display: block;
  margin: 7px 0 6px;
  color: var(--text);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cash-form-grid {
  margin-top: 10px;
}

.excel-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.excel-table {
  min-width: 1180px;
  width: 100%;
  border-collapse: collapse;
}

.excel-table th,
.excel-table td {
  border: 1px solid var(--line);
  padding: 8px;
  font-size: 12px;
}

.excel-table input {
  border-radius: 4px;
  padding: 8px;
}

.tank-measure-table {
  min-width: 1420px;
}

.tank-measure-table td:first-child {
  min-width: 220px;
}

.cell-initial { background: rgba(74, 163, 255, .12); }
.cell-final { background: rgba(247, 201, 72, .12); }
.cell-result { background: rgba(61, 220, 151, .12); }
.cell-total { background: rgba(177, 140, 255, .12); }

.pump-price-panel {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr) auto;
  align-items: end;
  gap: 16px;
  background: rgba(16, 26, 39, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 16px;
}

.pump-price-panel h3 {
  margin: 0 0 4px;
}

.pump-price-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.pump-price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
}

.pump-save-actions {
  justify-content: flex-end;
  margin-top: 0;
  white-space: nowrap;
}

.pump-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 16px;
}

.pump-card {
  background: rgba(16, 26, 39, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.pump-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.pump-card-head h3 {
  margin: 0;
  font-size: 18px;
}

.pump-face-grid {
  display: grid;
  gap: 12px;
}

.pump-face {
  background: rgba(10, 18, 28, .72);
  border: 1px solid rgba(76, 99, 126, .7);
  border-radius: var(--radius);
  padding: 12px;
}

.pump-face-title {
  color: var(--accent);
  font-weight: 900;
  margin-bottom: 10px;
}

.pump-product-list {
  display: grid;
  gap: 10px;
}

.pump-product {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(4, minmax(92px, 1fr));
  gap: 8px;
  align-items: end;
  border: 1px solid rgba(76, 99, 126, .55);
  border-radius: var(--radius);
  padding: 10px;
  background: rgba(13, 22, 34, .82);
}

.pump-card:nth-child(3) {
  grid-column: 1 / -1;
  width: min(760px, 100%);
  justify-self: center;
}

.pump-product-name {
  color: var(--text);
  font-weight: 800;
  align-self: center;
}

.pump-product label {
  font-size: 11px;
  gap: 4px;
}

.pump-product input {
  padding: 8px;
  border-radius: 6px;
}

.mini-panel {
  box-shadow: none;
  background: rgba(16, 26, 39, .7);
}

.money-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.names-money-list {
  grid-template-columns: 1fr;
}

.name-delivery-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, .45fr) minmax(220px, 1.4fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(76, 99, 126, .55);
  border-radius: var(--radius);
  background: rgba(10, 18, 28, .64);
}

.name-delivery-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #8dccff;
  background: rgba(74, 163, 255, .14);
  white-space: nowrap;
}
.badge.ok { color: var(--ok); background: rgba(61, 220, 151, .14); }
.badge.warn { color: var(--warn); background: rgba(247, 201, 72, .16); }
.badge.danger { color: var(--danger); background: rgba(255, 99, 112, .14); }
.badge.pending { color: #9dccff; background: rgba(74, 163, 255, .14); }
.badge.corrected { color: #5eead4; background: rgba(45, 212, 191, .15); }
.badge.closed { color: #c4b5fd; background: rgba(167, 139, 250, .16); }

select.review-select-pending { border-color: #4aa3ff; box-shadow: inset 4px 0 0 rgba(74, 163, 255, .85); }
select.review-select-ok { border-color: var(--ok); box-shadow: inset 4px 0 0 rgba(61, 220, 151, .85); }
select.review-select-corrected { border-color: #2dd4bf; box-shadow: inset 4px 0 0 rgba(45, 212, 191, .9); }
select.review-select-observed { border-color: var(--warn); box-shadow: inset 4px 0 0 rgba(247, 201, 72, .9); }
select.review-select-closed { border-color: #a78bfa; box-shadow: inset 4px 0 0 rgba(167, 139, 250, .85); }

.tank-grid { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 16px; }
.tank { background: var(--panel-3); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tank h3 { min-height: 40px; margin: 0 0 10px; font-size: 15px; }
.tank-shell { height: 180px; border: 2px solid #40536a; border-radius: var(--radius); position: relative; overflow: hidden; background: #090f18; }
.tank-fill { position: absolute; left: 0; right: 0; bottom: 0; min-height: 3%; transition: height .2s ease; }
.tank-lines { position: absolute; inset: 0; background: repeating-linear-gradient(to top, transparent 0 34px, rgba(255,255,255,.08) 35px); }
.tank-meta { display: grid; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12px; }

.notice { border: 1px solid var(--line); border-left: 4px solid var(--accent); padding: 12px; border-radius: var(--radius); background: var(--panel-3); color: var(--muted); }
.notice strong { display: block; color: var(--text); margin-bottom: 4px; }
.help-box { margin-top: 14px; }
.notice.danger { border-left-color: var(--danger); }
.notice.warn { border-left-color: var(--warn); }
.notice.ok { border-left-color: var(--ok); }
.password-reset-form { margin-top: 14px; }
.profile-panel {
  display: grid;
  gap: 16px;
}
.profile-summary .card strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.password-change-card {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.password-request-panel {
  border-color: rgba(247, 201, 72, .45);
}
.temporary-password-box,
.temporary-inline {
  display: inline-block;
  color: #061018;
  background: linear-gradient(135deg, var(--warn), var(--accent));
  border-radius: var(--radius);
  padding: 10px 12px;
  font-weight: 900;
  letter-spacing: .03em;
  overflow-wrap: anywhere;
}
.temporary-password-box {
  display: block;
  margin: 12px 0;
  font-size: 20px;
  text-align: center;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button.active { background: var(--accent); color: #061018; }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .58);
  z-index: 20;
}
.modal-card { width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; padding: 18px; }

.inspection-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-3);
  margin-top: 10px;
  overflow: hidden;
}

.turn-review-shell {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.turn-review-intro {
  border-color: rgba(52, 211, 211, .28);
  background: linear-gradient(180deg, rgba(16, 30, 47, .88), rgba(8, 16, 26, .74));
}

.turn-day-section {
  display: grid;
  gap: 12px;
}

.turn-day-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(76, 105, 139, .56);
  border-radius: 8px;
  background: rgba(8, 16, 26, .62);
}

.turn-day-heading span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.turn-day-heading strong {
  color: var(--text);
  font-size: 17px;
}

.turn-review-block {
  margin-top: 0;
  border-color: rgba(86, 125, 166, .64);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .16);
}

.turn-review-block > .panel-title {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(96, 132, 171, .24);
}

.inspection-technical-view {
  margin-top: 16px;
  border: 1px solid rgba(76, 105, 139, .58);
  border-radius: var(--radius);
  background: rgba(8, 16, 26, .42);
  overflow: hidden;
}

.inspection-technical-view > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: var(--text);
}

.inspection-technical-view > summary span {
  display: grid;
  gap: 3px;
}

.inspection-technical-view > summary small {
  color: var(--muted);
  font-size: 12px;
}

.inspection-technical-body {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(76, 105, 139, .42);
}

.inspection-technical-body > .panel:first-child {
  margin-top: 14px !important;
}

.inspection-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  padding: 12px 14px;
  background: rgba(15, 23, 42, .42);
  color: var(--text);
}
.inspection-accordion summary:hover {
  background: rgba(20, 184, 166, .06);
}
.inspection-accordion summary span:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.inspection-accordion .table-wrap {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
.inspection-accordion table {
  min-width: 980px;
}

.inspection-accordion th,
.inspection-accordion td {
  vertical-align: middle;
}

.inspection-accordion td:nth-child(6),
.inspection-accordion td:nth-child(7),
.inspection-accordion td:nth-child(8),
.inspection-accordion td:nth-child(9),
.inspection-accordion td:nth-child(10) {
  white-space: nowrap;
}

.inspection-accordion .review-cell {
  min-width: 270px;
  max-width: 430px;
}

.inspection-accordion .review-cell .badge {
  margin-bottom: 5px;
}

.inspection-accordion .review-cell .text-warn {
  display: block;
  max-width: 390px;
  line-height: 1.35;
}

.inspection-alerts {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
}

.inspection-alerts .notice {
  padding: 10px 12px;
}
.inspection-correction-panel {
  max-width: none;
}
.inspection-correction-context {
  display: grid;
  gap: 10px;
}
.inspection-context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.inspection-context-grid > div,
.security-target {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  padding: 12px;
}
.inspection-context-grid span,
.security-target span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.inspection-context-grid strong,
.security-target strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}
.security-modal-card {
  width: min(720px, 100%);
}
.regularization-completion-card {
  width: min(1180px, calc(100vw - 40px));
}
.regularization-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 14px;
  background: rgba(15, 23, 42, 0.48);
}
.regularization-pump-table {
  overflow-x: auto;
}
.regularization-pump-table input {
  min-width: 104px;
}
.regularization-mini-form,
.regularization-compact-table {
  margin-top: 10px;
}
.credit-edit-modal-card {
  width: min(860px, 100%);
}
.credit-edit-modal-card textarea {
  min-height: 96px;
}
.security-target {
  margin: 12px 0;
}
.security-target small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.inactivity-card .actions {
  justify-content: flex-end;
}
.toast-notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(16, 29, 45, .96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
  color: var(--text);
  padding: 14px 16px;
}
.text-warn { color: var(--warn); }

@media (max-width: 1180px) {
  .cards, .tank-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-tanks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .management-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pump-price-panel { grid-template-columns: 1fr; }
  .pump-card-grid { grid-template-columns: 1fr; }
  .pump-card:nth-child(3) { width: 100%; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inspection-context-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  body { overflow-x: hidden; }
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100svh;
    padding: 16px;
  }
  .login-card, .site-selector { width: min(100%, 480px); padding: 20px; }
  .login-card h1 { font-size: 26px; }
  .app-layout,
  .app-layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }
  .app-layout.sidebar-collapsed .sidebar {
    padding: 18px;
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 35;
    width: min(310px, 84vw);
    height: 100svh;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 60px rgba(0, 0, 0, .45);
  }
  .app-layout.mobile-sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 34;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  .app-layout.mobile-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .nav { grid-template-columns: 1fr; }
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .main { padding: 16px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; justify-content: flex-start; }
  .title-row { width: 100%; align-items: flex-start; }
  .title-row h1 { font-size: 22px; }
  .cards, .two, .three, .tank-grid, .form-grid { grid-template-columns: 1fr; }
  .grid,
  .panel,
  .card,
  .table-wrap {
    min-width: 0;
  }
  .panel {
    overflow: hidden;
  }
  .dashboard-tanks { grid-template-columns: 1fr; }
  .card { min-height: 92px; }
  .card strong { font-size: 22px; }
  .panel, .card { padding: 14px; }
  .panel-title {
    flex-direction: column;
    align-items: stretch;
  }
  .panel-title .toolbar {
    justify-content: flex-start;
  }
  .movement-item { grid-template-columns: 1fr; }
  .movement-side { justify-items: start; text-align: left; }
  .performance-bar { grid-template-columns: 1fr; }
  .performance-bar strong { text-align: left; }
  .pump-price-grid { grid-template-columns: 1fr; }
  .pump-product { grid-template-columns: 1fr 1fr; }
  .pump-product-name { grid-column: 1 / -1; }
  .management-panel, .money-list, .name-delivery-row { grid-template-columns: 1fr; }
  .archive-detail-grid { grid-template-columns: 1fr; }
  .inspection-bar { grid-template-columns: 1fr; }
  .actions,
  .toolbar,
  .button-row {
    gap: 8px;
  }
  .btn {
    min-height: 42px;
    padding: 10px 12px;
  }
  .btn.small,
  .icon-button,
  .password-toggle {
    min-height: 38px;
  }
  .table-wrap {
    margin-inline: -2px;
    scrollbar-width: thin;
  }
  table {
    min-width: max-content;
  }
  .turn-history-table { min-width: 780px; }
  th, td {
    padding: 10px;
    font-size: 12px;
  }
  .modal {
    align-items: stretch;
    padding: 10px;
  }
  .modal-card,
  .security-modal-card,
  .inspection-correction-panel {
    width: 100%;
    max-height: calc(100svh - 20px);
    overflow-y: auto;
  }
  .turn-day-heading,
  .inspection-technical-view > summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .inspection-accordion summary { align-items: flex-start; flex-direction: column; }
  .inspection-context-grid { grid-template-columns: 1fr; }
  .inline-correction-panel { margin: 10px; padding: 13px; }
  .inline-correction-head { flex-direction: column; }
  .inline-correction-actions { display: grid; grid-template-columns: 1fr; }
  .inline-correction-actions .btn { width: 100%; }
  .credit-dashboard-grid { grid-template-columns: 1fr; }
  .credit-flow-note,
  .cash-overview-grid {
    grid-template-columns: 1fr;
  }
  .cash-overview-card strong {
    font-size: 21px;
  }
  .credit-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credit-table-wrap { max-height: 460px; }
  .user-pill { width: 100%; }
  .assistant-widget { right: 12px; bottom: 12px; }
  .assistant-panel {
    width: min(340px, calc(100vw - 24px));
    max-height: min(620px, calc(100svh - 84px));
  }
  .assistant-coach { right: 0; bottom: 58px; width: min(300px, calc(100vw - 24px)); }
  .assistant-coach::after { right: 16px; bottom: -8px; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 8px solid rgba(16, 26, 39, .98); border-bottom: 0; }
  .assistant-choice, .assistant-question, .assistant-nickname, .assistant-settings { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .main { padding: 12px; }
  .panel { padding: 12px; }
  .topbar { gap: 12px; }
  .toolbar > .btn,
  .actions > .btn {
    flex: 1 1 140px;
  }
  .site-grid { grid-template-columns: 1fr; }
  .login-options { align-items: flex-start; flex-direction: column; }
  .report-summary { align-items: stretch; flex-direction: column; }
  .report-summary strong,
  .report-summary span { width: 100%; }
  .credit-metric-strip { grid-template-columns: 1fr; }
  .credit-ledger-table { min-width: 780px; }
  .turn-history-table { min-width: 760px; }
  .table-wrap {
    border-radius: 8px;
  }
  th, td {
    padding: 9px 10px;
  }
  .pump-product { grid-template-columns: 1fr; }
  .assistant-widget {
    right: 10px;
    bottom: 10px;
  }
  .assistant-panel {
    right: 0;
    bottom: 58px;
    width: calc(100vw - 20px);
    max-height: calc(100svh - 78px);
  }
  .assistant-head {
    align-items: center;
    flex-wrap: wrap;
  }
  .assistant-head select {
    width: 100%;
    margin-left: 0;
  }
}

@media (min-width: 1500px) {
  .main {
    max-width: 1680px;
    width: 100%;
    margin: 0 auto;
  }
  .cards {
    grid-template-columns: repeat(4, minmax(210px, 1fr));
  }
}
