:root {
  --brand-900: #00383f;
  --brand-800: #004f5a;
  --sidebar-950: #071f36;
  --sidebar-900: #082a45;
  --sidebar-800: #0c3658;
  --sidebar-700: #11456b;
  --sky-600: #2f80ed;
  --sky-50: #eff6ff;
  --amber-600: #f59e0b;
  --amber-700: #d97706;
  --amber-50: #fff7ed;
  --rose-600: #e11d48;
  --rose-700: #be123c;
  --violet-600: #6d5dfc;
  --ink: #12233d;
  --muted: #75849a;
  --line: #e2eaf4;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --shadow: 0 18px 42px rgba(20, 45, 80, 0.08);
  --shadow-sm: 0 10px 24px rgba(20, 45, 80, 0.06);
  --sidebar-width: 268px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

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

button,
a {
  font: inherit;
}

.sidebar-state {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 18px 16px 16px;
  background:
    radial-gradient(circle at 30% 0%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(180deg, var(--sidebar-950) 0%, var(--sidebar-900) 52%, var(--sidebar-800) 100%);
  color: #fff;
  z-index: 60;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  margin-bottom: 18px;
}

.logo {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-image {
  width: 156px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-row-divider {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navitem {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 10px;
  color: #e8f7ff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.navitem.active {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    linear-gradient(135deg, var(--sidebar-700), var(--sidebar-900));
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.72), 0 10px 26px rgba(0, 56, 63, 0.22);
}

.navitem svg,
.tab-icon svg,
.kpi-icon svg,
.side-user-logout svg,
.mobile-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navitem b {
  font-weight: 700;
  line-height: 1.1;
}

.navitem i {
  margin-left: auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ff4253;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
}

.side-user {
  min-height: 58px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  color: #f7fbff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.side-user-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(74, 196, 0, 0.18), rgba(74, 196, 0, 0.3));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(74, 196, 0, 0.14);
}

.side-user-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  line-height: 1.06;
}

.side-user-copy strong {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-copy small {
  margin-top: 2px;
  color: #abc9d9;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-user-logout {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #f7fbff;
}

.page {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 28px 28px 110px;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 40px;
  margin-bottom: 18px;
}

.mobile-brand {
  display: none;
}

.top h1 {
  font-size: 19px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.35px;
}

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

.tab-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #61728c;
  font-size: 12px;
  font-weight: 800;
}

.tab-chip.active {
  border-color: #d7e5f1;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,250,253,0.96));
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(30, 55, 90, 0.06);
}

.tab-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
}

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

.kpi {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--kpi-accent, var(--brand-800));
}

.kpi-icon {
  position: absolute;
  left: 22px;
  top: 20px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--kpi-accent, var(--brand-800));
  color: #fff;
  box-shadow: 0 13px 24px var(--kpi-shadow, rgba(0, 79, 90, 0.22));
}

.kpi.teal {
  --kpi-accent: var(--brand-800);
  --kpi-shadow: rgba(0, 79, 90, 0.22);
}

.kpi.blue {
  --kpi-accent: var(--sky-600);
  --kpi-shadow: rgba(47, 128, 237, 0.18);
}

.kpi.orange {
  --kpi-accent: var(--amber-600);
  --kpi-shadow: rgba(245, 158, 11, 0.2);
}

.kpi.purple {
  --kpi-accent: var(--violet-600);
  --kpi-shadow: rgba(109, 93, 252, 0.18);
}

.kpi-copy {
  margin-left: 58px;
}

.kpi-copy strong {
  display: block;
  margin-top: 8px;
  color: #0d2440;
  font-size: 28px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: 0.2px;
}

.kpi-copy h3 {
  margin-top: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.kpi-copy p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-panel {
  min-height: 214px;
}

.panel-head {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.25px;
}

.panel-empty {
  min-height: 164px;
  display: grid;
  place-items: center;
  color: #6b7ea5;
  font-size: 16px;
  text-align: center;
}

.ds-footer {
  position: fixed;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  width: auto;
  margin: 0;
  padding: 12px 28px 18px;
  z-index: 35;
  background: linear-gradient(180deg, rgba(244,247,251,0), rgba(244,247,251,0.92) 18%, rgba(244,247,251,0.98));
}

.ds-footer-sep {
  display: none;
}

.ds-footer-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
}

.ds-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ds-footer-brand-right {
  justify-content: flex-end;
}

.ds-footer-brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ds-footer-brand img {
  width: 156px;
  max-height: 36px;
  object-fit: contain;
}

.ds-footer-brand-right img {
  width: 92px;
  max-height: 20px;
}

.menu-toggle,
.mobile-toggle,
.sidebar-scrim,
.mobile-only {
  display: none;
}

@media (max-width: 1320px) {
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: min(86vw, 296px);
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: 0 24px 48px rgba(7, 31, 54, 0.28);
  }

  .sidebar-state:checked ~ .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(7, 31, 54, 0.16);
  }

  .sidebar-state:checked ~ .sidebar-scrim {
    display: block;
  }

  .page {
    margin-left: 0;
    padding: 20px 14px 116px;
  }

  .top {
    min-height: 42px;
    margin-bottom: 18px;
    padding-left: 56px;
    justify-content: space-between;
  }

  .top h1 {
    font-size: 22px;
  }

  .mobile-toggle {
    position: fixed;
    top: 20px;
    left: 14px;
    z-index: 81;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(9, 42, 69, 0.14);
    border-radius: 12px;
    background: rgba(255,255,255,0.92);
    color: var(--sidebar-900);
    box-shadow: 0 8px 20px rgba(7,31,54,0.10);
  }

  .mobile-toggle .toggle-closed {
    display: none;
  }

  .sidebar-state:checked ~ .page .mobile-toggle {
    background: rgba(255,255,255,0.92);
    border-color: rgba(9, 42, 69, 0.14);
    color: var(--sidebar-900);
    box-shadow: 0 8px 20px rgba(7,31,54,0.10);
  }

  .sidebar-state:checked ~ .page .mobile-toggle .toggle-open {
    display: none;
  }

  .sidebar-state:checked ~ .page .mobile-toggle .toggle-closed {
    display: inline;
  }

  .mobile-brand {
    display: block;
    margin-left: auto;
    max-height: 34px;
    width: auto;
    object-fit: contain;
  }

  .tabbar {
    position: relative;
    gap: 10px;
    margin-bottom: 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 0 34px 6px 0;
    scrollbar-width: none;
  }

  .tabbar::after {
    content: "›";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    flex: 0 0 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(244,247,251,0.92));
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    box-shadow: -10px 0 18px rgba(244,247,251,0.96);
    pointer-events: none;
  }

  .tabbar::-webkit-scrollbar {
    display: none;
  }

  .tab-chip {
    white-space: nowrap;
    flex: 0 0 auto;
  }

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

  .kpi {
    min-height: 112px;
  }

  .dashboard-panel {
    min-height: 180px;
  }

  .panel-head {
    min-height: 46px;
    padding: 0 14px;
  }

  .panel-head h2 {
    font-size: 14px;
  }

  .panel-empty {
    min-height: 132px;
    padding: 18px;
    font-size: 14px;
  }

  .ds-footer {
    left: 0;
    right: 0;
    padding: 12px 14px 16px;
  }

  .ds-footer-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }

  .ds-footer-brand,
  .ds-footer-brand-right {
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .ds-footer-brand-right {
    justify-content: flex-end;
  }

  .ds-footer-brand-right {
    padding-top: 0;
    border-top: 0;
  }

  .ds-footer-brand span {
    display: none;
  }

  .ds-footer-brand img {
    width: 120px;
    max-width: none;
    height: auto;
  }

  .ds-footer-brand-right img {
    width: 92px;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .sidebar {
    width: min(88vw, 288px);
    padding: 16px 14px 14px;
  }

  .page {
    padding: 18px 14px 116px;
  }

  .top h1 {
    font-size: 20px;
  }

  .top {
    padding-left: 56px;
  }

  .mobile-brand {
    max-height: 32px;
  }

  .kpi {
    padding: 19px 18px;
  }

  .kpi-icon {
    left: 18px;
    top: 18px;
  }

  .kpi-copy {
    margin-left: 62px;
  }

  .ds-footer-row {
    padding: 10px 12px;
  }

  .ds-footer-brand,
  .ds-footer-brand-right {
    gap: 0;
  }

  .ds-footer-brand-right {
    justify-content: flex-end;
  }

  .ds-footer-brand img {
    width: 108px;
  }

  .ds-footer-brand-right img {
    width: 84px;
  }

  .tabbar::after {
    content: none;
  }

}

/* Dashboard tabs + content patterns derived from legacy HACCP screens */
.is-hidden {
  display: none !important;
}

.tabbar {
  position: relative;
  gap: 18px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
}

.tab-chip {
  position: relative;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #62728c;
  cursor: pointer;
  transition: color 160ms ease;
}

.tab-chip:hover,
.tab-chip.active {
  color: var(--sky-600);
  box-shadow: none;
}

.tab-chip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}

.tab-chip.active::after {
  background: var(--sky-600);
}

.dashboard-panel {
  margin-top: 2px;
}

.empty-state {
  min-height: 164px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: #6b7ea5;
  text-align: center;
}

.empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eef6ff;
  color: var(--sky-600);
}

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

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.empty-state p {
  max-width: 420px;
  color: #6b7ea5;
  font-size: 13px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
}

.ds-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.ds-table th {
  padding: 13px 18px;
  background: #f5f8fc;
  color: #51627c;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.ds-table td {
  padding: 14px 18px;
  border-top: 1px solid #edf2f8;
  color: #263b5c;
  vertical-align: middle;
  white-space: nowrap;
}

.ds-table td strong {
  color: var(--ink);
  font-weight: 800;
}

.ds-table tbody tr:hover td {
  background: #fbfdff;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.badge-success {
  background: #d9f8e8;
  color: #057a44;
}

.badge-soft {
  background: #d7fae8;
  color: #15935b;
}

@media (max-width: 900px) {
  .tabbar {
    gap: 18px;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  .tab-chip {
    min-height: 34px;
    padding: 0 1px;
  }

  .dashboard-panel {
    border-radius: 16px;
  }

  .empty-state {
    min-height: 170px;
    padding: 26px 18px;
  }

  .table-wrap {
    overflow: visible;
    padding: 12px;
    background: #f6f9fd;
  }

  .ds-table,
  .ds-table thead,
  .ds-table tbody,
  .ds-table tr,
  .ds-table th,
  .ds-table td {
    display: block;
  }

  .ds-table thead {
    display: none;
  }

  .ds-table tbody {
    display: grid;
    gap: 12px;
  }

  .ds-table tr {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .ds-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 10px 14px;
    border-top: 1px solid #eef3f8;
    white-space: normal;
    text-align: right;
  }

  .ds-table td:first-child {
    border-top: 0;
    padding-top: 14px;
  }

  .ds-table td:last-child {
    padding-bottom: 14px;
  }

  .ds-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: #73849a;
    font-size: 11px;
    font-weight: 800;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .empty-icon {
    width: 38px;
    height: 38px;
  }

  .empty-state strong {
    font-size: 14px;
  }

  .empty-state p {
    font-size: 12px;
  }

  .ds-table td {
    padding-inline: 12px;
    font-size: 12px;
  }
}

/* Softer dashboard tab state: navigation underline, not a boxed button */
.tab-chip,
.tab-chip.active {
  border-color: transparent;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.tab-chip.active {
  color: var(--sky-600);
  font-weight: 850;
}

.view {
  display: block;
}

.page-subtitle {
  margin: -4px 0 22px;
  color: #6b7ea5;
  font-size: 13px;
  font-weight: 500;
}

.reminder-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.reminder-stat {
  min-height: 92px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  column-gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.reminder-stat.danger {
  border-color: #f2b8bf;
  background: #fff1f2;
}

.stat-dot {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--stat, #2f80ed);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--stat, #2f80ed) 16%, transparent);
}

.reminder-stat.danger { --stat: #e23d59; }
.reminder-stat.orange { --stat: #ff784e; }
.reminder-stat.amber { --stat: #eab93f; }
.reminder-stat.blue { --stat: #4d86dd; }

.reminder-stat strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  font-weight: 850;
}

.reminder-stat small {
  grid-column: 2;
  margin-top: 8px;
  color: #6b7ea5;
  font-size: 12px;
  font-weight: 700;
}

.urgent-banner {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid #f3b8bd;
  border-radius: var(--radius);
  background: #fff1f2;
  color: #b00020;
  box-shadow: var(--shadow-sm);
}

.urgent-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #f2b342;
}

.urgent-icon svg,
.expired-meta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.urgent-banner strong {
  display: block;
  font-size: 15px;
  font-weight: 850;
}

.urgent-banner p {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #6b7ea5;
  font-size: 14px;
  font-weight: 850;
}

.section-label span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e23d59;
}

.section-label em {
  font-style: normal;
  color: #8290a6;
}

.expired-list {
  display: grid;
  gap: 14px;
}

.expired-card {
  position: relative;
  min-height: 118px;
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px 24px;
  border: 1px solid #f2c7cb;
  border-radius: var(--radius);
  background: #fff1f2;
  box-shadow: var(--shadow-sm);
}

.expired-dot {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff6b78, #c6213e);
  box-shadow: 0 0 0 5px rgba(226, 61, 89, 0.1);
}

.expired-copy {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.expired-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #d0001b;
  font-size: 11px;
  font-weight: 850;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 8px;
  border-radius: 5px;
  background: #fde2e7;
  color: #c6213e;
  font-size: 10px;
  font-weight: 850;
}

.expired-card h2 {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.2px;
}

.expired-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #526580;
  font-size: 13px;
}

.expired-meta span,
.expired-meta b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.expired-meta b {
  color: #d0001b;
  font-weight: 850;
}

@media (max-width: 900px) {
  .page-subtitle {
    margin: -2px 0 16px;
    line-height: 1.4;
  }

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

  .reminder-stat {
    min-height: 86px;
    padding: 16px;
    border-radius: 16px;
  }

  .reminder-stat strong {
    font-size: 24px;
  }

  .urgent-banner {
    min-height: 74px;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 16px;
  }

  .expired-card {
    gap: 14px;
    padding: 18px 16px;
    border-radius: 16px;
  }

  .expired-meta {
    gap: 9px;
    font-size: 12px;
  }
}

/* Entity pages: operators and suppliers (UI mock layer, removable later) */
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.primary-action,
.secondary-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.secondary-action {
  min-height: 34px;
  padding-inline: 12px;
  font-size: 12px;
  box-shadow: none;
}

.primary-action svg,
.secondary-action svg,
.icon-action svg,
.upload-icon svg,
.modal-close svg,
.ghost-link svg,
.entity-meta svg,
.supplier-info svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action.full { width: 100%; }

.entity-list {
  display: grid;
  gap: 14px;
}

.entity-card,
.supplier-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.entity-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
}

.entity-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #dcecff;
  color: #2563eb;
  font-weight: 900;
}

.entity-main { min-width: 0; }

.entity-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
}

.entity-title-row h2,
.supplier-card h2 {
  margin-right: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.entity-meta,
.supplier-info {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: #637593;
  font-size: 12px;
  font-weight: 600;
}

.entity-meta span,
.supplier-info span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-danger { color: #dc2626 !important; font-weight: 850; }

.ui-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.ui-badge-success { background: #d9f8e8; color: #047846; }
.ui-badge-danger { background: #ffe1e4; color: #be123c; }
.ui-badge-warning { background: #fff0c7; color: #a16207; }
.ui-badge-info { background: #dcecff; color: #2563eb; }
.ui-badge-purple { background: #eee5ff; color: #7c3aed; }
.ui-badge-neutral { background: #eef3f8; color: #53667f; }

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

.icon-action {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #dbe8f7;
  border-radius: 11px;
  background: linear-gradient(180deg, #ffffff, #f6faff);
  color: #48627f;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 48, 78, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.icon-action:hover {
  transform: translateY(-1px);
  border-color: #9ec9ff;
  background: #eef6ff;
  color: #2563eb;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.icon-action.info {
  border-color: #d8e8ff;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: #2563eb;
}

.icon-action.info:hover,
.icon-action.info[aria-expanded="true"] {
  border-color: #bfdcff;
  background: var(--sky-50);
  color: #1d4ed8;
}

.icon-action.warning {
  border-color: #fde6c8;
  background: linear-gradient(180deg, #fffdfa, #fff8f0);
  color: var(--amber-700);
}

.icon-action.warning:hover {
  border-color: #f9d4a5;
  background: var(--amber-50);
  color: #b45309;
}

.icon-action.success {
  border-color: #86efac;
  background: linear-gradient(180deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.icon-action.success:hover {
  border-color: #4ade80;
  background: #bbf7d0;
  color: #065f46;
}

.icon-action.danger {
  border-color: #f9d6dd;
  background: linear-gradient(180deg, #fffdfd, #fff7f8);
  color: #be123c;
}

.icon-action.danger:hover {
  border-color: #f6a7b9;
  background: #ffe4ea;
  color: #9f1239;
}

.icon-action.print {
  border-color: #d8e8ff;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: #2563eb;
}

.icon-action.print:hover {
  border-color: #bfdcff;
  background: var(--sky-50);
  color: #1d4ed8;
}

.entity-detail {
  border-top: 1px solid #e8eef6;
  padding: 18px;
  background: #f8fbff;
}

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

.detail-head h3 {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
}

.slim-tabs { margin-bottom: 22px; }

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

.supplier-card {
  padding: 18px;
}

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

.supplier-head p {
  margin-top: 4px;
  color: #637593;
  font-size: 12px;
  font-weight: 600;
}

.supplier-info {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eef6;
}

.supplier-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
}

.ghost-link {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 850;
  cursor: pointer;
}

/* Modal system: centered, responsive, no page-cutting fake panels */
.modal-layer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 13, 27, 0.68);
  backdrop-filter: blur(2px);
  z-index: 120;
}

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

.modal-dialog {
  width: min(100%, 560px);
  max-height: min(86vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
}

.modal-lg { width: min(100%, 760px); }
.modal-md { width: min(100%, 540px); }

.modal-head,
.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e5edf6;
}

.modal-foot {
  border-top: 1px solid #e5edf6;
  border-bottom: 0;
}

.modal-head h2 {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
}

.modal-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #f4f7fb;
  color: #637593;
  cursor: pointer;
}

.modal-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 22px;
}

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

.form-grid.one { grid-template-columns: 1fr; }
.span-2 { grid-column: span 2; }

.form-field {
  display: grid;
  gap: 7px;
  color: #2f4059;
  font-size: 13px;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfdced;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  font-weight: 500;
  outline: none;
}

.form-field textarea {
  min-height: 92px;
  padding-block: 12px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #6aa7f4;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.form-field small,
.upload-box small {
  color: #73849a;
  font-size: 11px;
  font-weight: 600;
}

.upload-box {
  width: 100%;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px dashed #adc5e3;
  border-radius: 13px;
  background: #f8fbff;
  color: #33445d;
  text-align: left;
  cursor: pointer;
}

.upload-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf3ff;
  color: #2563eb;
}

.upload-box strong { display: block; color: var(--ink); font-weight: 900; }

.check-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid #d7e3f1;
  border-radius: 13px;
  background: #f8fbff;
}

.check-group legend {
  padding: 0 6px;
  color: #2f4059;
  font-size: 13px;
  font-weight: 850;
}

.check-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #33445d;
  font-weight: 650;
}

.detail-card,
.note-box {
  border-radius: 14px;
  background: #f6f9fd;
  padding: 16px;
}

.detail-card h3 { margin-bottom: 8px; font-size: 16px; font-weight: 900; }
.detail-card p { display: flex; align-items: center; gap: 8px; color: #637593; }
.detail-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e5edf6; }
.detail-section h3 { margin-bottom: 12px; font-size: 14px; font-weight: 900; color: #2f4059; }
.detail-section dl { display: grid; gap: 8px; margin: 0; }
.detail-section dt { color: #73849a; font-weight: 800; }
.detail-section dd { margin: -6px 0 4px; color: #263b5c; font-weight: 650; }
.note-box { color: #33445d; }

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

@media (max-width: 900px) {
  .page-toolbar {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-toolbar .page-subtitle {
    margin: 0;
    line-height: 1.35;
    flex: 1 1 auto;
  }

  .page-toolbar .primary-action {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .primary-action { width: 100%; }
  .entity-summary { grid-template-columns: auto 1fr; align-items: flex-start; }
  .entity-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .supplier-grid { grid-template-columns: 1fr; }
  .modal-layer { align-items: flex-end; padding: 0; }
  .modal-dialog { width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
}

@media (max-width: 520px) {
  .entity-summary { padding: 14px; gap: 12px; }
  .entity-title-row { gap: 6px; }
  .entity-title-row h2 { width: 100%; }
  .entity-meta { display: grid; gap: 7px; }
  .modal-head, .modal-body, .modal-foot { padding-inline: 16px; }
}

/* Refinements requested after operator/supplier review */
.nested-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-empty {
  margin-top: 18px;
}

.icon-action[aria-expanded="true"] {
  border-color: #9ec9ff;
  background: #eaf3ff;
  color: #2563eb;
}

.upload-box {
  border-style: solid;
  border-color: #d7e5f4;
  background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.upload-box:hover {
  border-color: #9ec9ff;
  background: #eef6ff;
}

.check-section {
  display: grid;
  gap: 10px;
}

.check-section h3 {
  color: #2f4059;
  font-size: 13px;
  font-weight: 850;
}

.check-section .check-group {
  grid-column: auto;
}

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

.equipment-card {
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.equipment-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.equipment-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf3ff;
  color: #2563eb;
}

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

.equipment-card h2 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.equipment-card p,
.equipment-meta {
  color: #637593;
  font-size: 12px;
  font-weight: 600;
}

.equipment-card p { margin-top: 4px; }

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

.equipment-limits span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: #f6f9fd;
}

.equipment-limits small {
  color: #73849a;
  font-size: 11px;
  font-weight: 800;
}

.equipment-limits strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.equipment-meta {
  display: grid;
  gap: 6px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8eef6;
}

.form-box {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 13px;
  background: #eff6ff;
}

.form-box h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2f4059;
  font-size: 13px;
  font-weight: 900;
}

.form-box small {
  color: #2563eb;
  font-size: 11px;
  font-weight: 700;
}

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

.report-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.report-empty-panel .empty-state {
  min-height: 300px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(47, 128, 237, 0.12), transparent 28%),
    linear-gradient(180deg, #f4f7fb 0%, #e9eef8 100%);
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid #d9e6f7;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(29, 54, 94, 0.12);
}

.login-logo {
  width: 164px;
}

.login-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.login-card p {
  margin: 0;
  color: #6b7ea5;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-brand {
  display: grid;
  place-items: center;
}

.login-logo {
  margin-inline: auto;
}

.login-card h1 {
  text-align: center;
}

.login-form .primary-action.full {
  justify-self: center;
  width: min(100%, 220px);
}

.login-remember {
  display: grid;
  gap: 10px;
  color: #2f4059;
  font-size: 14px;
}

.login-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.modal-layer {
  overflow-y: auto;
}

.modal-body {
  scrollbar-width: thin;
  scrollbar-color: #c8d6e8 transparent;
}

.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: #c8d6e8; border-radius: 999px; }

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

@media (max-width: 900px) {
  .equipment-grid { grid-template-columns: 1fr; }
  .nested-two { grid-template-columns: 1fr; }
}

/* Ricezione merci: section-specific components */
.receiving-panel {
  overflow: hidden;
}

.receiving-table td:last-child,
.receiving-table th:last-child {
  text-align: left;
}

.inline-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  white-space: nowrap;
}

.danger-text {
  color: #e11d48 !important;
}

.form-info {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f6f9fd;
  color: #314560;
  font-weight: 650;
}

.form-info span,
.receive-products-head h3,
.signature-box h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-info svg,
.receive-products-head svg,
.signature-box svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.invoice-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid #e7cffd;
  border-radius: 14px;
  background: #fbf5ff;
  color: #6d28d9;
  cursor: pointer;
}

.invoice-option input,
.check-group input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: #2563eb;
}

.invoice-option strong {
  display: block;
  margin-bottom: 5px;
  font-weight: 900;
}

.invoice-option small {
  display: block;
  color: #7c3aed;
  font-size: 12px;
  line-height: 1.4;
}

.receive-products-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.receive-products-head h3,
.signature-box h3 {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.product-dropzone {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 2px dashed #c6d6eb;
  border-radius: 15px;
  background: #f8fbff;
  color: #7b8ca6;
  text-align: center;
}

.product-dropzone strong {
  color: #91a0b7;
  font-size: 15px;
  font-weight: 800;
}

.product-dropzone span {
  color: #53667f;
  font-weight: 850;
}

.nc-box {
  background: #f8fbff;
  border-color: #d7e3f1;
}

.nc-box > small {
  color: #73849a;
}

.check-group.single {
  grid-template-columns: 1fr;
  background: #fff;
}

.success-line {
  margin: 0;
  color: #059669;
  font-size: 12px;
  font-weight: 850;
}

.signature-box {
  display: grid;
  gap: 10px;
  padding: 15px;
  border: 1px solid #d7e3f1;
  border-radius: 14px;
  background: #f8fbff;
}

.signature-box p {
  color: #53667f;
  font-size: 12px;
  font-weight: 650;
}

.signature-pad {
  min-height: 132px;
  border: 2px dashed #9fb5d1;
  border-radius: 12px;
  background: #fff;
}

.signature-help {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: #637593;
  font-size: 12px;
  font-weight: 650;
}

.signature-help button {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #e11d48;
  font-weight: 850;
  cursor: pointer;
}

@media (max-width: 900px) {
  .receiving-table-wrap {
    padding: 12px;
  }

  .inline-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .receive-products-head {
    align-items: stretch;
    flex-direction: column;
  }

  .signature-help button {
    margin-left: 0;
  }
}

/* Ricezione merci: detail modal */
.icon-action.danger {
  border-color: #f9d6dd;
  background: linear-gradient(180deg, #fffdfd, #fff7f8);
  color: var(--rose-600);
}
.detail-grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.detail-label { display: block; margin-bottom: 5px; color: #64748b; font-size: 12px; font-weight: 700; }
.receiving-summary-card { margin-bottom: 18px; }
.highlight-card { display: grid; gap: 8px; padding: 16px; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; }
.highlight-card h4 { color: var(--ink); font-size: 16px; font-weight: 900; }
.highlight-card p, .document-chip { display: inline-flex; align-items: center; gap: 9px; color: #3b4d66; font-size: 13px; font-weight: 650; }
.highlight-card svg, .detail-section h3 svg, .document-chip svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.invoice-note { padding: 16px; border: 1px solid #e9d5ff; border-radius: 14px; background: #faf5ff; color: #6d28d9; }
.invoice-note strong { display: block; margin-bottom: 7px; font-weight: 900; }
.invoice-note p { margin: 0; font-size: 13px; line-height: 1.45; }
.success-panel { padding: 15px 16px; border: 1px solid #86efac; border-radius: 13px; background: #ecfdf5; color: #047857; font-weight: 850; }
.detail-section.compact { gap: 10px; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #52657d; font-weight: 700; }
.document-chip { width: 100%; padding: 14px 16px; border: 1px solid #dbe6f3; border-radius: 12px; background: #f8fbff; color: #2563eb; text-decoration: none; }
.signature-preview { display: grid; gap: 8px; padding: 12px; border: 1px solid #dbe6f3; border-radius: 14px; background: #f8fbff; text-align: center; color: #64748b; font-size: 12px; font-weight: 650; }
.signature-preview svg { width: 100%; height: 120px; border: 1px solid #cbd8e9; border-radius: 10px; background: #fff; }
.signature-preview path { fill: none; stroke: #0f172a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) { .detail-grid.two { grid-template-columns: 1fr; } }

/* Abbattimento: table-specific patterns */
.abatement-panel {
  overflow: hidden;
}

.abatement-methods,
.status-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #33445d;
  font-weight: 700;
}

.product-type-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  color: var(--product-tone, #64748b);
}

.product-type-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.product-type-label {
  color: #33445d;
}

.product-type-beef { --product-tone: #e11d48; }
.product-type-pork { --product-tone: #ef4444; }
.product-type-poultry { --product-tone: #ec4899; }
.product-type-fish { --product-tone: #2563eb; }
.product-type-vegetables { --product-tone: #16a34a; }
.product-type-fruit { --product-tone: #dc2626; }
.product-type-other { --product-tone: #a16207; }

.product-type-beef .product-type-label,
.product-type-pork .product-type-label,
.product-type-poultry .product-type-label,
.product-type-fish .product-type-label,
.product-type-vegetables .product-type-label,
.product-type-fruit .product-type-label,
.product-type-other .product-type-label {
  color: var(--product-tone);
}

.method-chip,
.status-pill,
.waste-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.method-chip-cool {
  background: #efe7ff;
  color: #7c3aed;
}

.method-chip-violet {
  background: #f3e8ff;
  color: #9333ea;
}

.waste-chip,
.status-pill {
  background: #d9f8e8;
  color: #047857;
}

.expiry-text {
  font-weight: 800;
}

.expiry-text-danger {
  color: #dc2626;
}

.expiry-text-success {
  color: #059669;
}

.expiry-text-muted {
  color: #94a3b8;
}

.abatement-table td:nth-child(4) {
  min-width: 230px;
}

.abatement-table td:nth-child(9) {
  min-width: 104px;
}

.abatement-summary-card {
  margin-bottom: 18px;
}

.abatement-detail-grid {
  display: grid;
  gap: 16px;
}

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

.detail-row-stack {
  justify-content: space-between;
  align-items: flex-start;
}

.detail-row-stack strong {
  color: var(--ink);
  font-weight: 800;
}

.expiry-alert {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #fcb8b8;
  border-radius: 12px;
  background: #fff5f5;
}

.expiry-alert-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #33445d;
  font-weight: 700;
}

.expiry-alert-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #64748b;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expiry-alert strong {
  color: #dc2626;
  font-size: 15px;
  font-weight: 900;
}

.abatement-metrics-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid #bfd7fb;
  border-radius: 14px;
  background: #eff6ff;
}

.abatement-metric {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.abatement-metric span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.abatement-metric strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.abatement-metric small {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.abatement-metric-accent strong {
  color: #047857;
}

.abatement-signature-preview {
  text-align: center;
}

.secondary-neutral {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #d4dfec;
  border-radius: 10px;
  background: #fff;
  color: #52657d;
  font-weight: 800;
  cursor: pointer;
}

.production-panel {
  overflow: hidden;
}

.production-filter-box {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-color: #d8e5f4;
  background: #fff;
}

.production-filter-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.production-filter-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.production-filter-title svg,
.process-token svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.production-filter-chevron {
  display: none;
  color: #7b8ca6;
}

.production-filter-body {
  margin-top: 12px;
}

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

.production-filter-grid .form-field {
  gap: 6px;
}

.production-filter-grid input,
.production-filter-grid select {
  min-height: 38px;
}

.production-table-wrap {
  padding: 0;
}

.production-table th {
  padding: 13px 18px;
}

.production-table td {
  padding: 14px 18px;
}

.production-lot-link {
  color: #1d4ed8;
  font-weight: 900;
  text-decoration: none;
}

.production-lot-link:hover {
  color: #1e40af;
  text-decoration: underline;
}

.production-processes {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.process-token {
  width: 22px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.process-token-amber {
  background: #fff0d9;
  color: #ea580c;
}

.process-token-cool {
  background: #e8f1ff;
  color: #2563eb;
}

.process-token-stone {
  background: #f5ebdc;
  color: #9a6b2f;
}

.production-dash {
  color: #94a3b8;
  font-weight: 700;
}

.expiry-text-warning {
  color: #ea580c;
}

.production-actions {
  gap: 8px;
}

.production-text-link {
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 700;
  padding: 0;
}

.production-text-link-danger {
  color: #dc2626;
}

@media (max-width: 900px) {
  .production-filter-head {
    cursor: pointer;
  }

  .production-filter-chevron {
    display: inline-flex;
  }

  .production-filter-box:not(.is-open) .production-filter-body {
    display: none;
  }

  .production-filter-box.is-open .production-filter-chevron-up {
    display: inline-flex;
  }

  .production-filter-box.is-open .production-filter-chevron-down {
    display: none;
  }

  .production-filter-box:not(.is-open) .production-filter-chevron-up {
    display: none;
  }

  .production-filter-box:not(.is-open) .production-filter-chevron-down {
    display: inline-flex;
  }

  .production-filter-grid {
    grid-template-columns: 1fr;
  }

  .production-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.label-sheet {
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 2px solid #cbd8e9;
  border-radius: 14px;
  background: #fff;
}

.label-sheet-head {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.label-product-type .product-type {
  font-size: 15px;
}

.label-sheet-head h3 {
  color: #1e293b;
  font-size: 18px;
  font-weight: 900;
}

.label-sheet-head p {
  color: #71839d;
  font-size: 13px;
  font-weight: 500;
}

.label-sheet-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 16px;
  align-items: start;
}

.label-sheet-main,
.label-status-grid {
  display: grid;
  gap: 10px;
}

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

.label-info-card,
.label-method-card {
  padding: 12px 14px;
  border-radius: 10px;
  background: #eff4fb;
}

.label-info-card span,
.label-method-card span {
  display: block;
  margin-bottom: 6px;
  color: #6b7ea5;
  font-size: 12px;
  font-weight: 700;
}

.label-info-card strong,
.label-method-card strong {
  color: #1e293b;
  font-size: 14px;
  font-weight: 850;
}

.label-expiry-card {
  padding: 12px 14px;
  border: 2px solid #fca5a5;
  border-radius: 10px;
  background: #fff5f5;
}

.label-expiry-card span {
  display: block;
  margin-bottom: 6px;
  color: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.label-expiry-card strong {
  color: #dc2626;
  font-size: 15px;
  font-weight: 900;
}

.label-method-card {
  border: 1px solid #d8b4fe;
  background: #faf5ff;
}

.label-method-card span {
  color: #7c3aed;
}

.label-method-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.label-method-list li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.label-method-list svg,
.label-tip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label-status-good {
  color: #059669 !important;
}

.label-qr-card {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.label-qr-box {
  width: 128px;
  height: 128px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 6px;
  border: 1px solid #d7e3f1;
  background: #fff;
}

.label-qr-box span {
  background:
    linear-gradient(90deg,
      #111827 0 22%,
      transparent 22% 34%,
      #111827 34% 56%,
      transparent 56% 67%,
      #111827 67% 100%);
}

.label-qr-box span:nth-child(3n),
.label-qr-box span:nth-child(5n) {
  background:
    linear-gradient(0deg,
      #111827 0 20%,
      transparent 20% 44%,
      #111827 44% 70%,
      transparent 70% 82%,
      #111827 82% 100%);
}

.label-qr-card small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.label-sheet-foot {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid #dbe6f3;
}

.label-sheet-foot p,
.label-sheet-foot strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}

.label-sheet-foot strong {
  color: #52657d;
}

.label-sheet-foot p svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 18px;
}

.label-print-action {
  min-height: 44px;
}

.label-tip {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
}

.label-tip p {
  color: #1d4ed8;
  font-size: 12px;
  line-height: 1.45;
}

.production-label-sheet {
  gap: 16px;
}

.production-label-head h3 {
  font-size: 19px;
}

.production-label-grid {
  grid-template-columns: 1fr;
}

.production-label-lot strong {
  color: #1d4ed8;
  font-size: 17px;
}

.production-label-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 16px;
  align-items: start;
}

.production-label-small {
  min-height: 50px;
}

.production-label-qr {
  gap: 8px;
  justify-items: center;
}

.production-label-qr small {
  color: #8aa0bc;
  font-size: 11px;
  font-weight: 700;
}

.production-label-quantity strong,
.production-label-allergens strong {
  font-size: 15px;
}

.production-label-allergens {
  border: 1px solid #d7e3f1;
  background: #f8fbff;
}

.production-label-allergens span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #33445d;
}

.production-label-allergens span svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: #f59e0b;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.production-label-processes {
  border-color: #fdba74;
  background: #fff7ed;
}

.production-label-processes span {
  color: #ea580c;
}

.production-label-processes .label-method-list li {
  color: #52657d;
}

.production-label-processes .label-method-list svg {
  color: #ea580c;
}

.production-label-foot {
  margin-top: 2px;
}

.production-label-tip p {
  color: #2563eb;
}

.production-summary-card {
  margin-bottom: 18px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.production-summary-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.production-summary-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9a6b2f;
}

.production-summary-icon svg,
.production-process-card h4 svg,
.production-allergen-card strong svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.production-summary-lot {
  color: #1d4ed8;
  font-size: 18px;
  font-weight: 900;
}

.production-detail-grid,
.production-process-stack,
.production-ingredient-list {
  display: grid;
  gap: 12px;
}

.production-process-card,
.production-ingredient-card {
  padding: 16px;
  border: 1px solid #dbe6f3;
  border-radius: 12px;
  background: #f8fbff;
}

.production-process-card h4,
.production-allergen-card strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.production-process-card p,
.production-allergen-card span {
  margin: 0;
  color: #52657d;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
}

.production-process-card-amber {
  border-color: #fdba74;
  background: #fff7ed;
}

.production-process-card-amber h4 {
  color: #c2410c;
}

.production-process-card-cool {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.production-process-card-cool h4 {
  color: #1d4ed8;
}

.production-allergen-card {
  background: #fff;
}

.production-allergen-card strong {
  color: #33445d;
}

.production-allergen-card strong svg {
  stroke: #f59e0b;
}

.production-signature-preview {
  text-align: center;
}

.lot-preview-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: #eff6ff;
}

.lot-preview-card p,
.lot-preview-card small {
  margin: 0;
}

.lot-preview-card p {
  color: #52657d;
  font-size: 13px;
  font-weight: 650;
}

.lot-preview-card strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1d4ed8;
  font-size: 18px;
  font-weight: 900;
}

.lot-preview-card strong svg,
.production-process-select h3 svg,
.production-process-select small svg,
.production-process-checks label span svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lot-preview-card strong svg {
  color: #9a6b2f;
}

.lot-preview-card small {
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
}

.production-process-select {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #fdba74;
  border-radius: 14px;
  background: #fff7ed;
}

.production-process-select h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7c2d12;
  font-size: 14px;
  font-weight: 900;
}

.production-process-select h3 svg,
.production-process-checks label span svg {
  color: #ea580c;
}

.production-process-checks {
  border: 0;
  padding: 0;
  background: transparent;
  gap: 10px;
}

.production-process-checks.check-group.single {
  background: transparent;
  border: 0;
  padding: 0;
}

.production-process-checks label {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.production-process-checks label span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.production-process-select small {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: #9a3412;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.production-process-select small svg {
  margin-top: 1px;
  color: #f59e0b;
}

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

.production-ingredients-head p {
  margin: 0;
  color: #52657d;
  font-size: 13px;
  font-weight: 650;
}

.production-ingredient-dropzone {
  margin-bottom: 16px;
  min-height: 168px;
}

.production-ingredient-card {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #dbe6f3;
  border-radius: 14px;
  background: #f8fbff;
}

.production-ingredient-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.production-ingredient-card-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.allergen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 14px;
  border: 1px solid #d7e3f1;
  border-radius: 13px;
  background: #f8fbff;
}

.allergen-option {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #33445d;
  font-weight: 650;
}

.allergen-option input {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.allergen-option > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.allergen-option img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.allergen-help {
  display: block;
  margin-top: 10px;
  color: #73849a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.check-section h3 svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 700px) {
  .production-label-row,
  .label-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .production-ingredients-head {
    align-items: stretch;
    flex-direction: column;
  }

  .production-ingredients-head .primary-action {
    width: 100%;
  }

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

  .login-card {
    padding: 22px;
  }

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

.modal-tabbar {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-tabbar .tab-chip {
  min-height: 34px;
}

.tab-chip {
  position: relative;
}

.tab-counter {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.modal-tab-panel {
  display: grid;
  gap: 16px;
}

.modal-tab-panel.is-hidden {
  display: none;
}

.modal-tab-panel .empty-state {
  min-height: 220px;
}

.abatement-form-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f6f9fd;
  color: #314560;
  font-weight: 650;
}

.abatement-form-meta span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.abatement-form-meta svg,
.abatement-form-section h3 svg,
.abatement-method-option svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

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

.abatement-form-section {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid #f2c88f;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
}

.abatement-form-section h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9a3412;
  font-size: 14px;
  font-weight: 900;
}

.abatement-form-section p {
  margin: 0;
  color: #cf6a1f;
  font-size: 12px;
  font-weight: 650;
}

.abatement-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
}

.abatement-method-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #33445d;
  font-weight: 700;
}

.abatement-method-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.abatement-form-grid .form-field small,
.abatement-form-section small {
  color: #6b7ea5;
  font-size: 12px;
  font-weight: 600;
}

.abatement-form-grid .upload-box {
  margin-top: 2px;
}

.abatement-form-grid .upload-box .upload-area {
  min-height: 86px;
}

.abatement-form-grid .upload-box svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 900px) {
  .abatement-table-wrap {
    padding: 12px;
  }

  .abatement-methods,
  .status-stack {
    justify-content: flex-end;
  }

  .abatement-form-meta,
  .abatement-form-row,
  .abatement-method-grid {
    grid-template-columns: 1fr;
  }

  .tab-counter {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
  }
}
