/* ========================================================
   Self-Hosted Inter Font
   ======================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/InterVariable.woff2') format('woff2-variations'),
       url('../fonts/InterVariable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-700.woff2') format('woff2');
}

/* ========================================================
   Easy POS - Standard Application Stylesheet
   Matches Exact Standard UI (Compact 3x3 Launchpad)
   ======================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-module: #ffffff;
  --bg-module-hover: #f1f5f9;
  --bg-icon-box: #f1f5f9;
  --bg-badge: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-heading: #0f172a;
  
  /* Indigo Standard Palette */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-primary-dark: #4338ca;
  --accent-color: #6366f1;
  --accent-active-box: #eef2ff;
  --accent-active-icon: #4f46e5;

  /* Semantic Colors */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  
  --radius-container: 12px;
  --radius-tile: 8px;
  --radius-badge: 6px;
  --radius-input: 6px;
}

[data-theme="dark"],
.dark-theme,
[data-theme="dark"] body,
body.dark-theme {
  --bg-page: #0b0f19;
  --bg-card: #131b2e;
  --bg-module: #1a243b;
  --bg-module-hover: #23304e;
  --bg-icon-box: #23304e;
  --bg-badge: #1a243b;
  --border-color: #263553;
  
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-heading: #ffffff;
  
  --accent-color: #818cf8;
  --accent-active-box: #312e81;
  --accent-active-icon: #a5b4fc;

  --color-success-bg: #064e3b;
  --color-warning-bg: #451a03;
  --color-danger-bg: #450a0a;
  --color-info-bg: #082f49;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
}

.app-wrapper {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ========================================================
   Top Bar - Standard Header
   ======================================================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-title-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-muted);
}

.action-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn, .btn-icon, .offcanvas-close-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  text-decoration: none;
  flex-shrink: 0;
  outline: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.icon-btn:hover, .btn-icon:hover, .offcanvas-close-btn:hover {
  background: var(--bg-icon-box);
  color: var(--text-heading);
  border-color: var(--brand-primary);
}

/* Responsive Page Header & Action Buttons */
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.page-header-actions .btn {
  padding: 4px 8px;
  font-size: 0.68rem;
  white-space: nowrap;
}

/* ========================================================
   Profile & Hero Header (Welcome & Date Only)
   ======================================================== */
.profile-hero {
  padding: 10px 12px 4px 12px;
  flex-shrink: 0;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.welcome-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-greeting {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  line-height: 1.2;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-badge);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

/* ========================================================
   Section Title
   ======================================================== */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 4px 12px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-heading);
  text-transform: uppercase;
  flex-shrink: 0;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.section-hint {
  font-size: 0.60rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

/* ========================================================
   Strictly 3-Column Compact Grid (Standard UI)
   ======================================================== */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 12px 20px 12px;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.module-card {
  background: var(--bg-module);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-tile);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  padding: 8px 4px 7px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.module-card:hover {
  background: var(--bg-module-hover);
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.module-card:active {
  transform: scale(0.97);
}

.module-card.pos-highlight {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.02));
  border-color: rgba(99, 102, 241, 0.35);
}

.module-card.pos-highlight .icon-box {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.module-card.inventory-focus {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.01));
  border-color: rgba(99, 102, 241, 0.35);
}

.icon-box {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--bg-icon-box);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.module-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-heading);
  text-align: center;
  line-height: 1.15;
  padding: 0 2px;
}

.module-sub-count {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-badge);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 6px;
  line-height: 1.2;
}

/* ========================================================
   Buttons & UI Elements
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-icon-box);
}

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

.btn-sm {
  padding: 4px 8px;
  font-size: 0.66rem;
}

/* ========================================================
   Offcanvas Bottom Sheet Drawer (Submenu Runner)
   ======================================================== */
.offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.offcanvas-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.offcanvas {
  position: fixed;
  background: var(--bg-card);
  z-index: 999;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.offcanvas-bottom-full {
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  height: auto;
  max-height: 85vh;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  border: 1px solid var(--border-color);
  border-bottom: none;
  transform: translateY(100%);
  overflow: hidden;
}

.offcanvas-bottom-full.active {
  transform: translateY(0);
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-card);
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
}

.offcanvas-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.offcanvas-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--accent-active-box);
  color: var(--accent-active-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.offcanvas-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 5px;
}

.offcanvas-subtitle {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.2;
}

.offcanvas-body {
  padding: 10px 14px;
  overflow-y: auto;
  flex: 1;
  background: var(--bg-card);
}

.offcanvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  flex-shrink: 0;
}

/* ========================================================
   Submenu List in Offcanvas Bottom Sheet
   ======================================================== */
.submenu-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submenu-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.submenu-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.submenu-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  background: var(--bg-module-hover);
}

.submenu-card:active {
  transform: scale(0.98);
}

.submenu-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--bg-icon-box);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.submenu-card:hover .submenu-card-icon {
  background: var(--accent-active-box);
  color: var(--accent-active-icon);
}

.submenu-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.submenu-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.submenu-card-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  line-height: 1.25;
}

.submenu-card-arrow {
  color: var(--text-muted);
  opacity: 0.45;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.submenu-card:hover .submenu-card-arrow {
  color: var(--brand-primary);
  opacity: 1;
  transform: translateX(2px);
}

/* ========================================================
   Toast Notification System
   ======================================================== */
.toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1100;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.74rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUpToast 0.2s ease;
  max-width: 320px;
}

.toast.toast-success { border-left: 3px solid var(--color-success); }
.toast.toast-danger { border-left: 3px solid var(--color-danger); }
.toast.toast-info { border-left: 3px solid var(--color-info); }

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   Confirm / Notice Dialog Modal
   ======================================================== */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 16px 24px -4px rgba(0, 0, 0, 0.2);
  transform: scale(0.94) translateY(6px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.custom-modal-overlay.active .custom-modal-box {
  transform: scale(1) translateY(0);
}

.custom-modal-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custom-modal-icon-wrap.confirm {
  background: var(--accent-active-box);
  color: var(--brand-primary);
}

.custom-modal-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-heading);
}

.custom-modal-message {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.custom-modal-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.custom-modal-actions .btn {
  flex: 1;
  height: 30px;
  font-size: 0.72rem;
  font-weight: 600;
}


/* ========================================================
   Standard Inner-Page Layouts (Settings, Forms, CRUD)
   ======================================================== */
.content-wrapper {
  max-width: 680px;
  margin: 10px auto 30px auto;
  padding: 0 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 1024px) {
  .content-wrapper {
    max-width: 980px;
  }
}

/* Quick Module Sibling Switcher Bar */
.module-subnav-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 6px 14px;
}

.module-subnav-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 1024px) {
  .module-subnav-inner {
    max-width: 980px;
  }
}

.module-subnav-inner::-webkit-scrollbar {
  display: none;
}

.module-subnav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.module-subnav-pill:hover {
  color: var(--text-heading);
  border-color: var(--brand-primary);
}

.module-subnav-pill.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.page-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-tile);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alert {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.alert-success {
  background: var(--color-success-bg);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--color-success);
}

.alert-danger {
  background: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--color-danger);
}

/* Logo Upload Section */
.logo-upload-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-icon-box);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
}

.logo-preview-box {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-upload-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.logo-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.custom-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  padding: 4px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  width: fit-content;
}

.custom-file-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.remove-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  color: var(--color-danger);
  cursor: pointer;
}

.logo-upload-hint {
  font-size: 0.60rem;
  color: var(--text-muted);
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.form-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-heading);
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  padding: 5px 9px;
  font-size: 0.74rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input {
  height: 32px;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
  background: var(--bg-card);
}

.form-textarea {
  resize: vertical;
  min-height: 56px;
  padding: 6px 9px;
}

.form-helper {
  font-size: 0.60rem;
  color: var(--text-muted);
}

/* ========================================================
   Roles & Permissions Matrix Styling
   ======================================================== */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.role-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.role-card:hover {
  border-color: var(--brand-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.role-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.role-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 700;
}

.role-icon-admin {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.role-icon-manager {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.role-icon-cashier {
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}

.role-icon-custom {
  background: rgba(14, 165, 233, 0.14);
  color: #0284c7;
}

.role-meta {
  flex: 1;
  min-width: 0;
}

.role-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 6px;
}

.role-desc {
  font-size: 0.70rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.35;
}

.role-stats-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.role-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--bg-icon-box);
  color: var(--text-heading);
  border: 1px solid var(--border-color);
}

.role-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

/* Role Selector Pills */
.role-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 8px;
  margin-bottom: 12px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  -webkit-overflow-scrolling: touch;
}

.role-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.role-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.role-tab-btn:hover {
  color: var(--text-heading);
  border-color: var(--brand-primary);
}

.role-tab-btn.active {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.role-tab-btn .badge-pill {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  padding: 1px 5px;
  border-radius: 10px;
  font-size: 0.60rem;
}

.role-tab-btn:not(.active) .badge-pill {
  background: var(--bg-icon-box);
  color: var(--text-muted);
}

/* ========================================================
   Cardless Native Permissions List Styling
   ======================================================== */
.perm-section {
  margin-bottom: 16px;
}

.perm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 2px 6px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 4px;
}

.perm-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.perm-section-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.perm-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.perm-section-badge {
  font-size: 0.60rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-icon-box);
  padding: 1px 6px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  flex-shrink: 0;
}

.perm-section-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.perm-section-toggle-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Submenu items list: Sleek cardless rows with subtle separator */
.perm-list {
  display: flex;
  flex-direction: column;
}

.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

.perm-row:last-child {
  border-bottom: none;
}

.perm-row:hover {
  background-color: rgba(99, 102, 241, 0.03);
}

.perm-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.perm-row-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.perm-row-text {
  min-width: 0;
  flex: 1;
}

.perm-row-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.perm-row-desc {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Modern iOS Style Toggle Switch */
.switch-control {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-color);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 20px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-control input:checked + .switch-slider {
  background-color: var(--brand-primary);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(16px);
}

.switch-control input:disabled + .switch-slider {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========================================================
   Product Catalog & Lazy Loader Styling (Ultra-Compact Cardless)
   ======================================================== */
.product-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.product-compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.12s ease;
}

.product-compact-row:last-child {
  border-bottom: none;
}

.product-compact-row:hover {
  background-color: rgba(99, 102, 241, 0.03);
}

.product-compact-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 1px;
}

.product-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-compact-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.product-compact-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.product-compact-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex: 1;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.product-compact-price {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-heading);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
  line-height: 1.35;
}

.product-compact-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.product-compact-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1;
  font-size: 0.62rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meta-dot {
  opacity: 0.5;
  font-size: 0.55rem;
}

.stock-tag-emerald {
  font-size: 0.58rem;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stock-tag-amber {
  font-size: 0.58rem;
  font-weight: 700;
  color: #d97706;
  background: rgba(245, 158, 11, 0.14);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stock-tag-rose {
  font-size: 0.58rem;
  font-weight: 700;
  color: #dc2626;
  background: rgba(239, 68, 68, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Minimalist borderless buttons that don't crowd the line */
.product-compact-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.btn-mini-action {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.12s ease;
}

.btn-mini-action:hover {
  background: var(--bg-card);
  color: var(--brand-primary);
}

.btn-mini-action.btn-mini-danger:hover {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.08);
}

/* Shimmer Skeleton for Compact Lazy Loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-compact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border-color);
}

.skeleton-box {
  background: linear-gradient(90deg, var(--bg-icon-box) 25%, var(--border-color) 50%, var(--bg-icon-box) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: 4px;
}

.filter-pills-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 4px;
}

.filter-pills-wrap::-webkit-scrollbar {
  display: none;
}

.filter-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 16px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.filter-pill-btn:hover {
  border-color: var(--brand-primary);
  color: var(--text-heading);
}

.filter-pill-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* ========================================================
   Categories Management Cardless Styling
   ======================================================== */
.cat-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.12s ease;
}

.cat-row:last-child {
  border-bottom: none;
}

.cat-row:hover {
  background-color: rgba(99, 102, 241, 0.03);
}

.cat-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.cat-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.cat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.cat-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-meta {
  font-size: 0.62rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cat-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.tag-badge-preview {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  background: var(--accent-active-box);
  color: var(--brand-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

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

.lucide-spin {
  animation: spin 0.8s linear infinite;
}
