:root {
  --navy: #1b2a4a;
  --navy-700: #24375f;
  --navy-900: #121d35;
  --orange: #f5a623;
  --orange-100: #fff2d7;
  --pink: #e91e8c;
  --pink-100: #ffe1f1;
  --cream: #fff8ea;
  --cream-2: #fffdf6;
  --mint: #dff8ee;
  --sky: #e8f4ff;
  --ink: #172033;
  --muted: #68738a;
  --line: #e6eaf2;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --shadow-sm: 0 8px 24px rgba(27, 42, 74, 0.08);
  --shadow-md: 0 18px 48px rgba(27, 42, 74, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --sidebar-width: 280px;
  --topbar-height: 72px;
  --font-display: "Fredoka", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-height: 100%;
  background: var(--cream-2);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 8% 14%, rgba(245, 166, 35, 0.18), transparent 26rem),
    radial-gradient(circle at 84% 6%, rgba(233, 30, 140, 0.12), transparent 24rem),
    radial-gradient(circle at 78% 84%, rgba(27, 42, 74, 0.10), transparent 28rem),
    linear-gradient(135deg, #fffdf7 0%, #f8fbff 48%, #fff8ea 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.48;
  background-image:
    radial-gradient(circle, rgba(245, 166, 35, 0.42) 0 2px, transparent 2.6px),
    radial-gradient(circle, rgba(233, 30, 140, 0.26) 0 1.5px, transparent 2.2px),
    radial-gradient(circle, rgba(27, 42, 74, 0.18) 0 1.6px, transparent 2.4px);
  background-position: 0 0, 22px 28px, 46px 12px;
  background-size: 92px 92px, 118px 118px, 138px 138px;
}

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

a:hover {
  color: #c81575;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 18% 14%, rgba(245, 166, 35, 0.28), transparent 12rem),
    radial-gradient(circle at 86% 4%, rgba(233, 30, 140, 0.24), transparent 10rem),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-900) 100%);
  box-shadow: 18px 0 48px rgba(27, 42, 74, 0.12);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 22px;
}

.brand-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  background: var(--orange);
  border: 3px solid rgba(255, 255, 255, 0.92);
  border-radius: 18px 18px 18px 8px;
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.24);
}

.brand-name {
  display: block;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.05;
}

.brand-subtitle {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.82rem;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.nav-section-label {
  margin: 18px 10px 6px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.86);
  border-radius: 14px;
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.nav-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 10px;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 42px);
  border-bottom: 1px solid rgba(230, 234, 242, 0.82);
  background: rgba(255, 253, 247, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-title {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.user-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  color: var(--navy);
  font-weight: 800;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 19px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 4px;
}

.hamburger span::before {
  transform: translateY(-6px);
}

.hamburger span::after {
  transform: translateY(4px);
}

.content {
  width: min(1480px, 100%);
  padding: 28px clamp(18px, 4vw, 42px) 56px;
  margin-inline: auto;
}

.page-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-kicker {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.98;
}

.page-subtitle {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid rgba(230, 234, 242, 0.82);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.surface {
  padding: 20px;
  background: var(--surface);
  border: 1px solid rgba(230, 234, 242, 0.86);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.surface + .surface {
  margin-top: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

.span-3 {
  grid-column: span 3;
}

.widget-card,
.metric-card,
.calendar-card,
.interactive-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(230, 234, 242, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.widget-card::after,
.metric-card::after {
  position: absolute;
  top: -34px;
  right: -26px;
  width: 96px;
  height: 96px;
  content: "";
  background: radial-gradient(circle, rgba(245, 166, 35, 0.28), transparent 68%);
  border-radius: 999px;
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.metric-value {
  margin: 8px 0 4px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1;
}

.metric-foot {
  margin: 0;
  color: var(--muted);
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  color: var(--navy);
  font-weight: 900;
  line-height: 1;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(27, 42, 74, 0.08);
  cursor: pointer;
  transition: 160ms ease;
}

.btn:hover {
  color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(27, 42, 74, 0.12);
}

.btn-primary {
  color: var(--navy);
  background: var(--orange);
  border-color: rgba(245, 166, 35, 0.2);
}

.btn-secondary {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.btn-accent {
  color: #fff;
  background: var(--pink);
  border-color: var(--pink);
}

.btn-danger {
  color: #fff;
  background: #d92d20;
  border-color: #d92d20;
}

.btn-light {
  background: rgba(255, 255, 255, 0.74);
}

.btn-sm {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

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

.form-field {
  display: grid;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 900;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d8deea;
  border-radius: 14px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

textarea {
  min-height: 128px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  background: #fff;
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.18);
}

.field-help {
  color: var(--muted);
  font-size: 0.86rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.article-picker {
  gap: 12px;
}

.article-picker-results {
  display: grid;
  gap: 8px;
}

.article-result {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: var(--navy);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.picked-items {
  margin-top: 6px;
}

.package-children {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.package-children[hidden],
[data-delivery-address-field][hidden] {
  display: none !important;
}

.package-row {
  font-weight: 800;
}

div.package-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 400;
}

.nested-item td:first-child {
  padding-left: 34px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f8fafc;
}

.data-table tr:hover td {
  background: #fffaf0;
}

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

.table-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  padding: 34px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.82);
  border: 2px dashed #dbe2ee;
  border-radius: var(--radius-lg);
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 10px;
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  background: #eef2f7;
  border-radius: 999px;
}

.badge-success {
  color: #076246;
  background: var(--mint);
}

.badge-warning {
  color: #8a5200;
  background: var(--orange-100);
}

.badge-danger {
  color: #9a1c1c;
  background: #ffe2df;
}

.bank-row-unmatched {
  background: #fef2f2;
}

.bank-row-unmatched td:first-child {
  box-shadow: inset 4px 0 0 #dc2626;
}

.bank-row-debit {
  background: #fffbeb;
}

.badge-info {
  color: #135285;
  background: var(--sky);
}

.invoice-totals {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.invoice-totals .totals-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.invoice-totals .totals-row-total {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}

.badge-pink {
  color: #8f0f54;
  background: var(--pink-100);
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.flash-success {
  background: #f0fff7;
  border-color: #bcebd4;
}

.flash-error {
  background: #fff2f0;
  border-color: #ffc9c1;
}

.flash-warning {
  background: #fff7e5;
  border-color: #f7dca7;
}

.flash-info {
  background: #eef7ff;
  border-color: #c8e4ff;
}

.flash-dismiss {
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 1.25rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-link {
  display: inline-flex;
  min-width: 38px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  color: var(--navy);
  font-weight: 900;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.page-link.is-active {
  color: var(--navy);
  background: var(--orange);
  border-color: var(--orange);
}

.page-link.is-disabled {
  color: #a2aabc;
  pointer-events: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.calendar-day {
  min-height: 132px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.calendar-day.is-today {
  border-color: var(--orange);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.16);
}

.calendar-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--navy);
  font-weight: 900;
}

.calendar-event {
  display: block;
  padding: 7px 9px;
  margin-top: 8px;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 800;
  background: var(--orange-100);
  border-left: 4px solid var(--orange);
  border-radius: 10px;
}

.agenda-list,
.timeline,
.route-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.agenda-item,
.timeline-item,
.route-stop {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.route-stop {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.drag-handle {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--muted);
  background: #f3f6fa;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: grab;
}

.route-stop.is-dragging {
  opacity: 0.6;
  transform: scale(0.99);
}

.chart-placeholder {
  display: grid;
  min-height: 260px;
  place-items: end stretch;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(27, 42, 74, 0.05), transparent),
    repeating-linear-gradient(to top, transparent 0 48px, rgba(27, 42, 74, 0.08) 49px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.chart-bars {
  display: grid;
  gap: 12px;
  align-items: end;
  min-height: 210px;
  grid-template-columns: repeat(6, 1fr);
}

.chart-bar {
  position: relative;
  min-height: 22px;
  background: linear-gradient(180deg, var(--pink), var(--orange));
  border-radius: 12px 12px 4px 4px;
}

.chart-bar span {
  position: absolute;
  right: 0;
  bottom: -26px;
  left: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.guest-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
}

.guest-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 7vw, 88px);
  color: #fff;
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 166, 35, 0.46), transparent 16rem),
    radial-gradient(circle at 90% 10%, rgba(233, 30, 140, 0.28), transparent 18rem),
    linear-gradient(145deg, var(--navy) 0%, #14213d 100%);
}

.guest-hero h1 {
  max-width: 720px;
  margin: 24px 0 16px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.9;
}

.guest-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.guest-bullets {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 32px 0 0;
  list-style: none;
}

.guest-bullets li {
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.guest-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
}

.login-box {
  width: min(440px, 100%);
  padding: clamp(24px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(230, 234, 242, 0.88);
  border-radius: 28px;
  box-shadow: var(--shadow-md);
}

.login-box h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 2.15rem;
  line-height: 1;
}

.login-box p {
  margin: 0 0 22px;
  color: var(--muted);
}

.document {
  width: min(980px, 100%);
  padding: 34px;
  margin: 24px auto;
  color: #172033;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.document-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--orange);
}

.document-title {
  margin: 0;
  color: var(--navy);
  font-family: var(--font-display);
  font-size: 2.3rem;
}

.document-meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  text-align: right;
}

.document-section {
  margin-top: 24px;
}

.document-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.document-table th,
.document-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.document-table th {
  color: var(--navy);
  background: #f8fafc;
}

.signature-line {
  height: 76px;
  margin-top: 12px;
  border-bottom: 1px solid #9ca3af;
}

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

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

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open::after {
    position: fixed;
    inset: 0;
    z-index: 35;
    content: "";
    background: rgba(18, 29, 53, 0.44);
  }

  .hamburger {
    display: inline-flex;
  }

  .topbar {
    gap: 12px;
  }

  .topbar-actions .user-pill {
    display: none;
  }

  .page-header {
    flex-direction: column;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

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

  .guest-hero {
    min-height: 46vh;
  }
}

@media (max-width: 640px) {
  .content {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 14px;
  }

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

  .toolbar,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn,
  .toolbar form,
  .toolbar input,
  .toolbar select {
    width: 100%;
  }

  .route-stop {
    grid-template-columns: auto 1fr;
  }

  .route-stop .table-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

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

  html,
  body {
    background: #fff !important;
  }

  body::before,
  .sidebar,
  .topbar,
  .no-print,
  .btn,
  .toolbar,
  .flash-stack {
    display: none !important;
  }

  .app-shell,
  .app-main,
  .content {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .surface,
  .document {
    padding: 0;
    margin: 0;
    border: 0;
    box-shadow: none;
  }

  .data-table,
  .document-table {
    min-width: 0;
    font-size: 12px;
  }

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

.plugin-config-form fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  margin: 0 0 12px;
}
.plugin-config-form legend {
  padding: 0 6px;
  color: #1B2A4A;
  font-weight: 700;
}
.plugin-config-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
}
.plugin-config-form input,
.plugin-config-form select {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.customer-picker {
  display: flex;
  gap: 10px;
  align-items: center;
}

.customer-picker input[type="search"] {
  flex: 1;
}

.customer-search-results,
.article-picker-results {
  margin-top: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  max-height: 240px;
  overflow: auto;
}

.customer-search-results button,
.article-picker-results button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  cursor: pointer;
}

.customer-search-results button:hover,
.article-picker-results button:hover {
  background: #f8fafc;
}

.app-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  max-width: min(640px, calc(100vw - 32px));
  width: 100%;
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.22);
}

.app-dialog::backdrop {
  background: rgba(23, 32, 51, 0.45);
}

.app-dialog-body {
  padding: 20px;
}

.choice-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}

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

.stock-dialog-list {
  margin: 12px 0;
  max-height: 240px;
  overflow: auto;
}

.stock-conflict-block {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
}
