/* ========================================
   POS Gabon — CSS v4 (rebuilt from scratch)
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- TOKENS ---- */
:root {
  --c-bg:       #0e1117;
  --c-surface:  #161b27;
  --c-card:     #1c2333;
  --c-hover:    #232b3e;
  --c-border:   #2a3350;
  --c-border2:  #1e2840;

  --c-text:     #e8eaf0;
  --c-text2:    #8892a4;
  --c-text3:    #4e5a72;

  --c-blue:     #4a7cff;
  --c-blue2:    #3a6af0;
  --c-blue-bg:  rgba(74,124,255,.12);

  --c-green:    #22c55e;
  --c-green-bg: rgba(34,197,94,.12);
  --c-orange:   #f97316;
  --c-orange-bg:rgba(249,115,22,.12);
  --c-red:      #ef4444;
  --c-red-bg:   rgba(239,68,68,.12);
  --c-purple:   #a855f7;
  --c-purple-bg:rgba(168,85,247,.12);
  --c-yellow:   #eab308;
  --c-yellow-bg:rgba(234,179,8,.12);

  --sidebar-w:  240px;
  --topbar-h:   56px;
  --r:          8px;
  --r2:         12px;
  --font:       'DM Sans', system-ui, sans-serif;
  --mono:       'JetBrains Mono', monospace;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --t:          .15s ease;
}

[data-theme="light"] {
  --c-bg:      #f1f4f9;
  --c-surface: #ffffff;
  --c-card:    #ffffff;
  --c-hover:   #f5f7fc;
  --c-border:  #e2e8f0;
  --c-border2: #edf0f7;
  --c-text:    #0f172a;
  --c-text2:   #64748b;
  --c-text3:   #94a3b8;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); background: var(--c-bg); color: var(--c-text);
       -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--c-blue); text-decoration: none; }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: var(--font); }

/* ---- LAYOUT ---- */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--t);
  overflow: hidden;
}

.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--c-border);
  min-height: var(--topbar-h);
}
.sb-logo-icon {
  width: 32px; height: 32px;
  background: var(--c-blue);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.sb-logo-text { font-size: 1rem; font-weight: 700; color: var(--c-text); }
.sb-logo-text span { color: var(--c-blue); }

.sb-biz {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  background: var(--c-hover);
}
.sb-biz-name { font-size: .82rem; font-weight: 600; color: var(--c-text); }
.sb-biz-role { font-size: .72rem; color: var(--c-text3); margin-top: 1px; }

.sb-nav { flex: 1; padding: 8px; overflow-y: auto; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }

.sb-section { font-size: .65rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-text3); padding: 12px 8px 4px; }

.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r);
  color: var(--c-text2); font-size: .85rem; font-weight: 500;
  transition: all var(--t); margin-bottom: 1px;
  position: relative; white-space: nowrap;
}
.sb-link:hover { background: var(--c-hover); color: var(--c-text); }
.sb-link.active { background: var(--c-blue-bg); color: var(--c-blue); }
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sb-badge {
  margin-left: auto; background: var(--c-red); color: #fff;
  font-size: .65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}

.sb-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-blue), var(--c-purple));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-uname { flex: 1; font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-logout { color: var(--c-text3); transition: color var(--t); flex-shrink: 0; }
.sb-logout:hover { color: var(--c-red); }
.sb-logout svg { width: 16px; height: 16px; }

/* Main wrapper */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  width: calc(100% - var(--sidebar-w));
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 90;
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center;
  padding: 0 20px; gap: 12px;
  width: 100%;
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.page-title { font-size: 1rem; font-weight: 700; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tb-btn {
  width: 34px; height: 34px;
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-text2);
  background: var(--c-hover);
  border: 1px solid var(--c-border);
  transition: all var(--t); flex-shrink: 0; position: relative;
}
.tb-btn:hover { color: var(--c-text); }
.tb-btn svg { width: 17px; height: 17px; }
.tb-dot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-red); border: 1.5px solid var(--c-surface);
  display: none;
}
.tb-dot.show { display: block; }

.tb-clock {
  font-family: var(--mono); font-size: .8rem;
  color: var(--c-text3);
  padding: 4px 10px;
  background: var(--c-hover);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  white-space: nowrap;
}
.mobile-toggle { display: none; }

/* Page content */
.page-body { flex: 1; padding: 20px; }
.page-body.no-pad { padding: 0; }

/* ---- COMPONENTS ---- */

/* Cards */
.card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r2); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: .9rem; font-weight: 700; color: var(--c-text); }
.card-body { padding: 18px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r2); padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--c-text3); }
.stat-value { font-size: 1.6rem; font-weight: 700; font-family: var(--mono);
  color: var(--c-text); line-height: 1; }
.stat-sub { font-size: .75rem; color: var(--c-text2); }
.stat-icon { font-size: 1.3rem; margin-bottom: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r);
  font-size: .85rem; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all var(--t); white-space: nowrap; vertical-align: middle;
}
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-lg { padding: 11px 22px; font-size: .95rem; }
.btn-xl { padding: 14px 28px; font-size: 1rem; font-weight: 700; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary { background: var(--c-blue); color: #fff; border-color: var(--c-blue); }
.btn-primary:hover:not(:disabled) { background: var(--c-blue2); border-color: var(--c-blue2); }
.btn-success { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.btn-success:hover:not(:disabled) { background: #16a34a; border-color: #16a34a; }
.btn-danger { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-warning { background: var(--c-orange); color: #fff; border-color: var(--c-orange); }
.btn-outline {
  background: transparent; color: var(--c-text);
  border-color: var(--c-border);
}
.btn-outline:hover:not(:disabled) { background: var(--c-hover); }
.btn-ghost { background: transparent; color: var(--c-text2); border-color: transparent; }
.btn-ghost:hover { background: var(--c-hover); color: var(--c-text); }

/* Forms */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
  color: var(--c-text2); margin-bottom: 5px;
}
.form-control {
  width: 100%; padding: 9px 12px;
  background: var(--c-hover); border: 1.5px solid var(--c-border);
  border-radius: var(--r); color: var(--c-text); font-size: .88rem;
  outline: none; transition: border-color var(--t);
}
.form-control:focus { border-color: var(--c-blue); }
.form-control::placeholder { color: var(--c-text3); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%238892a4'%3E%3Cpath d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px;
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px; font-size: .7rem; font-weight: 600;
}
.badge-open     { background: var(--c-blue-bg);   color: var(--c-blue); }
.badge-pending  { background: var(--c-yellow-bg);  color: var(--c-yellow); }
.badge-paid     { background: var(--c-green-bg);   color: var(--c-green); }
.badge-cancelled{ background: var(--c-hover);      color: var(--c-text3); }
.badge-success  { background: var(--c-green-bg);   color: var(--c-green); }
.badge-danger   { background: var(--c-red-bg);     color: var(--c-red); }
.badge-warning  { background: var(--c-yellow-bg);  color: var(--c-yellow); }
.badge-info     { background: var(--c-blue-bg);    color: var(--c-blue); }

/* Tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .84rem; }
.tbl th {
  padding: 9px 14px; text-align: left;
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-text3); background: var(--c-hover);
  border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--c-border2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--t); }
.tbl tbody tr:hover { background: var(--c-hover); }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* Flash messages */
.flash {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 20px;
  font-size: .84rem; font-weight: 500;
}
.flash-success { background: var(--c-green-bg); color: var(--c-green); }
.flash-error   { background: var(--c-red-bg);   color: var(--c-red); }
.flash-info    { background: var(--c-blue-bg);  color: var(--c-blue); }
.flash-close   { font-size: 1rem; opacity: .6; cursor: pointer; flex-shrink: 0; }

/* Toast */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r2); padding: 12px 16px;
  font-size: .84rem; font-weight: 500; color: var(--c-text);
  box-shadow: var(--shadow); min-width: 260px; max-width: 360px;
  display: flex; align-items: center; gap: 10px;
  animation: toast-in .2s ease;
  border-left: 3px solid var(--c-blue);
}
.toast.s { border-left-color: var(--c-green); }
.toast.e { border-left-color: var(--c-red); }
.toast.w { border-left-color: var(--c-orange); }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px; animation: fadein .15s ease;
}
.modal {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r2); width: 100%; max-width: 500px;
  box-shadow: var(--shadow); animation: slideup .2s ease;
  overflow: hidden;
}
.modal-lg { max-width: 680px; }
.modal-head {
  padding: 16px 20px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: .92rem; font-weight: 700; }
.modal-close { font-size: 1.2rem; color: var(--c-text2); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--c-hover); }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--c-border);
  display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes fadein  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Spinner */
.spin {
  width: 20px; height: 20px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-blue);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Grid helpers */
.g2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.g4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.flex { display: flex; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.fw-bold { font-weight: 700; }
.mono { font-family: var(--mono); }
.text-muted { color: var(--c-text2); }
.text-sm { font-size: .82rem; }
.text-xs { font-size: .72rem; }
.accent { color: var(--c-blue); }

/* Notification panel */
.notif-panel {
  position: fixed;
  top: var(--topbar-h); right: 0;
  width: 340px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-top: none;
  border-radius: 0 0 var(--r2) var(--r2);
  box-shadow: var(--shadow); z-index: 200;
  max-height: 440px; overflow-y: auto;
  display: none;
}
.notif-panel.open { display: block; }
.notif-head { padding: 12px 16px; border-bottom: 1px solid var(--c-border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: .82rem; font-weight: 600; position: sticky; top: 0;
  background: var(--c-card); }
.notif-item {
  padding: 11px 16px; border-bottom: 1px solid var(--c-border2);
  cursor: pointer; transition: background var(--t);
}
.notif-item:hover { background: var(--c-hover); }
.notif-item:last-child { border: none; }
.notif-it { font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.notif-ib { font-size: .75rem; color: var(--c-text2); }
.notif-it2 { font-size: .7rem; color: var(--c-text3); margin-top: 3px; }
.notif-empty { padding: 30px 16px; text-align: center; color: var(--c-text3); font-size: .84rem; }

/* ====================================
   POS INTERFACE
   ==================================== */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - var(--topbar-h));
  gap: 0;
  overflow: hidden;
}

/* Left: products */
.pos-left {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--c-border);
  overflow: hidden;
  background: var(--c-surface);
}

.pos-search-bar {
  padding: 12px; border-bottom: 1px solid var(--c-border);
  display: flex; gap: 8px;
}
.pos-search {
  flex: 1; padding: 8px 12px 8px 36px;
  background: var(--c-hover);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r);
  color: var(--c-text); font-size: .88rem; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' fill='none' stroke='%238892a4' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
  transition: border-color var(--t);
}
.pos-search:focus { border-color: var(--c-blue); }

.pos-cats {
  display: flex; gap: 6px; padding: 10px 12px;
  overflow-x: auto; border-bottom: 1px solid var(--c-border);
  scrollbar-width: none; flex-shrink: 0;
}
.pos-cats::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: 5px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  background: var(--c-hover); border: 1.5px solid var(--c-border);
  color: var(--c-text2); white-space: nowrap; cursor: pointer;
  transition: all var(--t);
}
.cat-btn:hover { border-color: var(--c-blue); color: var(--c-blue); }
.cat-btn.on { background: var(--c-blue-bg); border-color: var(--c-blue); color: var(--c-blue); }

.pos-products {
  flex: 1; overflow-y: auto; padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px; align-content: start;
}

.prod-card {
  background: var(--c-card);
  border: 1.5px solid var(--c-border);
  border-radius: var(--r2); padding: 12px;
  cursor: pointer; transition: all var(--t);
  display: flex; flex-direction: column; gap: 5px;
  position: relative; user-select: none;
}
.prod-card:hover { border-color: var(--c-blue); transform: translateY(-1px); }
.prod-card:active { transform: scale(.97); }
.prod-card.out-of-stock { opacity: .4; cursor: not-allowed; }
.prod-card.out-of-stock:hover { transform: none; border-color: var(--c-border); }

.prod-img {
  width: 100%; aspect-ratio: 1; border-radius: var(--r);
  object-fit: cover; background: var(--c-hover);
  display: block; margin-bottom: 4px;
}
.prod-emoji { font-size: 1.8rem; line-height: 1; }
.prod-name { font-size: .8rem; font-weight: 600; color: var(--c-text); line-height: 1.3; }
.prod-price { font-size: .82rem; font-weight: 700; color: var(--c-blue); font-family: var(--mono); }
.prod-stock-tag {
  position: absolute; top: 6px; right: 6px;
  font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 4px;
}

/* Right: cart */
.pos-right {
  display: flex; flex-direction: column;
  background: var(--c-surface);
  overflow: hidden;
}

.cart-header {
  padding: 12px 14px; border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; gap: 10px;
}
.cart-title { flex: 1; min-width: 0; }
.cart-title-main { font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-title-sub  { font-size: .72rem; color: var(--c-text3); margin-top: 1px; }

.cart-items { flex: 1; overflow-y: auto; padding: 8px; }

.cart-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; gap: 10px; color: var(--c-text3); text-align: center;
}
.cart-empty-ico { font-size: 2.5rem; opacity: .4; }
.cart-empty-txt { font-size: .84rem; }

.cart-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px; border-radius: var(--r);
  border: 1px solid var(--c-border2);
  margin-bottom: 5px; background: var(--c-card);
  transition: background var(--t);
}
.cart-item:hover { background: var(--c-hover); }
.ci-name { flex: 1; min-width: 0; }
.ci-n  { font-size: .8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-p  { font-size: .72rem; color: var(--c-text3); }
.ci-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty-btn {
  width: 24px; height: 24px; border-radius: 5px; font-size: .9rem;
  background: var(--c-hover); border: 1px solid var(--c-border);
  color: var(--c-text); display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.qty-btn:hover { background: var(--c-blue-bg); color: var(--c-blue); }
.qty-val { font-size: .85rem; font-weight: 700; font-family: var(--mono); min-width: 22px; text-align: center; }
.ci-total { font-size: .82rem; font-weight: 700; font-family: var(--mono); color: var(--c-blue); min-width: 65px; text-align: right; }
.ci-del { color: var(--c-text3); padding: 3px; border-radius: 4px; flex-shrink: 0; }
.ci-del:hover { color: var(--c-red); background: var(--c-red-bg); }
.ci-del svg { width: 13px; height: 13px; }

.cart-totals {
  border-top: 1px solid var(--c-border);
  padding: 10px 14px; display: flex; flex-direction: column; gap: 4px;
}
.tot-row { display: flex; justify-content: space-between; font-size: .8rem; color: var(--c-text2); }
.tot-row.grand { font-size: .95rem; font-weight: 700; color: var(--c-text);
  padding-top: 6px; margin-top: 2px; border-top: 1px solid var(--c-border); }
.tot-row.grand .amount { color: var(--c-blue); font-family: var(--mono); font-size: 1rem; }
.tot-row .amount { font-family: var(--mono); }

.cart-actions {
  padding: 10px 12px; border-top: 1px solid var(--c-border);
  display: flex; flex-direction: column; gap: 6px;
}

/* Cashier pending cards */
.pending-card {
  background: var(--c-card); border: 1.5px solid var(--c-border);
  border-radius: var(--r2); padding: 14px; cursor: pointer;
  transition: all var(--t); margin-bottom: 10px;
}
.pending-card:hover { border-color: var(--c-green); }
.pending-card.urgent { border-color: var(--c-orange); animation: pulse-warn 2s infinite; }
@keyframes pulse-warn {
  0%,100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 4px var(--c-orange-bg); }
}

/* Auth page */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--c-bg); padding: 20px;
}
.auth-box {
  width: 100%; max-width: 400px;
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--r2); padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-ico {
  width: 52px; height: 52px; border-radius: var(--r2);
  background: var(--c-blue); display: inline-flex;
  align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 10px;
}
.auth-logo-text { font-size: 1.4rem; font-weight: 800; }
.auth-logo-text span { color: var(--c-blue); }
.auth-logo-sub { font-size: .8rem; color: var(--c-text3); margin-top: 3px; }

/* Image upload */
.img-upload {
  border: 2px dashed var(--c-border); border-radius: var(--r);
  padding: 20px; text-align: center; cursor: pointer;
  transition: border-color var(--t); position: relative;
}
.img-upload:hover { border-color: var(--c-blue); }
.img-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-preview {
  width: 80px; height: 80px; border-radius: var(--r);
  object-fit: cover; margin: 0 auto 8px;
  display: block;
}

/* Ticket print */
@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .ticket-wrap { max-width: 280px; margin: 0 auto; font-family: 'Courier New', monospace; font-size: 11px; }
}

/* Responsive */
@media (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 240px; }
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; width: 100%; }
  .mobile-toggle { display: flex; }
  .pos-layout { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pos-right { max-height: 380px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .page-body { padding: 12px; }
  .topbar { padding: 0 12px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 24px 18px; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }
