/* ==========================================================================
   Coffee POS - Design System
   Modern Clean Coffee Shop POS
   ========================================================================== */

:root {
  --bg: #F8F7F4;
  --card: #FFFFFF;
  --primary: #6F4E37;
  --primary-dark: #4B3425;
  --accent: #D6A77A;
  --success: #4F8A6B;
  --danger: #C95C54;
  --text: #292725;
  --muted: #77736E;
  --border: #E8E4DD;
  --border-soft: #F0EDE7;
  --sidebar-bg: #FFFFFF;
  --topbar-bg: #FFFFFF;
  --input-bg: #FFFFFF;
  --hover-bg: #F3F0EA;
  --shadow-sm: 0 1px 2px rgba(41, 39, 37, 0.06);
  --shadow-md: 0 4px 14px rgba(41, 39, 37, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sidebar-width: 248px;
  --sidebar-width-collapsed: 76px;
  --topbar-height: 64px;
}

[data-theme="dark"] {
  --bg: #17140F;
  --card: #221E19;
  --primary: #D6A77A;
  --primary-dark: #C4936A;
  --accent: #D6A77A;
  --success: #5FA680;
  --danger: #D97970;
  --text: #F1ECE5;
  --muted: #A39C92;
  --border: #35302A;
  --border-soft: #2B2721;
  --sidebar-bg: #1D1A15;
  --topbar-bg: #1D1A15;
  --input-bg: #221E19;
  --hover-bg: #2A2620;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Inter', Roboto, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

h1, h2, h3, h4 { margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* ==========================================================================
   Layout Shell
   ========================================================================== */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar.collapsed { width: var(--sidebar-width-collapsed); }

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand .mark {
  width: 34px; height: 34px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
  padding: 6px;
  box-sizing: border-box;
}
.sidebar-brand .mark svg { width: 100%; height: 100%; }

.sidebar-brand .brand-name {
  font-weight: 700;
  font-size: 15.5px;
  white-space: nowrap;
}
.sidebar.collapsed .brand-name { display: none; }

.sidebar-nav { padding: 12px; overflow-y: auto; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item svg { flex-shrink: 0; width: 18px; height: 18px; }
.nav-item:hover { background: var(--hover-bg); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.show { display: block; }

.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.2s ease;
}
.sidebar.collapsed ~ .app-main { margin-left: var(--sidebar-width-collapsed); }

.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.icon-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover { background: var(--hover-bg); }
.icon-btn svg { width: 19px; height: 19px; }

.topbar-search { flex: 1; max-width: 360px; position: relative; }
.topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
}
.topbar-search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--muted);
}

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.topbar-datetime { font-size: 13px; color: var(--muted); white-space: nowrap; }

.printer-status {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.printer-status .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.printer-status.connected .status-dot { background: var(--success); }
.printer-status.connected { color: var(--success); border-color: var(--success); }
.printer-status:not(.connected) { color: var(--danger); border-color: var(--danger); }

.topbar-user { display: flex; flex-direction: column; line-height: 1.2; margin-right: 4px; }
.topbar-user .u-name { font-weight: 600; font-size: 13.5px; }
.topbar-user .u-role { font-size: 11.5px; color: var(--muted); }

.app-content { padding: 24px; flex: 1; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-lg { padding: 13px 22px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { background: var(--hover-bg); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.9; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text); }

/* ==========================================================================
   Cards / Grid
   ========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-flush { padding: 0; overflow: hidden; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-body { padding: 20px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; }
.stat-card .stat-sub { font-size: 12px; color: var(--muted); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:hover { border-color: var(--muted); }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(111,78,55,0.12); }
[data-theme="dark"] .form-control:focus { box-shadow: 0 0 0 3px rgba(214,167,122,0.16); }
.form-control:disabled { opacity: 0.55; cursor: not-allowed; }
textarea.form-control { resize: vertical; min-height: 80px; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2377736E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
select.form-control:hover { border-color: var(--primary); }
[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A39C92' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
select.form-control::-ms-expand { display: none; }
select.form-control option { color: var(--text); background: var(--card); }

.form-row { display: flex; gap: 14px; }
.form-row > .form-group { flex: 1; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check input { width: 16px; height: 16px; }

.input-group { display: flex; }
.input-group .form-control { border-radius: 0; }
.input-group .input-group-text {
  display: flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--border); background: var(--hover-bg); color: var(--muted); font-size: 13px;
}
.input-group > :first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.input-group > :last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

/* ==========================================================================
   Table
   ========================================================================== */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.03em; color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 600;
  white-space: nowrap;
}
table.table td { padding: 12px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.table tbody tr:hover { background: var(--hover-bg); }
table.table tbody tr:last-child td { border-bottom: none; }

/* ==========================================================================
   Badge
   ========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em;
}
.badge-success { background: rgba(79,138,107,0.14); color: var(--success); }
.badge-danger { background: rgba(201,92,84,0.14); color: var(--danger); }
.badge-muted { background: var(--hover-bg); color: var(--muted); }
.badge-accent { background: rgba(214,167,122,0.2); color: var(--primary-dark); }

/* ==========================================================================
   Modal
   ========================================================================== */

.modal-backdrop-custom {
  display: none;
  position: fixed; inset: 0; background: rgba(20,18,15,0.5);
  z-index: 1000; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop-custom.show { display: flex; }
.modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.modal-box.modal-lg { max-width: 720px; }
.modal-box.modal-xl { max-width: 960px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 340px;
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  padding: 12px 16px; font-size: 13px;
  animation: toastIn 0.2s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ==========================================================================
   Auth Page
   ========================================================================== */

.auth-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}

.auth-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--primary-dark) 0%, var(--primary) 65%, var(--accent) 130%);
  color: #fff;
  padding: 56px 56px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero-pattern {
  position: absolute; inset: 0; opacity: 0.12; pointer-events: none;
  background-image: radial-gradient(circle, #fff 1.6px, transparent 1.6px);
  background-size: 26px 26px;
}
.auth-hero-glow {
  position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.16), transparent 70%);
  right: -160px; bottom: -180px; pointer-events: none;
}
.auth-hero-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.auth-hero-top .mark { width: 44px; height: 44px; background: rgba(255,255,255,0.16); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 8px; box-sizing: border-box; }
.auth-hero-top .mark svg { width: 100%; height: 100%; color: #fff; }
.auth-hero-top span { font-weight: 700; font-size: 17px; letter-spacing: 0.01em; }

.auth-hero-mid { position: relative; z-index: 1; max-width: 420px; }
.auth-hero-mid h2 { font-size: 34px; line-height: 1.25; margin: 0 0 14px; font-weight: 700; letter-spacing: -0.01em; }
.auth-hero-mid p { font-size: 15px; line-height: 1.6; color: rgba(255,255,255,0.82); margin: 0; }

.auth-hero-features { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 16px; }
.auth-hero-feature { display: flex; align-items: center; gap: 14px; }
.auth-hero-feature .f-icon {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px;
  background: rgba(255,255,255,0.14); display: flex; align-items: center; justify-content: center;
}
.auth-hero-feature .f-icon svg { width: 18px; height: 18px; color: #fff; }
.auth-hero-feature .f-text strong { display: block; font-size: 13.5px; font-weight: 600; }
.auth-hero-feature .f-text span { font-size: 12px; color: rgba(255,255,255,0.72); }

.auth-hero-foot { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255,255,255,0.6); }

.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 28px; }
.auth-brand .mark { width: 46px; height: 46px; background: var(--primary); color: #fff; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; padding: 9px; box-sizing: border-box; }
.auth-brand .mark svg { width: 100%; height: 100%; }
.auth-brand h1 { font-size: 21px; margin: 0; }
.auth-brand p { font-size: 12.5px; color: var(--muted); margin: 0; }
.auth-error { background: rgba(201,92,84,0.1); color: var(--danger); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.auth-hint { margin-top: 18px; font-size: 12px; color: var(--muted); }
.auth-hint strong { color: var(--text); }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-form-panel { padding: 24px; }
}

/* ==========================================================================
   Empty state
   ========================================================================== */

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .mark { width: 56px; height: 56px; border-radius: 50%; background: var(--hover-bg); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.empty-state .mark svg { width: 24px; height: 24px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-bottom: 4px; }

/* ==========================================================================
   Filters bar
   ========================================================================== */

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; align-items: center; }
.filter-bar .form-control { width: auto; min-width: 150px; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

/* ==========================================================================
   Loading
   ========================================================================== */

.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
.spinner-dark { border: 2px solid var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--hover-bg) 25%, var(--border-soft) 37%, var(--hover-bg) 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ==========================================================================
   POS
   ========================================================================== */

.pos-shell { display: grid; grid-template-columns: 180px 1fr 360px; gap: 16px; height: calc(100vh - var(--topbar-height) - 48px); }

.pos-categories { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.cat-btn {
  text-align: left; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-btn:hover:not(.active) { background: var(--hover-bg); }

.pos-products { display: flex; flex-direction: column; min-width: 0; }
.pos-toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-shrink: 0; }
.pos-toolbar input { flex: 1; }
.pos-toolbar select { width: 160px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; overflow-y: auto; padding-bottom: 12px; align-content: start; }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.product-card:hover { border-color: var(--primary); }
.product-card.sold-out { opacity: 0.55; cursor: not-allowed; }
.product-card .thumb { width: 100%; aspect-ratio: 1/1; background: var(--hover-bg); object-fit: cover; display: block; }
.product-card .thumb-empty { width: 100%; aspect-ratio: 1/1; background: var(--hover-bg); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.product-card .info { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.product-card .p-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.product-card .p-price { font-size: 13px; font-weight: 700; color: var(--primary-dark); }
[data-theme="dark"] .product-card .p-price { color: var(--accent); }

.pos-cart { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cart-header { padding: 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.cart-header .form-control { font-size: 13px; padding: 8px 10px; }
.cart-items { flex: 1; overflow-y: auto; padding: 10px 14px; }
.cart-item { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-top { display: flex; justify-content: space-between; gap: 8px; }
.cart-item .ci-name { font-size: 13.5px; font-weight: 600; }
.cart-item .ci-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cart-item .ci-price { font-size: 13px; font-weight: 700; white-space: nowrap; }
.cart-item .ci-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.qty-control button { width: 26px; height: 26px; border: none; background: var(--hover-bg); cursor: pointer; font-size: 14px; color: var(--text); }
.qty-control span { width: 28px; text-align: center; font-size: 13px; font-weight: 600; }

.cart-summary { padding: 14px; border-top: 1px solid var(--border); flex-shrink: 0; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.summary-row.total { font-size: 17px; font-weight: 700; color: var(--text); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.cart-actions { padding: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex-shrink: 0; }
.cart-actions .btn-pay { grid-column: 1 / -1; }

.empty-cart { text-align: center; padding: 40px 10px; color: var(--muted); font-size: 13px; }

.variant-option-btn, .addon-option-btn {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 8px; font-size: 13.5px;
}
.variant-option-btn.selected { border-color: var(--primary); background: rgba(111,78,55,0.08); }
.addon-option-btn.selected { border-color: var(--success); background: rgba(79,138,107,0.08); }

.payment-method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.payment-method-btn { padding: 14px 8px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 600; }
.payment-method-btn.selected { border-color: var(--primary); background: var(--primary); color: #fff; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .app-main { margin-left: 0 !important; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .pos-shell { grid-template-columns: 140px 1fr 320px; }
}

@media (max-width: 900px) {
  .pos-shell { display: flex; flex-direction: column; height: auto; }
  .pos-categories { flex-direction: row; overflow-x: auto; overflow-y: visible; flex-shrink: 0; }
  .cat-btn { white-space: nowrap; }
  .product-grid { max-height: 520px; }
  .pos-cart { max-height: none; }
}

@media (max-width: 640px) {
  .app-content { padding: 14px; }
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-datetime, .topbar-user { display: none; }
  .form-row { flex-direction: column; gap: 0; }
  .payment-method-grid { grid-template-columns: repeat(2, 1fr); }
}
