@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Manrope:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #f6f6f3;
  --panel: #ffffff;
  --ink: #111213;
  --muted: #6c6f73;
  --accent: #c8b98a;
  --border: #e4e6e8;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
}

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-title {
  font-family: "Playfair Display", serif;
  font-size: 1.1rem;
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.nav-btn {
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.nav-btn.active {
  background: #f2ede6;
  color: var(--ink);
}

.sidebar-footer {
  margin-top: auto;
}

.main {
  padding: 28px 32px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 2rem;
}

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

.btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
}

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

.btn.ghost {
  background: transparent;
}

.chip {
  background: #f2ede6;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  color: var(--muted);
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

.quick-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  border: none;
  cursor: pointer;
}

.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff8e7;
  margin-bottom: 12px;
}

.toast-root {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: grid;
  gap: 10px;
  z-index: 100;
}

.toast {
  background: #111213;
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 12px 30px rgba(15, 17, 20, 0.12);
  font-size: 0.9rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #b23b3b;
}

.toast.success {
  background: #1f6f4a;
}

.order-new {
  border-color: rgba(200, 185, 138, 0.85);
  box-shadow: 0 10px 24px rgba(200, 185, 138, 0.2);
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.95), #fff);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  border: 1px solid transparent;
}

.status-default { background: #f2f2f2; color: #6a6a6a; }
.status-new { background: #eef6ff; color: #2d5d9f; border-color: #d7e7ff; }
.status-warn { background: #fff6e5; color: #9a6b12; border-color: #ffe3b0; }
.status-paid { background: #edf7f2; color: #2b6b4f; border-color: #cfe8dc; }
.status-info { background: #eef2ff; color: #3947a7; border-color: #d8ddff; }
.status-success { background: #eaf8ef; color: #2f6b43; border-color: #cfe7d9; }
.status-danger { background: #fdecec; color: #9a2c2c; border-color: #f7caca; }

.call-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-visible { animation: fadeUp 0.9s ease forwards; }
.reveal.stagger > * { opacity: 0; transform: translateY(14px); }
.reveal.stagger.is-visible > * { animation: fadeUp 0.7s ease forwards; }
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.4s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.float { animation: float 6s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible,
  .float,
  .reveal.stagger > * {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

.media-frame {
  border-radius: 18px;
  border: 1px solid rgba(228, 230, 232, 0.9);
  filter: grayscale(0.15) saturate(0.7);
  box-shadow: 0 16px 30px rgba(16, 18, 20, 0.08);
}

.cta-shell {
  position: relative;
  overflow: hidden;
}

.cta-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(200, 185, 138, 0.22), transparent 60%);
  pointer-events: none;
}

.view { display: none; }
.view.active { display: grid; gap: 18px; }

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

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

.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}

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

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input[type="text"],
.filters input[type="date"],
.filters select {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
  min-height: 38px;
  box-shadow: 0 10px 22px rgba(15, 17, 20, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filters input[type="text"]:focus,
.filters input[type="date"]:focus,
.filters select:focus {
  outline: none;
  border-color: rgba(200, 185, 138, 0.7);
  box-shadow: 0 14px 30px rgba(15, 17, 20, 0.08);
}

.filters select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8f8f8f 50%),
    linear-gradient(135deg, #8f8f8f 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 16px,
    calc(100% - 12px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.filters .btn {
  min-height: 38px;
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(15, 17, 20, 0.04);
}

.table {
  display: grid;
  gap: 10px;
}

.table-head {
  display: grid;
  gap: 12px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.table-head + .table {
  margin-top: 6px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  align-items: center;
}

.table-row select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  font: inherit;
  background: #fff;
  min-height: 36px;
  box-shadow: 0 8px 18px rgba(15, 17, 20, 0.04);
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #8f8f8f 50%),
    linear-gradient(135deg, #8f8f8f 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 15px,
    calc(100% - 12px) 15px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.table-row select:focus {
  outline: none;
  border-color: rgba(200, 185, 138, 0.7);
  box-shadow: 0 12px 26px rgba(15, 17, 20, 0.08);
}

.table-row strong { font-weight: 700; }

.users-head,
.users-row {
  grid-template-columns: 1.3fr 1fr 0.7fr 0.8fr 0.6fr 0.7fr;
}

.couriers-head,
.couriers-row {
  grid-template-columns: 1fr 1.1fr 0.9fr 0.7fr 0.8fr 0.9fr 0.7fr;
}

.deliveries-row {
  grid-template-columns: 1.2fr 0.7fr 0.8fr 0.7fr 0.6fr;
}

.bonus-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bonus-cell .input {
  min-width: 0;
  max-width: 120px;
}

.action-cell {
  display: flex;
  justify-content: flex-end;
}

.input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  width: 100%;
}

.input.slim {
  padding: 6px 8px;
}

.small {
  font-size: 0.75rem;
}

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

.list-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: grid;
  gap: 6px;
}

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

.form input,
.form textarea,
.form select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
}

.form textarea { min-height: 80px; }

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

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.list-item .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  background: #f2ede6;
  color: var(--muted);
}

.status {
  font-weight: 600;
  color: var(--ink);
}

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

.drawer {
  position: fixed;
  right: 20px;
  top: 90px;
  width: 360px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(31,27,22,0.4);
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #fff;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border);
  width: 360px;
  display: grid;
  gap: 10px;
}

.modal.show { display: flex; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 0; z-index: 2; flex-direction: row; overflow-x: auto; }
  .nav { grid-auto-flow: column; grid-auto-columns: max-content; }
}

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr; }
  .grid.two { grid-template-columns: 1fr; }
  .drawer { position: static; width: auto; }
}
