/* assets/css/pos_spa_nav.css */
/* POS SPA Unified Theme (nav + shell) */

:root {
  /* Brand */
  --pos-brand: #0ea5e9;              /* sky-500 */
  --pos-brand-600: #0284c7;          /* sky-600 */

  /* Neutrals */
  --pos-bg: #f6f7fb;                 /* app background */
  --pos-surface: #ffffff;            /* cards/panels */
  --pos-surface-2: #f8fafc;          /* subtle */
  --pos-border: #e5e7eb;             /* gray-200 */
  --pos-text: #0f172a;               /* slate-900 */
  --pos-muted: #64748b;              /* slate-500 */

  /* Status */
  --pos-success: #16a34a;            /* green-600 */
  --pos-warning: #f59e0b;            /* amber-500 */
  --pos-danger: #ef4444;             /* red-500 */

  /* Effects */
  --pos-shadow-sm: 0 1px 2px rgba(2, 6, 23, 0.06);
  --pos-shadow: 0 10px 25px rgba(2, 6, 23, 0.08);
  --pos-radius: 14px;
  --pos-radius-sm: 10px;
  --pos-gap: 12px;

  /* Layout */
  --pos-topbar-h: 60px;
  --pos-drawer-w: 290px;
}

/* Base */
html, body { height: 100%; }

body {
  background: var(--pos-bg);
  color: var(--pos-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.35;
}

/* Prevent legacy theme containers from squeezing SPA */
.pos-spa, .pos-spa #app {
  min-height: 100vh;
  width: 100%;
}

/* Topbar */
.pos-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--pos-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--pos-gap);
  padding: 0 16px;
  background: var(--pos-surface);
  border-bottom: 1px solid var(--pos-border);
  box-shadow: var(--pos-shadow-sm);
}

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

.pos-topbar-title {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--pos-text);
}

.pos-topbar-subtitle {
  color: var(--pos-muted);
  font-size: 12px;
}

/* Buttons */
.pos-btn, .pos-icon-btn {
  appearance: none;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--pos-shadow-sm);
}

.pos-icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pos-btn:hover, .pos-icon-btn:hover {
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.10);
}

.pos-btn:active, .pos-icon-btn:active { transform: translateY(1px); }

.pos-btn-primary {
  background: linear-gradient(180deg, var(--pos-brand) 0%, var(--pos-brand-600) 100%);
  color: #fff;
  border: 1px solid rgba(2, 132, 199, 0.4);
}

/* Drawer backdrop */
.pos-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 90;
  display: none;
}
.pos-drawer-backdrop.is-open { display: block; }

/* Drawer panel */
.pos-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--pos-drawer-w);
  background: var(--pos-surface);
  border-right: 1px solid var(--pos-border);
  box-shadow: var(--pos-shadow);
  z-index: 100;
  transform: translateX(-102%);
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
}
.pos-drawer.is-open { transform: translateX(0); }

.pos-drawer-header {
  height: var(--pos-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--pos-border);
}

.pos-drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pos-drawer-brand .brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--pos-brand);
  box-shadow: 0 0 0 6px rgba(14, 165, 233, 0.12);
}
.pos-drawer-brand .brand-title { font-weight: 800; }

.pos-drawer-body {
  padding: 12px;
  overflow: auto;
}

/* Menu sections */
.pos-menu-section { margin-bottom: 14px; }

.pos-menu-section-title {
  font-size: 12px;
  color: var(--pos-muted);
  font-weight: 700;
  padding: 8px 10px;
  letter-spacing: .2px;
}

/* Menu item */
.pos-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--pos-text);
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.pos-menu-item:hover {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.22);
}
.pos-menu-item:active { transform: translateY(1px); }

.pos-menu-item.active {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.35);
}

.pos-menu-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pos-surface-2);
  border: 1px solid var(--pos-border);
  flex: 0 0 30px;
}

.pos-menu-text strong {
  font-size: 14px;
  display: block;
  line-height: 1.2;
}
.pos-menu-text small {
  display: block;
  margin-top: 2px;
  color: var(--pos-muted);
  font-size: 12px;
}

/* Status pills / chips */
.pos-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--pos-border);
  background: var(--pos-surface);
  color: var(--pos-text);
}
.pos-pill.success {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.10);
  color: #14532d;
}
.pos-pill.warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #7c2d12;
}
.pos-pill.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: #7f1d1d;
}

/* Responsive */
@media (max-width: 920px) {
  :root { --pos-drawer-w: 300px; }
}
@media (max-width: 640px) {
  .pos-topbar { padding: 0 12px; }
}

/* Utility */
.pos-hidden { display: none !important; }