/* Mera's General Merchandise — Professional Admin Stylesheet */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* ── Core Palette ─────────────────────────────── */
  --color-bg: #eef0f7;
  --color-surface: #ffffff;
  --color-surface-2: #f8fafc;

  /* Primary — Indigo */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #eef2ff;
  --color-primary-mid: #c7d2fe;
  --color-primary-dark: #3730a3;

  /* Secondary — Slate */
  --color-secondary: #0f172a;
  --color-secondary-hover: #1e293b;
  --color-secondary-soft: #334155;

  /* Semantic */
  --color-success: #059669;
  --color-success-hover: #047857;
  --color-success-light: #ecfdf5;
  --color-success-mid: #6ee7b7;

  --color-warning: #d97706;
  --color-warning-hover: #b45309;
  --color-warning-light: #fffbeb;
  --color-warning-mid: #fcd34d;

  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-light: #fef2f2;
  --color-danger-mid: #fca5a5;

  --color-info: #0284c7;
  --color-info-light: #e0f2fe;
  --color-info-mid: #7dd3fc;

  /* Text */
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-subtle: #94a3b8;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  /* ── Shadows ──────────────────────────────────── */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.1), 0 4px 8px -4px rgba(0, 0, 0, 0.07);
  --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.14), 0 8px 16px -4px rgba(0, 0, 0, 0.08);
  --shadow-primary: 0 4px 14px rgba(79, 70, 229, 0.3);
  --shadow-success: 0 4px 14px rgba(5, 150, 105, 0.25);
  --shadow-danger: 0 4px 14px rgba(220, 38, 38, 0.25);

  /* ── Radius ───────────────────────────────────── */
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  /* ── Transitions ──────────────────────────────── */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Global Entrance Animations ──────────────────── */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }

  100% {
    background-position: 400px 0;
  }
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.45);
  }

  70% {
    box-shadow: 0 0 0 8px rgba(217, 119, 6, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
  }
}

@keyframes ping {

  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* ── Reset & Global ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection color */
::selection {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ─── App Wrapper (sidebar + content) ────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* .has-sidebar layout is defined in the Layout Containers section below */

/* ─── Sidebar Navigation ─────────────────────────── */
.app-sidebar {
  width: 264px;
  background: linear-gradient(175deg, #12103a 0%, #1e1b4b 30%, #2d2a72 70%, #3730a3 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 200;
  box-shadow: 4px 0 32px rgba(30, 27, 75, 0.28), 1px 0 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.4), transparent);
}

.sidebar-brand .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.5);
  flex-shrink: 0;
}

.sidebar-brand .icon-brand {
  width: 20px;
  height: 20px;
  color: #fff;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--color-secondary);
  font-weight: 700;
  font-size: 1.25rem;
}

.icon-brand {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(165, 180, 252, 0.7);
  padding: 8px 10px 4px;
  margin-top: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(199, 210, 254, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

.nav-link svg {
  opacity: 0.75;
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-link:hover svg {
  opacity: 1;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.3), rgba(99, 102, 241, 0.1));
  color: #fff;
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #a5b4fc, #818cf8);
}

.nav-link.active svg {
  opacity: 1;
  color: #a5b4fc;
}

/* ─── Sidebar User Profile ────────────────────────── */
.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  position: relative;
}

.sidebar-user::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(165, 180, 252, 0.35), transparent);
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(165, 180, 252, 0.35), 0 4px 12px rgba(99, 102, 241, 0.4);
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  flex: 1;
}

.username {
  font-weight: 600;
  font-size: 0.875rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(165, 180, 252, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1px;
}

.logout-btn {
  font-size: 0.755rem;
  color: rgba(252, 165, 165, 0.8);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  transition: var(--transition);
  width: fit-content;
}

.logout-btn:hover {
  color: #fca5a5;
}

.logout-modal-open {
  overflow: hidden;
}

.logout-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.logout-confirm-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.logout-confirm-dialog {
  width: min(420px, 100%);
  background: var(--color-surface);
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.35);
  padding: 28px;
  text-align: center;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.logout-confirm-overlay.open .logout-confirm-dialog {
  transform: translateY(0) scale(1);
}

.logout-confirm-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  border-radius: 18px;
  color: var(--color-danger);
  background: linear-gradient(135deg, #fff7ed, var(--color-danger-light));
  border: 1px solid #fecaca;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.16);
}

.logout-confirm-copy h3 {
  color: var(--color-secondary);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 6px;
}

.logout-confirm-copy p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 320px;
}

.logout-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 24px;
}

.logout-confirm-actions .btn {
  width: 100%;
  padding-inline: 14px;
}

@media (max-width: 420px) {
  .logout-confirm-dialog {
    padding: 24px 20px;
  }

  .logout-confirm-actions {
    grid-template-columns: 1fr;
  }
}

/* ─── Mobile Top Bar ─────────────────────────────── */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 150;
  height: 60px;
  padding: 0 16px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-topbar .brand {
  flex: 1;
  font-size: 1.1rem;
}

.mobile-topbar .icon-brand {
  color: var(--color-primary);
}

.mobile-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #818cf8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* ─── Burger Button ──────────────────────────────── */
.burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.burger-btn:hover {
  background-color: var(--color-bg);
  border-color: var(--color-primary);
}

.burger-line {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--color-secondary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
  transform-origin: center;
}

.burger-btn.active .burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger-btn.active .burger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger-btn.active .burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Sidebar Overlay ────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  z-index: 190;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.visible {
  display: block;
  opacity: 1;
}

/* ─── Layout Containers ──────────────────────────── */

/*
  HTML structure: <aside.app-sidebar> and <div.app-wrapper> are SIBLINGS under body.
  Sidebar is position:fixed (out of flow). Wrapper is offset with margin-left on desktop.
*/

/* Desktop: offset content area to the right of the fixed sidebar */
.app-wrapper.has-sidebar {
  margin-left: 264px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.has-sidebar .app-main {
  flex: 1;
  min-width: 0;
  padding: 36px 40px;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
}

.app-footer {
  background-color: transparent;
  color: var(--color-text-muted);
  padding: 24px 0 8px 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 0.85rem;
  margin-top: auto;
  width: 100%;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.auth-footer-bar {
  background-color: var(--color-secondary);
  color: #94a3b8;
  padding: 20px 0;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: 0.85rem;
  margin-top: 0;
}

/* ── Auth Pages (Login/Register) ─────────────────── */
.auth-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 150px);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 44px 36px;
  border: 1px solid var(--color-border);
  animation: authFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .brand {
  justify-content: center;
  margin-bottom: 14px;
}

.auth-header h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-secondary);
  letter-spacing: -0.02em;
}

.auth-header p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

/* ── Form Controls ────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-secondary-soft);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 11px 16px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-2);
  color: var(--color-text);
  outline: none;
  transition: var(--transition);
  line-height: 1.5;
}

.form-control::placeholder {
  color: var(--color-text-subtle);
}

.form-control:hover {
  border-color: var(--color-border-strong);
}

.form-control:focus {
  background-color: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

select.form-control {
  cursor: pointer;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.15s;
}

.btn:active::after {
  background: rgba(0, 0, 0, 0.06);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.38);
  filter: brightness(1.07);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-secondary-soft);
  border: 1.5px solid var(--color-border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--color-surface-2);
  border-color: var(--color-text-muted);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), var(--color-danger-hover));
  color: white;
  box-shadow: var(--shadow-danger);
}

.btn-danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, var(--color-success), var(--color-success-hover));
  color: white;
  box-shadow: var(--shadow-success);
}

.btn-success:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 14px 30px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Alerts ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-left-width: 4px;
}

.alert-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger-hover);
  border-color: var(--color-danger-mid);
  border-left-color: var(--color-danger);
}

.alert-success {
  background-color: var(--color-success-light);
  color: var(--color-success-hover);
  border-color: var(--color-success-mid);
  border-left-color: var(--color-success);
}

.alert-warning {
  background-color: var(--color-warning-light);
  color: var(--color-warning-hover);
  border-color: var(--color-warning-mid);
  border-left-color: var(--color-warning);
}

.alert-info {
  background-color: var(--color-info-light);
  color: var(--color-info);
  border-color: var(--color-info-mid);
  border-left-color: var(--color-info);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* ── Page Header ──────────────────────────────────── */
.page-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-secondary);
  letter-spacing: -0.025em;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title h2 .page-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #818cf8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.page-title p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.page-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  box-shadow: var(--shadow-xs);
}

.page-header-meta .live-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.page-header-meta .live-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  flex-shrink: 0;
  position: relative;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.3);
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* ── Stat Cards ───────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 20px 20px;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  animation: fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.stat-card:nth-child(1) {
  animation-delay: 0.04s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.08s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.12s;
}

.stat-card:nth-child(4) {
  animation-delay: 0.16s;
}

.stat-card:nth-child(5) {
  animation-delay: 0.20s;
}

.stat-card:nth-child(6) {
  animation-delay: 0.24s;
}

/* Colored left border accent */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Subtle pattern overlay */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.04;
  transition: opacity 0.25s, transform 0.25s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-card:hover::after {
  opacity: 0.08;
  transform: scale(1.15);
}

.stat-primary::before {
  background: linear-gradient(180deg, #6366f1, #4f46e5);
}

.stat-success::before {
  background: linear-gradient(180deg, #34d399, #059669);
}

.stat-warning::before {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.stat-danger::before {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.stat-primary::after {
  background: var(--color-primary);
}

.stat-success::after {
  background: var(--color-success);
}

.stat-warning::after {
  background: var(--color-warning);
}

.stat-danger::after {
  background: var(--color-danger);
}

.stat-content {
  min-width: 0;
  flex: 1;
}

.stat-content h3 {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-subtle);
  margin-bottom: 5px;
  white-space: nowrap;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.stat-primary .stat-value {
  color: var(--color-primary-dark);
}

.stat-success .stat-value {
  color: #065f46;
}

.stat-warning .stat-value {
  color: #92400e;
}

.stat-danger .stat-value {
  color: var(--color-danger-hover);
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-trend.up {
  color: var(--color-success);
}

.stat-trend.down {
  color: var(--color-danger);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-primary .stat-icon {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.18);
}

.stat-success .stat-icon {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: var(--color-success);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.18);
}

.stat-warning .stat-icon {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: var(--color-warning);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
}

.stat-danger .stat-icon {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  color: var(--color-danger);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.18);
}

/* ── Dashboard Sections ───────────────────────────── */
.dashboard-sections {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .dashboard-sections {
    grid-template-columns: 1fr;
  }
}

/* ── Panel Cards ──────────────────────────────────── */
.panel-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  padding: 22px 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s;
  animation: fadeSlideUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.panel-card:hover {
  box-shadow: var(--shadow-md);
}

.panel-header {
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--color-border);
}

.panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-secondary);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-header h3 .panel-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Quick Actions ────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.18s, border-color 0.18s;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 60%, rgba(99, 102, 241, 0.04));
  opacity: 0;
  transition: opacity 0.2s;
}

.action-card:hover::before {
  opacity: 1;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-mid);
  color: var(--color-secondary);
}

.action-card .action-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.18s;
}

.action-card:hover .action-icon {
  transform: scale(1.08);
}

/* Per-card accent colors */
.action-card.action-pos .action-icon {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: #4f46e5;
}

.action-card.action-inv .action-icon {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #059669;
}

.action-card.action-chat .action-icon {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #2563eb;
}

.action-card.action-reports .action-icon {
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
  color: #7c3aed;
}

.action-card h4 {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-secondary);
  line-height: 1.3;
  margin-top: 2px;
}

.action-card p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ── Tables ───────────────────────────────────────── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.table-custom thead tr {
  background: linear-gradient(90deg, #f8fafc, #f1f5f9);
}

.table-custom th {
  padding: 11px 16px;
  font-weight: 700;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}

.table-custom td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.7);
  font-size: 0.875rem;
  color: var(--color-text);
  vertical-align: middle;
  transition: background 0.12s;
}

.table-custom tbody tr:last-child td {
  border-bottom: none;
}

.table-custom tbody tr:nth-child(even) td {
  background-color: rgba(248, 250, 252, 0.5);
}

.table-custom tbody tr {
  transition: background 0.1s;
}

.table-custom tbody tr:hover td {
  background: linear-gradient(90deg, var(--color-primary-light), rgba(238, 242, 255, 0.6));
}

/* Sale ID pill */
.sale-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-primary-mid);
  border-radius: 9999px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sale-amount {
  font-weight: 700;
  color: var(--color-success-hover) !important;
  font-size: 0.9rem !important;
}

/* ── Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge-success {
  background-color: var(--color-success-light);
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-warning {
  background-color: var(--color-warning-light);
  color: #92400e;
  border-color: #fde68a;
  animation: pulse-ring 2s cubic-bezier(0.66, 0, 0, 1) infinite;
}

.badge-danger {
  background-color: var(--color-danger-light);
  color: var(--color-danger-hover);
  border-color: #fecaca;
  animation: pulse-ring 1.5s cubic-bezier(0.66, 0, 0, 1) infinite;
}

.badge-primary {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-mid);
}

.badge-info {
  background-color: var(--color-info-light);
  color: var(--color-info);
  border-color: var(--color-info-mid);
}

/* Inventory Page Layout */
.inventory-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}

.search-box {
  margin-bottom: 16px;
  position: relative;
}

.search-box input {
  padding-left: 40px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

/* POS Interface Layout */
.pos-container {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .pos-container {
    grid-template-columns: 1fr;
  }
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px;
}

.pos-product-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.pos-product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.pos-prod-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.pos-prod-stock {
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.pos-prod-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.pos-prod-price {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.btn-icon-add {
  background-color: var(--color-primary);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon-add:hover {
  background-color: var(--color-primary-hover);
  transform: scale(1.05);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background-color: var(--color-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.cart-item-info {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.cart-item-price {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px;
}

.btn-qty {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-qty:hover {
  background-color: var(--color-bg);
}

.cart-qty-val {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.cart-item-total {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 60px;
  text-align: right;
}

.btn-cart-remove {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  margin-left: 12px;
}

.pos-summary {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.pos-summary-total {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-secondary);
}

/* Chat Module Layout */
.chat-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 200px);
  min-height: 480px;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

@media (max-width: 768px) {
  .chat-container {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    display: none;
  }
}

.chat-sidebar {
  border-right: 1px solid var(--color-border);
  background-color: #f1f5f9;
  display: flex;
  flex-direction: column;
}

.chat-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-secondary);
}

.chat-user-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.chat-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  margin-bottom: 8px;
  border: 1px solid var(--color-border);
}

.chat-main {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface);
}

.chat-main-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-main-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

#chatbox {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #f8fafc;
}

/* Chat bubble designs */
.chat-msg-row {
  display: flex;
  width: 100%;
}

.chat-msg-row.self {
  justify-content: flex-end;
}

.chat-msg-row.other {
  justify-content: flex-start;
}

.chat-bubble-container {
  display: flex;
  gap: 10px;
  max-width: 70%;
  align-items: flex-end;
}

.chat-msg-row.self .chat-bubble-container {
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 0.925rem;
  line-height: 1.4;
  box-shadow: var(--shadow-sm);
}

.chat-msg-row.self .chat-bubble {
  background-color: var(--color-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg-row.other .chat-bubble {
  background-color: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.chat-msg-meta {
  display: flex;
  flex-direction: column;
}

.chat-msg-row.self .chat-msg-meta {
  align-items: flex-end;
}

.chat-msg-sender {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.chat-msg-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.chat-input-bar {
  padding: 18px 24px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-surface);
}

.chat-form {
  display: flex;
  gap: 12px;
}

/* Reports Analytics Dashboard Page Styling */
.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
  margin-top: 16px;
}

/* Utility layout helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

@media (max-width: 768px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ─── Mobile Responsive Sidebar ─────────────────── */
@media (max-width: 900px) {
  .mobile-topbar {
    display: flex;
  }

  .app-wrapper.has-sidebar {
    flex-direction: column;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 200;
  }

  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(30, 27, 75, 0.35);
  }

  .has-sidebar .app-main {
    padding: 20px 16px;
  }
}

/* Admin Settings */
.settings-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.settings-export-panel {
  margin-bottom: 0;
}

.settings-side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-side-panel .panel-card {
  margin-bottom: 0;
}

.settings-timestamp {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.settings-export-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 0 18px;
}

.settings-export-lead h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-secondary);
  margin-bottom: 4px;
}

.settings-export-lead p {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  max-width: 620px;
}

.settings-note {
  border: 1px solid var(--color-info-mid);
  background: var(--color-info-light);
  color: #075985;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.settings-export-list {
  display: flex;
  flex-direction: column;
}

.settings-export-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition-fast);
}

.settings-export-option:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-export-option:hover {
  color: var(--color-secondary);
  transform: translateX(3px);
}

.settings-export-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-mid);
}

.settings-export-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.settings-export-copy strong {
  font-size: 0.9rem;
  color: var(--color-secondary);
}

.settings-export-copy small {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-export-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.settings-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.settings-profile-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-success));
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.2);
  font-weight: 800;
  font-size: 1.1rem;
}

.settings-profile h4 {
  color: var(--color-secondary);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
}

.settings-profile p {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  margin: 2px 0 6px;
  word-break: break-word;
}

.settings-detail-list {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 18px;
}

.settings-detail-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--color-border);
}

.settings-detail-list div:last-child {
  border-bottom: 0;
}

.settings-detail-list span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.settings-detail-list strong {
  color: var(--color-secondary);
  font-size: 0.85rem;
  text-align: right;
}

.settings-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-shortcuts {
  display: flex;
  flex-direction: column;
}

.settings-demo-form {
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.settings-shortcuts a {
  padding: 12px 0;
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition-fast);
}

.settings-shortcuts a:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.settings-shortcuts a:hover {
  color: var(--color-primary);
  transform: translateX(3px);
}

@media (max-width: 1100px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {

  .settings-stats-grid,
  .settings-side-panel {
    grid-template-columns: 1fr;
  }

  .settings-export-lead {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-export-option {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .settings-export-count {
    grid-column: 2;
    justify-content: flex-start;
    width: fit-content;
  }
}

/* Dashboard Single-Page Lock Styles */
body.dashboard-body, body.dashboard-body * { box-sizing: border-box; } 

@media (min-width: 1025px) {
  body.dashboard-body {
    height: 100vh;
    overflow: hidden;
  }

  body.dashboard-body .app-wrapper.has-sidebar {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: row;
  }

  body.dashboard-body .app-main {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 20px 24px;
    gap: 14px;
  }

  body.dashboard-body .page-header {
    margin-bottom: 0;
    flex-shrink: 0;
  }

  body.dashboard-body .page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 2px 0;
  }

  body.dashboard-body .page-header p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin: 0;
  }

  body.dashboard-body .stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  body.dashboard-body .stat-card {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 68px;
  }

  body.dashboard-body .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  body.dashboard-body .stat-content {
    display: flex;
    flex-direction: column;
  }

  body.dashboard-body .stat-card h3 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0;
    font-weight: 600;
  }

  body.dashboard-body .stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text);
    margin-top: 2px;
  }

  body.dashboard-body .stat-card .stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.dashboard-body .stat-card.stat-success .stat-icon {
    background: rgba(5, 150, 105, 0.08);
    color: #059669;
  }

  body.dashboard-body .stat-card.stat-primary .stat-icon {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
  }

  body.dashboard-body .stat-card.stat-warning .stat-icon {
    background: rgba(217, 119, 6, 0.08);
    color: #d97706;
  }

  body.dashboard-body .dashboard-layout-content {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.80fr 1fr;
    gap: 16px;
    overflow: hidden;
  }

  body.dashboard-body .dashboard-left {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
  }

  body.dashboard-body .dashboard-charts-row {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 16px;
    flex-shrink: 0;
    height: 235px;
  }

  body.dashboard-body .chart-card {
    padding: 12px 14px;
    background: var(--color-surface);
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  body.dashboard-body .chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-shrink: 0;
  }

  body.dashboard-body .chart-card-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  body.dashboard-body .chart-card-header h4 svg {
    color: var(--color-primary);
  }

  body.dashboard-body .chart-caption {
    font-size: 0.7rem;
    color: var(--color-text-muted);
  }

  body.dashboard-body .chart-wrapper {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
  }

  body.dashboard-body canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 100%;
  }

  body.dashboard-body .recent-sales-panel {
    flex: 1 1 0;
    min-height: 0;
  }

  body.dashboard-body .dashboard-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: hidden;
  }

  body.dashboard-body .category-stock-card {
    height: 235px;
    flex-shrink: 0;
  }

  body.dashboard-body .quick-actions-panel {
    flex-shrink: 0;
    padding: 10px 14px;
  }

  body.dashboard-body .quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  body.dashboard-body .action-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    gap: 4px;
    text-align: center;
  }

  body.dashboard-body .action-card:hover {
    background: rgba(79, 70, 229, 0.04);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
  }

  body.dashboard-body .action-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.08);
    color: var(--color-primary);
    transition: all 0.2s;
  }

  body.dashboard-body .action-card:hover .action-icon {
    background: var(--color-primary);
    color: white;
  }

  body.dashboard-body .action-card h4 {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
  }

  body.dashboard-body .action-card p {
    display: none;
  }

  body.dashboard-body .low-stock-panel {
    flex: 1 1 0;
    min-height: 0;
  }

  body.dashboard-body .panel-card {
    background: var(--color-surface);
    border-radius: 14px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 12px 14px;
  }

  body.dashboard-body .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    flex-shrink: 0;
  }

  body.dashboard-body .panel-header h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
  }

  body.dashboard-body .table-responsive {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
  }

  body.dashboard-body .table-responsive::-webkit-scrollbar {
    width: 4px;
  }

  body.dashboard-body .table-responsive::-webkit-scrollbar-track {
    background: transparent;
  }

  body.dashboard-body .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 4px;
  }

  body.dashboard-body .table-custom {
    width: 100%;
    border-collapse: collapse;
  }

  body.dashboard-body .table-custom th {
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 1;
    padding: 6px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    text-align: left;
  }

  body.dashboard-body .table-custom td {
    padding: 6px 8px;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    vertical-align: middle;
    color: var(--color-text);
  }

  body.dashboard-body .table-custom tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.6);
  }

  body.dashboard-body .table-custom tr:last-child td {
    border-bottom: none;
  }
}

@media (max-width: 1024px) {
  body.dashboard-body {
    height: auto;
    overflow: auto;
  }

  body.dashboard-body .app-wrapper.has-sidebar {
    height: auto;
    overflow: auto;
  }

  body.dashboard-body .app-main {
    padding: 16px;
    gap: 16px;
  }

  body.dashboard-body .stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  body.dashboard-body .stat-card {
    padding: 12px 14px;
    height: auto;
  }

  body.dashboard-body .dashboard-layout-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  body.dashboard-body .dashboard-charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.dashboard-body .chart-card,
  body.dashboard-body .category-stock-card {
    height: 260px;
  }

  body.dashboard-body .chart-wrapper {
    height: 200px;
  }

  body.dashboard-body .quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  body.dashboard-body .action-card {
    padding: 12px 8px;
  }

  body.dashboard-body .panel-card {
    padding: 16px;
  }
}

@media (max-width: 768px) {
  body.dashboard-body .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  body.dashboard-body .stats-grid {
    grid-template-columns: 1fr;
  }

  body.dashboard-body .quick-actions {
    grid-template-columns: 1fr;
  }
}


/* Print & Reports Page Styles */
.print-only {
  display: none;
}

.reports-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background-color: var(--color-surface);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
}

.reports-tabs {
  display: flex;
  background-color: var(--color-bg);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.reports-tab-btn {
  padding: 8px 16px;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.reports-tab-btn:hover {
  color: var(--color-secondary);
}

.reports-tab-btn.active {
  background-color: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

@media print {
  body {
    background-color: white !important;
    color: black !important;
    font-size: 11pt !important;
  }

  .no-print,
  .app-sidebar,
  .mobile-topbar,
  .sidebar-overlay,
  .app-footer,
  .reports-toolbar,
  .quick-actions,
  .quick-actions-panel,
  form,
  .btn {
    display: none !important;
  }

  .app-wrapper {
    display: block !important;
    margin-left: 0 !important;
    width: 100% !important;
  }

  .app-main {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .panel-card {
    box-shadow: none !important;
    border: 1px solid #cbd5e1 !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  .table-custom th {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border-bottom: 2px solid #cbd5e1 !important;
  }

  .table-custom td {
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 8px 12px !important;
  }

  .print-only {
    display: block !important;
  }

  .dashboard-sections,
  .grid-2 {
    display: block !important;
  }

  .dashboard-sections>div,
  .grid-2>div {
    width: 100% !important;
    margin-bottom: 20px !important;
  }

  canvas {
    max-width: 100% !important;
    height: 220px !important;
  }
}

/* ─── Modal Overlay ─────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  animation: modalPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.modal-total-display {
  background: var(--color-primary-light);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-align: center;
  margin-bottom: 20px;
}

.modal-total-display .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-primary);
  font-weight: 600;
}

.modal-total-display .amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-top: 2px;
}

.change-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  background: var(--color-success-light);
  border: 1px solid #6ee7b7;
  transition: var(--transition);
}

.change-display.insufficient {
  background: var(--color-danger-light);
  border-color: #fca5a5;
}

.change-display .change-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-success);
}

.change-display.insufficient .change-label {
  color: var(--color-danger);
}

.change-display .change-amount {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-success);
}

.change-display.insufficient .change-amount {
  color: var(--color-danger);
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ─── Thermal Receipt ────────────────────────────── */
.receipt-wrapper {
  display: none;
  /* shown only on print */
  font-family: 'Courier New', Courier, monospace;
  font-size: 10.5pt;
  color: #000;
  width: 72mm;
  /* standard 80mm paper, ~72mm printable */
  margin: 0 auto;
}

.receipt-header {
  text-align: center;
  margin-bottom: 8px;
}

.receipt-store-name {
  font-size: 14pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-tagline {
  font-size: 9pt;
  color: #555;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed #888;
  margin: 8px 0;
}

.receipt-divider-solid {
  border: none;
  border-top: 2px solid #000;
  margin: 8px 0;
}

.receipt-meta {
  font-size: 9pt;
  margin-bottom: 6px;
}

.receipt-meta table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-meta td {
  padding: 1px 0;
}

.receipt-meta td:last-child {
  text-align: right;
}

.receipt-items table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-items th {
  font-size: 9pt;
  text-transform: uppercase;
  border-bottom: 1px dashed #888;
  padding: 3px 0;
}

.receipt-items th:not(:first-child),
.receipt-items td:not(:first-child) {
  text-align: right;
}

.receipt-items td {
  font-size: 9.5pt;
  padding: 3px 0;
  vertical-align: top;
}

.receipt-totals {
  margin-top: 6px;
}

.receipt-totals table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-totals td {
  padding: 2px 0;
  font-size: 10pt;
}

.receipt-totals td:last-child {
  text-align: right;
}

.receipt-grand {
  font-size: 12.5pt;
  font-weight: 700;
}

.receipt-cash-row td {
  font-size: 10pt;
}

.receipt-change-row td {
  font-size: 12pt;
  font-weight: 700;
}

.receipt-footer {
  text-align: center;
  font-size: 9pt;
  color: #555;
  margin-top: 10px;
}

/* ── Screen: always hide print content ─────────────── */
.receipt-wrapper {
  display: none !important;
}

.print-document {
  display: none !important;
}

.screen-only {
  display: block;
}

/* ─── Print media ───────────────────────────────────── */
@media print {

  /* Receipt-only mode (POS page) */
  body.printing-receipt * {
    visibility: hidden;
  }

  body.printing-receipt .receipt-wrapper,
  body.printing-receipt .receipt-wrapper * {
    visibility: visible;
  }

  body.printing-receipt .receipt-wrapper {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 72mm;
    padding: 6mm;
  }

  body:not(.printing-receipt) .receipt-wrapper {
    display: none !important;
  }

  /* Reports full-page print */
  .print-document {
    display: block !important;
    width: 100% !important;
    max-width: 180mm !important;
    margin: 0 auto !important;
  }

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

  /* Print document layout helpers */
  .print-cover {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px solid #0f172a;
  }

  .print-brand-name {
    font-size: 20pt;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .print-brand-address {
    font-size: 10pt;
    color: #64748b;
    margin-top: 4px;
  }

  .print-meta-block {
    text-align: right;
  }

  .print-meta-row {
    font-size: 9.5pt;
    margin-bottom: 3px;
    color: #334155;
  }

  .print-meta-row span {
    color: #94a3b8;
    margin-right: 6px;
  }

  .print-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }

  .print-summary-box {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 12px 14px;
    text-align: center;
  }

  .psb-label {
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
    margin-bottom: 4px;
  }

  .psb-value {
    font-size: 14pt;
    font-weight: 800;
    color: #0f172a;
  }

  .print-section {
    margin-bottom: 24px;
  }

  .print-section-title {
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 5px;
    margin-bottom: 10px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9.5pt;
  }

  .print-table th {
    background: #f1f5f9;
    padding: 7px 10px;
    font-weight: 700;
    font-size: 8.5pt;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 2px solid #cbd5e1;
    color: #475569;
    text-align: left;
  }

  .print-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    color: #1e293b;
  }

  .col-no {
    width: 42px;
    text-align: center;
  }

  .col-right {
    text-align: right;
  }

  .row-alt td {
    background: #f8fafc;
  }

  .print-total-row td {
    background: #f1f5f9 !important;
    border-top: 2px solid #cbd5e1;
    border-bottom: none;
    font-size: 10pt;
    padding: 9px 10px;
  }

  .print-footer {
    margin-top: 32px;
    padding-top: 10px;
    border-top: 1px dashed #94a3b8;
    text-align: center;
    font-size: 8.5pt;
    color: #94a3b8;
  }

  /* General print cleanup */
  body {
    background: white !important;
    font-size: 11pt !important;
    margin: 0 !important;
  }

  .app-sidebar,
  .mobile-topbar,
  .sidebar-overlay,
  .app-footer,
  .reports-toolbar,
  .no-print,
  .btn,
  form {
    display: none !important;
  }

  .app-wrapper {
    display: block !important;
    margin-left: 0 !important;
    width: 100% !important;
    min-height: auto !important;
  }

  .app-main {
    display: block !important;
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ── Landing Main Layout ─────────────────────────── */
.landing-main {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ─── Auth layout (no sidebar) ────────────────────── */
.auth-layout-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
}

/* ── Dashboard Charts & Analytics ────────────────── */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header-row h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-secondary);
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-filters {
  display: flex;
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  padding: 3px;
  border-radius: var(--radius-md);
  gap: 2px;
  box-shadow: var(--shadow-xs);
}

.chart-filters .filter-btn {
  padding: 6px 16px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chart-filters .filter-btn:hover {
  color: var(--color-secondary);
  background-color: var(--color-surface-2);
}

.chart-filters .filter-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  box-shadow: var(--shadow-sm);
}

.dashboard-charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (min-width: 1200px) {
  .dashboard-charts-section {
    grid-template-columns: 1.25fr 0.75fr;
  }
}

@media (max-width: 992px) {
  .dashboard-charts-section {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-card-header h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-header h4 svg {
  color: var(--color-primary);
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 280px;
}

/* Loading overlay for charts */
.chart-loading-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chart-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.chart-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════════════════════════════════════════════════════
   POS — Point of Sale styles
═══════════════════════════════════════════════════════════ */
.pos-container {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .pos-container {
    grid-template-columns: 1fr;
  }
}

.pos-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  padding: 16px;
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

.pos-product-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: var(--transition);
}

.pos-product-card:hover {
  border-color: var(--color-primary-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pos-card-oos {
  opacity: .55;
}

.pos-prod-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 4px;
  line-height: 1.3;
}

.pos-prod-stock {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.pos-oos-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-danger-light);
  color: var(--color-danger);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
}

.pos-low-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--color-warning-light);
  color: var(--color-warning);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 6px;
}

.pos-prod-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pos-prod-price {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-primary);
}

/* Retail / bulk price pair on the POS product card */
.pos-prod-pricing {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pos-prod-bulk {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.pos-bulk-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--color-success-light);
  color: var(--color-success);
  padding: 1px 6px;
  border-radius: 20px;
}

.pos-bulk-min {
  font-weight: 600;
  opacity: 0.8;
}

.cart-item-was {
  margin-left: 4px;
  text-decoration: line-through;
  opacity: 0.65;
}

.cart-item-hint {
  margin-left: 4px;
  font-style: italic;
  opacity: 0.75;
}

.btn-icon-add {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-icon-add:hover:not(:disabled) {
  background: var(--color-primary-hover);
  transform: scale(1.12);
  box-shadow: var(--shadow-primary);
}

/* Cart */
.cart-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: calc(100vh - 520px);
  overflow-y: auto;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

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

.cart-item-price {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.cart-qty-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-qty {
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

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

.cart-qty-val {
  min-width: 22px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
}

.cart-item-total {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--color-text);
}

/* Cart summary / checkout */
.pos-summary {
  padding: 16px;
  border-top: 1px solid var(--color-border);
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  margin-bottom: 14px;
}

.pos-grand-total {
  font-size: 1.3rem;
  color: var(--color-primary);
}

.pos-change-preview {
  background: var(--color-success-light);
  border: 1px solid var(--color-success-mid);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-top: 8px;
  color: var(--color-text);
}

/* Payment Tabs */
.pos-payment-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.pos-pay-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.pos-pay-tab:hover {
  border-color: var(--color-primary-mid);
  color: var(--color-primary);
}

.pos-pay-tab.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* GCash QR */
.gcash-qr-container {
  /* Center QR panel content */
  text-align: center;
  padding: 12px 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Ensure the image is also centered and can grow properly */
.gcash-qr-img {
  display: block;
  margin: 0 auto;
  object-fit: contain;
}



.gcash-instruction {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 14px;
}

.gcash-qr-img {
  width: 320px;
  height: 320px;
  object-fit: contain;
  border: 3px solid #e2e8f0;
  border-radius: var(--radius-md);
  display: block;
  margin: 0 auto 12px;
  max-width: 100%;
}


.gcash-hint {
  font-size: 0.8rem;
  color: var(--color-text-subtle);
  margin-bottom: 12px;
}

/* Receipt Modal */
.receipt-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeSlideUp 0.3s ease;
}

.receipt-modal-dialog {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 420px;
  max-width: 96vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.receipt-modal-header {
  text-align: center;
}

.receipt-modal-header h3 {
  font-size: 1.3rem;
  margin: 0 0 4px;
}

.receipt-modal-sub {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin: 0;
}

.receipt-wrapper {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  color: #1a1a1a;
}

.receipt-head {
  text-align: center;
  margin-bottom: 8px;
}

.receipt-store-name {
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.receipt-address {
  font-size: 0.72rem;
  color: #555;
  margin-top: 4px;
}

.receipt-divider {
  color: #aaa;
  margin: 8px 0;
  letter-spacing: 1px;
}

.receipt-meta {
  color: #444;
  font-size: 0.78rem;
}

.receipt-items {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 0.78rem;
}

.receipt-items th {
  border-bottom: 1px dashed #aaa;
  padding: 4px 4px;
  font-weight: 800;
}

.receipt-items td {
  padding: 3px 4px;
}

.receipt-totals {
  margin: 4px 0;
}

.receipt-total-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 0.82rem;
}

.receipt-change {
  font-size: 1rem;
  font-weight: 900;
}

.receipt-footer {
  text-align: center;
  margin-top: 8px;
  font-size: 0.78rem;
  color: #555;
}

.receipt-modal-actions {
  display: flex;
  gap: 10px;
}

.receipt-modal-actions .btn {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════
   Chat — Bubble UI styles
═══════════════════════════════════════════════════════════ */
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .chat-sidebar {
    order: 2;
  }
}

.chat-sidebar-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.chat-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-user-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-user-role {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  text-transform: capitalize;
}

.chat-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
}

.chat-stat-row:last-of-type {
  border-bottom: none;
}

.chat-stat-row strong {
  color: var(--color-primary);
  font-size: 0.95rem;
}

.chat-tips {
  background: var(--color-primary-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.chat-tip-title {
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 6px;
}

.chat-tips ul {
  margin: 0;
  padding-left: 16px;
}

.chat-tips li {
  margin-bottom: 4px;
}

/* Live indicator */
.chat-live-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-success);
  background: var(--color-success-light);
  padding: 6px 14px;
  border-radius: 20px;
}

.chat-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  animation: livePulse 1.5s ease-in-out infinite;
  display: block;
}

@keyframes livePulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .4;
    transform: scale(.75);
  }
}

/* Chat panel header */
.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-clear-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-clear-btn:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Chatbox */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  background-color: #f1f5f9 !important; /* Soft, textured iOS/Android background */
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 0;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 85%; /* Expanded slightly for better space utilization */
}

.chat-own {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-other {
  align-self: flex-start;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-avatar-own {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: #fff;
}

.chat-avatar-other {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
}

.chat-msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.chat-own .chat-msg-header {
  flex-direction: row-reverse;
}

.chat-msg-author {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.chat-author-own {
  color: #4f46e5;
}

.chat-msg-time {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 500;
}

.chat-bubble {
  padding: 11px 16px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.chat-bubble-own {
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble-other {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Quick replies */
.chat-quick-replies {
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--color-surface-2);
}

.chat-quick-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.chat-quick-btn {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.chat-quick-btn:hover {
  border-color: var(--color-primary-mid);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Chat input */
.chat-input-form {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: 24px !important; /* Premium pill-shaped input bar */
  padding: 6px 6px 6px 14px !important;
  transition: var(--transition-fast);
}

.chat-input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.chat-input-wrapper textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  outline: none;
  min-height: 24px;
}

.chat-input-wrapper textarea::placeholder {
  color: var(--color-text-subtle);
}

.chat-send-btn {
  width: 36px !important; /* Slightly more compact circular button */
  height: 36px !important;
  border-radius: 50% !important;
  background: var(--color-primary);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}

.chat-send-btn:hover {
  background: var(--color-primary-hover);
  transform: scale(1.08);
  box-shadow: var(--shadow-primary);
}

/* ═══════════════════════════════════════════════════════════
   Reports — Print & Polish
═══════════════════════════════════════════════════════════ */
.row-alt {
  background: var(--color-surface-2);
}

.print-cover {
  display: none;
}

.print-footer {
  display: none;
}

.screen-only {}

/* shown by default on screen */

/* ═══════════════════════════════════════════════════════════
   @media print
═══════════════════════════════════════════════════════════ */
@media print {

  /* Hide navigation, sidebars, buttons, etc. */
  .app-sidebar,
  .sidebar-overlay,
  .mobile-topbar,
  .page-actions,
  .report-toolbar,
  .screen-only,
  .receipt-modal-overlay,
  .logout-confirm-overlay,
  .chat-quick-replies,
  .chat-input-form,
  .chat-sidebar {
    display: none !important;
  }

  body {
    background: #fff !important;
  }

  .app-wrapper {
    margin: 0 !important;
    padding: 0 !important;
  }

  .app-main {
    padding: 0 !important;
  }

  .panel-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  /* Print receipt */
  .receipt-wrapper {
    font-size: 10pt;
    border: none !important;
    background: #fff !important;
    padding: 0 !important;
  }

  .receipt-modal-overlay {
    position: static !important;
    background: none !important;
  }

  .receipt-modal-dialog {
    box-shadow: none !important;
    max-height: none !important;
    width: 100% !important;
  }

  /* Print report cover */
  .print-cover {
    display: flex !important;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
    margin-bottom: 20px;
  }

  .print-brand-name {
    font-size: 16pt;
    font-weight: 900;
  }

  .print-brand-address {
    font-size: 9pt;
    color: #555;
  }

  .print-meta-block {
    text-align: right;
    font-size: 9pt;
  }

  .print-meta-row {
    margin-bottom: 4px;
  }

  .print-meta-row span {
    font-weight: 700;
  }

  .print-section {
    page-break-inside: avoid;
  }

  .print-section-title {
    font-size: 11pt !important;
  }

  .print-table {
    font-size: 9pt;
  }

  .print-table thead th {
    background: #f0f0f0 !important;
    border-bottom: 1px solid #999;
  }

  .print-table tbody td {
    border-bottom: 1px solid #eee;
  }

  .print-summary-grid {
    display: flex !important;
    gap: 16px;
    margin-bottom: 20px;
  }

  .print-summary-grid .stat-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }

  .print-footer {
    display: block !important;
    text-align: center;
    font-size: 8pt;
    color: #888;
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
  }
}

/* Feature refinements added for POS, support chat, reports, inquiries, and dashboard charts */
.empty-state.compact-empty-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--color-text-muted);
}

.empty-state.compact-empty-state svg {
  margin-bottom: 12px;
  opacity: 0.42;
}

.cart-line-actions {
  min-width: 92px;
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.btn-gcash {
  background: linear-gradient(135deg, #0063d1, #00a7e8) !important;
  box-shadow: 0 8px 18px rgba(0, 99, 209, 0.24);
}

.btn-outline.active,
.report-filters .btn.active {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
}

.table-empty-cell {
  text-align: center;
  color: var(--color-text-muted);
  padding: 28px 16px !important;
}

.table-empty-cell.success-empty {
  color: var(--color-success);
  font-weight: 700;
}

.muted-cell,
.muted-mono {
  color: var(--color-text-muted);
}

.muted-mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.rank-cell {
  color: var(--color-text-subtle);
  font-weight: 800;
}

/* Support chat workspace */
.chat-page-actions {
  align-items: center;
}

.support-count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color-warning-light);
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 800;
}

.support-chat-layout {
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: stretch;
}

.support-panel-card,
.chat-workspace-card {
  padding: 0;
  overflow: hidden;
}

.support-panel-header,
.chat-panel-header {
  padding: 16px 18px;
  margin: 0;
}

.support-panel-header p,
.chat-heading-wrap p,
.report-table-header p,
.inquiry-panel-header p {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.support-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 16px;
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
}

.support-stats-row div {
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

.support-stats-row span {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.support-stats-row strong {
  display: block;
  margin-top: 3px;
  color: var(--color-secondary);
  font-size: 1.15rem;
}

.support-ticket-list {
  max-height: calc(100vh - 290px);
  min-height: 420px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.support-ticket,
.inquiry-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
}

.support-ticket {
  padding: 14px;
}

.support-ticket.is-pending,
.inquiry-card.is-pending {
  border-left: 4px solid var(--color-warning);
}

.support-ticket.is-responded,
.inquiry-card.is-responded {
  border-left: 4px solid var(--color-success);
}

.support-ticket-topline,
.inquiry-card-topline,
.support-customer-meta,
.inquiry-customer-row,
.support-ticket-actions,
.inquiry-action-row,
.support-response-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.support-ticket-topline,
.inquiry-card-topline {
  justify-content: space-between;
  margin-bottom: 9px;
}

.support-ticket-topline time,
.inquiry-card-topline time {
  color: var(--color-text-subtle);
  font-size: 0.72rem;
  font-weight: 700;
}

.support-ticket h4,
.inquiry-card h3 {
  color: var(--color-secondary);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 6px;
}

.support-ticket-message,
.inquiry-message {
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.support-customer-meta,
.inquiry-customer-row {
  justify-content: space-between;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.7);
}

.support-customer-meta span,
.inquiry-customer-row span {
  color: var(--color-secondary);
  font-weight: 800;
}

.support-customer-meta a,
.inquiry-customer-row a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
}

.support-saved-response,
.inquiry-response-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-success-light);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.support-saved-response p,
.inquiry-response-box p {
  margin: 5px 0;
  color: #065f46;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.support-saved-response small,
.inquiry-response-box small {
  color: #047857;
  font-weight: 700;
}

.support-response-form,
.inquiry-response-form {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.support-response-form textarea,
.inquiry-response-form textarea {
  width: 100%;
  min-height: 88px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--color-text);
  background: var(--color-surface-2);
  resize: vertical;
  outline: none;
  transition: var(--transition-fast);
}

.support-response-form textarea:focus,
.inquiry-response-form textarea:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.support-response-actions,
.support-ticket-actions,
.inquiry-action-row {
  justify-content: flex-end;
}

.chat-workspace-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 560px;
}

.chat-heading-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-heading-wrap h3 {
  margin: 0;
}

.support-empty-state {
  min-height: 260px;
}

/* Inquiry page */
.inquiry-toolbar {
  padding: 16px;
}

.inquiry-filter-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px auto;
  gap: 14px;
  align-items: end;
}

.inquiry-filter-form .form-group {
  margin-bottom: 0;
}

.inquiry-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.inquiry-panel {
  padding: 0;
  overflow: hidden;
}

.inquiry-panel-header {
  padding: 18px 20px;
  margin: 0;
}

.inquiry-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.inquiry-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 18px;
  padding: 18px;
}

.inquiry-card-actions {
  border-left: 1px solid var(--color-border);
  padding-left: 18px;
}

.inquiry-response-form label {
  color: var(--color-secondary-soft);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.inquiry-empty-state {
  padding: 48px 16px;
}

/* Reports */
.report-actions,
.report-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.report-summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.report-summary-card strong {
  color: var(--color-secondary);
  font-size: 0.9rem;
}

.report-stat-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.report-insight-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: -8px 0 22px;
}

.report-insight-strip div {
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
}

.report-insight-strip span {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.report-insight-strip strong {
  display: block;
  margin-top: 2px;
  color: var(--color-secondary);
  font-size: 0.95rem;
}

.report-sections {
  align-items: start;
}

.report-table-header {
  align-items: flex-start;
}

.report-table-card .table-responsive {
  border: 1px solid var(--color-border);
}

/* Dashboard charts */
.dashboard-charts-section {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.8fr);
}

.chart-card-full {
  grid-column: 1 / -1;
}

.chart-card-wide .chart-wrapper {
  height: 320px;
}

.chart-wrapper-sm {
  height: 240px;
}

.chart-caption {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.quick-actions-panel .quick-actions {
  margin-bottom: 0;
}

@media (max-width: 1080px) {

  .support-chat-layout {
    display: flex;
    flex-direction: column;
  }

  .chat-main-panel {
    order: 1; /* Chat workspace at the top on mobile */
  }

  .support-queue {
    order: 2; /* Support tickets go below on mobile */
  }

  .inquiry-card,
  .dashboard-charts-section {
    grid-template-columns: 1fr;
  }

  .support-ticket-list {
    max-height: none;
    height: auto;
  }

  .chat-workspace-card {
    /* Keep a beautiful fixed height on mobile so the chatbox scrolls internally and input is fixed */
    height: calc(100vh - 240px);
    min-height: 420px;
    max-height: 600px;
  }

  .inquiry-card-actions {
    border-left: 0;
    border-top: 1px solid var(--color-border);
    padding-left: 0;
    padding-top: 16px;
  }

  .report-stat-grid,
  .report-insight-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {

  .inquiry-filter-form,
  .support-stats-row {
    grid-template-columns: 1fr;
  }

  .report-toolbar,
  .report-summary-card {
    align-items: stretch;
  }

  .report-toolbar {
    flex-direction: column;
  }

  .cart-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .cart-line-actions {
    width: 100%;
    min-width: 0;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media print {
  body.printing-receipt .app-main> :not(.receipt-modal-overlay) {
    display: none !important;
  }

  body.printing-receipt .receipt-modal-overlay {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    inset: auto !important;
    background: #fff !important;
    backdrop-filter: none !important;
    padding: 0 !important;
  }

  body.printing-receipt .receipt-modal-overlay * {
    visibility: visible !important;
  }

  body.printing-receipt .receipt-modal-dialog {
    width: 80mm !important;
    max-width: 80mm !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.printing-receipt .receipt-modal-header,
  body.printing-receipt .receipt-modal-actions {
    display: none !important;
  }

  body.printing-receipt .receipt-wrapper {
    display: block !important;
    position: static !important;
    width: 100% !important;
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
  }
}

/* ── Mobile Bottom Navigation Bar (Bootstrap / Premium look) ────────────────── */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background-color: #ffffff !important;
  display: none; /* Hidden on desktop */
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #dee2e6 !important;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08) !important;
  z-index: 9999 !important;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6c757d !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  flex: 1;
  height: 100%;
  transition: all 0.15s ease-in-out;
  position: relative;
}

.mobile-nav-item:hover, .mobile-nav-item.active {
  color: #0d6efd !important; /* Bootstrap primary blue */
}

.mobile-nav-item .nav-icon {
  font-size: 1.35rem !important;
  margin-bottom: 1px;
  display: inline-block;
  transition: transform 0.15s ease;
}

.mobile-nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.05);
}

.mobile-nav-item .nav-label {
  font-size: 10px !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  letter-spacing: 0.2px;
}

@media (max-width: 767px) {
  .mobile-bottom-nav {
    display: flex !important;
  }
}

/* ── Mobile Floating Chat Action Button ────────────────── */
.mobile-chat-fab {
  position: fixed;
  bottom: 80px !important; /* Positioned perfectly right above the bottom navigation bar (65px + 15px spacing) */
  right: 18px !important;
  width: 56px !important;
  height: 56px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #4f46e5, #3730a3) !important;
  color: #ffffff !important;
  display: none; /* Hidden on desktop */
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4) !important;
  z-index: 9998 !important;
  transition: all 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none !important;
}

.mobile-chat-fab i {
  font-size: 1.60rem !important;
  display: inline-block;
  transition: transform 0.2s ease;
}

.mobile-chat-fab:hover {
  transform: scale(1.08) translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5) !important;
}

.mobile-chat-fab:active {
  transform: scale(0.95) !important;
}

@media (max-width: 767px) {
  .mobile-chat-fab {
    display: flex !important;
  }
}

/* ── Interactive Floating Chatbot Widget ────────────────── */
.chatbot-widget-container {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  z-index: 999999 !important;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif) !important;
  display: block !important;
}

.chatbot-fab {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 18px 10px 14px !important;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 50px !important;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.45) !important;
  cursor: pointer !important;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  outline: none !important;
}

.chatbot-fab:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.5);
}

.chatbot-fab-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-fab-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #10b981;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.chatbot-fab-label {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* Chatbot Popover Window */
.chatbot-window {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 110px);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.94);
  transform-origin: bottom right;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Chatbot Header */
.chatbot-header {
  background: linear-gradient(135deg, #4f46e5 0%, #312e81 100%);
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chatbot-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chatbot-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: #ffffff;
}

.chatbot-status {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chatbot-status-dot {
  width: 7px;
  height: 7px;
  background: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 6px #34d399;
}

.chatbot-close-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chatbot-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Box */
.chatbot-messages {
  flex: 1;
  padding: 16px;
  background: #f8fafc;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chatbot-msg {
  display: flex;
  gap: 10px;
  max-width: 86%;
}

.chatbot-msg-bot {
  align-self: flex-start;
}

.chatbot-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chatbot-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.chatbot-msg-user .chatbot-msg-avatar {
  background: #c7d2fe;
}

.chatbot-msg-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chatbot-bubble {
  padding: 11px 15px;
  border-radius: 16px 16px 16px 4px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  border: 1px solid #e2e8f0;
  word-break: break-word;
}

.chatbot-bubble-user {
  background: #4f46e5;
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  border: none;
  box-shadow: 0 3px 8px rgba(79, 70, 229, 0.25);
}

/* Product Card in Chat */
.chatbot-products-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.chatbot-prod-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.chatbot-prod-title {
  font-weight: 700;
  color: #0f172a;
}

.chatbot-prod-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.chatbot-prod-price {
  font-weight: 800;
  color: #4f46e5;
}

.chatbot-prod-status {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 600;
}

/* Typing indicator */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}

.chatbot-typing .dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: chatbotBounce 1.2s infinite ease-in-out;
}

.chatbot-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatbotBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

/* Chips list */
.chatbot-chips-wrapper {
  background: #ffffff;
  padding: 10px 14px;
  border-top: 1px solid #e2e8f0;
}

.chatbot-chips-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}

.chatbot-chips-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chatbot-chips-list::-webkit-scrollbar { display: none; }

.chatbot-chip {
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chatbot-chip:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

/* Input form */
.chatbot-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.chatbot-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 0.88rem;
  outline: none;
  background: #f8fafc;
  transition: border-color 0.15s ease;
}

.chatbot-input:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

.chatbot-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #4f46e5;
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  background: #4338ca;
  transform: scale(1.05);
}

@media (max-width: 767px) {
  .chatbot-widget-container {
    bottom: 80px !important;
    right: 16px !important;
    z-index: 999999 !important;
  }
  .chatbot-window {
    bottom: 60px !important;
    right: 0 !important;
    width: calc(100vw - 32px) !important;
    height: 480px !important;
  }
}