/* ==========================================================================
   THE SHOP OWNER'S FRIEND — DESIGN SYSTEM & STYLESHEET
   Deep Emerald Green, Warm White Background, Charcoal Text, Restrained Shadows
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Surface & Background */
  --bg: #FFFFFF;
  --panel: #FFFFFF;
  --panel-alt: #F9FAFB;
  --panel-hover: #F3F4F6;
  
  /* Deep Emerald Palette */
  --primary: #047857;
  --primary-hover: #065F46;
  --primary-dark: #064E3B;
  --primary-deep: #022C22;
  --primary-tint: #ECFDF5;
  --primary-tint-hover: #D1FAE5;
  --primary-glow: rgba(4, 120, 87, 0.22);
  --primary-border: #A7F3D0;
  --accent-mint: #34D399;
  --accent-emerald: #10B981;
  
  /* Typography & Ink (Charcoal) */
  --ink: #111827;
  --ink-secondary: #374151;
  --muted: #6B7280;
  --muted-light: #9CA3AF;
  --ink-inverted: #FFFFFF;
  
  /* Borders & Dividers */
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --line-light: #F3F4F6;
  
  /* Status & Semantic */
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --danger-border: #FECACA;
  --danger-ink: #991B1B;
  
  --warn: #D97706;
  --warn-bg: #FFFBEB;
  --warn-border: #FDE68A;
  --warn-ink: #92400E;
  
  --ok: #059669;
  --ok-bg: #ECFDF5;
  --ok-border: #A7F3D0;
  --ok-ink: #065F46;
  
  --info: #0284C7;
  --info-bg: #F0F9FF;
  --info-border: #BAE6FD;
  --info-ink: #075985;

  /* Elevation / Shadows */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow: 0 4px 6px -1px rgba(17, 24, 39, 0.06), 0 2px 4px -2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(17, 24, 39, 0.07), 0 4px 6px -4px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(17, 24, 39, 0.08), 0 8px 10px -6px rgba(17, 24, 39, 0.04);
  
  /* Geometry */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Navigation & Sidebar (Desktop) */
  --sidebar-w: 240px;
  --sidebar-bg: #064E3B;
  --sidebar-bg-2: #022C22;
  --sidebar-ink: #E2E8F0;
  --sidebar-muted: #9CA3AF;
  --sidebar-active: #047857;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover {
  color: var(--primary-hover);
}

.ic {
  flex-shrink: 0;
  vertical-align: -0.16em;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ==========================================================================
   TYPOGRAPHY & HEADINGS
   ========================================================================== */

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
}

h1 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

h2 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

p {
  color: var(--ink-secondary);
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* ==========================================================================
   SIDEBAR (DESKTOP)
   ========================================================================== */

.sidebar {
  width: var(--sidebar-w);
  background: #FFFFFF;
  color: #1F2937;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  border-right: 1.5px solid #E5E7EB;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 22px;
  border-bottom: 1px solid #F3F4F6;
  margin-bottom: 18px;
}

.brand-icon-box {
  width: 44px;
  height: 44px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-app-name {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
  color: #064E3B;
  letter-spacing: -0.02em;
}

.brand-shop-name {
  display: none;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.sidebar nav a {
  color: #4B5563;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 140ms ease;
  position: relative;
}

.sidebar nav a:hover {
  background: #F3F4F6;
  color: #111827;
}

.sidebar nav a.active {
  background: #E8F5E9;
  color: #046A4E;
  font-weight: 700;
}

.sidebar nav a.active::before {
  display: none;
}

/* Sidebar Footer / User section */
.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid #F3F4F6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 10px;
  transition: background 120ms ease;
}

.user-badge:hover {
  background: #F9FAFB;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: #064E3B;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.78rem;
  color: #6B7280;
  font-weight: 500;
}

.logout-link {
  color: var(--sidebar-muted);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: all 150ms ease;
}
.logout-link:hover {
  color: #F87171;
  background: rgba(239, 68, 68, 0.12);
}

/* Online / Offline status badge */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.2);
  color: var(--sidebar-ink);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
}
.status-dot.offline {
  background: var(--warn);
  box-shadow: 0 0 6px var(--warn);
}

/* ==========================================================================
   MAIN CONTENT LAYOUT
   ========================================================================== */

.content {
  flex: 1;
  padding: 24px 28px;
  max-width: 1360px;
  min-width: 0;
  margin: 0 auto;
  width: 100%;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.panel:hover {
  box-shadow: var(--shadow);
}
.panel.narrow {
  max-width: 520px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.panel-header h2 {
  margin: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   BUTTONS & CONTROLS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  touch-action: manipulation;
  transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-xs);
}

.btn:hover {
  background: var(--panel-alt);
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px var(--primary-glow);
}
.btn.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 10px var(--primary-glow);
}
.btn.primary:active {
  background: var(--primary-dark);
}
.btn.primary:disabled {
  background: #A7C4B9;
  border-color: #A7C4B9;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--line-light);
  color: var(--ink);
}

.btn.danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.btn.danger:hover {
  background: var(--danger);
  color: #FFFFFF;
}

.btn.full {
  width: 100%;
}

.btn.big {
  min-height: 50px;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius);
}

.btn.tiny {
  min-height: 34px;
  min-width: 36px;
  padding: 4px 10px;
  font-size: 0.9rem;
  border-radius: var(--radius-xs);
}

.btn-trash {
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted-light);
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 140ms ease;
}
.btn-trash:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: underline;
  font-family: inherit;
  transition: color 140ms ease;
}
.link-btn:hover {
  color: var(--primary-hover);
}
.link-btn.danger {
  color: var(--danger);
}
.link-btn.danger:hover {
  color: var(--danger-ink);
}

/* ==========================================================================
   FORMS, INPUTS & LABELS
   ========================================================================== */

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 12px;
}

input, select, textarea {
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 400;
  background: var(--panel);
  color: var(--ink);
  min-height: 44px;
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

input::placeholder, textarea::placeholder {
  color: var(--muted-light);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
}
.form-grid.single {
  grid-template-columns: 1fr;
}
.form-grid button {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.inline-form {
  display: flex;
  gap: 8px;
  margin: 0;
  align-items: center;
}

/* Password Toggle Wrapper */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field input {
  width: 100%;
  padding-right: 44px;
}
.password-toggle {
  position: absolute;
  right: 4px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  transition: color 150ms ease;
}
.password-toggle:hover {
  color: var(--ink);
}

/* Checkbox Label */
.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  cursor: pointer;
  margin: 8px 0;
}
.checkbox-label input[type="checkbox"] {
  min-height: 18px;
  width: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ==========================================================================
   ALERTS & FLASH MESSAGES
   ========================================================================== */

.flashes {
  margin-bottom: 16px;
}
.flash {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash.error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger-ink);
}
.flash.warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  color: var(--warn-ink);
}

/* Network Connection Banner */
.net-banner {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.net-banner.offline {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  color: var(--warn-ink);
}
.net-banner.syncing {
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-ink);
}
.net-banner.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-ink);
}

/* ==========================================================================
   BADGES & STATUS CHIPS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  line-height: 1.3;
}
.badge.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border: 1px solid var(--ok-border);
}
.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid var(--warn-border);
}
.badge.danger {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid var(--danger-border);
}
.badge.neutral {
  background: var(--panel-alt);
  color: var(--muted);
  border: 1px solid var(--line);
}
.badge.primary {
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

/* ==========================================================================
   STAT CARDS & KPI ROW
   ========================================================================== */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  transition: all 160ms ease;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: var(--primary);
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--panel);
}

tbody tr {
  transition: background 120ms ease;
}
tbody tr:hover {
  background: var(--panel-hover);
}
tbody tr:last-child td {
  border-bottom: none;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.actions form {
  display: inline;
}

.thumb-cell {
  width: 48px;
  padding-right: 0;
}
.table-thumb {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}
.table-thumb.initial {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   POS SELL / CHECKOUT PAGE
   ========================================================================== */

/* ==========================================================================
   POS SELL / CHECKOUT PAGE — SALES COUNTER REDESIGN (MATCHING MOCKUP)
   ========================================================================== */

.sell-counter-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 28px;
  align-items: start;
  width: 100%;
}

@media (max-width: 1100px) {
  .sell-counter-layout {
    grid-template-columns: 1fr 340px;
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .sell-counter-layout {
    grid-template-columns: 1fr;
  }
}

.counter-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* Header with Title and Online Pill */
.counter-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.counter-page-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  margin-bottom: 2px;
}

.counter-subtitle {
  font-size: 0.98rem;
  color: #6B7280;
  margin: 0;
}

.counter-meta-pill {
  display: flex;
  align-items: center;
  gap: 16px;
}

.online-sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #047857;
}

.online-sync-status .status-dot {
  width: 9px;
  height: 9px;
  background: #10B981;
  border-radius: 50%;
  display: inline-block;
}

.date-dropdown {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}

/* Search input with barcode scanner icon inside */
.counter-search-row {
  width: 100%;
}

.counter-search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.counter-search-box .search-icon {
  position: absolute;
  left: 18px;
  color: #9CA3AF;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.counter-search-box input {
  width: 100%;
  height: 52px;
  padding: 12px 52px 12px 50px;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 14px;
  font-size: 0.98rem;
  color: #111827;
  transition: all 140ms ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.counter-search-box input:focus {
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.12);
  outline: none;
}

.scan-barcode-btn {
  position: absolute;
  right: 14px;
  background: transparent;
  border: none;
  color: #4B5563;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 120ms ease;
}

.scan-barcode-btn:hover {
  color: #047857;
}

/* Category Filter Bar */
.counter-category-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.counter-category-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 10px 22px;
  border-radius: 9999px;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}

.cat-pill:hover {
  border-color: #D1D5DB;
  background: #F9FAFB;
}

.cat-pill.active {
  background: #044E3B;
  border-color: #044E3B;
  color: #FFFFFF;
  font-weight: 700;
}

/* Product Cards Grid */
.counter-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.counter-product-card {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  cursor: pointer;
}

.counter-product-card:hover {
  border-color: #D1D5DB;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.counter-product-card.out {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.counter-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1.08 / 1;
  background: #F3F4F6;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.counter-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.counter-card-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  color: #FFFFFF;
}

.counter-stock-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #E8F5E9;
  color: #046A4E;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.counter-card-details {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.counter-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.counter-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.counter-card-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}

.counter-add-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #044E3B;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease, transform 100ms ease;
}

.counter-add-btn:hover {
  background: #03382B;
}

.counter-add-btn:active {
  transform: scale(0.94);
}

/* ==========================================================================
   CURRENT SALE PANEL (RIGHT ASIDE)
   ========================================================================== */

.current-sale-panel {
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 18px;
  padding: 22px 20px 20px;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.sale-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  border-bottom: 1px solid #F3F4F6;
}

.sale-panel-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0;
}

.sale-order-num {
  font-size: 0.86rem;
  color: #6B7280;
  font-weight: 500;
}

.add-customer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  background: #FFFFFF;
  color: #111827;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
}

.add-customer-btn:hover {
  border-color: #047857;
  color: #047857;
}

/* Cart Items Scroll list */
.counter-cart-items {
  display: flex;
  flex-direction: column;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
  margin: 10px 0 6px;
}

.counter-cart-row {
  display: grid;
  grid-template-columns: 46px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
}

.cart-item-thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: #F3F4F6;
  object-fit: contain;
  padding: 4px;
}

.cart-item-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #FFFFFF;
  font-size: 1rem;
}

.cart-item-middle {
  min-width: 0;
}

.cart-item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-unit {
  font-size: 0.78rem;
  color: #6B7280;
}

.counter-qty-group {
  display: flex;
  align-items: center;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  background: #FFFFFF;
}

.counter-qty-btn {
  width: 26px;
  height: 28px;
  border: none;
  background: transparent;
  color: #4B5563;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease;
}

.counter-qty-btn:hover {
  background: #F3F4F6;
}

.counter-qty-val {
  min-width: 26px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  color: #111827;
}

.counter-cart-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 72px;
}

.counter-trash-btn {
  background: transparent;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 120ms ease;
}

.counter-trash-btn:hover {
  color: #EF4444;
}

.counter-line-total {
  font-size: 0.96rem;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

/* Pricing Breakdown */
.counter-summary-block {
  border-top: 1px solid #F3F4F6;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.counter-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}

.summary-label {
  color: #6B7280;
  font-weight: 500;
}

.summary-val {
  color: #111827;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.add-discount-link {
  background: transparent;
  border: none;
  color: #047857;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.counter-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px solid #E5E7EB;
}

.total-big-label {
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
}

.total-big-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Payment Method Grid */
.counter-payment-section {
  margin-top: 14px;
}

.payment-section-title {
  display: block;
  font-size: 0.82rem;
  color: #6B7280;
  font-weight: 600;
  margin-bottom: 8px;
}

.counter-payment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mockup-pay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms ease;
}

.mockup-pay-btn:hover {
  border-color: #D1D5DB;
}

.mockup-pay-btn.active {
  border: 2px solid #044E3B;
  background: #FFFFFF;
  color: #044E3B;
}

.mockup-icon-card {
  width: 26px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.mockup-icon-card.cash {
  background: #E8F5E9;
  color: #046A4E;
  border: 1px solid #A7F3D0;
}
.mockup-icon-card.momo {
  background: #FEF3C7;
  color: #D97706;
  border: 1px solid #FDE68A;
}
.mockup-icon-card.card {
  background: #EFF6FF;
  color: #2563EB;
  border: 1px solid #BFDBFE;
}

/* Action Buttons Stack */
.sale-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.counter-charge-btn {
  width: 100%;
  height: 52px;
  background: #044E3B;
  color: #FFFFFF;
  border: none;
  border-radius: 12px;
  font-size: 1.02rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 140ms ease, opacity 140ms ease;
}

.counter-charge-btn:hover:not(:disabled) {
  background: #03382B;
}

.counter-charge-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.counter-hold-btn {
  width: 100%;
  height: 48px;
  background: #FFFFFF;
  color: #111827;
  border: 1.5px solid #E5E7EB;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 120ms ease;
}

.counter-hold-btn:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

.cart-items-footer-count {
  font-size: 0.78rem;
  color: #9CA3AF;
  text-align: left;
  margin-top: 14px;
}

/* Cash Tender and Change */
.tender-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 0;
}
.tender-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tender-input-wrap label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.cash-shortcuts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip-btn {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line);
  background: var(--panel-alt);
  color: var(--ink-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: all 120ms ease;
}
.chip-btn:hover {
  background: var(--primary-tint);
  border-color: var(--primary-border);
  color: var(--primary);
}

.change-callout {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok-ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  margin-top: 10px;
}

/* Sticky Mobile Cart Bar */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #044E3B;
  color: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
}
.cart-bar-info {
  display: flex;
  flex-direction: column;
}
.cart-bar-info span {
  font-size: 0.8rem;
  color: #A7F3D0;
  font-weight: 600;
}
.cart-bar-info strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 901px) {
  .cart-bar {
    display: none !important;
  }
}

/* ==========================================================================
   LOGIN SCREEN (REFERENCE MOCKUP: FULL-BLEED SHOPKEEPER + RIGHT CARD)
   ========================================================================== */

.login-reference-screen {
  position: relative;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.35) 100%),
              url('/static/login-bg.jpg') no-repeat center center / cover;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 40px 70px;
  overflow-x: hidden;
}

/* Top-Left Brand Logo & Title */
.ref-brand-top {
  position: absolute;
  top: 36px;
  left: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  z-index: 10;
  text-decoration: none;
}
.ref-brand-top .ic {
  color: #FFFFFF;
}

/* Bottom-Left Hero Tagline */
.ref-hero-bottom {
  position: absolute;
  bottom: 48px;
  left: 48px;
  max-width: 580px;
  z-index: 10;
  color: #FFFFFF;
}
.ref-hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: #FFFFFF;
  margin-bottom: 8px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}
.ref-hero-sub {
  font-size: 1.1rem;
  font-weight: 400;
  color: #FFFFFF;
  line-height: 1.4;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65);
}

/* Bottom Center Watermark */
.ref-watermark {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  z-index: 5;
  pointer-events: none;
  white-space: nowrap;
}

/* Floating Right Login Card */
.ref-login-card {
  width: 440px;
  max-width: 100%;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 40px 36px 34px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 20;
}

/* Floating Right Sign Up Card */
.ref-signup-card {
  width: 540px;
  max-width: 100%;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 38px 36px 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 20;
}

.ref-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ref-phone-box {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  background: #FFFFFF !important;
  transition: all 140ms ease;
  overflow: hidden;
  height: 48px;
}

.ref-phone-box:focus-within {
  border-color: #046A4E;
  box-shadow: 0 0 0 3px rgba(4, 106, 78, 0.15);
}

.ref-phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 12px;
  background: #F3F4F6 !important;
  border-right: 1.5px solid #E5E7EB;
  height: 100%;
  color: #374151 !important;
  flex-shrink: 0;
}

.ref-phone-prefix select {
  border: none !important;
  background: transparent !important;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1F2937 !important;
  cursor: pointer;
  padding: 0 4px 0 0;
  outline: none !important;
  box-shadow: none !important;
}

.ref-phone-prefix select option {
  background: #FFFFFF;
  color: #111827;
}

.ref-phone-box input {
  border: none !important;
  box-shadow: none !important;
  padding: 10px 14px !important;
  height: 100% !important;
  width: 100%;
  font-size: 0.95rem;
  color: #111827 !important;
  background: #FFFFFF !important;
}

.ref-phone-box input::placeholder {
  color: #9CA3AF !important;
}

.ref-helper-text {
  font-size: 0.78rem;
  color: #6B7280;
}

.ref-terms-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 18px;
  font-size: 0.84rem;
  color: #374151;
  line-height: 1.4;
}

.ref-terms-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  margin-top: 2px;
  accent-color: #046A4E;
  cursor: pointer;
}

.ref-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #046A4E;
  margin-bottom: 12px;
}

.ref-card-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.ref-card-subtitle {
  font-size: 0.95rem;
  color: #6B7280;
  text-align: center;
  margin-bottom: 24px;
}

/* Form Input Wrapper with Left/Right Icons */
.ref-field-group {
  margin-bottom: 16px;
}
.ref-field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 6px;
}

.ref-input-box {
  position: relative;
  display: flex;
  align-items: center;
}
.ref-input-box .ref-icon-left {
  position: absolute;
  left: 14px;
  color: #6B7280;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.ref-input-box input {
  width: 100%;
  height: 48px;
  padding: 10px 14px 10px 42px;
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #111827 !important;
  background: #FFFFFF !important;
  transition: all 140ms ease;
  box-shadow: none;
}
.ref-input-box input:focus {
  border-color: #046A4E;
  box-shadow: 0 0 0 3px rgba(4, 106, 78, 0.15);
  outline: none;
}
.ref-input-box .ref-icon-toggle {
  position: absolute;
  right: 10px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6B7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.ref-input-box .ref-icon-toggle:hover {
  color: #111827;
}

/* Split Options Row: Remember Me & Forgot Password */
.ref-split-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0 20px;
  font-size: 0.88rem;
}
.ref-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #4B5563;
  cursor: pointer;
  font-weight: 500;
}
.ref-remember input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 17px;
  accent-color: #046A4E;
  cursor: pointer;
}
.ref-link-emerald {
  color: #046A4E;
  font-weight: 600;
  text-decoration: none;
  transition: color 120ms ease;
}
.ref-link-emerald:hover {
  color: #034D38;
  text-decoration: underline;
}

/* Primary Sign In Button */
.ref-submit-btn {
  width: 100%;
  height: 50px;
  background: #046A4E;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 140ms ease;
  box-shadow: 0 4px 12px rgba(4, 106, 78, 0.25);
  font-family: inherit;
}
.ref-submit-btn:hover {
  background: #03523C;
  box-shadow: 0 6px 16px rgba(4, 106, 78, 0.35);
  transform: translateY(-1px);
}
.ref-submit-btn:active {
  transform: translateY(0);
}

.ref-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 0.88rem;
  color: #4B5563;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .login-reference-screen {
    padding: 30px 40px;
  }
  .ref-brand-top {
    left: 32px;
    top: 28px;
  }
  .ref-hero-bottom {
    left: 32px;
    bottom: 36px;
    max-width: 440px;
  }
  .ref-hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 900px) {
  .login-reference-screen {
    justify-content: center;
    padding: 90px 20px 40px;
    min-height: 100vh;
    height: auto;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.3) 100%),
                url('/static/login-bg.jpg') no-repeat center center / cover;
  }
  .ref-brand-top {
    left: 24px;
    top: 24px;
  }
  .ref-hero-bottom {
    display: none;
  }
  .ref-login-card,
  .ref-signup-card {
    padding: 32px 24px;
    border-radius: 22px;
  }
}

@media (max-width: 580px) {
  .ref-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .ref-signup-card {
    padding: 28px 18px 24px;
  }
}

/* ==========================================================================
   RECEIPT DESIGN
   ========================================================================== */

.receipt-page {
  max-width: 400px;
  margin: 0 auto;
}

.receipt {
  background: #FFFFFF;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  position: relative;
}
.receipt hr {
  border: none;
  border-top: 1.5px dashed var(--line-strong);
  margin: 12px 0;
}
.receipt-head {
  text-align: center;
}
.receipt-shop {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink);
  font-family: inherit;
}
.receipt-table {
  width: 100%;
  font-size: 0.88rem;
}
.receipt-table td {
  border: none;
  padding: 4px 0;
}
.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.receipt-row.total {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  padding: 6px 0;
}
.receipt-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

/* ==========================================================================
   MODALS, OVERLAYS & SHEETS
   ========================================================================== */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  transition: opacity 200ms ease;
}
.overlay.dark {
  background: rgba(2, 6, 23, 0.88);
  align-items: center;
}
.overlay[hidden] {
  display: none;
}

.sheet {
  background: var(--panel);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
@media (min-width: 700px) {
  .overlay {
    align-items: center;
  }
  .sheet {
    border-radius: var(--radius-lg);
  }
}

.scan-box {
  width: 100%;
  max-width: 440px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#scan-video {
  width: 100%;
  border-radius: var(--radius);
  background: #000;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.scan-status {
  color: #FFFFFF;
  text-align: center;
  font-weight: 600;
}

/* ==========================================================================
   MOBILE DESIGN SYSTEM & NAVIGATION (NATIVE APP EXPERIENCE)
   ========================================================================== */

.mobile-only {
  display: none !important;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); opacity: 0.5; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Dedicated Mobile Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: 0 8px env(safe-area-inset-bottom, 0px);
  background: #FFFFFF;
  border-top: 1.5px solid #E5E7EB;
  display: none;
  align-items: center;
  justify-content: space-around;
  z-index: 80;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 0;
  color: #6B7280;
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 120ms ease, transform 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: #047857;
  font-weight: 700;
}

.mobile-nav-item svg {
  width: 21px;
  height: 21px;
}

/* Mobile Drawer Bottom Sheet ("More" menu) */
.mobile-nav-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.18s ease-out;
}

.mobile-nav-sheet-content {
  width: 100%;
  background: #FFFFFF;
  border-radius: 24px 24px 0 0;
  padding: 12px 18px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
  animation: slideUpSheet 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 9999px;
  background: #D1D5DB;
  margin: 0 auto 14px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #F3F4F6;
  margin-bottom: 14px;
}

.sheet-user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sheet-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #047857;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.sheet-user-name {
  display: block;
  font-size: 0.96rem;
  color: #111827;
  line-height: 1.2;
}

.sheet-shop-name {
  font-size: 0.78rem;
  color: #6B7280;
}

.sheet-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #F3F4F6;
  color: #4B5563;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-nav-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  text-decoration: none;
  color: #111827;
  transition: background 120ms ease, transform 120ms ease;
}

.sheet-nav-card:active {
  background: #F3F4F6;
  transform: scale(0.98);
}

.sheet-nav-card.active {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

.sheet-nav-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #047857;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
}

.sheet-nav-text {
  display: flex;
  flex-direction: column;
}

.sheet-nav-text strong {
  font-size: 0.92rem;
  line-height: 1.2;
}

.sheet-nav-text span {
  font-size: 0.76rem;
  color: #6B7280;
}

.cart-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid #E5E7EB;
  background: #F9FAFB;
  color: #111827;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

/* Responsive Overrides (Phones & Tablets) */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .mobile-only {
    display: flex !important;
  }

  /* Completely hide desktop sidebar on mobile */
  .sidebar {
    display: none !important;
  }

  .mobile-brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #064E3B;
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }

  .content {
    padding: 14px 12px calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .panel {
    padding: 16px 14px !important;
    border-radius: 14px !important;
  }

  .panel-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .panel-header > div:last-child {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-header .btn {
    flex: 1;
    min-width: 130px;
    justify-content: center;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  h1 {
    font-size: 1.35rem !important;
    margin-bottom: 8px !important;
  }

  .stat-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .stat-card:last-child:nth-child(odd) {
    grid-column: 1 / -1 !important;
  }

  .stat-card {
    padding: 14px 12px !important;
  }

  .stat-value {
    font-size: 1.35rem !important;
  }

  .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    display: block !important;
    border-radius: 10px;
  }

  table {
    min-width: 520px !important;
  }

  .inline-form {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
  }
}

/* Sell Counter on Mobile */
@media (max-width: 900px) {
  .sell-counter-layout {
    display: block !important;
    width: 100% !important;
  }

  .counter-top-bar {
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
  }

  .counter-page-title {
    font-size: 1.45rem !important;
  }

  .counter-subtitle {
    font-size: 0.84rem !important;
  }

  .counter-meta-pill {
    font-size: 0.8rem !important;
    gap: 10px !important;
  }

  .counter-search-box input {
    height: 48px !important;
    font-size: 16px !important;
    padding: 10px 48px 10px 44px !important;
  }

  .counter-search-box .search-icon {
    left: 14px !important;
  }

  .counter-category-bar {
    padding-bottom: 2px !important;
    margin-bottom: 4px !important;
  }

  .cat-pill {
    padding: 8px 16px !important;
    font-size: 0.84rem !important;
  }

  /* Product Catalog: Clean 2-column mobile cards */
  .counter-product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .counter-product-card {
    border-radius: 14px !important;
  }

  .counter-card-media {
    aspect-ratio: 1.05 / 1 !important;
  }

  .counter-card-body {
    padding: 10px !important;
  }

  .counter-prod-name {
    font-size: 0.86rem !important;
    line-height: 1.25 !important;
    max-height: 2.5em !important;
    overflow: hidden;
  }

  .counter-prod-price {
    font-size: 0.96rem !important;
  }

  .counter-card-stock {
    font-size: 0.72rem !important;
  }

  /* Cart panel is hidden in catalog flow, and opens as full-screen modal when requested */
  .current-sale-panel {
    display: none !important;
  }

  body.cart-open .current-sale-panel {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000 !important;
    border-radius: 0 !important;
    padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
    background: #FFFFFF !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    animation: slideUpSheet 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .cart-close-btn {
    display: flex !important;
  }

  /* Floating Bottom Cart Bar (appears when items added) */
  .cart-bar {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    background: #044E3B !important;
    color: #FFFFFF !important;
    border-radius: 18px !important;
    padding: 11px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 85 !important;
    box-shadow: 0 8px 24px rgba(4, 78, 59, 0.35) !important;
    border: 1.5px solid rgba(167, 243, 208, 0.35) !important;
    animation: bounceIn 0.25s ease-out !important;
  }

  .cart-bar[hidden] {
    display: none !important;
  }
}

/* ==========================================================================
   STOCK PHOTO SUGGESTIONS & LIBRARY MODAL
   ========================================================================== */

.stock-suggestions-box {
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-top: 8px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  grid-column: 1 / -1;
  animation: fadeIn 0.15s ease-out;
}

.stock-suggestions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.stock-browse-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}
.stock-browse-link:hover {
  text-decoration: underline;
}

.stock-suggestions-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.stock-suggestion-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px 6px 6px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.stock-suggestion-card:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
  transform: translateY(-1px);
}

.stock-suggestion-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: #FFF;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.stock-suggestion-info {
  display: flex;
  flex-direction: column;
}

.stock-suggestion-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.stock-suggestion-cat {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Selected photo preview card */
.selected-photo-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--primary-tint);
  border: 1px solid rgba(4, 120, 87, 0.25);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-top: 8px;
  margin-bottom: 8px;
  grid-column: 1 / -1;
  animation: fadeIn 0.15s ease-out;
}

.selected-photo-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #FFF;
  border: 1px solid rgba(4, 120, 87, 0.3);
  flex-shrink: 0;
}

.selected-photo-info {
  flex: 1;
  min-width: 0;
}

.selected-photo-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.selected-photo-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Modal styling */
.stock-modal-body {
  max-width: 680px;
  width: 95%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--line);
}

.stock-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  overflow-y: auto;
  max-height: 50vh;
  padding: 4px 2px 12px;
}

.stock-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--panel-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.stock-grid-item:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.stock-grid-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #FFF;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}

.stock-grid-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
}

.stock-grid-cat {
  font-size: 0.68rem;
  color: var(--muted);
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
  .sidebar, .no-print, .flashes, .cart-bar, .net-banner {
    display: none !important;
  }
  .content {
    padding: 0;
  }
  .receipt {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  body {
    background: #FFFFFF;
  }
}

/* Dark mode override removed to keep app design consistently clean white and emerald across all screens */
