@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: light;
  --brand: #14532d;
  --brand-600: #166534;
  --brand-soft: #ecfdf3;
  --accent: #c78b12;
  --bg: #f6f7f5;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --ink: #171717;
  --muted: #5f6661;
  --subtle: #8b9490;
  --line: rgba(23, 23, 23, 0.09);
  --ring: rgba(23, 23, 23, 0.08) 0 0 0 1px;
  --card-shadow: rgba(23,23,23,.08) 0 0 0 1px, rgba(23,23,23,.04) 0 2px 2px, rgba(23,23,23,.05) 0 12px 28px -16px, #fafafa 0 0 0 1px inset;
  --focus: #0072f5;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-feature-settings: "liga" 1;
  background:
    radial-gradient(circle at 8% -8%, rgba(20, 83, 45, .12), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 330px);
  color: var(--ink);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(23,23,23,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(23,23,23,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.55), transparent 420px);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-heading {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.hero-logo-card {
  flex: 0 0 auto;
  width: 92px;
  height: 72px;
  padding: 8px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #fbfaf4);
  box-shadow: rgba(20,83,45,.18) 0 0 0 1px, rgba(23,23,23,.12) 0 16px 34px -24px;
}
.hero-logo { filter: drop-shadow(0 8px 16px rgba(20,83,45,.10)); }
.login-logo-wrap {
  width: 172px;
  height: 118px;
  justify-self: center;
  display: grid;
  place-items: center;
  padding: 14px;
  border-radius: 26px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(20,83,45,.28), rgba(199,139,18,.32)) border-box;
  border: 1px solid transparent;
  box-shadow: rgba(20,83,45,.16) 0 18px 45px -28px, rgba(23,23,23,.06) 0 0 0 1px;
}
.login-logo { filter: drop-shadow(0 10px 18px rgba(20,83,45,.12)); }

.hero {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 18px 28px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  backdrop-filter: blur(18px);
  box-shadow: rgba(23,23,23,.08) 0 1px 0;
}

.brand-heading > div:last-child { display: grid; gap: 4px; }
.eyebrow {
  color: var(--brand-600);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  margin: 0 0 4px;
}
h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: -1.7px;
  font-weight: 600;
}
.hero p { max-width: 760px; margin: 0; line-height: 1.45; color: var(--muted); font-size: 14px; }
.hero-actions { display: flex; align-items: center; gap: 12px; }
.hero-card {
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  box-shadow: var(--card-shadow);
}
.hero-card strong { display: block; font-size: 30px; line-height: 1; letter-spacing: -1px; color: var(--brand); }
.hero-card span { color: var(--muted); font-size: 12px; font-weight: 500; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 5%, rgba(20, 83, 45, .22), transparent 30rem),
    radial-gradient(circle at 92% 90%, rgba(199, 139, 18, .14), transparent 26rem),
    #f7f8f6;
}
.login-card {
  width: min(430px, 100%);
  background: rgba(255,255,255,.92);
  border-radius: 18px;
  padding: 30px;
  box-shadow: var(--card-shadow), rgba(23,23,23,.08) 0 24px 70px -30px;
  display: grid;
  gap: 14px;
  backdrop-filter: blur(16px);
}
.login-card h1 { color: var(--ink); }
.login-card p { color: var(--muted); margin: 0; line-height: 1.55; }

.layout {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(520px, 1.1fr);
  gap: 18px;
  padding: 24px;
  max-width: 1480px;
  margin: 0 auto;
  position: relative;
}
.panel {
  background: rgba(255,255,255,.94);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
}
.wide { grid-column: 1 / -1; }
.panel-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.45px; font-weight: 600; }
.panel-title h3 { margin: 0; font-size: 15px; letter-spacing: -.2px; }
.panel-title span, .hint, small { color: var(--muted); }
.delivery-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delivery-actions input, .delivery-actions select { width: auto; min-width: 170px; }
.overview-panel { background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,253,251,.96)); }
.overview-filter { width: auto; min-width: 210px; }
.overview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.overview-grid .order-card { margin: 0; }
.overview-empty { margin: 0; padding: 18px; border-radius: 12px; background: #fff; box-shadow: var(--ring); }

.grid-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stack-form { display: grid; gap: 12px; }
.full { grid-column: 1 / -1; }
.line-editor { border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #fbfdfb, #ffffff); box-shadow: var(--ring); }
.compact { margin-bottom: 8px; }
.order-line { display: grid; grid-template-columns: 1fr 120px auto; gap: 10px; margin: 8px 0; }
.suggest-field { position: relative; width: 100%; }
.suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 320px;
  overflow-y: auto;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: rgba(23,23,23,.14) 0 0 0 1px, rgba(23,23,23,.18) 0 18px 50px -22px;
  padding: 6px;
}
.suggestion-item {
  width: 100%;
  min-height: 0;
  display: grid;
  gap: 3px;
  text-align: left;
  background: #ffffff;
  color: var(--ink);
  box-shadow: none;
  border-radius: 10px;
  padding: 10px 11px;
}
.suggestion-item:hover { background: var(--brand-soft); transform: none; filter: none; }
.suggestion-item strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
.suggestion-item span { color: var(--muted); font-size: 12px; line-height: 1.25; }
label { display: grid; gap: 7px; font-weight: 600; color: #202823; font-size: 13px; }
input, select, textarea {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 13px;
  min-height: 44px;
  font: inherit;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--ring);
  outline: none;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa29d; }
input:focus, select:focus, textarea:focus {
  box-shadow: var(--ring), 0 0 0 3px rgba(0, 114, 245, .16);
}
button {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  min-height: 44px;
  background: var(--ink);
  color: white;
  font-weight: 600;
  font: inherit;
  cursor: pointer;
  box-shadow: rgba(23,23,23,.16) 0 8px 18px -10px;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(0); }
.secondary { background: #ffffff; color: var(--ink); box-shadow: var(--ring); }

.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.day-column { background: #ffffff; border-radius: 14px; padding: 14px; min-height: 220px; box-shadow: var(--ring); }
.day-column h3 { margin: 0 0 7px; color: var(--ink); font-size: 15px; letter-spacing: -.2px; }
.badge { display: inline-block; background: var(--brand-soft); color: var(--brand); padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.order-card { background: #fff; border-radius: 12px; padding: 12px; margin: 10px 0; box-shadow: rgba(20,83,45,.2) 3px 0 0 inset, var(--ring); }
.order-card strong, .order-card small, .order-card em { display: block; }
.order-card small { color: var(--muted); margin-top: 3px; }
.order-card p { margin: 9px 0; line-height: 1.45; }
.order-card em { color: var(--muted); font-size: 13px; }
.empty { color: var(--subtle); font-style: normal; }

.orders-table { overflow-x: auto; border-radius: 14px; box-shadow: var(--ring); }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; border-bottom: 1px solid rgba(23,23,23,.08); padding: 13px 14px; vertical-align: top; font-size: 14px; }
th { color: var(--muted); background: #fbfbfb; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  background: #171717;
  color: white;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: rgba(0,0,0,.22) 0 20px 45px -18px;
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  body { background: #f7f8f6; }
  .hero { position: static; flex-direction: column; align-items: stretch; padding: 20px; }
  .brand-heading { align-items: flex-start; gap: 14px; }
  .hero-logo-card { width: 78px; height: 62px; border-radius: 16px; padding: 7px; }
  .login-logo-wrap { width: 150px; height: 104px; border-radius: 22px; }
  .hero-actions { justify-content: space-between; }
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .grid-form { grid-template-columns: 1fr; }
  .order-line { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .panel { padding: 16px; border-radius: 14px; }
}
@media (max-width: 520px) {
  h1 { font-size: 28px; letter-spacing: -1px; }
  .brand-heading { gap: 10px; }
  .hero-logo-card { width: 66px; height: 54px; border-radius: 14px; padding: 6px; }
  .hero-card { min-width: 100px; }
  .delivery-actions input, .delivery-actions select, .delivery-actions button { width: 100%; }
  th, td { padding: 11px 10px; font-size: 13px; }
}
@media print {
  .hero, form, .hint, .orders-table, #printButton, #deliveryPdfButton, .delivery-actions { display: none !important; }
  body { background: white; }
  .panel { box-shadow: none; }
  .board { grid-template-columns: repeat(5, 1fr); }
}
