/* WINCON Cloud — stylesheet */

:root {
  --brand: #E10431;
  --brand-dark: #B9032A;
  --brand-soft: rgba(225, 4, 49, 0.08);
  --dark: #243342;
  --dark-2: #2D3E50;
  --ink: #1f2937;
  --muted: #6b7280;
  --bg: #F9F9F9;
  --surface: #ffffff;
  --line: #e2e8f0;
  --line-soft: #eef2f6;

  --ok: #0b6b57;
  --ok-bg: #eefbf6;
  --ok-line: #cdece1;
  --warn: #a16207;
  --warn-bg: #fef9ea;
  --warn-line: #f3e2b8;
  --danger: #b3261e;
  --danger-bg: #fdf1f0;
  --danger-line: #f2d0cc;

  --radius: 3px;
  --radius-sm: 2px;
  --topbar-h: 56px;
  --sidebar-w: 260px;
  --sidebar-collapsed-w: 68px;
  --font: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04);

  /* Spacing tokens */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
}

/* ---------------------------------------------------------- reset / base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

body.sidebar-collapsed {
  --sidebar-w: var(--sidebar-collapsed-w);
}

@supports not (overflow: clip) {
  body {
    overflow-x: hidden;
  }
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0;
}

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

a:hover {
  text-decoration: underline;
}

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

svg {
  display: block;
  flex: 0 0 auto;
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

::selection {
  background: rgba(225, 4, 49, 0.15);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d3dbe4;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #b9c4d0;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------------------------------------- utilities */

.muted {
  color: var(--muted);
}

.num {
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted);
  line-height: 1.4;
}

.divider {
  height: 1px;
  background: var(--line-soft);
  border: 0;
  margin: 14px 0;
}

/* ---------------------------------------------------------------- login */

.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  padding: 34px 32px 26px;
}

.login-logo {
  display: block;
  height: 32px;
  width: auto;
  margin: 0 0 24px;
}

.login-card h1 {
  font-size: 19px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--dark);
  margin: 0 0 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.45;
}

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

.login-card label {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.login-card input {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  margin: 0 0 16px;
  border: 1px solid #d5dce5;
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.login-card input::placeholder {
  color: #9aa4b2;
}

.login-card input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.login-card .btn {
  width: 100%;
  height: 40px;
  margin-top: 14px;
}

.login-foot {
  margin: 22px 0 0;
  padding-top: 15px;
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
}

/* ---------------------------------------------------------------- shell */

.app-shell {
  display: flex;
  min-height: 100dvh;
  width: 100%;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------------- sidebar */

.app-sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid var(--line);
  overflow: visible;
  z-index: 110;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-collapse-btn {
  position: absolute;
  right: -12px;
  top: 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s ease;
  padding: 0;
}

.sidebar-collapse-btn:hover {
  background: #f8fafc;
  color: var(--dark-2);
  border-color: var(--brand);
  transform: scale(1.1);
}

.sidebar-collapse-btn .collapse-icon {
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--line);
  position: relative;
  flex: 0 0 auto;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

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

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  height: 34px;
  width: auto;
  max-width: 195px;
  display: block;
  transition: all 0.25s ease;
}

.brand-monogram {
  display: none;
}

.app-title {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0;
  color: var(--dark-2);
  letter-spacing: -0.01em;
}

.sidebar-station {
  margin-top: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  min-width: 0;
}

.sidebar-station label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
}

.sidebar-station .station-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-2);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-station .station-site {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cost {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 10px 10px 0;
  padding: 8px 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dark-2);
  text-decoration: none;
  min-width: 0;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.sidebar-cost.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.sidebar-cost:hover {
  color: var(--dark-2);
  text-decoration: none;
  background: #f1f5f9;
}

.sidebar-cost-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sidebar-cost strong {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-cost-meta {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-title {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 8px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: #4b5563;
  text-decoration: none;
  border-radius: var(--radius);
  border-left: 3px solid transparent;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: #f1f5f9;
  color: var(--dark-2);
  text-decoration: none;
}

.nav-item.active {
  background: rgba(225, 4, 49, 0.06);
  color: var(--brand);
  border-left-color: var(--brand);
  font-weight: 700;
}

.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-icon {
  flex-shrink: 0;
  color: #64748b;
  transition: all 0.15s ease;
}

.nav-item:hover .nav-icon {
  color: var(--dark-2);
}

.nav-item.active .nav-icon {
  color: var(--brand);
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  background: #fafafa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-footer .btn {
  width: 100%;
  justify-content: center;
}

.user-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.user-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef2f7;
  border: 1px solid var(--line);
  color: var(--dark);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-meta > span:not(.user-avatar) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.user-meta strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta small {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar minimizat, conform POC */
@media (min-width: 901px) {
.app-sidebar.collapsed {
  width: 68px;
}

.app-sidebar.collapsed .sidebar-collapse-btn .collapse-icon {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .sidebar-header {
  padding: 18px 8px 14px;
  align-items: center;
  display: flex;
  flex-direction: column;
}

.app-sidebar.collapsed .brand-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  padding: 4px 0;
}

.app-sidebar.collapsed .brand {
  justify-content: center;
}

.app-sidebar.collapsed .brand-logo {
  display: none !important;
}

.app-sidebar.collapsed .brand-monogram {
  display: block !important;
  width: 42px;
  height: 26px;
  margin: 0 auto;
  filter: drop-shadow(0 1px 3px rgba(225, 4, 49, 0.25));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.app-sidebar.collapsed .brand-monogram:hover {
  transform: scale(1.1);
}

.app-sidebar.collapsed .app-title,
.app-sidebar.collapsed .sidebar-station,
.app-sidebar.collapsed .sidebar-cost,
.app-sidebar.collapsed .nav-title,
.app-sidebar.collapsed .nav-label,
.app-sidebar.collapsed .sidebar-footer .btn {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-nav {
  padding: 14px 6px;
  align-items: center;
  gap: 6px;
}

.app-sidebar.collapsed .nav-group {
  align-items: center;
  gap: 6px;
}

.app-sidebar.collapsed .nav-item {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-left: none;
  border-radius: var(--radius);
  position: relative;
}

.app-sidebar.collapsed .nav-item.active {
  background: var(--brand);
  color: #ffffff;
}

.app-sidebar.collapsed .nav-item.active .nav-icon {
  color: #ffffff;
  stroke: #ffffff;
}

.app-sidebar.collapsed .sidebar-footer {
  padding: 14px 6px;
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.app-sidebar.collapsed .user-meta {
  justify-content: center;
}

.app-sidebar.collapsed .user-meta > span:not(.user-avatar) {
  display: none;
}
}

/* Tooltip sidebar minimizat, conform POC */
.erp-tooltip {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  background: #111827;
  color: #ffffff;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 280px;
  width: max-content;
  font-family: var(--font);
  opacity: 0;
  transform: translateY(-50%) translateX(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.erp-tooltip.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.erp-tooltip .tooltip-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
}

.erp-tooltip .tooltip-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.35;
  font-weight: 400;
}

/* -------------------------------------------------------- topbar / main */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-h);
  padding: 0 clamp(16px, 2.2vw, 30px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid var(--line);
}

.mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--dark);
}

.mobile-menu:hover {
  background: #f4f6f9;
}

.breadcrumb {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-picker > span {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.site-picker select {
  height: 32px;
  max-width: 220px;
  padding: 0 26px 0 9px;
  border: 1px solid #d5dce5;
  border-radius: var(--radius);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--ink);
  font-size: 12.5px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.site-picker select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 22px clamp(16px, 2.2vw, 30px) 40px;
}

#view-day {
  padding-bottom: 92px;
}

.view-section {
  min-width: 0;
}

/* ---------------------------------------------------------- page header */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.page-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.page-kicker {
  display: block;
  margin: 0 0 4px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-title {
  margin: 0;
  font-size: clamp(20px, 2.1vw, 25px);
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--dark);
}

.title-brand,
.page-title > span {
  color: var(--brand);
  font-weight: 700;
}

.page-sub {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--dark);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.btn:active {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(1px);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08) inset;
}

.btn:focus-visible {
  outline: none;
  border-color: var(--dark);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(36, 51, 66, 0.25);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--brand);
  border: 1px solid #c4032a;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(225, 4, 49, 0.25), 0 1px 1px rgba(0, 0, 0, 0.06);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: #9e0224;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(225, 4, 49, 0.32);
}

.btn-primary:active {
  background: #9e0224;
  border-color: #83011c;
  color: #ffffff;
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18) inset;
}

.btn-primary:focus-visible {
  outline: none;
  border-color: #83011c;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(225, 4, 49, 0.35);
}

.btn-ghost {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: var(--dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: var(--brand);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.btn-ghost:active {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--brand);
  transform: translateY(1px);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.08) inset;
}

.btn-ghost:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(225, 4, 49, 0.25);
}

.btn-secondary {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: var(--dark);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}

.btn-secondary:active {
  background: #e2e8f0;
  border-color: #94a3b8;
  transform: translateY(1px);
}

.btn-danger {
  background: #ffffff;
  border: 1px solid #fca5a5;
  color: var(--danger);
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.06);
}

.btn-danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12);
}

.btn-danger:active {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
  transform: translateY(1px);
  box-shadow: 0 1px 1px rgba(220, 38, 38, 0.1) inset;
}

.btn-danger:focus-visible {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(220, 38, 38, 0.25);
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 11.5px;
  gap: 5px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
}

.btn-lg {
  height: 40px;
  padding: 0 18px;
  font-size: 13.5px;
}

.btn-block {
  width: 100%;
}

/* ----------------------------------------------------------------- card */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  min-width: 0;
}

.view-section > .card + .card,
.view-section > .card + .grid,
.view-section > .grid + .card {
  margin-top: 16px;
}

.history-source {
  margin: 2px 0 16px;
  font-size: 12px;
  color: var(--muted);
}

.history-kpis {
  margin-bottom: 16px;
}

.history-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}

.history-legend-internal,
.history-legend-external {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
}

.history-legend-internal { background: var(--brand); }
.history-legend-external { background: var(--dark); margin-left: 8px; }

.history-gantt-wrap {
  overflow-x: auto;
}

table.history-gantt {
  min-width: 1120px;
  border-collapse: separate;
  border-spacing: 0;
}

table.history-gantt th,
table.history-gantt td {
  padding: 5px 4px;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

table.history-gantt .hist-client {
  position: sticky;
  left: 0;
  z-index: 2;
  width: 210px;
  min-width: 210px;
  max-width: 210px;
  padding-left: 8px !important;
  background: var(--surface);
  border-right: 1px solid var(--line);
  text-align: left;
  white-space: normal;
}

table.history-gantt thead .hist-client,
table.history-gantt tfoot .hist-client {
  background: #f8fafc;
  z-index: 3;
}

table.history-gantt .hist-total {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 92px;
  min-width: 92px;
  padding-right: 10px !important;
  background: var(--surface);
  border-left: 1px solid var(--line);
  text-align: right;
}

table.history-gantt thead .hist-total,
table.history-gantt tfoot .hist-total {
  background: #f8fafc;
  z-index: 3;
}

table.history-gantt .hist-client strong {
  display: inline;
  font-size: 12px;
}

table.history-gantt .hist-client small,
table.history-gantt .hist-total small {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.hist-pill {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: 1px;
}

.hist-pill.internal {
  background: var(--brand-soft);
  color: var(--brand);
}

.hist-pill.external {
  background: #f1f5f9;
  color: #475569;
}

table.history-gantt th.hist-year {
  padding: 5px 6px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

table.history-gantt th.hist-month {
  width: 57px;
  min-width: 57px;
  padding: 4px 1px;
  background: #f8fafc;
  text-align: center;
  font-size: 10px;
  color: var(--dark);
}

table.history-gantt th.hist-month span,
table.history-gantt th.hist-month small {
  display: block;
  white-space: nowrap;
}

table.history-gantt th.hist-month small {
  margin-top: 1px;
  font-size: 9px;
  color: var(--muted);
}

table.history-gantt th.hist-month.is-peak {
  color: var(--brand);
}

.hist-cell {
  width: 57px;
  min-width: 57px;
  padding: 4px 1px !important;
  text-align: center;
}

.hist-empty {
  display: block;
  height: 1px;
  width: 100%;
  background: #e2e8f0;
}

.hist-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 3px;
  overflow: hidden;
  border-radius: 2px;
  color: #fff;
  cursor: default;
}

.hist-bar.internal { background: var(--brand); }
.hist-bar.external { background: var(--dark); }

.hist-bar span {
  position: relative;
  z-index: 1;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.hist-bar i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.65);
}

table.history-gantt tr.hist-sum td {
  background: #f8fafc;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hist-sum-cell {
  position: relative;
  padding: 4px 1px !important;
  text-align: center;
}

.hist-sum-cell span {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--dark);
}

.hist-sum-cell i {
  display: block;
  height: 2px;
  margin: 2px auto 0;
  background: var(--brand);
}

.hist-sum-cell small {
  display: block;
  margin-top: 1px;
  font-size: 7.5px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.3px;
}

@media (max-width: 768px) {
  .history-legend {
    display: none;
  }
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--dark);
}

.card-title::before {
  content: "";
  width: 3px;
  height: 13px;
  border-radius: 1px;
  background: var(--brand);
  flex: 0 0 auto;
}

.card-title + * {
  margin-top: 0;
}

.form-drawer {
  margin-top: 12px;
}

.form-drawer > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--dark);
}

.form-drawer > summary::-webkit-details-marker {
  display: none;
}

.form-drawer > summary::before {
  content: "+";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.form-drawer[open] > summary::before {
  content: "−";
}

.form-drawer[open] > summary {
  margin-bottom: 12px;
}

.form-drawer > form {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.card > .table-wrap:last-child,
.card > .grid:last-child,
.card > .form-grid:last-child {
  margin-bottom: 0;
}

/* ----------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  min-width: 0;
}

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

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

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  min-width: 0;
}

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

.form-grid > .field:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.form-grid + .field {
  margin-top: 14px;
}

.card form > .btn {
  margin-top: 14px;
}

.table-wrap + .row-actions,
.table-wrap + .btn,
.table-wrap + button,
.table-wrap + .step-actions,
.table-wrap + .form-actions {
  margin-top: 14px;
}

.form-grid + .btn,
.form-grid + button,
.form-grid + .row-actions,
.form-grid + .form-actions {
  margin-top: 14px;
}

.import-preview > .btn,
.import-preview > button,
.import-preview .row-actions {
  margin-top: 14px;
}

#inventoryList + .row-actions,
#inventoryList + .btn,
#inventoryList + button,
.card > .row-actions {
  margin-top: 16px;
}

/* --------------------------------------------------------------- fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > label,
.field > .label,
label.field {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.4;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.admin-date {
  flex: 0 0 auto;
  width: 170px;
  max-width: 100%;
}

.admin-date .input {
  height: 36px;
}

.input,
.select,
.textarea,
textarea.input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d5dce5;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-transform: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.input::placeholder,
.textarea::placeholder,
textarea.input::placeholder {
  color: #9aa4b2;
}

.input:hover,
.select:hover,
.textarea:hover,
textarea.input:hover {
  border-color: #c3ccd7;
}

.input:focus,
.select:focus,
.textarea:focus,
textarea.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.input:disabled,
.select:disabled,
.textarea:disabled,
textarea.input:disabled {
  background: #f3f5f8;
  color: var(--muted);
  cursor: not-allowed;
}

.textarea,
textarea.input {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
  resize: vertical;
}

.select {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select[multiple] {
  height: auto;
  min-height: 96px;
  padding: 6px 10px;
  background-image: none;
  cursor: default;
}

input[type="date"].input,
.input.input-date {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  cursor: pointer;
}

.check input {
  margin: 0;
}

.form-error {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--danger);
}

.form-error:empty {
  display: none;
}

/* --------------------------------------------------------------- tables */

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.data-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 12.5px;
  color: var(--ink);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.data-table th.num,
.data-table td.num,
.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  min-width: 0;
}

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

.data-table tbody tr:hover {
  background: #fbfcfd;
}

.data-table td.actions,
.data-table th.actions {
  text-align: right;
  white-space: nowrap;
}

.data-table td.row-actions {
  display: table-cell;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}

.data-table td.row-actions .btn {
  margin-left: 4px;
}

.data-table .btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.data-table strong {
  font-weight: 600;
  color: var(--dark);
}

.data-table .muted {
  color: var(--muted);
}

.data-table .input,
.data-table .select {
  height: 30px;
  padding: 0 7px;
  border-color: var(--line-soft);
  background-color: var(--surface);
  font-size: 12px;
}

.data-table .select {
  padding-right: 22px;
  background-position: right 5px center;
}

.data-table .input:focus,
.data-table .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.data-table input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.data-table td.empty {
  padding: 18px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ------------------------------------------------------- flags / status */

.flag,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f4f6f9;
  color: var(--dark-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}

.flag::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}

.flag.ok,
.badge.ok {
  background: var(--ok-bg);
  border-color: var(--ok-line);
  color: var(--ok);
}

.flag.warn,
.badge.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn);
}

.flag.danger,
.badge.danger {
  background: var(--danger-bg);
  border-color: var(--danger-line);
  color: var(--danger);
}

.day-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.day-status .flag {
  flex: 0 0 auto;
}

.day-status > span:last-child {
  min-width: 0;
}

.badge {
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 10px;
}

.badge.outline {
  background: transparent;
}

.badge.brand {
  background: var(--brand-soft);
  border-color: rgba(225, 4, 49, 0.22);
  color: var(--brand);
}

/* -------------------------------------------------------------- day view */

.day-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.day-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.day-card.span-2 {
  grid-column: 1 / -1;
}

#dayProdCard .data-table {
  min-width: 760px;
}

.prod-totals {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.prod-totals-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 10px;
}

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

.prod-totals-grid h3 {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

#dayProdCard .prod-totals .data-table {
  min-width: 0;
}

.missing-recipes {
  margin-top: 14px;
}

.missing-recipes .form-error {
  margin-bottom: 6px;
}

#dayProdCard .missing-recipes .data-table {
  min-width: 0;
}

@media (max-width: 900px) {
  .prod-totals-grid {
    grid-template-columns: 1fr;
  }
}

.day-card > .btn {
  align-self: flex-start;
  margin-top: 12px;
}

.step-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: -16px -16px 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fcfdfe;
  border-radius: var(--radius) var(--radius) 0 0;
}

.step-num {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.step-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.step-copy strong,
.step-copy h2,
.step-copy h3 {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  color: var(--dark);
}

.step-copy span,
.step-copy small {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

.step-copy p,
.step-copy .muted {
  margin: 1px 0 0;
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.4;
  text-transform: none;
  color: var(--muted);
}

.step-copy .card-title {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  color: var(--dark);
}

.step-copy .card-title::before {
  display: none;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.day-toolbar,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 16px;
}

.page-header .day-toolbar,
.page-header .toolbar {
  margin: 0;
  justify-content: flex-end;
}

.day-meter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  min-width: 0;
}

.day-import {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.day-import:last-child {
  margin-bottom: 0;
}

.day-num {
  width: 72px;
  max-width: 100%;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .day-num {
  width: 64px;
}

.data-table .day-time {
  width: 96px;
  font-variant-numeric: tabular-nums;
}

.day-driver {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.step-head .btn {
  align-self: center;
  margin-left: auto;
}

.day-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfcfd;
  font-size: 12.5px;
  color: var(--ink);
  min-width: 0;
}

.summary > * {
  margin: 0;
}

.summary strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--dark);
  font-variant-numeric: tabular-nums;
}

.summary .summary-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 74px;
}

.summary .summary-item span,
.summary .summary-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.row-actions .btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.delivery-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  padding: 8px 10px 0;
  font-size: 12px;
  color: var(--muted);
}

.totals strong {
  color: var(--dark);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- save bar */

.save-bar {
  position: fixed;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 11px clamp(16px, 2.2vw, 30px);
  background: var(--dark);
  border-top: 1px solid #33475a;
  transition: left 0.18s ease;
}

.save-message {
  min-width: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.78);
}

.save-bar .summary {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}

.save-bar .summary strong {
  color: #fff;
}

.save-message.ok {
  color: #8fe3c6;
}

.save-message.warn {
  color: #f3d391;
}

.save-message.danger,
.save-message.error {
  color: #f4a9a3;
}

.save-bar .btn-primary {
  min-width: 140px;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.save-bar .btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.save-bar .btn-ghost {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.save-bar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.save-bar .btn:not(.btn-primary):not(.btn-ghost) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* ------------------------------------------------------- cost notes */

.cost-notes {
  margin: 12px 0;
}

.cost-formula {
  margin: 8px 0;
  padding: 8px 10px;
  background: #f8fafc;
  border-left: 2px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  color: var(--dark-2);
  overflow-x: auto;
}

.cost-note-table {
  min-width: 620px;
}

.cost-note-table .total-row td {
  background: #f8fafc;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------- metrics / site cards */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  min-width: 0;
}

.overview-totals {
  margin-bottom: 14px;
}

.site-missing {
  margin: 0 0 10px;
  padding: 6px 8px;
  background: #fff7ed;
  border-left: 2px solid #f59e0b;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  color: #9a3412;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric > span,
.metric-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric strong,
.metric .metric-value {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--dark);
  font-variant-numeric: tabular-nums;
}

.metric small {
  font-size: 11px;
  color: var(--muted);
}

.metric.is-brand strong {
  color: var(--brand);
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

button.site-card {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

.site-card:hover {
  border-color: #cfd8e3;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  text-decoration: none;
}

.site-card.active,
.site-card[aria-current="true"] {
  border-color: rgba(225, 4, 49, 0.35);
  box-shadow: inset 0 0 0 1px rgba(225, 4, 49, 0.18);
}

.site-card h2,
.site-card h3,
.site-card strong {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--dark);
  letter-spacing: -0.005em;
}

.site-card p,
.site-card .muted {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.site-card .metric-grid {
  margin: 10px 0;
}

.site-card > .btn {
  align-self: flex-start;
  margin-top: auto;
}

.site-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
}

/* ---------------------------------------------------------------- empty */

.empty {
  padding: 26px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.empty strong {
  display: block;
  margin-bottom: 2px;
  color: var(--dark);
  font-size: 13px;
  font-weight: 600;
}

.empty p {
  margin: 0;
  color: var(--muted);
}

.empty .btn {
  margin-top: 12px;
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 18px;
  z-index: 200;
  max-width: min(380px, calc(100vw - 36px));
  padding: 10px 14px;
  background: var(--dark);
  border-left: 3px solid #34d399;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.2);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.45;
}

.toast[data-type="warn"] {
  border-left-color: #f0b429;
}

.toast[data-type="error"],
.toast[data-type="danger"] {
  border-left-color: var(--brand);
}

/* --------------------------------------------------------- interactions */

.save-bar .btn {
  flex: 0 0 auto;
}

.card .table-wrap + .card-title {
  margin-top: 16px;
}

.data-table .row-actions {
  flex-wrap: nowrap;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1000px) {
  .day-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 1024px) {
  .topbar {
    gap: 10px;
  }

  .card {
    padding: 14px 15px;
  }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 260px;
    flex-basis: 260px;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    border-right: 1px solid var(--line);
    box-shadow: none;
    z-index: 120;
  }

  body.sidebar-open .app-sidebar {
    transform: translateX(0);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  }

  body.sidebar-open .topbar {
    z-index: 130;
  }

  .app-main {
    display: flex;
    width: 100%;
  }

  .mobile-menu {
    display: inline-flex;
  }

  .sidebar-collapse-btn {
    display: none;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 18px 16px 32px;
  }

  #view-day {
    padding-bottom: 88px;
  }

  .save-bar {
    left: 0;
  }

  .toast {
    top: calc(var(--topbar-h) + 10px);
    right: 12px;
  }

  .site-picker select {
    max-width: 170px;
  }
}

@media (max-width: 768px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .page-title {
    font-size: 20px;
  }

  .form-grid,
  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .day-card {
    padding: 14px;
  }

  .step-head {
    margin: -14px -14px 12px;
    padding: 11px 14px;
  }

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

  .metric strong,
  .metric .metric-value {
    font-size: 19px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .site-picker > span {
    display: none;
  }

  .site-picker select {
    max-width: 150px;
  }

  .data-table th,
  .data-table td {
    padding-left: 8px;
    padding-right: 8px;
  }
}

@media (max-width: 600px) {
  #view-day {
    padding-bottom: 118px;
  }

  .save-bar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  .save-bar .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .save-message {
    order: -1;
    font-size: 11.5px;
  }

  .page-header-actions {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .login-view {
    padding: 16px 12px;
  }

  .login-card {
    padding: 26px 20px 22px;
  }

  .login-logo {
    height: 28px;
    margin-bottom: 20px;
  }

  .login-card h1 {
    font-size: 17px;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .breadcrumb {
    font-size: 12px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .site-picker select {
    max-width: 128px;
    height: 30px;
    font-size: 12px;
  }

  .content {
    padding: 14px 12px 28px;
  }

  #view-day {
    padding-bottom: 124px;
  }

  .page-title {
    font-size: 18px;
  }

  .page-sub {
    font-size: 12.5px;
  }

  .card {
    padding: 13px;
  }

  .day-card {
    padding: 13px;
  }

  .step-head {
    margin: -13px -13px 11px;
    padding: 10px 13px;
  }

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

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

  .metric {
    padding: 10px 11px;
  }

  .metric strong,
  .metric .metric-value {
    font-size: 17px;
  }

  .data-table {
    font-size: 11.5px;
  }

  .data-table th {
    font-size: 10px;
  }

  .data-table .input,
  .data-table .select {
    font-size: 11.5px;
  }

  .toast {
    left: 12px;
    right: 12px;
    max-width: none;
  }

  .table-wrap {
    border-radius: var(--radius-sm);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------- print */

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
    color: #000;
    overflow: visible;
  }

  .app-sidebar,
  .topbar,
  .save-bar,
  .toast,
  .mobile-menu,
  .sidebar-collapse-btn,
  .row-actions,
  .login-view {
    display: none !important;
  }

  .app-shell,
  .app-main {
    display: block;
    min-height: 0;
  }

  .content {
    padding: 0 !important;
  }

  #view-day {
    padding-bottom: 0 !important;
  }

  .day-grid,
  .grid,
  .grid.cols-2,
  .grid.cols-3,
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card,
  .day-card,
  .metric,
  .site-card {
    border-color: #ccc;
    box-shadow: none;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
    border-color: #ccc;
  }

  .data-table th {
    position: static;
    background: #f2f2f2 !important;
    color: #000;
  }

  .page-header {
    border-bottom-color: #ccc;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}

/* Import producție — previzualizare înainte de salvare */
.import-preview {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}
.import-preview-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.import-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.import-preview .row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Jurnal audit */
.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}
.audit-filters .field { margin: 0; }
.audit-filter-actions { display: flex; gap: 8px; align-items: center; }
.audit-pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.audit-table tbody tr[data-audit-id] { cursor: pointer; }
.audit-table tbody tr[data-audit-id]:hover { background: #f8fafc; }
.audit-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 12px; margin: 10px 0; }
.audit-json {
  max-height: 420px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Date Picker (Air Datepicker v3) — WINCON Theme */
.air-datepicker {
  max-width: calc(100vw - 24px);
  --adp-font-family: var(--font);
  --adp-font-size: 13px;
  --adp-width: 256px;
  --adp-padding: 8px;
  --adp-border-radius: var(--radius);
  --adp-cell-border-radius: var(--radius-sm);
  --adp-background-color: var(--surface);
  --adp-background-color-hover: #f1f5f9;
  --adp-background-color-active: #e2e8f0;
  --adp-border-color: var(--line);
  --adp-border-color-inner: var(--line-soft);
  --adp-accent-color: var(--brand);
  --adp-cell-background-color-selected: var(--brand);
  --adp-cell-background-color-selected-hover: var(--brand-dark);
  --adp-cell-background-color-in-range: var(--brand-soft);
  --adp-cell-background-color-in-range-hover: rgba(225, 4, 49, 0.16);
  --adp-cell-border-color-in-range: transparent;
  --adp-color: var(--ink);
  --adp-color-secondary: var(--muted);
  --adp-color-current-date: var(--brand);
  --adp-day-name-color: var(--dark);
  --adp-day-name-color-hover: var(--brand);
  --adp-nav-action-size: 28px;
  --adp-nav-height: 32px;
  --adp-btn-color: var(--brand);
  --adp-btn-color-hover: var(--brand-dark);
  --adp-btn-background-color-hover: var(--brand-soft);
  --adp-btn-border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.air-datepicker-global-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1050;
}
.air-datepicker:not(.-active-) {
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(-9999px) !important;
}
.air-datepicker.-active- {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) !important;
  z-index: 1050 !important;
}

/* Indicator zi cu date înregistrate (punct roșu sub numărul zilei) */
.air-datepicker-cell.has-data {
  position: relative;
}
.air-datepicker-cell.has-data::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}
.air-datepicker-cell.-selected-.has-data::after {
  background: #ffffff;
}

/* Modal dialog styling for direct inline price edits */
dialog.wincon-modal {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  border-radius: var(--radius);
  padding: var(--sp-4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  max-width: 440px;
  width: 90%;
  font-family: inherit;
}
dialog.wincon-modal::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}
dialog.wincon-modal .modal-header {
  margin-bottom: var(--sp-3);
}
dialog.wincon-modal .modal-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
dialog.wincon-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

/* ============================================================ */
/* TOUR INTERACTIV (SPOTLIGHT / FOCUS ZONE)                     */
/* ============================================================ */
.tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: transparent;
  cursor: pointer;
}

.tour-spotlight-box {
  position: absolute;
  border: 2px solid var(--brand, #E10431);
  border-radius: var(--radius, 3px);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55), 0 0 20px rgba(225, 4, 49, 0.4);
  pointer-events: none;
  z-index: 1101;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-card {
  position: absolute;
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 16px;
  z-index: 1102;
  font-family: inherit;
  transition: top 0.2s cubic-bezier(0.16, 1, 0.3, 1), left 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tour-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tour-step-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand, #E10431);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tour-close-btn {
  background: none;
  border: none;
  color: var(--muted, #64748b);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  line-height: 1;
  border-radius: var(--radius, 3px);
}
.tour-close-btn:hover {
  color: var(--fg, #0f172a);
  background: rgba(0, 0, 0, 0.05);
}

.tour-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark, #243342);
  margin: 0 0 6px 0;
}

.tour-card-body {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.tour-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ============================================================ */
/* MANUAL OPERAȚIONAL RETRACTABIL (DRAWER)                      */
/* ============================================================ */
.manual-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(1.5px);
  z-index: 1090;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.manual-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.manual-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  bottom: 0;
  width: 440px;
  max-width: 90vw;
  background: var(--surface, #ffffff);
  border-left: 1px solid var(--border, #e2e8f0);
  box-shadow: -8px 0 25px rgba(0, 0, 0, 0.15);
  z-index: 1091;
  display: flex;
  flex-direction: column;
  transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.manual-drawer.open {
  right: 0;
}

.manual-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.manual-eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: var(--brand, #E10431);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.manual-drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark, #243342);
  line-height: 1.3;
}

.manual-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.manual-drawer-body h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark, #243342);
  margin: 16px 0 6px;
}
.manual-drawer-body h4:first-child {
  margin-top: 0;
}

.manual-drawer-body p {
  margin: 0 0 10px;
}

.manual-drawer-body ul,
.manual-drawer-body ol {
  margin: 0 0 14px;
  padding-left: 20px;
}
.manual-drawer-body li {
  margin-bottom: 4px;
}

.manual-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
}

/* ============================================================ */
/* SMART DROPZONE COMPONENT (§7.6, UX-10, D-18)                */
/* ============================================================ */

.wincon-dropzone {
  position: relative;
  border: 2px dashed var(--line2, #cbd5e1);
  background: #ffffff;
  border-radius: var(--radius, 3px);
  padding: 16px 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  outline: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}

.wincon-dropzone:hover,
.wincon-dropzone:focus-visible {
  border-color: var(--brand, #E10431);
  box-shadow: 0 0 0 2px rgba(225, 4, 49, 0.08);
}

.wincon-dropzone.dragover {
  border-color: var(--brand, #E10431);
  background-color: #fff5f5;
  box-shadow: 0 0 0 3px rgba(225, 4, 49, 0.16);
}

.wincon-dropzone.has-error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.wincon-dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}

.dropzone-idle {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius, 3px);
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  color: var(--brand, #E10431);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.wincon-dropzone:hover .dropzone-icon,
.wincon-dropzone.dragover .dropzone-icon {
  transform: translateY(-2px);
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.dropzone-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark, #243342);
  line-height: 1.3;
}

.dropzone-browse {
  color: var(--brand, #E10431);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--muted, #64748b);
}

.dropzone-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 3px);
  padding: 10px 14px;
  width: 100%;
  box-sizing: border-box;
}

.dropzone-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dropzone-file-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius, 3px);
  background: rgba(225, 4, 49, 0.08);
  color: var(--brand, #E10431);
  flex-shrink: 0;
}

.dropzone-file-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
}

.dropzone-file-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark, #243342);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.dropzone-file-size {
  font-size: 11.5px;
  color: var(--muted, #64748b);
}

.dropzone-remove-btn {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 3px);
  background: #ffffff;
  color: var(--muted, #64748b);
  cursor: pointer;
  transition: all 0.12s ease;
  flex-shrink: 0;
}

.dropzone-remove-btn:hover {
  color: var(--brand, #E10431);
  border-color: var(--brand, #E10431);
  background: #fff5f5;
}

.form-grid-pricing {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: end;
  gap: var(--sp-2, 12px);
}

@media (max-width: 640px) {
  .form-grid-pricing {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Rezervor Motorină (Industrial WINCON Tank Dashboard) */
.wincon-tank-dashboard {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: var(--sp-4, 20px);
  align-items: start;
  margin-bottom: var(--sp-4, 20px);
}

@media (max-width: 960px) {
  .wincon-tank-dashboard {
    grid-template-columns: 1fr;
  }
}

.wincon-tank-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 3px);
  padding: 16px 14px 14px;
}

.tank-visual-container {
  width: 100%;
  max-width: 270px;
  display: flex;
  justify-content: center;
}

.wincon-tank-svg {
  width: 100%;
  height: auto;
  display: block;
}

.tank-telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}

.tank-stat-box {
  background: var(--bg, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 3px);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.tank-stat-box .stat-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #64748b);
  letter-spacing: 0.3px;
}

.tank-stat-box .stat-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dark, #1e293b);
  margin-top: 2px;
}

.wincon-tank-lots {
  min-width: 0;
}

/* Modal backdrop and box for field dialogs */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4, 20px);
}

.modal-box {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--radius, 3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: var(--sp-4, 20px);
  width: 100%;
}

.modal-box .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--sp-2, 10px);
  margin-top: var(--sp-4, 16px);
  padding-top: var(--sp-3, 12px);
}
