:root {
  --bg: #f5f7fb;
  --ink: #172033;
  --muted: #6a7385;
  --line: #dde3ee;
  --panel: #ffffff;
  --primary: #1167d8;
  --primary-dark: #0b4fa8;
  --accent: #0d9488;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow: 0 16px 38px rgba(23, 32, 51, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 272px;
  background: #111827;
  color: #e5eaf3;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}
.logo span, .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 900;
}
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
  padding: 12px 14px;
  border-radius: 8px;
  color: #cbd5e1;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.app-main { margin-left: 272px; padding: 28px; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.topbar h1 { margin: 0; font-size: 28px; letter-spacing: 0; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.tiny { min-height: 30px; padding: 5px 9px; font-size: 12px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.metric, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.metric { padding: 18px; display: grid; gap: 10px; }
.metric span, .muted { color: var(--muted); }
.metric strong { font-size: 26px; }
.panel { padding: 18px; overflow: hidden; }
.panel.wide { min-width: 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-head h2, .customer-head h1, .login-card h2 { margin: 0; letter-spacing: 0; }

.work-grid, .split-grid, .pos-layout {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 18px;
}
.stack-form { display: grid; gap: 13px; }
.feature-list { margin: 0; padding-left: 18px; display: grid; gap: 12px; color: var(--muted); }
.order-board, .qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.order-card, .qr-card, .ticket, .menu-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.order-card div, .qr-card, .menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.order-card span, .qr-card span, .menu-item span, small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.status-new { border-left: 4px solid var(--warning); }
.status-ready, .status-served { border-left: 4px solid var(--success); }
.status-preparing { border-left: 4px solid var(--primary); }
.qr-card img {
  width: 118px;
  height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.data-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.pill {
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary-dark);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}
.danger-text { color: var(--danger); font-weight: 900; }

.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
}
.kanban-col {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 360px;
}
.kanban-col h3 { margin: 0 0 12px; font-size: 14px; }
.ticket { margin-bottom: 12px; }
.ticket-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ticket p { color: var(--muted); font-size: 13px; }
.ticket-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.login-shell, .install-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(17,103,216,0.18), transparent 34%),
    linear-gradient(135deg, #f6f9ff, #eef7f4);
}
.login-shell {
  grid-template-columns: minmax(280px, 520px) minmax(280px, 420px);
  gap: 28px;
}
.login-art h1 { font-size: 46px; margin: 18px 0 12px; letter-spacing: 0; }
.login-art p { color: var(--muted); font-size: 18px; line-height: 1.6; }
.login-card, .install-panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
}
.install-shell { width: min(520px, 100%); }
.install-panel h1 { margin-bottom: 8px; }
.install-panel p { color: var(--muted); }
.notice {
  border-radius: 8px;
  padding: 11px 13px;
  margin-bottom: 14px;
  font-weight: 800;
}
.notice.success { background: #dcfce7; color: #166534; }
.notice.danger { background: #fee2e2; color: #991b1b; }

.customer-body { background: #f7f9fc; }
.customer-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #111827;
  color: #fff;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.customer-head p { margin: 0 0 5px; color: #a7f3d0; font-size: 13px; font-weight: 800; }
.customer-head span { background: rgba(255,255,255,0.12); padding: 8px 10px; border-radius: 8px; }
.customer-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  padding: 18px;
}
.menu-list h2 { margin: 22px 0 10px; }
.menu-item { margin-bottom: 10px; }
.cart-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.cart-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

@media (max-width: 980px) {
  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
  }
  .app-main { margin-left: 0; padding: 18px; }
  .metric-grid, .work-grid, .split-grid, .pos-layout, .customer-menu, .login-shell {
    grid-template-columns: 1fr;
  }
  .topbar { align-items: flex-start; flex-direction: column; }
  .kanban { grid-template-columns: repeat(5, 240px); }
  .cart-panel { position: static; }
}

@media print {
  .sidebar, .topbar, .btn { display: none !important; }
  .app-main { margin: 0; padding: 0; }
  .panel { box-shadow: none; border: 0; }
}

