:root {
  --green-950: #062820;
  --green-900: #0B3D32;
  --green-850: #10483B;
  --green-800: #125445;
  --green-700: #176B57;
  --green-600: #1F8068;
  --green-500: #2D967C;
  --green-300: #8CCDB8;
  --green-200: #BCE4D6;
  --green-100: #DFF2EC;
  --green-50: #EFF8F4;
  --paper: #F3F8F5;
  --white: #FFFFFF;
  --ink: #17231F;
  --muted: #66766F;
  --muted-2: #8B9993;
  --danger: #C83E4D;
  --danger-soft: #FCE8EB;
  --warning: #B36A0E;
  --warning-soft: #FFF2D8;
  --blue: #246BCE;
  --blue-soft: #E7F0FD;
  --shadow-sm: 0 1px 2px rgba(6, 40, 32, .04), 0 6px 20px rgba(6, 40, 32, .05);
  --shadow-md: 0 16px 42px rgba(6, 40, 32, .12);
  --radius: 18px;
  --radius-sm: 13px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.strong { font-weight: 750; }
.danger-text { color: var(--danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Login */
.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr);
  background: var(--white);
}
.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 6vw, 78px);
  color: white;
  background:
    radial-gradient(circle at 74% 22%, rgba(140, 205, 184, .28), transparent 25%),
    radial-gradient(circle at 12% 88%, rgba(255, 255, 255, .12), transparent 30%),
    linear-gradient(145deg, var(--green-950), var(--green-800));
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  border: 54px solid rgba(255, 255, 255, .06);
  border-radius: 50%;
  right: -130px;
  bottom: -130px;
}
.login-brand { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.login-brand img { width: 54px; height: 54px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.16)); }
.login-brand b { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; }
.login-brand span { display: block; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 4px; }
.login-copy { max-width: 610px; position: relative; z-index: 1; }
.login-copy h1 { font-size: clamp(36px, 5vw, 64px); letter-spacing: -.055em; line-height: 1.02; margin: 0 0 20px; }
.login-copy p { max-width: 560px; font-size: clamp(16px, 2vw, 20px); color: rgba(255,255,255,.77); margin: 0; }
.login-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-points span { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.12); padding: 8px 12px; border-radius: 999px; font-size: 12px; }
.login-foot { font-size: 12px; color: rgba(255,255,255,.54); position: relative; z-index: 1; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 34px; background: #FBFDFC; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.035em; color: var(--green-950); }
.login-card > p { color: var(--muted); margin: 0 0 30px; }
.login-form { display: grid; gap: 14px; }
.login-version { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 24px; }

/* App frame */
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  color: #DCEDE7;
  background:
    radial-gradient(circle at 30% 10%, rgba(98,184,155,.13), transparent 28%),
    linear-gradient(180deg, var(--green-950), #0A342B 78%, #082F27);
  transition: transform .22s ease;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 22px 18px 16px; }
.side-brand img { width: 42px; height: 42px; }
.side-brand b { display: block; color: #fff; font-size: 19px; letter-spacing: -.025em; }
.side-brand small { color: rgba(220,237,231,.58); font-size: 10.5px; display: block; margin-top: 2px; }
.nav-scroll { flex: 1; overflow-y: auto; padding: 8px 11px 12px; scrollbar-width: thin; }
.nav-title { padding: 15px 12px 6px; color: rgba(220,237,231,.38); font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .15em; }
.nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  color: rgba(230,244,239,.72);
  background: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font-weight: 590;
  margin: 2px 0;
  transition: background .16s, color .16s, transform .16s;
}
.nav-link svg { width: 19px; height: 19px; flex: 0 0 auto; stroke-width: 1.85; }
.nav-link:hover { background: rgba(255,255,255,.07); color: white; }
.nav-link.active { color: white; background: rgba(255,255,255,.13); box-shadow: inset 3px 0 0 var(--green-300); }
.nav-link:active { transform: scale(.985); }
.side-user { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(255,255,255,.06); border-radius: 14px; }
.user-avatar { width: 36px; height: 36px; display: grid; place-items: center; background: rgba(255,255,255,.13); color: white; border-radius: 12px; font-weight: 800; }
.user-chip b { display: block; color: white; font-size: 12.5px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip small { display: block; color: rgba(220,237,231,.52); font-size: 10.5px; margin-top: 1px; }
.side-actions { display: flex; gap: 7px; margin-top: 9px; }
.side-actions button { flex: 1; border: 0; border-radius: 10px; padding: 8px; color: #DCEDE7; background: rgba(255,255,255,.07); cursor: pointer; font-size: 11px; }
.side-actions button:hover { background: rgba(255,255,255,.12); }
.side-version { text-align: center; color: rgba(220,237,231,.34); font-size: 10px; padding: 9px 0 1px; }
.main-area { margin-left: var(--sidebar); width: calc(100% - var(--sidebar)); min-width: 0; }
.mobile-bar { display: none; }
.page { max-width: 1540px; margin: 0 auto; padding: 24px 28px 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 25px; line-height: 1.15; letter-spacing: -.035em; color: var(--green-950); }
.page-head p { color: var(--muted); margin: 5px 0 0; font-size: 13px; }
.page-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  min-height: 42px;
  padding: 10px 15px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  transition: transform .12s, box-shadow .16s, background .16s, opacity .16s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; stroke-width: 2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.btn-primary { color: white; background: var(--green-700); box-shadow: 0 7px 18px rgba(23,107,87,.19); }
.btn-primary:hover { background: var(--green-800); box-shadow: 0 9px 24px rgba(23,107,87,.25); }
.btn-soft { color: var(--green-800); background: var(--green-100); }
.btn-soft:hover { background: var(--green-200); }
.btn-white { color: var(--green-800); background: white; box-shadow: var(--shadow-sm); }
.btn-white:hover { background: var(--green-50); }
.btn-danger { color: var(--danger); background: var(--danger-soft); }
.btn-warning { color: var(--warning); background: var(--warning-soft); }
.btn-ghost { color: var(--muted); background: transparent; padding-left: 10px; padding-right: 10px; }
.btn-ghost:hover { background: rgba(11,61,50,.06); color: var(--green-900); }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 11.5px; border-radius: 10px; }
.btn-icon { width: 40px; padding: 0; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: var(--green-800); background: var(--green-50); }
.icon-button:hover { background: var(--green-100); }
.icon-button svg { width: 17px; height: 17px; }

/* Cards and stats */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 19px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.card-title h2, .card-title h3 { margin: 0; color: var(--green-950); letter-spacing: -.02em; }
.card-title h2 { font-size: 18px; }
.card-title h3 { font-size: 15px; }
.card-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card-subtle { background: linear-gradient(145deg, #fff, #FBFDFC); }
.grid-stats { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 13px; margin-bottom: 16px; }
.stat-card { min-height: 122px; border-radius: var(--radius); background: white; padding: 17px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; justify-content: space-between; }
.stat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stat-label { color: var(--muted); font-size: 11.5px; font-weight: 650; }
.stat-icon { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); }
.stat-icon svg { width: 17px; height: 17px; }
.stat-value { font-size: 24px; line-height: 1; color: var(--green-950); font-weight: 820; letter-spacing: -.035em; }
.stat-note { color: var(--muted-2); font-size: 10.5px; margin-top: 5px; }
.stat-card.warning .stat-icon { color: var(--warning); background: var(--warning-soft); }
.stat-card.danger .stat-icon { color: var(--danger); background: var(--danger-soft); }
.stat-card.blue .stat-icon { color: var(--blue); background: var(--blue-soft); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 16px; align-items: start; }
.mini-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }

/* Filled field design — intentionally not Google-Form-like */
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.field {
  position: relative;
  min-width: 0;
  border-radius: 14px;
  background: #F1F6F3;
  padding: 9px 12px 8px;
  transition: background .16s, box-shadow .16s;
}
.field:focus-within { background: #ECF5F1; box-shadow: 0 0 0 2px rgba(31,128,104,.17); }
.field > label { display: block; color: var(--muted); font-size: 10.5px; font-weight: 750; margin: 0 0 2px; letter-spacing: .01em; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  padding: 2px 0;
  min-height: 27px;
  font-size: 14px;
  font-weight: 540;
}
.field textarea { min-height: 78px; resize: vertical; line-height: 1.45; }
.field select { appearance: none; padding-right: 22px; cursor: pointer; }
.field.select-field::after { content: "⌄"; position: absolute; right: 13px; top: 50%; transform: translateY(-7%); color: var(--green-700); pointer-events: none; font-size: 16px; }
.field input::placeholder, .field textarea::placeholder { color: #A4B0AB; font-weight: 430; }
.field-help { color: var(--muted-2); font-size: 10.5px; margin: 5px 3px 0; }
.field.required > label::after { content: " *"; color: var(--danger); }
.date-field { cursor: pointer; }
.date-field input[type="date"], .date-field input[type="month"], .date-field input[type="time"], .date-field input[type="datetime-local"] { cursor: pointer; position: relative; }
.date-field input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: -28px -12px -8px -12px;
  width: calc(100% + 24px);
  height: calc(100% + 36px);
  opacity: 0;
  cursor: pointer;
}
.date-field::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23176B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
}
.checkbox-row { display: flex; flex-wrap: wrap; gap: 9px; }
.check-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 8px 11px; border-radius: 12px; color: var(--muted); background: #F1F6F3; cursor: pointer; font-size: 12px; }
.check-chip input { width: 16px; height: 16px; accent-color: var(--green-700); }
.check-chip:has(input:checked) { color: var(--green-900); background: var(--green-100); font-weight: 700; }
.segmented { display: inline-flex; gap: 4px; background: #EAF2EE; border-radius: 13px; padding: 4px; flex-wrap: wrap; }
.segmented button { border: 0; border-radius: 10px; min-height: 34px; padding: 7px 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; }
.segmented button.active { background: white; color: var(--green-900); box-shadow: 0 2px 9px rgba(6,40,32,.08); }

/* Toolbar and tables */
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .field { min-width: 150px; padding-top: 7px; padding-bottom: 6px; }
.toolbar .grow { flex: 1; min-width: 220px; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); background: white; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { padding: 12px 14px; text-align: left; color: var(--muted); background: #F7FAF8; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
td { padding: 13px 14px; border-top: 1px solid #EDF3F0; vertical-align: middle; }
tbody tr { transition: background .13s; }
tbody tr:hover { background: #FBFDFC; }
td.actions { width: 1%; white-space: nowrap; text-align: right; }
.table-main { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.table-main .thumb { width: 46px; height: 46px; border-radius: 13px; object-fit: cover; background: var(--green-100); flex: 0 0 auto; }
.table-main b { display: block; font-size: 12.5px; color: var(--ink); }
.table-main small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; }
.mobile-cards { display: none; }
.empty { padding: 44px 22px; text-align: center; color: var(--muted); }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: var(--green-600); background: var(--green-100); margin: 0 auto 12px; }
.empty-icon svg { width: 24px; height: 24px; }
.empty h3 { margin: 0 0 5px; color: var(--green-950); font-size: 15px; }
.empty p { margin: 0 auto; max-width: 400px; font-size: 12px; }
.loading { padding: 38px; display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--green-700); }
.spinner { width: 19px; height: 19px; border: 2px solid var(--green-200); border-top-color: var(--green-700); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chips and statuses */
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 4px 9px; border-radius: 999px; color: var(--green-800); background: var(--green-100); font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.chip.gray { color: #68726E; background: #EEF1F0; }
.chip.blue { color: #245FAE; background: var(--blue-soft); }
.chip.warning { color: var(--warning); background: var(--warning-soft); }
.chip.danger { color: var(--danger); background: var(--danger-soft); }
.chip.dark { color: white; background: var(--green-900); }
.status-new { color: #4D6A61; background: #EAF0ED; }
.status-confirmed { color: #246BCE; background: #E7F0FD; }
.status-preparing { color: #9B5B0B; background: #FFF0D1; }
.status-ready { color: #15745D; background: #DDF3EA; }
.status-on_delivery { color: #6A4AB2; background: #EEE8FC; }
.status-completed { color: #176B57; background: #DFF2EC; }
.status-cancelled { color: #B53543; background: #FBE5E8; }
.payment-unpaid { color: #B53543; background: #FBE5E8; }
.payment-partial { color: #9B5B0B; background: #FFF0D1; }
.payment-paid { color: #176B57; background: #DFF2EC; }

/* Lists */
.list { display: grid; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 14px; background: #F7FAF8; }
.list-row:hover { background: var(--green-50); }
.list-row-main { min-width: 0; }
.list-row-main b { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-main small { color: var(--muted); display: block; font-size: 10.5px; margin-top: 3px; }
.list-value { font-weight: 800; color: var(--green-900); white-space: nowrap; }
.progress { height: 7px; background: #E4EEE9; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--green-600); }

/* Order form and detail */
.order-form-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .55fr); gap: 16px; align-items: start; }
.section-label { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; color: var(--green-900); font-weight: 800; font-size: 13px; }
.section-label svg { width: 17px; height: 17px; }
.line-builder { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 9px; align-items: stretch; margin-bottom: 12px; }
.line-items { display: grid; gap: 9px; }
.line-item { display: grid; grid-template-columns: minmax(130px, 1fr) 95px 130px 38px; gap: 8px; align-items: center; padding: 10px; border-radius: 14px; background: #F7FAF8; }
.line-item .item-name { min-width: 0; }
.line-item .item-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.line-item .item-name small { color: var(--muted); font-size: 10px; }
.inline-input { width: 100%; border: 0; outline: 0; background: white; min-height: 36px; border-radius: 10px; padding: 7px 9px; }
.order-total { display: grid; gap: 7px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #DDE9E4; }
.total-row { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); }
.total-row strong { color: var(--ink); }
.total-row.grand { font-size: 17px; color: var(--green-950); font-weight: 800; }
.total-row.grand strong { color: var(--green-800); }
.sticky-summary { position: sticky; top: 20px; }
.detail-hero { padding: 20px; border-radius: var(--radius); color: white; background: linear-gradient(135deg, var(--green-950), var(--green-700)); margin-bottom: 16px; box-shadow: var(--shadow-md); }
.detail-hero-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.detail-hero h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.detail-hero p { color: rgba(255,255,255,.7); margin: 4px 0 0; }
.detail-hero .chip { background: rgba(255,255,255,.15); color: white; }
.detail-kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; margin-top: 18px; }
.detail-kpi { padding: 10px 12px; border-radius: 13px; background: rgba(255,255,255,.09); }
.detail-kpi small { color: rgba(255,255,255,.62); display: block; font-size: 9.5px; }
.detail-kpi b { display: block; margin-top: 3px; font-size: 12.5px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .65fr); gap: 16px; align-items: start; }
.timeline { position: relative; display: grid; gap: 12px; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 7px; width: 2px; background: #DDEBE5; }
.timeline-item { position: relative; padding-left: 27px; }
.timeline-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border: 4px solid white; border-radius: 50%; background: var(--green-600); box-shadow: 0 0 0 1px var(--green-200); }
.timeline-item b { display: block; font-size: 12px; }
.timeline-item small { color: var(--muted); font-size: 10.5px; }
.task-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; border-radius: 13px; background: #F7FAF8; }
.task-check { width: 22px; height: 22px; border: 0; border-radius: 8px; display: grid; place-items: center; color: var(--green-700); background: var(--green-100); cursor: pointer; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted-2); }
.task-title b { display: block; font-size: 12px; }
.task-title small { color: var(--muted); font-size: 10px; }

/* Calendar */
.calendar-shell { background: white; border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow-sm); }
.calendar-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.calendar-head h2 { margin: 0; font-size: 17px; color: var(--green-950); text-transform: capitalize; }
.calendar-nav { display: flex; gap: 7px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 6px; }
.calendar-weekdays div { text-align: center; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 6px; }
.calendar-day { min-height: 120px; border: 0; border-radius: 14px; padding: 9px; background: #F8FBF9; text-align: left; cursor: pointer; overflow: hidden; transition: background .15s, transform .15s; }
.calendar-day:hover { background: var(--green-50); transform: translateY(-1px); }
.calendar-day.outside { opacity: .38; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--green-500); }
.day-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: var(--green-900); font-weight: 800; font-size: 11px; }
.calendar-day.today .day-number { background: var(--green-700); color: white; }
.day-events { display: grid; gap: 4px; margin-top: 6px; }
.day-event { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 6px; border-radius: 7px; color: var(--green-850); background: var(--green-100); font-size: 9px; font-weight: 700; }
.day-event.catering { color: #79500A; background: #FFF0D1; }
.day-event.task { color: #5E49A2; background: #EEE8FC; }
.day-more { color: var(--muted); font-size: 9px; padding: 2px 4px; }
.agenda { display: grid; gap: 8px; }
.agenda-row { display: grid; grid-template-columns: 74px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: #F7FAF8; }
.agenda-time { color: var(--green-800); font-weight: 800; font-size: 12px; }

/* Kitchen board */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 13px; overflow-x: auto; padding-bottom: 7px; }
.kanban-col { min-width: 260px; border-radius: var(--radius); background: #EAF2EE; padding: 10px; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 6px 10px; }
.kanban-head b { color: var(--green-900); font-size: 12px; }
.kanban-count { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--green-800); background: white; font-size: 10px; font-weight: 800; }
.order-card { border-radius: 15px; background: white; padding: 13px; box-shadow: 0 3px 12px rgba(6,40,32,.07); margin-bottom: 9px; cursor: pointer; }
.order-card:hover { box-shadow: 0 7px 20px rgba(6,40,32,.11); }
.order-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.order-card h4 { margin: 0; font-size: 12.5px; color: var(--green-950); }
.order-card p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; }
.order-card-items { display: grid; gap: 3px; margin-top: 10px; }
.order-card-item { display: flex; justify-content: space-between; gap: 9px; font-size: 10.5px; }
.order-card-item span:last-child { color: var(--green-800); font-weight: 800; }
.order-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed #DDE9E4; }

/* Modal and toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(3, 27, 22, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 28px 14px; overflow-y: auto; }
.modal {
  width: min(680px, 100%);
  background: white;
  border-radius: 22px;
  box-shadow: 0 28px 90px rgba(3,27,22,.28);
  animation: modal-in .17s ease;
  overflow: hidden;
}
.modal.large { width: min(980px, 100%); }
.modal.xlarge { width: min(1180px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 21px 14px; }
.modal-head h2 { margin: 0; color: var(--green-950); font-size: 19px; letter-spacing: -.025em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-close { width: 36px; height: 36px; flex: 0 0 auto; border: 0; border-radius: 12px; cursor: pointer; color: var(--muted); background: #F1F6F3; font-size: 21px; line-height: 1; }
.modal-body { padding: 6px 21px 21px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 9px; padding: 14px 21px calc(14px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid #EDF3F0; }
#toast-root { position: fixed; z-index: 120; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 28px)); pointer-events: none; }
.toast { color: white; background: var(--green-950); border-radius: 13px; padding: 12px 15px; box-shadow: 0 14px 42px rgba(3,27,22,.27); font-size: 12.5px; animation: toast-in .18s ease; }
.toast.success { background: var(--green-700); }
.toast.error { background: #A82F3D; }
.toast.warning { background: #9A5B0D; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Misc */
.notice { padding: 12px 14px; border-radius: 14px; color: var(--green-850); background: var(--green-100); font-size: 11.5px; margin-bottom: 12px; }
.notice.warning { color: #855009; background: var(--warning-soft); }
.notice.danger { color: #A72E3B; background: var(--danger-soft); }
.code-block { position: relative; padding: 13px; border-radius: 13px; color: #DDF3EA; background: var(--green-950); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
.copy-code { position: absolute; top: 7px; right: 7px; }
.tabs { display: flex; gap: 5px; padding: 4px; border-radius: 14px; background: #EAF2EE; width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 14px; }
.tab { border: 0; border-radius: 10px; min-height: 34px; padding: 7px 12px; color: var(--muted); background: transparent; cursor: pointer; white-space: nowrap; font-size: 11.5px; font-weight: 750; }
.tab.active { color: var(--green-900); background: white; box-shadow: 0 2px 8px rgba(6,40,32,.08); }
.avatar-letter { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: white; background: var(--green-700); font-weight: 850; }
.menu-image-preview { width: 116px; height: 116px; border-radius: 18px; object-fit: cover; background: var(--green-100); }
.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.metric-bar { display: grid; grid-template-columns: 125px minmax(80px, 1fr) 90px; gap: 10px; align-items: center; margin: 9px 0; }
.metric-bar .progress { height: 9px; }
.integration-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 15px; border-radius: 16px; background: #F7FAF8; margin-bottom: 9px; }
.integration-card h3 { margin: 0; font-size: 13px; }
.integration-card p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 13px; color: var(--green-900); background: var(--green-100); font-family: ui-monospace, monospace; word-break: break-all; }
.sidebar-overlay { display: none; }

/* Responsive */
@media (max-width: 1220px) {
  .grid-stats { grid-template-columns: repeat(3, minmax(150px,1fr)); }
  .dashboard-grid, .order-form-layout, .detail-grid { grid-template-columns: 1fr; }
  .sticky-summary { position: static; }
  .kanban { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 260px; }
  .sidebar { transform: translateX(-105%); box-shadow: 18px 0 55px rgba(3,27,22,.25); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(3,27,22,.45); }
  .main-area { margin-left: 0; width: 100%; }
  .mobile-bar { display: flex; position: sticky; top: 0; z-index: 35; align-items: center; justify-content: space-between; gap: 10px; height: 62px; padding: 9px 13px; color: var(--green-950); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: 0 1px 0 rgba(6,40,32,.06); }
  .mobile-brand { display: flex; align-items: center; gap: 9px; }
  .mobile-brand img { width: 35px; height: 35px; }
  .mobile-brand b { display: block; font-size: 14px; }
  .mobile-brand small { display: block; color: var(--muted); font-size: 9.5px; }
  .page { padding: 16px 13px 70px; }
  .page-head { align-items: center; }
  .page-head h1 { font-size: 21px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 22px; background: radial-gradient(circle at 50% 0, var(--green-100), #FBFDFC 35%); }
  .login-card::before { content: ""; display: block; width: 66px; height: 66px; margin: 0 0 24px; border-radius: 20px; background: center/cover url('/assets/logo.svg'); box-shadow: var(--shadow-md); }
  .form-grid.four, .form-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .calendar-day { min-height: 100px; padding: 7px; }
  .day-event { font-size: 8px; }
}

@media (max-width: 680px) {
  body { font-size: 13.5px; }
  .page-head { align-items: flex-start; }
  .page-head .page-actions { width: 100%; justify-content: stretch; }
  .page-head .page-actions .btn { flex: 1; }
  .grid-stats { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .stat-card { min-height: 108px; padding: 14px; }
  .stat-value { font-size: 20px; }
  .form-grid.two, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .card { border-radius: 16px; padding: 15px; }
  .toolbar { align-items: stretch; }
  .toolbar .field, .toolbar .grow { width: 100%; min-width: 0; }
  .desktop-table { display: none; }
  .mobile-cards { display: grid; gap: 9px; }
  .mobile-data-card { padding: 14px; border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
  .mobile-data-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
  .mobile-data-head h3 { margin: 0; font-size: 13px; color: var(--green-950); }
  .mobile-data-head p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
  .mobile-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; margin-top: 11px; }
  .mobile-data-value { padding: 8px 10px; border-radius: 11px; background: #F3F8F5; }
  .mobile-data-value small { display: block; color: var(--muted); font-size: 9px; }
  .mobile-data-value b { display: block; color: var(--ink); font-size: 11.5px; margin-top: 2px; }
  .mobile-data-actions { display: flex; gap: 7px; margin-top: 10px; }
  .mobile-data-actions .btn { flex: 1; }
  .line-builder { grid-template-columns: 1fr; }
  .line-item { grid-template-columns: minmax(0,1fr) 80px 38px; }
  .line-item .price-cell { grid-column: 1 / 3; }
  .detail-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-hero-top { flex-direction: column; }
  .calendar-shell { padding: 10px; overflow-x: auto; }
  .calendar-weekdays, .calendar-grid { min-width: 620px; }
  .calendar-day { min-height: 92px; }
  .agenda-row { grid-template-columns: 55px minmax(0,1fr); }
  .agenda-row > :last-child { grid-column: 1 / -1; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: 94vh; overflow-y: auto; border-radius: 22px 22px 0 0; }
  .modal.large, .modal.xlarge { width: 100%; }
  .modal-head { position: sticky; top: 0; z-index: 2; background: white; }
  .metric-bar { grid-template-columns: 90px minmax(60px,1fr) 70px; }
  .integration-card { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .grid-stats { grid-template-columns: 1fr; }
  .stat-card { min-height: 96px; }
  .page { padding-left: 10px; padding-right: 10px; }
  .mobile-data-grid { grid-template-columns: 1fr; }
}
