:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #18202a;
  --muted: #667085;
  --line: #dbe3ef;
  --primary: #1f6feb;
  --primary-dark: #1659bc;
  --secondary: #eef4ff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --status-new: #2563eb;
  --status-confirmed: #5b21b6;
  --status-cooking: #dc2626;
  --status-prepared: #f97316;
  --status-delivery: #eab308;
  --status-complete: #16a34a;
  --status-cancelled: #6b7280;
  --notify-red: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-shell { width: min(100%, 460px); }

.auth-card,
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card { padding: 24px; }

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-badge {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #5b9cff);
  font-weight: 700;
}

.brand-block h1,
.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.brand-block p,
.eyebrow,
.venue-line {
  margin: 4px 0 0;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.auth-form label,
.date-field,
.date-mode-field {
  display: grid;
  gap: 8px;
}

input,
select,
button { font: inherit; }

input,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease, background 0.14s ease;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.04);
}

.btn:hover { transform: translateY(-1px); }

.btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn-status {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.btn-notify {
  min-width: min(100%, 380px);
  min-height: 52px;
  font-weight: 700;
}

.btn-notify-alert {
  background: var(--notify-red);
  color: #fff;
  box-shadow: 0 0 0 rgba(220, 38, 38, 0.35);
  animation: notifyPulse 1.6s ease-in-out infinite;
}

.btn-notify-ready {
  background: #e7eef8;
  color: #4b5563;
}

.btn:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

@keyframes notifyPulse {
  0% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.35); }
  50% { transform: translateY(-2px); box-shadow: 0 8px 20px 0 rgba(220, 38, 38, 0.22); }
  100% { transform: translateY(0); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.08); }
}

.btn-full { width: 100%; }

.alert {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.alert-error {
  background: #fff1f1;
  color: #9c2222;
  border: 1px solid #f2c4c4;
}

.topbar {
  background: rgba(243, 246, 251, 0.95);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(219, 227, 239, 0.8);
}

.page {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 16px;
}

.toolbar { padding: 16px; }

.toolbar-row { display: grid; gap: 12px; }

.toolbar-row-main { grid-template-columns: 1fr; }

.toolbar-actions-center {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.field-block { display: grid; gap: 10px; }

.field-title {
  font-size: 14px;
  color: var(--muted);
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-pill { position: relative; }

.check-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.check-pill span {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  transition: all 0.14s ease;
}

.check-pill input:checked + span {
  background: var(--secondary);
  border-color: #bfd4ff;
  color: var(--primary-dark);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.summary-card { padding: 14px 16px; }

.summary-card span {
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.summary-card strong { font-size: 20px; }

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card { overflow: visible; }

.order-head-row {
  display: flex;
  align-items: stretch;
}

.status-wrap {
  position: relative;
  width: 144px;
  flex: 0 0 144px;
  z-index: 3;
}

.status-chip {
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 14px 12px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.status-chip:hover { transform: translateY(-1px); }
.status-chip:active { transform: translateY(1px) scale(0.99); }

.status-pending { background: var(--status-new); }
.status-confirmed { background: var(--status-confirmed); }
.status-accepted { background: var(--status-cooking); }
.status-prepared { background: var(--status-prepared); }
.status-delivery { background: var(--status-delivery); color: #fff; }
.status-complete { background: var(--status-complete); }
.status-cancelled { background: var(--status-cancelled); }

.order-head {
  width: 100%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.order-main,
.order-side {
  display: grid;
  gap: 8px;
}

.order-main { flex: 1 1 auto; }

.order-side {
  flex: 0 0 auto;
  align-items: end;
}

.order-address {
  font-weight: 700;
  line-height: 1.35;
}

.order-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.order-time,
.order-number { color: var(--muted); }

.order-sum {
  font-weight: 800;
  font-size: 20px;
  text-align: right;
}

.status-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  z-index: 5;
  width: 260px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fffaf5;
  box-shadow: var(--shadow);
}

.order-body {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 16px;
}

.hidden { display: none !important; }

.detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.detail-full-row { grid-column: 1 / -1; }

.items-block h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.item-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdff;
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.item-modifiers,
.item-comment,
.item-buddy {
  color: var(--muted);
  margin-top: 6px;
}

.empty-state {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state.small { padding: 14px; }

.date-toolbar { display: grid; gap: 10px; }

.date-range-panel {
  display: none;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.date-range-panel.is-active { display: grid; }

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

.btn-date-apply {
  min-height: 48px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .detail-grid,
  .date-range-panel.is-active {
    grid-template-columns: 1fr;
  }

  .order-head-row {
    display: grid;
    grid-template-columns: 110px 1fr;
  }

  .status-wrap {
    width: 110px;
    flex: 0 0 110px;
  }

  .order-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .order-side {
    width: 100%;
    align-items: start;
  }

  .order-sum { text-align: left; }

  .item-top {
    flex-direction: column;
    gap: 6px;
  }

  .status-menu {
    left: 8px;
    width: min(240px, calc(100vw - 32px));
  }

  .btn-notify {
    width: 100%;
    min-width: 0;
  }
}


.totals-block {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.totals-row-final {
  font-size: 16px;
}
