/* Maqdy dashboard — brand tokens mirror docs/BRAND.md and the Android theme. */
:root {
  --grape: #7C3AED;
  --grape-600: #6D28D9;
  --grape-800: #4C1D95;
  --grape-50: #F4EEFF;
  --mango: #FF7A1A;
  --mango-50: #FFF1E6;
  --lime: #B8F34A;
  --lime-ink: #3F6212;
  --sky: #0EA5E9;
  --ink: #17132B;
  --muted: #6B6585;
  --line: #ECE6F5;
  --bg: #FFF8F1;
  --surface: #FFFFFF;
  --success: #16A34A;
  --success-50: #E9F9EF;
  --danger: #E11D48;
  --danger-50: #FFE8EE;
  --warn: #D97706;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 19, 43, .06), 0 8px 24px rgba(23, 19, 43, .06);
  --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); color: var(--ink); background: var(--bg); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -.02em; line-height: 1.15; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 700; }
a { color: var(--grape); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden, [hidden] { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: var(--lime); color: var(--ink); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; transform: rotate(-6deg); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.03em; }
.brand-name span { color: var(--lime); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.45); padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; color: rgba(255,255,255,.78); font-weight: 600; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--grape); color: #fff; }
.nav a .ico { width: 20px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.06); font-size: 13px; }
.sidebar-foot b { display: block; }
.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.btn.menu-toggle { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { padding: 18px 16px 60px; }
  .btn.menu-toggle { display: inline-flex; }
}

/* ---------- Components ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; border: 1px solid var(--line); }
.card.flat { box-shadow: none; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-weight: 600; font-size: 13px; }
.stat .value { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -.03em; margin-top: 4px; }
.stat.grape { background: var(--grape); color: #fff; border-color: var(--grape); }
.stat.grape .label { color: rgba(255,255,255,.75); }
.stat.lime { background: var(--lime); border-color: var(--lime); }
.stat.lime .label { color: var(--lime-ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; cursor: pointer; background: var(--grape); color: #fff; transition: transform .05s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--grape-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--grape-50); color: var(--grape-800); }
.btn.secondary:hover { background: #E9DEFF; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #fff; }
.btn.mango { background: var(--mango); }
.btn.mango:hover { background: #F06A0A; }
.btn.lime { background: var(--lime); color: var(--ink); }
.btn.lime:hover { background: #A8E43A; }
.btn.danger { background: var(--danger-50); color: var(--danger); }
.btn.danger:hover { background: #FFD5DF; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px 8px; border-radius: 10px; color: var(--muted); }
.icon-btn:hover { background: var(--grape-50); color: var(--grape); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--grape-50); color: var(--grape-800); white-space: nowrap; }
.pill.green { background: var(--success-50); color: var(--success); }
.pill.red { background: var(--danger-50); color: var(--danger); }
.pill.mango { background: var(--mango-50); color: #C2410C; }
.pill.lime { background: var(--lime); color: var(--ink); }
.pill.gray { background: #F1EFF5; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
.input:focus { border-color: var(--grape); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }
.input.invalid { border-color: var(--danger); }
textarea.input { min-height: 84px; resize: vertical; }
input[type=color].input { padding: 4px; height: 42px; width: 64px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: #D9D4E4; position: relative; transition: background .15s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.switch input:checked + .track { background: var(--success); }
.switch input:checked + .track::after { transform: translateX(20px); }

table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FCFAFF; }
.table-wrap { overflow-x: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 40px; }

.tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--ink); color: #fff; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(23, 19, 43, .45); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s; }
.modal { background: #fff; border-radius: 22px; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; box-shadow: 0 30px 80px rgba(23,19,43,.3); }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; padding: 20px 24px 0; }
.modal-body { padding: 18px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; }
@keyframes fade { from { opacity: 0; } }

/* Toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600; max-width: 360px; animation: slide .2s; }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--grape); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-hero h1 { font-size: 56px; max-width: 520px; margin-top: auto; }
.auth-hero h1 em { font-style: normal; color: var(--lime); }
.auth-hero p { font-size: 17px; color: rgba(255,255,255,.8); max-width: 460px; }
.auth-hero .blob { position: absolute; border-radius: 50%; filter: blur(2px); }
.auth-hero .blob.a { width: 340px; height: 340px; background: var(--mango); right: -120px; top: -80px; opacity: .9; }
.auth-hero .blob.b { width: 180px; height: 180px; background: var(--lime); right: 120px; top: 180px; opacity: .85; }
.auth-form { display: grid; place-items: center; padding: 32px; }
.auth-form form { width: min(380px, 100%); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px; min-height: 280px; }
  .auth-hero h1 { font-size: 38px; }
  .auth-hero .blob.a { width: 200px; height: 200px; right: -110px; top: -90px; }
  .auth-hero .blob.b { width: 90px; height: 90px; right: -30px; top: auto; bottom: -40px; }
}

/* Orders board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .board { grid-template-columns: 1fr; } }
.lane { background: #F6F1FF; border-radius: var(--radius); padding: 14px; min-height: 200px; }
.lane.new { background: var(--mango-50); }
.lane.ready { background: var(--success-50); }
.lane-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 0 4px; }
.lane-head .count { background: var(--ink); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 800; }
.ticket { background: #fff; border-radius: 16px; padding: 14px; box-shadow: var(--shadow); margin-bottom: 12px; border: 1px solid var(--line); }
.ticket.fresh { animation: pop .5s; border-color: var(--mango); }
@keyframes pop { 0% { transform: scale(.96); } 50% { transform: scale(1.02); } }
.ticket-code { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: .04em; }
.ticket ul { list-style: none; padding: 0; margin: 10px 0; }
.ticket li { padding: 4px 0; border-top: 1px dashed var(--line); }
.ticket li:first-child { border-top: 0; }
.ticket .qty { font-weight: 800; color: var(--grape); margin-right: 6px; }
.ticket .opts { font-size: 12.5px; color: var(--muted); }
.ticket .who { font-size: 11.5px; font-weight: 700; color: var(--mango); text-transform: uppercase; letter-spacing: .05em; }
.ticket .note { background: #FFFBEB; border-radius: 10px; padding: 6px 10px; font-size: 13px; margin: 6px 0; }
.ticket .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Map */
.map-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
@media (max-width: 1000px) { .map-layout { grid-template-columns: 1fr; } }
.map { width: 100%; height: 600px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #EEE9F7; }
.map.small { height: 320px; }
.map-toolbar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 500; background: var(--ink); color: #fff; border-radius: 999px; padding: 8px 8px 8px 16px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); font-weight: 600; font-size: 13px; }
.map-wrap { position: relative; }
.zone-list .zone { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; }
.zone-list .zone:hover, .zone-list .zone.active { background: var(--grape-50); }
.swatch { width: 14px; height: 14px; border-radius: 5px; flex: none; }
.vertex-icon { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--grape); box-shadow: 0 1px 4px rgba(0,0,0,.3); }

/* Menu manager */
.menu-cat { margin-bottom: 18px; }
.menu-item { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; }
.menu-item:hover { background: #FCFAFF; }
.thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--grape-50) center/cover no-repeat; flex: none; display: grid; place-items: center; font-size: 24px; }
.options-editor .opt-row { display: grid; grid-template-columns: 1fr 1fr 110px 36px; gap: 8px; margin-bottom: 8px; }

/* App preview card (store settings) */
.phone-preview { width: 300px; border-radius: 30px; background: var(--bg); border: 8px solid var(--ink); overflow: hidden; box-shadow: var(--shadow); }
.phone-preview .cover { height: 120px; background: var(--grape) center/cover no-repeat; position: relative; }
.phone-preview .logo { width: 64px; height: 64px; border-radius: 18px; border: 4px solid var(--bg); background: #fff center/cover no-repeat; position: absolute; left: 16px; bottom: -28px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 24px; }
.phone-preview .body { padding: 36px 16px 20px; }

.banner { background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 16px; display: flex; gap: 12px; align-items: center; margin-bottom: 18px; font-weight: 600; }
.banner .btn { margin-left: auto; }

.uploader { display: flex; gap: 12px; align-items: center; }
.uploader .preview { width: 64px; height: 64px; border-radius: 14px; background: var(--grape-50) center/cover no-repeat; border: 1px solid var(--line); flex: none; }
