:root {
  --mango: #f6a609;
  --mango-dark: #d98800;
  --cream: #fff8ec;
  --cream-2: #fdf1dc;
  --brown: #5a3e2b;
  --ink: #2f271c;
  --muted: #7a6a58;
  --line: #eadfce;
  --green: #2f7d4f;
  --green-soft: #e6f4ec;
  --red: #c0392b;
  --red-soft: #fbe9e7;
  --amber: #b26a00;
  --amber-soft: #fdf1d6;
  --blue: #2563eb;
  --blue-soft: #e7efff;
  --shadow: 0 10px 30px rgba(90, 62, 43, 0.08);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
}

a { color: var(--brown); text-decoration: none; }
a:hover { color: var(--mango-dark); }

h1, h2, h3, h4 { margin: 0 0 0.5rem; line-height: 1.2; color: var(--ink); }
p { margin: 0 0 0.85rem; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.grow { flex: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem 1.05rem; border-radius: 10px; border: 1px solid transparent;
  font-size: 0.94rem; font-weight: 600; cursor: pointer; transition: all .15s ease;
  background: var(--mango); color: #3a2a12; text-decoration: none; line-height: 1.2;
}
.btn:hover { background: var(--mango-dark); color: #fff; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--mango); color: var(--brown); background: var(--cream-2); }
.btn-dark { background: var(--brown); color: #fff; }
.btn-dark:hover { background: #45301f; color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #256640; color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #9c2c20; color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover { background: #1d4ed8; color: #fff; }
.btn-sm { padding: 0.38rem 0.7rem; font-size: 0.82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Public nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 248, 236, 0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--brown); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--mango), #ffcf66); color: #5a3e2b; font-size: 1.2rem;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.nav-links { display: flex; align-items: center; gap: 1.35rem; }
.nav-links a { font-weight: 600; color: var(--ink); }
.nav-links a:hover, .nav-links a.active { color: var(--mango-dark); }
.nav-actions { display: flex; align-items: center; gap: 0.6rem; }

/* ---------- Messages ---------- */
.messages { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.5rem; }
.alert { padding: 0.75rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 0.92rem; }
.alert-success { background: var(--green-soft); border-color: #bfe3cd; color: #1d5b38; }
.alert-error { background: var(--red-soft); border-color: #f3c4bd; color: #8f2b20; }
.alert-warning { background: var(--amber-soft); border-color: #f0d59a; color: #7a4a00; }
.alert-info { background: var(--blue-soft); border-color: #c3d6ff; color: #1e40af; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 400px at 80% -10%, #ffe6ad 0%, transparent 60%),
              linear-gradient(180deg, #fff3d6, var(--cream));
  border-bottom: 1px solid var(--line);
  padding: 4.2rem 0 3.5rem;
}
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; }
.hero p { font-size: 1.08rem; color: var(--muted); max-width: 46ch; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .4rem; background: #fff; border: 1px solid var(--line);
  padding: .35rem .8rem; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--brown);
  margin-bottom: 1rem;
}
.hero-art {
  aspect-ratio: 1/1; border-radius: 26px; background:
    radial-gradient(circle at 30% 25%, #ffd47a, transparent 45%),
    radial-gradient(circle at 70% 75%, #ffb347, transparent 50%),
    linear-gradient(135deg, #ffe9b8, #ffd27a);
  display: grid; place-items: center; box-shadow: var(--shadow);
  border: 6px solid #fff;
}
.hero-art .cup { font-size: 6rem; filter: drop-shadow(0 12px 18px rgba(90,62,43,.2)); }

.section { padding: 3.2rem 0; }
.section-title { font-size: 1.6rem; font-weight: 800; }
.section-head { margin-bottom: 1.5rem; }
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 1.2rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; box-shadow: var(--shadow);
}
.card-flat { box-shadow: none; }
.product-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.product-media {
  aspect-ratio: 16/10; background: linear-gradient(135deg, #ffe9b8, #ffd27a);
  display: grid; place-items: center; font-size: 3rem; color: #b57b12; position: relative;
}
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.product-body h3 { font-size: 1.08rem; margin: 0; }
.price { font-weight: 800; color: var(--brown); font-size: 1.05rem; }
.price .cur { font-size: .75rem; color: var(--muted); font-weight: 700; }

.pill {
  display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem;
  border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .01em;
}
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-grey { background: #f0ebe2; color: var(--muted); }

/* ---------- Status badges ---------- */
.status { font-size: .72rem; font-weight: 800; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.status-PENDING { background: var(--amber-soft); color: var(--amber); }
.status-PREPARING { background: var(--blue-soft); color: var(--blue); }
.status-READY { background: #e8f7ef; color: var(--green); }
.status-COMPLETED { background: #ece9e3; color: #5b5347; }
.status-CANCELLED { background: var(--red-soft); color: var(--red); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); background: #fff9ef; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding: 2.6rem 0; }
.footer h4 { margin-bottom: .7rem; }
.footer a { display: block; color: var(--muted); margin-bottom: .35rem; }
.footer a:hover { color: var(--mango-dark); }
.footer-bottom { border-top: 1px solid var(--line); padding: 1rem 0; color: var(--muted); font-size: .85rem; }

/* ---------- Forms ---------- */
.form-control {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 9px;
  font-size: .95rem; background: #fff; color: var(--ink); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--mango); box-shadow: 0 0 0 3px rgba(246,166,9,.18); }
.form-check-input { width: 1.05rem; height: 1.05rem; }
label { font-weight: 600; font-size: .88rem; margin-bottom: .3rem; display: inline-block; }
.form-row { margin-bottom: 1rem; }
.form-help { font-size: .8rem; color: var(--muted); }
.form-error { color: var(--red); font-size: .82rem; margin-top: .25rem; }
select.form-control { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
textarea.form-control { resize: vertical; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #fffaf1; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #fffdf8; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 2.5rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 2rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.5rem; }
.auth-hint { background: var(--cream-2); border: 1px dashed var(--line); border-radius: 10px; padding: .7rem .9rem; font-size: .82rem; color: var(--muted); }

/* ---------- Dashboard shell ---------- */
.app { min-height: 100vh; background: #faf4ea; }
.app-header {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1.4rem; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.app-header .brand { font-size: 1.02rem; }
.app-user { display: flex; align-items: center; gap: .75rem; font-size: .86rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--mango), #ffcf66); display: grid; place-items: center; font-weight: 800; color: #5a3e2b; text-transform: uppercase; }
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - 61px); }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 1.2rem .8rem; }
.sidebar .nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .4rem .75rem; margin-top: 1rem; font-weight: 700; }
.sidebar a {
  display: flex; align-items: center; gap: .65rem; padding: .58rem .75rem; border-radius: 10px;
  font-weight: 600; color: var(--ink); font-size: .92rem; margin-bottom: .15rem;
}
.sidebar a:hover { background: var(--cream-2); color: var(--brown); }
.sidebar a.active { background: var(--mango); color: #3a2a12; }
.sidebar a .ico { width: 1.15rem; text-align: center; }
.app-main { padding: 1.6rem 1.8rem 3rem; }
.page-title { font-size: 1.5rem; font-weight: 800; margin-bottom: .2rem; }
.page-sub { color: var(--muted); margin-bottom: 1.5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.7rem; font-weight: 800; color: var(--brown); margin-top: .2rem; }
.stat .sub { font-size: .8rem; color: var(--muted); }

/* ---------- Kitchen board ---------- */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; align-items: start; }
.board-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; min-height: 160px; }
.board-col h3 { display: flex; align-items: center; justify-content: space-between; font-size: .95rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: .8rem; }
.board-col .count { background: var(--cream-2); color: var(--brown); border-radius: 999px; padding: .05rem .55rem; font-size: .8rem; }
.order-card { border: 1px solid var(--line); border-radius: 12px; padding: .8rem .85rem; margin-bottom: .75rem; background: #fffdf8; }
.order-card.urgent { border-color: #f3c4bd; background: #fff6f4; }
.order-card .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .35rem; }
.order-card .num { font-weight: 800; }
.order-card .meta { font-size: .76rem; color: var(--muted); margin-bottom: .5rem; }
.order-card ul { list-style: none; margin: 0 0 .6rem; padding: 0; font-size: .88rem; }
.order-card li { display: flex; justify-content: space-between; padding: .18rem 0; border-bottom: 1px dashed #efe6d7; }
.order-card li:last-child { border-bottom: none; }
.order-card .qty { font-weight: 800; color: var(--brown); }
.order-card .actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.order-card .actions form { margin: 0; }
.empty { color: var(--muted); font-size: .86rem; text-align: center; padding: 1.4rem 0; }

/* ---------- Order create ---------- */
.menu-group { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; background: #fff; }
.menu-group-head { background: #fffaf1; padding: .6rem 1rem; border-bottom: 1px solid var(--line); font-weight: 800; }
.menu-row { display: grid; grid-template-columns: 1fr 90px 110px; gap: .8rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid #f4ece0; }
.menu-row:last-child { border-bottom: none; }
.menu-row .name { font-weight: 600; }
.menu-row .stock { font-size: .78rem; color: var(--muted); }
.menu-row .price { text-align: right; }
.qty-input { width: 74px; padding: .45rem .5rem; text-align: center; }
.order-summary { position: sticky; top: 80px; }
.summary-line { display: flex; justify-content: space-between; padding: .25rem 0; font-size: .9rem; }
.summary-total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .6rem; font-weight: 800; font-size: 1.1rem; }

/* ---------- Detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.4rem; align-items: start; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.5rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--mango); }
.timeline li::after { content: ""; position: absolute; left: .3rem; top: 1.1rem; width: 2px; height: calc(100% - .4rem); background: var(--line); }
.timeline li:last-child::after { display: none; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: .4rem 0; border-bottom: 1px dashed #efe6d7; font-size: .9rem; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }

.bar-track { background: #f1e8da; border-radius: 999px; height: 10px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--mango), #ffce5c); height: 100%; }

.filter-bar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.filter-bar .form-control { max-width: 240px; }

.badge-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-grid, .grid-3, .grid-4, .stat-grid, .detail-grid, .board { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; flex-wrap: wrap; gap: .3rem; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar .nav-label { display: none; }
  .sidebar a { margin-bottom: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .app-main { padding: 1.2rem 1rem 2.5rem; }
  .menu-row { grid-template-columns: 1fr 70px; }
  .menu-row .price { grid-column: 2; text-align: right; }
}
