@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650&family=Outfit:wght@360;420;520;600;700&display=swap');

:root {
  --ink: #15202b;
  --ink-2: #2c3b4a;
  --muted: #66788a;
  --line: #e7ddd0;
  --paper: #f4efe6;
  --white: #fffdf8;
  --sidebar: #101820;
  --sidebar-2: #18222c;
  --gold: #c4a36a;
  --gold-d: #8d6b34;
  --spice: #c4491d;
  --spice-d: #8a2f12;
  --teal: #1e6b58;
  --ok: #1b7a54;
  --warn: #c47a12;
  --danger: #c43b32;
  --info: #2f6f9e;
  --shadow: 0 12px 40px rgba(16,24,32,.08);
  --radius: 16px;
  --accent: #3d6b8c;
  --accent-ink: #fff;
  --sidebar-w: 268px;
}
[data-biz="marble"] { --accent: var(--gold); --accent-ink: #2a2112; }
[data-biz="cafe"] { --accent: var(--spice); --accent-ink: #fff; }
[data-biz="all"] { --accent: #3d6b8c; --accent-ink: #fff; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Outfit, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  letter-spacing: .01em;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; }

.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sidebar) 0%, #0c131a 100%);
  color: #d7dee6;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: width .2s ease, transform .25s ease;
}
.sidebar.collapsed { width: 78px; }
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--spice));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-family: Fraunces, serif;
  flex: 0 0 auto;
}
.brand b { display: block; color: #fff; font-size: 15px; letter-spacing: .04em; }
.brand span { display: block; color: #8b9aaa; font-size: 11px; }
.collapsed .brand-text, .collapsed .nav-label, .collapsed .nav-sec, .collapsed .side-foot span { display: none; }
.nav { padding: 12px 10px; overflow: auto; flex: 1; }
.nav-sec {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: #6d7d8c; padding: 14px 12px 6px;
}
.nav a, .nav button.navlink {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 10px;
  color: #c5d0da; background: none; border: 0; cursor: pointer;
  font-size: 13.5px; margin-bottom: 2px;
}
.nav a:hover, .nav button.navlink:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active {
  background: linear-gradient(90deg, rgba(196,163,106,.22), rgba(196,73,29,.12));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--gold);
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  background: rgba(255,253,248,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--white);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.searchbar {
  flex: 1; max-width: 420px; position: relative;
}
.searchbar input {
  width: 100%; height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--white);
  padding: 0 14px 0 38px; outline: none;
}
.searchbar svg { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.biz-switch {
  display: flex; background: #efe8dc; border-radius: 12px; padding: 3px; gap: 2px;
}
.biz-switch a {
  font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 9px; color: var(--ink-2);
}
.biz-switch a.on { background: var(--white); box-shadow: var(--shadow); color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.dropdown { position: relative; }
.drop {
  display: none; position: absolute; right: 0; top: 46px; width: 320px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; z-index: 50;
}
.dropdown.open .drop { display: block; }
.drop-h { padding: 12px 14px; font-weight: 650; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.drop a, .drop .drop-i { display: block; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid #f1ebe1; }
.drop a:hover { background: #faf6ef; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--spice));
  color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.content { padding: 22px 24px 48px; }
.page-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-family: Fraunces, serif; font-size: 28px; font-weight: 650; }
.page-h p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.crumbs { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--white); color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer;
  transition: .15s transform, .15s box-shadow, .15s background;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-danger { background: #fdecea; color: var(--danger); border-color: #f4c7c3; }
.btn-ok { background: #e7f6ee; color: var(--ok); border-color: #bfe5cf; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }
.btn-lg { height: 46px; padding: 0 18px; font-size: 14px; }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.stat {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
  position: relative; overflow: hidden;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); transition: .2s; }
.stat .k { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.stat .v { font-family: Fraunces, serif; font-size: 26px; margin-top: 6px; }
.stat .h { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat.gold { background: linear-gradient(180deg, #fffaf0, #fff); }
.stat.spice { background: linear-gradient(180deg, #fff6f1, #fff); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.card h3 { margin: 0 0 12px; font-size: 15px; }
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px 8px; border-bottom: 1px solid #f0e9de; vertical-align: middle; }
table.data tr:hover td { background: #faf7f1; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 650; }
.badge-ok { background: #e7f6ee; color: var(--ok); }
.badge-warn { background: #fff4e0; color: #9a5d00; }
.badge-danger { background: #fdecea; color: var(--danger); }
.badge-info { background: #e8f2fa; color: var(--info); }
.badge-muted { background: #eef1f4; color: #5d6b78; }

.form { display: grid; gap: 12px; }
.form.two { grid-template-columns: 1fr 1fr; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
label.f input, label.f select, label.f textarea {
  height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 0 10px; font-size: 13.5px;
}
label.f textarea { height: 88px; padding: 8px 10px; resize: vertical; }
.full { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters input, .filters select { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); padding: 0 10px; }

.pager { display: flex; gap: 6px; margin-top: 14px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-ico { font-size: 32px; margin-bottom: 8px; }
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 260px; background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow); animation: up .25s ease; }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warn); color: #1a1204; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-bg { position: fixed; inset: 0; background: rgba(16,24,32,.45); display: none; z-index: 70; align-items: center; justify-content: center; padding: 18px; }
.modal-bg.open { display: flex; }
.modal { background: var(--white); border-radius: 18px; width: min(720px, 100%); max-height: 90vh; overflow: auto; padding: 18px; }
.modal h2 { margin: 0 0 12px; font-family: Fraunces, serif; }

.login-body { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-art {
  background: #101820 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cpath d='M0 80L80 0' stroke='%231c2833' stroke-width='1'/%3E%3C/svg%3E");
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art h1 { font-family: Fraunces, serif; font-size: 42px; margin: 12px 0; }
.login-art p { color: #b9c4ce; max-width: 420px; line-height: 1.6; }
.biz-pills { display: flex; gap: 10px; margin-top: 24px; }
.biz-pill { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 14px 16px; width: 220px; }
.biz-pill b { display: block; color: var(--gold); }
.login-box { display: grid; place-items: center; padding: 32px; background: var(--paper); }
.login-card { width: min(440px, 100%); background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.demo-roles { display: grid; gap: 6px; margin-top: 14px; }
.demo-roles button { text-align: left; }

.home-hero {
  background: linear-gradient(135deg, #141c24, #243140);
  color: #fff; border-radius: 22px; padding: 28px; margin-bottom: 18px;
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
}
.home-hero h1 { font-family: Fraunces, serif; font-size: 32px; margin: 0 0 8px; }
.biz-card {
  border-radius: 22px; padding: 22px; min-height: 240px; color: #fff; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
}
.biz-card.marble { background: linear-gradient(145deg, #3a2e1c, #c4a36a 140%); }
.biz-card.cafe { background: linear-gradient(145deg, #4a1d12, #c4491d 140%); }
.biz-card h2 { font-family: Fraunces, serif; margin: 0 0 6px; font-size: 28px; }
.chart-box { height: 240px; }

.prod-ico {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; color: #fff; font-size: 12px;
}
.cat-Marble { background: #8d6b34; } .cat-Granite { background: #2c3b4a; }
.cat-Tiles { background: #3d6b8c; } .cat-Slabs { background: #5a4630; }
.cat-Sanitary { background: #1e6b58; } .cat-Countertops { background: #6b4e7a; }
.cat-Adhesives { background: #7a5a1e; } .cat-Accessories { background: #4a5560; }

.doc {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px;
  max-width: 860px; margin: 0 auto; color: #111;
}
.doc-top { display: flex; justify-content: space-between; gap: 16px; border-bottom: 3px solid #15202b; padding-bottom: 14px; }
.doc h2 { font-family: Fraunces, serif; margin: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc td, .doc th { border: 1px solid #ddd; padding: 7px; }
.doc th { background: #f3f0ea; }

.pos { display: grid; grid-template-columns: 1fr 360px; gap: 14px; min-height: calc(100vh - 110px); }
.pos-cats { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; }
.chip { border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.chip.on { background: var(--spice); color: #fff; border-color: var(--spice); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.menu-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: .15s transform;
}
.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.menu-pic { height: 92px; display: grid; place-items: center; font-size: 36px; }
.menu-card .bd { padding: 10px; }
.menu-card .pr { font-weight: 700; }
.vegdot { display: inline-block; width: 10px; height: 10px; border: 1.5px solid; margin-right: 4px; }
.vegdot.veg { color: #1b7a54; background: #1b7a54; border-radius: 2px; }
.vegdot.nveg { color: #c43b32; background: #c43b32; border-radius: 2px; }
.cart {
  background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
  display: flex; flex-direction: column; position: sticky; top: 72px; max-height: calc(100vh - 90px);
}
.cart-items { flex: 1; overflow: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 8px 0; border-bottom: 1px solid #f0e9de; font-size: 13px; }
.qtybox { display: inline-flex; align-items: center; gap: 6px; }
.qtybox button { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }

.tables-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tbl {
  border-radius: 18px; padding: 16px; min-height: 120px; border: 1px solid var(--line); background: var(--white); cursor: pointer;
}
.tbl.Available { box-shadow: inset 0 0 0 3px #1b7a54; }
.tbl.Occupied { box-shadow: inset 0 0 0 3px #c43b32; background: #fff6f5; }
.tbl.Reserved { box-shadow: inset 0 0 0 3px #2f6f9e; background: #f3f8fc; }
.tbl.Cleaning { box-shadow: inset 0 0 0 3px #c47a12; background: #fff8ec; }
.tbl h3 { margin: 0 0 6px; font-family: Fraunces, serif; }

.kot { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.kot-col { background: rgba(255,255,255,.5); border-radius: 16px; padding: 10px; min-height: 60vh; }
.kot-col h3 { margin: 4px 8px 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kot-card { background: var(--white); border-radius: 14px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); }
.kot-card .t { font-weight: 700; }
.New { border-top: 3px solid var(--info); }
.Preparing { border-top: 3px solid var(--warn); }
.Ready { border-top: 3px solid var(--ok); }
.Completed { border-top: 3px solid #8aa; opacity: .75; }

.side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); font-size: 11px; color: #8b9aaa; }
.mobile-only { display: none; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }

@media (max-width: 1100px) {
  .g-5, .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-3 { grid-template-columns: 1fr 1fr; }
  .pos { grid-template-columns: 1fr; }
  .kot { grid-template-columns: 1fr 1fr; }
  .login-body { grid-template-columns: 1fr; }
  .login-art { display: none; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; transform: translateX(-105%); }
  .sidebar.open { transform: none; }
  .overlay.show { display: block; }
  .mobile-only { display: grid; }
  .biz-switch { display: none; }
  .g-2, .g-3, .g-4, .g-5, .form.two { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .home-hero { flex-direction: column; align-items: flex-start; }
  .kot { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, .topbar, .actions, .btn, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .doc { box-shadow: none; border: 0; }
  body { background: #fff; }
}
