/* =============================================================================
   OneG Design System — slim (shell + core components)
   Shared by OneCRM / OneFul portals. Extracted from OneG Hub app.css.
   Loads AFTER Bootstrap 5.3. Module-specific CSS omitted.
   ============================================================================= */


/* --- OneG app.css L1-528 --- */
/* =============================================================================
   OneG Design System — app.css
   Shared by OneG & OneG. Loads AFTER Bootstrap 5.3.
   Prefer Bootstrap utilities/components; this file = tokens + app chrome + brand.
   Breakpoints: mobile <768 | tablet ≤1024 | desktop >1024
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------------------- */
:root {
  /* Brand */
  --af-bg: #f3f5fa;
  --af-surface: #ffffff;
  --af-sidebar: #12142b;
  --af-sidebar-soft: #1b1e3d;
  --af-primary: #3d5afe;
  --af-primary-dark: #2a3eb1;
  --af-teal: #14b8a6;
  --af-amber: #f5a623;
  --af-rose: #ef476f;
  --af-text: #12172b;
  --af-text-muted: #6b7280;
  --af-text-faint: #9aa1b1;
  --af-border: #e6e9f2;
  --af-success: #1fae6b;
  --af-danger: #e5484d;

  /* Semantic aliases */
  --bg: var(--af-bg);
  --surface: var(--af-surface);
  --surface-muted: #fafafa;
  --surface-hover: #f5f5f5;
  --surface-soft: #f9f9f9;
  --surface-tint: #fafbff;
  --border: var(--af-border);
  --border-md: #d5dae8;
  --text: var(--af-text);
  --text-2: var(--af-text-muted);
  --text-3: var(--af-text-faint);
  --brand-accent: var(--af-primary);
  --brand-accent-dark: var(--af-primary-dark);

  /* Sidebar chrome */
  --sidebar-text: #e8eaf2;
  --sidebar-muted: #a8aec3;
  --sidebar-accent-soft: #c5ceff;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-active-bg: rgba(61, 90, 254, 0.18);
  --sidebar-av-bg: rgba(61, 90, 254, 0.25);
  --sidebar-badge-bg: rgba(61, 90, 254, 0.2);

  /* Palette scales */
  --green-50: #e8f8f0;
  --green-100: #b8e8cf;
  --green-200: #6fd4a0;
  --green-400: var(--af-success);
  --green-600: #178a54;
  --green-800: #0f5c38;
  --blue-50: #eef1ff;
  --blue-soft: #c5ceff;
  --blue-400: var(--af-primary);
  --blue-800: var(--af-primary-dark);
  --amber-50: #fff6e5;
  --amber-soft: #fde68a;
  --amber-400: var(--af-amber);
  --amber-border: #fac775;
  --amber-800: #8a5a00;
  --red-50: #fdecec;
  --red-soft: #f5b0b2;
  --red-400: var(--af-danger);
  --red-800: #9b1c1f;
  --purple-50: #eef1ff;
  --purple-400: var(--af-primary);
  --purple-800: var(--af-primary-dark);
  --teal-50: #e6faf7;
  --teal-soft: #99f6e4;
  --teal-400: var(--af-teal);
  --teal-800: #0f766e;
  --pink-50: #fde8ee;
  --pink-400: var(--af-rose);
  --pink-800: #9b1d3a;
  --gray-50: #f3f5fa;
  --gray-100: #e6e9f2;
  --gray-400: var(--af-text-faint);
  --gray-800: var(--af-text-muted);
  --green-soft-alt: #eaf3de;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography / shape / elevation */
  --font: "Google Sans Flex", ui-sans-serif, system-ui, sans-serif;
  --bs-font-sans-serif: var(--font);
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 16px;
  --fs-2xl: 17px;
  --fs-3xl: 18px;
  --fs-4xl: 20px;
  --fs-5xl: 22px;
  --fs-6xl: 26px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 20px;
  --sidebar-w: 220px;
  --sidebar-collapsed: 60px;
  --topbar-h: 56px;
  --content-narrow: 720px;
  --panel-aside: 340px;
  --shadow-sm: 0 1px 3px rgba(18, 23, 43, 0.06);
  --shadow-md: 0 4px 16px rgba(18, 23, 43, 0.08);
  --shadow-lg: 0 8px 32px rgba(18, 23, 43, 0.12);
  --focus-ring: 0 0 0 3px rgba(61, 90, 254, 0.15);
  --primary-glow: 0 2px 8px rgba(61, 90, 254, 0.45);
  --transition-fast: 0.15s ease;
  --z-sidebar: 100;
  --z-overlay: 99;
  --z-topbar: 50;
  --z-modal: 200;

  /* Select chevron */
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");

  /* Bootstrap 5.3 bridge — theme BS components from our tokens */
  --bs-primary: var(--af-primary);
  --bs-primary-rgb: 61, 90, 254;
  --bs-secondary: var(--af-text-muted);
  --bs-secondary-rgb: 107, 114, 128;
  --bs-success: var(--af-success);
  --bs-success-rgb: 31, 174, 107;
  --bs-danger: var(--af-danger);
  --bs-danger-rgb: 229, 72, 77;
  --bs-warning: var(--af-amber);
  --bs-warning-rgb: 245, 166, 35;
  --bs-info: var(--af-teal);
  --bs-info-rgb: 20, 184, 166;
  --bs-body-font-family: var(--font);
  --bs-body-font-size: var(--fs-base);
  --bs-body-color: var(--af-text);
  --bs-body-bg: var(--af-bg);
  --bs-border-color: var(--af-border);
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-pill: var(--radius-pill);
  --bs-link-color: var(--af-primary);
  --bs-link-hover-color: var(--af-primary-dark);
  --bs-focus-ring-color: rgba(61, 90, 254, 0.25);
}

/* ---------------------------------------------------------------------------
   2. Base
   --------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

input,
select,
textarea,
button,
.btn,
.form-control,
.form-select,
.dropdown-menu,
.nav,
.table,
.modal {
  font-family: var(--font);
}


/* —— Secret field: show / hide + copy —— */
.secret-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.secret-field > .form-control,
.secret-field > input {
  padding-right: 4.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
}

.secret-field:has(.secret-field-actions .secret-field-btn:only-child) > .form-control,
.secret-field:has(.secret-field-actions .secret-field-btn:only-child) > input {
  padding-right: 2.75rem;
}

.secret-field-inline {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-2, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 0.5rem;
  padding: 0.2rem 0.35rem 0.2rem 0.65rem;
}

.secret-field-inline > code,
.secret-field-inline > [data-copyable] {
  font-size: 0.8rem;
  word-break: break-all;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--text, #0f172a);
}

.secret-field-inline .secret-field-actions {
  position: static;
  transform: none;
  padding-right: 0;
}

.secret-field-actions {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  z-index: 2;
}

.secret-field-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--muted, #64748b);
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.secret-field-btn:hover,
.secret-field-btn:focus-visible {
  background: var(--surface-2, #e2e8f0);
  color: var(--text, #0f172a);
  outline: none;
}

.secret-field-btn.is-active {
  color: var(--primary, #2563eb);
}

.secret-field-btn.is-copied {
  color: #16a34a;
}

.secret-field-btn .ti {
  font-size: 1.05rem;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
}

i.ti {
  vertical-align: -0.125em;
}

/* ---------------------------------------------------------------------------
   3. App shell — sidebar, main, topbar
   --------------------------------------------------------------------------- */
.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--af-sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: var(--z-sidebar);
  overflow: hidden;
  transition: width var(--transition-fast), transform var(--transition-fast);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-4) var(--space-4) 9px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--af-primary);
  box-shadow: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-icon .ti {
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.logo-icon.logo-icon-sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.logo-icon.logo-icon-sm .ti {
  font-size: 12px;
}

.logo-icon.accent-blue {
  background: var(--af-primary);
  box-shadow: var(--primary-glow);
}

.brand-logo {
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-logo-login {
  height: 48px;
}

.brand-logo-sidebar {
  height: 32px;
}

.brand-logo-topbar {
  height: 28px;
}

.brand-with-fallback {
  justify-content: center;
}

.brand-fallback {
  display: none;
  text-align: center;
}

.brand-with-fallback.is-fallback .brand-logo {
  display: none;
}

.brand-with-fallback.is-fallback .brand-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-text {
  font-size: var(--fs-xl);
  font-weight: 600;
  white-space: nowrap;
  color: #fff;
}

.sidebar-tenant {
  font-size: var(--fs-xs);
  color: var(--af-text-faint);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: 10px var(--space-2);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-2) var(--space-2) var(--space-2);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-group-label {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--af-text-faint);
  text-transform: capitalize;
  white-space: nowrap;
  margin: 8px 0;
  line-height: 1;
}

.nav-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1;
}

.nav-group-icon {
  font-size: 15px;
  width: 18px;
  text-align: center;
  color: var(--af-text-faint);
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-group-chevron {
  font-size: 14px;
  color: var(--af-text-faint);
  transition: transform var(--transition-fast), color var(--transition-fast);
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-group-items {
  display: none;
  padding: 6px 0 4px 40px;
  position: relative;
}

.nav-group-items::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 18px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.nav-group.is-open .nav-group-items {
  display: block;
}

.nav-group.is-open .nav-group-chevron {
  transform: rotate(180deg);
  color: #fff;
}

.nav-group.is-open .nav-group-icon,
.nav-group-toggle:hover .nav-group-icon {
  color: #fff;
}

.nav-group.is-open .nav-group-toggle,
.nav-group-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) 10px;
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--sidebar-muted);
  margin-bottom: 1px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-group-items .nav-link {
  position: relative;
  gap: 8px;
  padding-left: 12px;
}

.nav-group-items .nav-link .nav-link-icon {
  font-size: 15px;
  width: 1.1em;
  flex-shrink: 0;
  opacity: 0.9;
  line-height: 1;
}

.nav-group-items .nav-link::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-50%);
}

.nav-chat-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.nav-group-items .nav-link .nav-icon,
.nav-group-items .nav-link i.ti,
.nav-group-items .nav-link i.fa-solid,
.nav-group-items .nav-link i.fa-regular {
  display: none;
}

.nav-link:hover {
  background: var(--af-sidebar-soft);
  color: #fff;
}

.nav-link.active {
  background: transparent;
  color: #4a9eff;
  font-weight: 600;
}

.nav-link.active:hover {
  background: transparent;
  color: #6eb0ff;
}

.nav-link .nav-icon,
.nav-link i.ti,
.nav-link i.fa-solid,
.nav-link i.fa-regular {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

.nav-link.active .nav-icon {
  color: var(--af-primary);
}

.nav-link.nav-link-soon {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.nav-section-label {
  margin: 10px 0 4px;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  user-select: none;
}


/* --- OneG app.css L1209-2106 --- */
.sidebar-footer {
  padding: 10px var(--space-2) 14px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer-link {
  margin: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--space-2) 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--af-sidebar-soft);
}

.user-menu {
  position: relative;
  width: 100%;
}

.topbar .user-menu {
  width: auto;
  flex-shrink: 0;
}

.user-menu>.sidebar-user,
.user-menu>.topbar-user {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu>.topbar-user {
  width: auto;
  gap: var(--space-2);
}

.user-menu .dropdown-toggle::after {
  display: none;
}

.user-menu-copy {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.user-menu-caret {
  font-size: 14px;
  opacity: 0.6;
  flex-shrink: 0;
}

.user-menu-dropdown {
  min-width: 200px;
  padding: 6px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, .08));
}

.user-menu-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-base);
  padding: 8px 10px;
}

.user-menu-dropdown .dropdown-item i {
  font-size: 16px;
  opacity: 0.85;
}

.user-menu-dropdown form {
  margin: 0;
}

.user-menu-dropdown button.dropdown-item {
  width: 100%;
  border: 0;
  background: transparent;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(8, 18, 38, 0.58), rgba(12, 32, 66, 0.42)),
    radial-gradient(ellipse at top left, color-mix(in srgb, var(--af-primary) 14%, transparent), transparent 52%),
    url("/img/login-bg.jpg");
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  padding: var(--space-5);
}

.auth-shell {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: color-mix(in srgb, var(--surface) 94%, #fff 6%);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(2px);
  padding: 28px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 20px;
}

.auth-brand-name {
  font-size: var(--fs-xl);
  font-weight: 700;
}

.auth-brand-sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.4;
  text-wrap: balance;
}

.auth-title {
  font-size: var(--fs-3xl);
  font-weight: 600;
  margin: 0 0 6px;
}

.auth-sub {
  color: var(--text-2);
  margin: 0 0 20px;
  font-size: var(--fs-base);
}

.auth-form .field {
  margin-bottom: 14px;
}

.auth-form .inp,
.auth-form .form-control,
.auth-form .form-select {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border-md) 88%, #fff 12%);
  border-radius: calc(var(--radius-md) + 2px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(18, 23, 43, 0.04);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.auth-form .inp::placeholder,
.auth-form .form-control::placeholder,
.auth-form .form-select::placeholder {
  color: color-mix(in srgb, var(--text-2) 78%, #fff 22%);
}

.auth-form .inp:hover,
.auth-form .form-control:hover,
.auth-form .form-select:hover {
  border-color: color-mix(in srgb, var(--af-primary) 28%, var(--border-md) 72%);
  background: rgba(255, 255, 255, 0.98);
}

.auth-form .inp:focus,
.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: var(--af-primary);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(61, 90, 254, 0.12),
    0 8px 20px rgba(61, 90, 254, 0.08);
  transform: translateY(-1px);
}

.auth-form .lbl,
.auth-form .form-label {
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--text) 82%, var(--text-2) 18%);
}

.auth-input-wrap {
  position: relative;
}

.auth-input-icon {
  position: absolute;
  /* Input khi focus có transform nên được nâng lên cùng lớp vẽ với icon;
     cần z-index để icon không bị nền input che mất. */
  z-index: 2;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 18px;
  color: color-mix(in srgb, var(--text-2) 82%, #fff 18%);
  pointer-events: none;
  transition: color var(--transition-fast);
}

.auth-input {
  padding-left: 42px !important;
}

.auth-input-wrap:focus-within .auth-input-icon {
  color: var(--af-primary);
}

.auth-input-wrap .secret-field > .form-control,
.auth-input-wrap .secret-field > input {
  padding-left: 42px;
}

.auth-form .form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--border-md) 85%, #fff 15%);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
}

.auth-form .form-check-input,
.auth-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 0;
  border: 1px solid color-mix(in srgb, var(--border-md) 80%, var(--af-primary) 20%);
  box-shadow: none;
}

.auth-form .form-check-input:focus,
.auth-form input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.14);
}

.auth-form .form-check-label,
.auth-form .auth-remember {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.auth-form .btn,
.auth-form .btn-primary:not(.btn) {
  min-height: 44px;
  font-weight: 600;
  border-radius: calc(var(--radius-md) + 2px);
  box-shadow: 0 10px 24px rgba(61, 90, 254, 0.18);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: var(--fs-md);
  color: var(--text-2);
  cursor: pointer;
}

.auth-hint {
  margin: 16px 0 0;
  font-size: var(--fs-sm);
  color: var(--text-3);
  text-align: center;
}

.user-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--af-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.user-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar .user-av {
  background: var(--sidebar-av-bg);
  color: var(--sidebar-accent-soft);
}

.user-name {
  font-size: var(--fs-base);
  font-weight: 500;
  white-space: nowrap;
}

.user-role {
  font-size: var(--fs-sm);
  color: var(--text-3);
  white-space: nowrap;
}

.sidebar .user-name {
  color: #fff;
}

.sidebar .user-role {
  color: var(--af-text-faint);
}

.area-badge {
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface-hover);
  color: var(--text-2);
  margin-left: 6px;
}

.sidebar .area-badge {
  background: var(--sidebar-badge-bg);
  color: var(--sidebar-accent-soft);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: var(--z-overlay);
}

.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-fast);
}

.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  flex-shrink: 0;
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 10px;
}

.topbar-brand-name {
  font-size: var(--fs-lg);
  font-weight: 600;
}

.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border-md) 78%, #fff 22%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 255, 0.96));
  box-shadow:
    0 6px 16px rgba(18, 23, 43, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--af-primary);
  font-size: var(--fs-4xl);
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
}

.hamburger:hover {
  border-color: color-mix(in srgb, var(--af-primary) 38%, var(--border-md) 62%);
  box-shadow:
    0 10px 22px rgba(61, 90, 254, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.hamburger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(61, 90, 254, 0.14),
    0 10px 22px rgba(61, 90, 254, 0.12);
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.topbar-search input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) 36px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface-soft);
  outline: none;
  font-family: var(--font);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.topbar-search input:focus {
  border-color: var(--af-primary);
  background: #fff;
  box-shadow: var(--focus-ring);
}

.topbar-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 16px;
  pointer-events: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-md);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-2);
  position: relative;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.topbar-pos-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 0.5px solid rgba(61, 90, 254, 0.35);
  background: rgba(61, 90, 254, 0.08);
  color: var(--af-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.topbar-pos-btn i {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

@media (max-width: 720px) {
  .topbar-pos-btn span {
    display: none;
  }

  .topbar-pos-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
}

.topbar-icon-btn:hover,
.topbar-icon-btn.is-active,
.settings-menu-trigger.show {
  background: var(--surface-hover);
  color: var(--af-primary);
  border-color: rgba(61, 90, 254, 0.35);
}

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--af-rose);
  border: 1.5px solid #fff;
}

.notif-dropdown .dropdown-toggle::after {
  display: none;
}

.notif-menu {
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(18, 20, 43, 0.12);
  overflow: hidden;
  margin-top: 8px !important;
}

.notif-menu-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
}

.notif-menu-hd a {
  color: var(--af-primary);
  text-decoration: none;
  font-weight: 500;
}

.notif-menu-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: var(--fs-sm);
}

.notif-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notif-item:hover {
  background: var(--surface-hover);
}

.notif-item.is-unread {
  background: rgba(61, 90, 254, 0.04);
}

.notif-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: rgba(61, 90, 254, 0.08);
  color: var(--af-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.notif-item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-item-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-meta {
  font-size: 11px;
  color: var(--text-3);
}

.notif-menu-ft {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 0.5px solid var(--border);
  background: var(--surface);
}

.notif-menu-ft a {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  padding: 8px 6px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-md);
  color: var(--text-2);
  text-decoration: none;
}

.notif-menu-ft a:hover {
  border-color: rgba(61, 90, 254, 0.35);
  color: var(--af-primary);
  background: rgba(61, 90, 254, 0.06);
}

.notif-row-unread .td-main {
  font-weight: 600;
}

.notif-unread-pip {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--af-primary);
}

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.settings-menu {
  position: relative;
}

.settings-mega {
  width: min(440px, calc(100vw - 24px));
  padding: 0;
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(18, 20, 43, 0.12);
  overflow: hidden;
  margin-top: 8px !important;
}

.settings-mega-hd {
  padding: 12px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 0.5px solid var(--border);
  background: var(--surface-soft);
}

.settings-mega-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

.settings-mega-col {
  padding: 10px;
}

.settings-mega-col+.settings-mega-col {
  border-left: 0.5px solid var(--border);
}

.settings-mega-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 4px 8px 8px;
}

.settings-mega-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.settings-mega-item:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.settings-mega-item.active {
  background: rgba(61, 90, 254, 0.08);
}

.settings-mega-item>i {
  width: 20px;
  font-size: 18px;
  color: var(--af-primary);
  margin-top: 1px;
  flex-shrink: 0;
}

.settings-mega-item strong {
  display: block;
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.25;
}

.settings-mega-item small {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-3);
  line-height: 1.35;
}

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

  .settings-mega-col+.settings-mega-col {
    border-left: 0;
    border-top: 0.5px solid var(--border);
  }
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-md);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.topbar-user:hover {
  background: var(--surface-hover);
}

.topbar-user .user-av {
  width: 32px;
  height: 32px;
  font-size: var(--fs-md);
}

.topbar-user-name {
  font-size: var(--fs-base);
  font-weight: 500;
}

.topbar-user-role {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.page-content {
  flex: 1;
  padding: var(--space-6);
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.page-title {
  font-size: var(--fs-5xl);
  font-weight: 600;
}

.page-sub {
  font-size: var(--fs-base);
  color: var(--text-2);
  margin-top: 3px;
}

.page-sub-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.page-sub-inline>span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-sub-inline>span:not(:last-child)::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--text-3);
  margin-left: 6px;
}

.page-sub-inline .page-sub-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.page-sub-inline .page-sub-link:hover {
  text-decoration: underline;
}

.page-header-actions,
.page-back-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-back-copy {
  min-width: 0;
  flex: 1;
}

/* --- OneG app.css L2108-2522 --- */
/* ---------------------------------------------------------------------------
   4. Buttons — Bootstrap .btn themed; legacy .btn-* kept as aliases
   --------------------------------------------------------------------------- */
.btn {
  --bs-btn-font-size: var(--fs-base);
  --bs-btn-padding-y: 0.5rem;
  --bs-btn-padding-x: 1rem;
  --bs-btn-border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
}

.btn-sm,
.btn-icon-sm {
  --bs-btn-padding-y: 0.4rem;
  --bs-btn-padding-x: 0.65rem;
  --bs-btn-font-size: var(--fs-base);
}

.btn-xs {
  padding: 5px 10px;
  font-size: var(--fs-md);
  border-radius: var(--radius-md);
}

/* Legacy aliases (no .btn required) — same look as BS primary/outline */
.btn-primary:not(.btn),
a.btn-primary:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  background: var(--bs-primary);
  color: #fff;
  font-size: var(--fs-base);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:not(.btn):hover,
a.btn-primary:not(.btn):hover {
  background: var(--af-primary-dark);
  box-shadow: var(--primary-glow);
}

.btn-secondary:not(.btn),
a.btn-secondary:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-secondary:not(.btn):hover,
a.btn-secondary:not(.btn):hover {
  background: var(--surface-hover);
}

.btn-icon-sm:not(.btn) {
  padding: 7px 10px;
}

.btn-icon-ghost {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 4px;
  border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------------------
   5. Stats & trends
   --------------------------------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  padding: 18px var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

a.product-stat {
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

a.product-stat:hover {
  border-color: color-mix(in srgb, var(--af-primary) 40%, var(--border));
  box-shadow: var(--shadow-sm);
}

a.product-stat.is-active {
  border-color: var(--af-primary);
  box-shadow: inset 0 0 0 1px var(--af-primary);
  background: color-mix(in srgb, var(--af-primary) 4%, var(--surface));
}

.product-stats .stat-val-money {
  font-size: var(--fs-3xl);
  letter-spacing: -0.02em;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-icon .ti {
  font-size: 20px;
  color: inherit;
}

.stat-icon-blue {
  background: var(--blue-50);
  color: var(--af-primary);
}

.stat-icon-teal {
  background: var(--teal-50);
  color: var(--af-teal);
}

.stat-icon-amber {
  background: var(--amber-50);
  color: var(--af-amber);
}

.stat-icon-red {
  background: var(--red-50);
  color: var(--af-danger);
}

.stat-icon-green {
  background: var(--green-50);
  color: var(--af-success);
}

.stat-icon-green-soft {
  background: var(--green-soft-alt);
  color: var(--green-600);
}

.stat-icon-purple {
  background: var(--purple-50);
  color: var(--purple-400);
}

.stat-lbl {
  font-size: var(--fs-md);
  color: var(--text-2);
  font-weight: 500;
}

.stat-val {
  font-size: var(--fs-6xl);
  font-weight: 600;
  line-height: 1;
}

.stat-val-amber {
  color: var(--amber-800);
}

.stat-val-danger,
.stat-val-red {
  color: var(--af-danger);
}

.stat-val-red {
  color: var(--red-800);
}

.stat-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-md);
}

.stat-more {
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
}

.mini-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
}

.mini-bars-mt {
  margin-top: var(--space-2);
}

.mini-bar {
  width: 5px;
  border-radius: 2px;
}

.mini-bar-h10 {
  height: 10px;
}

.mini-bar-h14 {
  height: 14px;
}

.mini-bar-h16 {
  height: 16px;
}

.mini-bar-h18 {
  height: 18px;
}

.mini-bar-h20 {
  height: 20px;
}

.mini-bar-h22 {
  height: 22px;
}

.mini-bar-h24 {
  height: 24px;
}

.mini-bar-blue-soft {
  background: var(--blue-soft);
}

.mini-bar-blue {
  background: var(--af-primary);
}

.mini-bar-teal-soft {
  background: var(--teal-soft);
}

.mini-bar-teal {
  background: var(--af-teal);
}

.mini-bar-green-soft {
  background: var(--green-100);
}

.mini-bar-green {
  background: var(--af-success);
}

.mini-bar-amber-soft {
  background: var(--amber-soft);
}

.mini-bar-amber {
  background: var(--af-amber);
}

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

.trend-warn {
  color: var(--amber-800);
}

.trend-danger {
  color: var(--red-800);
}

.trend-info {
  color: var(--blue-800);
}


/* Bootstrap card bridge — optional .card surfaces match .panel */
.card {
  --bs-card-border-color: var(--border);
  --bs-card-border-radius: var(--radius-lg);
  --bs-card-bg: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------------------
   6. Panels, empty states, KPI
   --------------------------------------------------------------------------- */
.panel,
.form-section,
.pf-section,
.analytics-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.panel-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.panel-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-title .ti {
  font-size: 18px;
  color: var(--text-2);
}

.panel-body {
  padding: var(--space-5);
}

.panel-body-sm {
  font-size: var(--fs-base);
}

.panel-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
}

.panel-spaced {
  margin-bottom: var(--space-4);
}

.panel-stack {
  margin-top: var(--space-4);
}

.form-section {
  margin-bottom: var(--space-4);
}

.form-section .sec-hd {
  padding: 14px var(--space-5);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.form-section .sec-bd {
  padding: var(--space-5);
}


.empty-state {
  text-align: center;
  padding: 48px var(--space-5);
  color: var(--text-2);
}

.empty-state > i {
  font-size: 36px;
  margin-bottom: var(--space-3);
  display: block;
  color: var(--text-3);
}

/* Icon trong nút/link CTA không bị empty-state ghi đè màu. */
.empty-state .btn i.ti,
.empty-state a.btn i.ti {
  font-size: 1em;
  margin: 0;
  display: inline;
  color: inherit;
  vertical-align: -0.125em;
}

.btn i.ti {
  color: inherit;
}

.empty-state-pad {
  padding: var(--space-6);
}

/* --- OneG app.css L2525-2563 --- */
.create-layout {
  display: grid;
  grid-template-columns: 1fr var(--panel-aside);
  gap: var(--space-5);
  align-items: start;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 4fr);
  gap: var(--space-5);
  align-items: start;
}

.product-detail-layout .data-table th,
.product-detail-layout .data-table td {
  white-space: nowrap;
}

.product-detail-layout .data-table td .td-main,
.product-detail-layout .data-table td.td-sub {
  white-space: normal;
  word-break: break-word;
}

.order-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.detail-main,
.detail-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

/* --- OneG app.css L2900-3611 --- */
/* ---------------------------------------------------------------------------
   7. Tables
   --------------------------------------------------------------------------- */

.data-table,
.variant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}

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

.variant-table {
  min-width: 640px;
}

.data-table th,
.variant-table th {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  border-bottom: 0.5px solid var(--border);
  background: var(--surface-muted);
  white-space: nowrap;
  text-transform: uppercase;
}

.data-table th {
  padding: 10px 14px;
}

.data-table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.data-table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.data-table td {
  padding: var(--space-3) 14px;
  border-bottom: 0.5px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

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

.data-table tbody tr:hover {
  background: var(--surface-muted);
}

.row-clickable {
  cursor: pointer;
}

.data-table .check-cell {
  width: 40px;
}

.row-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 0.5px solid var(--border-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
}

.row-check.checked {
  background: var(--af-primary);
  border-color: var(--af-primary);
}

.td-main {
  font-weight: 500;
  font-size: var(--fs-base);
}

.td-sub {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin-top: 2px;
}

.td-actions,
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

/* Keep the cell in the table grid — flex on <td> breaks row borders. */
td.td-actions,
td.table-actions,
th.th-actions {
  display: table-cell;
  width: 1%;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

td.td-actions > *,
td.table-actions > * {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

td.td-actions > :first-child,
td.table-actions > :first-child {
  margin-left: 0;
}

.td-actions form,
.table-actions form,
td.td-actions form.d-inline,
td.table-actions form.d-inline {
  display: inline-flex !important;
  margin: 0;
  vertical-align: middle;
}

.td-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 0.5px solid color-mix(in srgb, var(--af-primary) 35%, var(--border));
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--af-primary);
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}

.td-action-btn:hover {
  background: color-mix(in srgb, var(--af-primary) 8%, var(--surface));
  border-color: var(--af-primary);
  color: var(--af-primary-dark);
}

.td-action-btn .ti {
  font-size: 14px;
}

.td-action-btn.is-danger,
.td-action-btn:has(.ti-trash),
.td-action-btn:has(.ti-ban),
.td-action-btn:has(.ti-player-pause),
.td-action-btn:has(.ti-player-stop),
.td-action-btn:has(.ti-circle-x),
.td-action-btn:has(.ti-x),
.td-action-btn.line-remove {
  color: var(--af-danger);
  border-color: color-mix(in srgb, var(--af-danger) 40%, var(--border));
}

.td-action-btn.is-danger:hover,
.td-action-btn:has(.ti-trash):hover,
.td-action-btn:has(.ti-ban):hover,
.td-action-btn:has(.ti-player-pause):hover,
.td-action-btn:has(.ti-player-stop):hover,
.td-action-btn:has(.ti-circle-x):hover,
.td-action-btn:has(.ti-x):hover,
.td-action-btn.line-remove:hover {
  color: var(--red-800);
  background: var(--red-50);
  border-color: var(--af-danger);
}

/* Nút icon nhấn mạnh — dùng cho hành động chính trên mỗi dòng */
.td-action-btn.is-solid {
  background: var(--af-primary);
  border-color: var(--af-primary);
  color: #fff;
}

.td-action-btn.is-solid:hover {
  background: var(--af-primary-dark);
  border-color: var(--af-primary-dark);
  color: #fff;
}

.data-table th.th-actions {
  text-align: right;
}

.btn-table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  min-width: 0;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border-radius: var(--radius-md);
}

.btn-table-action .ti {
  font-size: 14px;
  flex-shrink: 0;
}

.btn-table-action.is-danger,
.btn-table-action.btn-outline-danger {
  color: var(--danger, #dc3545);
  border-color: color-mix(in srgb, var(--danger, #dc3545) 40%, var(--border));
}

.btn-table-action.is-danger:hover,
.btn-table-action.btn-outline-danger:hover {
  color: var(--danger, #dc3545);
  background: color-mix(in srgb, var(--danger, #dc3545) 8%, var(--surface));
  border-color: var(--danger, #dc3545);
}

.variant-table {
  margin-top: 10px;
}

.variant-table th {
  padding: 6px 10px;
}

.variant-table td {
  padding: 7px 10px;
  border-bottom: 0.5px solid var(--border);
  vertical-align: middle;
}

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

.variant-table .inp {
  padding: 5px var(--space-2);
  font-size: var(--fs-md);
}

.product-thumb,
.pl-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface-hover);
  border: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.product-thumb {
  font-size: 18px;
  color: var(--text-3);
}

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

.product-sku-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  padding: 2px 7px;
  white-space: nowrap;
}

.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--fs-sm);
  background: var(--blue-50);
  color: var(--af-primary-dark);
}

.avatar-md {
  width: 36px;
  height: 36px;
  font-size: var(--fs-md);
  background: var(--blue-50);
  color: var(--af-primary-dark);
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 16px;
  background: var(--blue-50);
  color: var(--blue-800);
}

.cell-with-avatar {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cell-with-avatar-md {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entity-thumb {
  flex-shrink: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-2, var(--blue-50));
  border: 0.5px solid var(--border);
}

.entity-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.entity-thumb-md {
  width: 36px;
  height: 36px;
}

.entity-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--af-primary-dark);
  background: var(--blue-50);
}

.entity-image-field {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.entity-image-preview {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--border-md);
  background: var(--surface-2, var(--bg));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.entity-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.entity-image-preview.is-empty {
  color: var(--text-3);
  font-size: 28px;
}

.entity-image-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.entity-image-pick {
  cursor: pointer;
  margin: 0;
}

.field-hint {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.list-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--border);
  color: inherit;
  min-width: 0;
}

.list-row-link .flex-fill,
.list-row-link>div:not(.avatar):not(.badge) {
  min-width: 0;
  flex: 1;
}

.list-row-link .td-main,
.list-row-link .td-sub {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   8. Badges
   --------------------------------------------------------------------------- */
/* Status badges — modifiers only; leaves Bootstrap .badge / .text-bg-* intact */
.badge.b-pending,
.badge.b-draft,
.badge.b-low,
.badge.b-processing,
.badge.b-shipped,
.badge.b-delivered,
.badge.b-cancelled,
.badge.b-oos,
.badge.b-refund,
.badge.b-active,
.badge.b-muted,
.badge.b-info,
.badge.b-warning,
.badge.b-success,
.badge.b-danger,
.badge.seg-vip,
.badge.seg-new,
.badge.seg-loyal,
.badge.seg-atrisk,
.badge.seg-inactive,
.badge.seg-pos,
.badge.badge-tag,
.badge.badge-option {
  font-size: var(--fs-sm);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.badge.b-active,
.badge.seg-loyal,
.badge.b-success {
  background: var(--green-50);
  color: var(--green-800);
}

.badge.b-muted {
  background: var(--gray-50);
  color: var(--gray-800);
}

.badge.b-info,
.badge.b-processing,
.badge.seg-new,
.badge.seg-pos {
  background: var(--blue-50);
  color: var(--blue-800);
}

.badge.b-warning,
.badge.b-pending,
.badge.b-draft,
.badge.b-low,
.badge.seg-vip {
  background: var(--amber-50);
  color: var(--amber-800);
}

.badge.b-shipped {
  background: var(--purple-50);
  color: var(--purple-800);
}

.badge.b-delivered {
  background: var(--teal-50);
  color: var(--teal-800);
}

.badge.b-danger,
.badge.b-cancelled,
.badge.b-oos,
.badge.seg-atrisk {
  background: var(--red-50);
  color: var(--red-800);
}

.badge.b-refund {
  background: var(--pink-50);
  color: var(--pink-800);
}

.badge.seg-inactive {
  background: var(--gray-50);
  color: var(--gray-800);
}

.badge.badge-tag {
  background: var(--surface-hover);
  color: var(--text-2);
  margin-right: var(--space-1);
}

.badge.badge-option {
  background: var(--surface-hover);
  color: var(--text);
  border: 0.5px solid var(--border-md);
}

/* ---------------------------------------------------------------------------
   9. Filters & pagination
   --------------------------------------------------------------------------- */
.panel-toolbar {
  padding: 12px var(--space-5);
  border-bottom: 0.5px solid var(--border);
  background: var(--surface-soft);
}

.panel > .panel-toolbar:last-child {
  border-bottom: 0;
}

.panel-toolbar .filter-bar,
.panel-body > .filter-bar {
  margin-bottom: 0;
}

.panel-toolbar .filter-bar .search-wrap {
  max-width: none;
}

.filter-bar {
  --filter-h: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}

.filter-bar-fill {
  margin: 0;
  flex: 1;
  gap: 8px;
}

.filter-bar-fill-sm {
  margin: 0;
  flex: 1;
}

.filter-bar .search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 420px;
}

.search-wrap-sm {
  max-width: 280px;
}

.filter-bar .search-wrap input {
  width: 100%;
  height: var(--filter-h);
  padding: 0 var(--space-3) 0 36px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: var(--font);
  line-height: 1.2;
}

.filter-bar .search-wrap input:focus {
  border-color: var(--af-primary);
  box-shadow: var(--focus-ring);
}

.filter-bar .si,
.si.ti {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 16px;
  pointer-events: none;
}

.filter-bar .form-select,
.filter-bar .form-control,
.filter-bar .filter-sel {
  width: auto;
  flex: 0 0 180px;
  min-width: 160px;
  max-width: 220px;
  height: var(--filter-h);
  padding-top: 0;
  padding-bottom: 0;
  font-size: var(--fs-base);
}

.filter-bar .form-select-sm,
.filter-bar .filter-sel-sm {
  flex: 0 0 160px;
  min-width: 140px;
  max-width: 200px;
}

.filter-bar .filter-sel-lg {
  flex: 0 0 220px;
  min-width: 180px;
  max-width: 280px;
}

.filter-bar .btn {
  height: var(--filter-h);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  padding-left: 14px;
  padding-right: 14px;
}

.filter-bar .filter-reset {
  width: var(--filter-h);
  padding: 0;
  color: var(--text-2);
}

.filter-chips {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.f-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px var(--space-3);
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--border-md);
  background: var(--surface);
  font-size: var(--fs-md);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
}

.f-chip:hover {
  background: var(--surface-hover);
}

.f-chip.active {
  background: var(--blue-50);
  border-color: var(--af-primary);
  color: var(--af-primary-dark);
  font-weight: 500;
}

.sort-sel {
  font-size: var(--fs-md);
  color: var(--text);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 6px 28px 6px 10px;
  background: var(--surface);
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  outline: none;
  font-family: var(--font);
}

.sort-sel:focus-visible {
  border-color: var(--af-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--af-primary) 14%, transparent);
}

.sort-sel-sm {
  font-size: 13px;
  min-height: 32px;
  padding: 0 26px 0 9px;
  background-position: right 7px center;
  max-width: 150px;
  text-overflow: ellipsis;
}

.einv-publish {
  flex-wrap: nowrap;
}

.einv-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #067647;
  background: #ecfdf3;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.einv-code {
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2, #f2f4f7);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: nowrap;
  padding: 12px var(--space-5);
  border-top: 0.5px solid var(--border);
}

.pager-info {
  font-size: var(--fs-md);
  color: var(--text-2);
  flex-shrink: 0;
}

.pager-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.pager-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--border-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
}

.pager-btn:hover:not(.disabled):not(.active) {
  background: var(--surface-hover);
  border-color: var(--border);
}

.pager-btn.active {
  background: var(--af-primary);
  border-color: var(--af-primary);
  color: #fff;
}

.pager-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pager-ellipsis {
  padding: 0 4px;
  color: var(--text-3);
}

/* --- OneG app.css L3614-3750 --- */
/* ---------------------------------------------------------------------------
   10. Forms & details
   --------------------------------------------------------------------------- */
.inp,
.form-control,
.form-select {
  width: 100%;
  padding: 9px var(--space-3);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: var(--font);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.inp:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--af-primary);
  box-shadow: var(--focus-ring);
}

textarea.inp,
textarea.form-control {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

select.inp,
.form-select {
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.lbl,
.form-label {
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lbl-spaced {
  margin-bottom: 10px;
}

.lbl-row {
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.field {
  margin-bottom: var(--space-4);
}

.field:last-child {
  margin-bottom: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-narrow {
  max-width: var(--content-narrow);
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: var(--space-4);
}

.form-inline {
  display: inline;
}

.inp-prefix {
  position: relative;
}

.inp-prefix .prefix-sym {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-base);
  color: var(--text-2);
  pointer-events: none;
}

.inp-prefix .inp {
  padding-left: 24px;
}

.inp-min-110 {
  min-width: 110px;
}

.inp-w-70 {
  width: 70px;
}

.inp-w-80 {
  width: 80px;
}

.inp-w-90 {
  width: 90px;
}

.inp-w-100 {
  width: 100px;
}


/* --- OneG app.css L4756-4807 --- */
.alert.alert-compact {
  font-size: var(--fs-md);
  padding: 0.65rem 0.85rem;
}

.alert.alert-dismissible {
  position: relative;
  padding-right: 2.75rem;
}

.alert-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  opacity: 0.55;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
  padding: 0;
}

.alert-close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.06);
}

.alert-close:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.alert.alert-compact.alert-dismissible {
  padding-right: 2.4rem;
}

.alert.alert-compact .alert-close {
  top: 0.35rem;
  right: 0.35rem;
  width: 24px;
  height: 24px;
  font-size: 0.9rem;
}


/* --- OneG app.css L5471-6082 --- */
/* ---------------------------------------------------------------------------
   14. Responsive
   Breakpoints: tablet ≤1024 | form stack ≤900 | mobile ≤767 | compact ≤480
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar .logo-text,
  .sidebar .nav-link span,
  .sidebar .nav-badge,
  .sidebar .nav-group-label,
  .sidebar .user-name,
  .sidebar .user-role {
    display: none;
  }

  .sidebar .nav-link {
    justify-content: center;
    padding: 10px;
  }

  .sidebar .nav-icon {
    width: auto;
  }

  .sidebar .sidebar-logo {
    justify-content: center;
    padding: var(--space-4) var(--space-3) 8px;
  }

  .sidebar .sidebar-user {
    justify-content: center;
    padding: var(--space-2);
  }

  .main-wrap {
    margin-left: var(--sidebar-collapsed);
  }

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

  .page-content {
    padding: var(--space-5);
  }

  .sticky-actions {
    position: static;
  }
}

@media (max-width: 900px) {

  .create-layout,
  .product-detail-layout,
  .dash-two-col,
  .order-detail-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pf-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .page-header {
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .page-header-actions {
    width: auto;
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
  }

  .form-narrow {
    max-width: none;
  }

  .chart-wrap {
    height: 220px;
  }
}

@media (max-width: 767px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w) !important;
  }

  .sidebar .logo-text,
  .sidebar .nav-link span,
  .sidebar .nav-badge,
  .sidebar .nav-group-label,
  .sidebar .user-name,
  .sidebar .user-role {
    display: block !important;
  }

  .sidebar .nav-link {
    justify-content: flex-start !important;
    padding: var(--space-2) 10px !important;
  }

  .sidebar .nav-icon {
    width: 20px !important;
  }

  .sidebar .sidebar-logo {
    justify-content: flex-start !important;
    padding: var(--space-4) !important;
  }

  .sidebar .sidebar-user {
    justify-content: flex-start !important;
    padding: var(--space-2) 10px !important;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-wrap {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .topbar-brand {
    display: flex;
    flex-shrink: 0;
  }

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

  /* Mobile: ẩn search, icon actions dồn sát phải */
  .topbar-search {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
    gap: 6px;
  }

  .topbar-pos-btn {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .topbar-pos-btn span {
    display: none;
  }

  /* Topbar user: avatar only on mobile */
  .topbar .user-menu-copy,
  .topbar .user-menu-caret,
  .topbar-divider {
    display: none;
  }

  .topbar-user {
    padding: 0;
    gap: 0;
  }

  .topbar-user .user-av {
    width: 34px;
    height: 34px;
  }

  .page-content {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: var(--space-4);
  }

  .panel,
  .form-section,
  .pf-section,
  .analytics-card {
    border-radius: var(--radius-md);
  }

  .panel-header,
  .form-section .sec-hd,
  .pf-sec-hd,
  .chart-header,
  .stock-doc-panel-hd,
  .stock-doc-aside-hd,
  .notif-menu-hd {
    padding: 12px 14px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .panel-header>strong,
  .panel-header>.panel-title,
  .panel-header>.aff-sec,
  .form-section .sec-hd>.sec-hd-title,
  .form-section .sec-hd>strong,
  .pf-sec-hd>strong,
  .pf-sec-hd>.panel-title,
  .chart-header>.panel-title,
  .stock-doc-panel-hd>.stock-doc-panel-title,
  .stock-doc-aside-hd>.stock-doc-panel-title,
  .notif-menu-hd>strong {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
  }

  .panel-header>.btn-secondary,
  .panel-header>.btn,
  .panel-header>a.btn-secondary,
  .panel-header>a.btn,
  .panel-header>a.small,
  .panel-header>.ops-result-meta,
  .form-section .sec-hd>.sec-hd-actions,
  .form-section .sec-hd>a,
  .pf-sec-hd>a,
  .chart-header>.chart-header-actions,
  .chart-header>a,
  .stock-doc-panel-hd>a,
  .stock-doc-aside-hd>a,
  .notif-menu-hd>a {
    flex: 0 0 auto;
    margin-left: auto;
    white-space: nowrap;
  }

  .panel-header>.filter-bar,
  .panel-header>.filter-bar-fill,
  .panel-header>form.filter-bar,
  .panel-header>.sort-sel,
  .form-section .sec-hd>.filter-bar,
  .pf-sec-hd>.filter-bar {
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
  }

  .panel-body,
  .form-section .sec-bd,
  .pf-sec-bd {
    padding: 14px;
  }

  .data-table {
    font-size: var(--fs-md);
  }

  .data-table th,
  .data-table td {
    padding: 10px;
  }

  .grid-2,
  .grid-3,
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: var(--space-4);
  }

  .page-back-row {
    width: 100%;
    align-items: flex-start;
  }

  .page-back-copy,
  .page-back-row .page-title,
  .page-header>div:first-child {
    min-width: 0;
    flex: 1 1 auto;
    text-align: left;
  }

  .page-back-row .badge {
    flex-shrink: 0;
  }

  .page-header-actions {
    width: auto;
    flex: 0 1 auto;
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }

  .page-header-actions .btn-primary:not(.btn),
  .page-header-actions .btn-secondary:not(.btn),
  .page-header-actions .btn,
  .page-header-actions a.btn-primary,
  .page-header-actions a.btn-secondary {
    flex: 0 0 auto;
    justify-content: center;
  }

  .page-title {
    font-size: var(--fs-3xl);
    word-break: break-word;
  }

  .page-sub {
    word-break: break-word;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
  }

  .filter-bar .search-wrap,
  .search-wrap-sm,
  .filter-bar .form-select,
  .filter-bar .form-control,
  .filter-bar .filter-sel,
  .filter-bar .form-select-sm,
  .filter-bar .filter-sel-sm,
  .filter-bar .filter-sel-lg {
    min-width: 0;
    max-width: none;
    width: 100%;
    flex: 1 1 100%;
  }

  .filter-bar .btn,
  .filter-bar .filter-reset {
    width: 100%;
  }

  .filter-bar .sort-sel,
  .sort-sel {
    width: 100%;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
    width: 100%;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn-primary:not(.btn),
  .form-actions .btn-secondary:not(.btn),
  .form-actions .btn,
  .form-actions a {
    width: 100%;
    justify-content: center;
  }

  .detail-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .detail-val {
    max-width: 100%;
    width: 100%;
    text-align: left;
  }

  .detail-fields-grid {
    grid-template-columns: 1fr;
  }

  .detail-total-grand .detail-total-amount {
    font-size: var(--fs-2xl);
  }

  .detail-action-form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-action-form-row .detail-action-btn {
    width: 100%;
  }
}

.pf-album-tabs,
.pf-media-axis,
.pf-vtype-chips {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.pf-album-tabs::-webkit-scrollbar,
.pf-media-axis::-webkit-scrollbar,
.pf-vtype-chips::-webkit-scrollbar {
  display: none;
}

.pf-album-tab,
.pf-media-axis-item,
.pf-vtype-chip {
  flex-shrink: 0;
}

.pf-dropzone {
  padding: 20px 14px;
}

.pf-slug-wrap {
  flex-wrap: wrap;
}

.pf-slug-prefix {
  border-right: 0.5px solid var(--border-md);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  width: 100%;
}

.pf-slug-wrap .inp {
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.variant-table {
  min-width: 560px;
}

.integ-sync-stats {
  flex-direction: column;
  align-items: flex-start;
}

.integ-action-row,
.modal-action-grid {
  grid-template-columns: 1fr;
}

.donut-wrap {
  padding: var(--space-4);
}

.chart-wrap {
  height: 220px;
  padding: var(--space-3);
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-wrap-lg {
  height: 300px;
}

.stats-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.dash-panel-hint {
  margin-left: auto;
  font-size: var(--fs-md);
  color: var(--text-2);
  font-weight: 500;
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .stats-grid-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}


.chart-header {
  padding: 12px 14px;
  gap: 8px;
}

.chart-header .panel-title {
  width: auto;
  flex: 1;
  min-width: 0;
}

.chart-metric-sel {
  min-width: 140px;
  max-width: 180px;
}

.donut-canvas-wrap {
  width: 140px;
  height: 140px;
}

.donut-center {
  text-align: center;
}

.donut-pct {
  font-size: var(--fs-5xl);
}

.leg-item {
  gap: 10px;
  align-items: flex-start;
}

.leg-left {
  min-width: 0;
  flex: 1;
  line-height: 1.4;
}

.leg-val {
  flex-shrink: 0;
}

.dashboard-grid {
  gap: var(--space-3);
}

.product-line {
  flex-wrap: wrap;
}

.pl-price {
  margin-left: 0;
  width: 100%;
  text-align: right;
}

.pf-detail-thumbs {
  gap: 6px;
}

.pf-detail-thumb {
  width: 64px;
  height: 64px;
}

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

  .stat-val {
    font-size: var(--fs-4xl);
  }

  .stat-card {
    padding: 14px;
  }

  .topbar {
    padding: 0 10px;
    gap: 6px;
  }

  .topbar-user-name,
  .topbar-user-role,
  .topbar-divider {
    display: none;
  }

  .topbar-search {
    display: none;
  }

  .page-content {
    padding: var(--space-3);
  }

  .page-header-actions .btn-primary:not(.btn),
  .page-header-actions .btn-secondary:not(.btn),
  .page-header-actions .btn,
  .page-header-actions a.btn-primary,
  .page-header-actions a.btn-secondary {
    flex: 0 0 auto;
    min-width: 0;
  }

  .pf-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .pf-sec-title,
  .panel-header strong,
  .form-section .sec-hd {
    font-size: var(--fs-base);
  }

  .empty-state {
    padding: 32px 14px;
  }
}


/* --- brand.css --- */
/* =============================================================================
   Brand + Bootstrap theme bridge (after bootstrap.min.css + app.css tokens)
   Per-app remaps live here; shared chrome stays in app.css.
   ============================================================================= */
:root {
  --brand-accent: var(--af-primary);
  --brand-accent-dark: var(--af-primary-dark);
}

/* --- sister-app utilities --- */
.topbar-spacer { flex: 1; }

/* ---------------------------------------------------------------------------
   Confirm / flash modal (OneG pattern)
   --------------------------------------------------------------------------- */
.confirm-modal .modal-dialog {
  max-width: 400px;
}

.confirm-modal .modal-content {
  position: relative;
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 56px rgba(18, 23, 43, 0.18);
  overflow: hidden;
  text-align: center;
}

.confirm-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
}

.confirm-modal-x:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.confirm-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 28px 8px;
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.55rem;
  margin-bottom: 4px;
}

.confirm-modal-icon.is-danger {
  background: var(--red-50);
  color: var(--af-danger);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--af-danger) 8%, transparent);
}

.confirm-modal-icon.is-primary {
  background: var(--blue-50, #eef2ff);
  color: var(--af-primary);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--af-primary) 8%, transparent);
}

.confirm-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  max-width: 20em;
}

.confirm-modal-message {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 28em;
}

.confirm-modal-message[hidden],
.confirm-modal-hint[hidden] {
  display: none !important;
}

.confirm-modal-hint {
  margin: 0;
  padding: 10px 12px;
  width: 100%;
  border-radius: 10px;
  background: var(--red-50);
  color: #9b1c1f;
  font-size: 0.82rem;
  line-height: 1.45;
}

.confirm-modal.is-primary .confirm-modal-hint {
  background: var(--blue-50, #eef2ff);
  color: var(--af-primary-dark, #2a3eb1);
}

.confirm-modal-footer {
  border-top: 0;
  padding: 16px 24px 24px;
  gap: 10px;
  display: flex;
  justify-content: center;
}

.confirm-modal-btn-cancel,
.confirm-modal-btn-ok {
  min-width: 118px;
  min-height: 42px;
  border-radius: 10px;
  font-weight: 650;
}

.confirm-modal-btn-cancel {
  border: 0.5px solid var(--border-md);
  background: var(--surface);
  color: var(--text-2);
}

.confirm-modal-btn-cancel:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.confirm-modal-btn-ok.is-danger {
  border: none;
  background: var(--af-danger);
  color: #fff;
}

.confirm-modal-btn-ok.is-danger:hover {
  background: var(--red-800, #9b1c1f);
  color: #fff;
}

.confirm-modal-btn-ok.is-primary {
  border: none;
  background: var(--af-primary);
  color: #fff;
}

.confirm-modal-btn-ok.is-primary:hover {
  background: var(--af-primary-dark);
  color: #fff;
}


/* ---------------------------------------------------------------------------
   Admin SaaS polish — CRUD forms, metrics, connect cards
   --------------------------------------------------------------------------- */
:root {
  --surface-2: var(--surface-soft, #f1f4f9);
  --primary: var(--af-primary);
  --muted: var(--text-2);
}

.page-content code:not([class]),
.data-table code:not([class]) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text);
  background: var(--surface-soft);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}

.product-sku-code {
  background: var(--surface-soft);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
}

.table.data-table {
  margin-bottom: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

.table.data-table > :not(caption) > * > * {
  background: transparent;
  box-shadow: none;
  border-bottom-width: 0.5px;
  border-bottom-color: var(--border);
}

.panel-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  min-height: 1.5rem;
  padding: 0 10px;
  font-size: var(--fs-base);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--af-primary);
  border: 0;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--af-primary) 35%, transparent);
}

.report-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.report-meter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.report-meter-track {
  display: block;
  flex: 1;
  max-width: 92px;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-muted);
  overflow: hidden;
}

.report-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--af-primary);
}

.report-meter-fill-teal {
  background: var(--af-teal);
}

.sla-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 16px;
}

.sla-form-grid .field {
  margin-bottom: 0;
}

.sla-form-grid .field-checks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  min-height: auto;
  padding-top: 4px;
}

.sla-form-grid .field-checks .form-check {
  margin: 0;
  min-height: auto;
  padding-left: 1.6em;
}

.sla-form .form-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border);
}

.crud-form .grid-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
}

.crud-form .field {
  margin-bottom: 0;
}

.crud-form .field-span-2 {
  grid-column: span 2;
}

.crud-form .field-span-3 {
  grid-column: span 3;
}

.crud-form .field-span-all {
  grid-column: 1 / -1;
}

.variant-builder {
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-tint, #fafbff);
}

.variant-builder-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.variant-builder-hd strong {
  font-size: var(--fs-base);
  font-weight: 650;
}

.variant-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variant-presets .chip {
  cursor: pointer;
  border: 0.5px solid color-mix(in srgb, var(--af-primary) 28%, var(--border));
  background: var(--surface);
  color: var(--af-primary-dark);
}

.variant-opt-row {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.variant-builder-meta {
  font-size: var(--fs-sm);
  color: var(--text-2);
  margin: 8px 0 10px;
  font-weight: 600;
}

.variant-preview th,
.variant-preview td {
  padding: 6px 8px;
  vertical-align: middle;
}

.variant-preview .form-control-sm {
  min-height: 32px;
  padding: 4px 8px;
}

.return-form .grid-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.return-form .field-span-3 {
  grid-column: 1 / -1;
}

.crud-form .field-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  min-height: 38px;
  padding-top: 26px;
}

.crud-form .field-checks .form-check {
  margin: 0;
  min-height: auto;
  padding-left: 1.6em;
}

.crud-form .form-actions {
  margin-top: 4px;
  padding-top: var(--space-2);
  border-top: 0.5px solid var(--border);
  align-items: center;
}

.crud-form .form-mode {
  font-size: var(--fs-sm);
  color: var(--text-3);
  margin-right: auto;
}

.metric-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
}

.metric-row-lbl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: var(--fs-md);
  font-weight: 500;
}

.metric-row-lbl .ti {
  font-size: 16px;
  color: var(--text-3);
}

.metric-row-val {
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1;
  color: var(--text);
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.connect-hint {
  font-size: var(--fs-md);
  color: var(--text-2);
  margin: 0 0 var(--space-4);
  line-height: 1.45;
}

.connect-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.connect-fields > input[type="hidden"] {
  display: none;
}

.connect-fields > .field,
.connect-fields > div {
  margin-bottom: 0;
}

.connect-fields .form-label {
  margin-bottom: 8px;
}

.connect-fields .form-check {
  margin: 4px 0 0;
  min-height: auto;
}

.connect-fields .form-actions {
  margin-top: 4px;
}

.connect-card .connect-fields {
  margin-bottom: var(--space-4);
}

.connect-card .connect-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: var(--space-3);
  border-top: 0.5px solid var(--border);
}

.connect-card .connect-meta {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.connect-card .panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.partner-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.partner-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.partner-logo-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  padding: 3px;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 240px;
}

.user-actions .action-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.user-actions .action-row .form-control,
.user-actions .action-row .form-select {
  min-width: 0;
  flex: 1;
}

.td-main {
  font-weight: 600;
  color: var(--text);
}

.td-sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
}

@media (max-width: 1024px) {
  .crud-form .grid-form,
  .sla-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connect-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .crud-form .grid-form,
  .sla-form-grid {
    grid-template-columns: 1fr;
  }

  .crud-form .field-span-2,
  .crud-form .field-span-3 {
    grid-column: auto;
  }

  .crud-form .field-checks {
    padding-top: 4px;
  }
}


/* ---------------------------------------------------------------------------
   Merchant marketplace channel cards
   --------------------------------------------------------------------------- */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.channel-card .channel-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: var(--space-3);
}

.channel-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-lg);
  flex-shrink: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  padding: 4px;
}

.channel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.channel-logo-shopee { background: #fff1e8; color: #ee4d2d; }
.channel-logo-lazada { background: #eef2ff; color: #0f1a8a; }
.channel-logo-tiktok { background: #f1f5f9; color: #111827; }

.channel-card .channel-name {
  font-weight: 600;
  font-size: var(--fs-xl);
  line-height: 1.2;
}

.channel-card .channel-hint {
  font-size: var(--fs-md);
  color: var(--text-2);
  line-height: 1.45;
  margin: 0 0 var(--space-4);
  min-height: 2.6em;
}

.money-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.entity-form-modal-dialog {
  max-width: 640px;
}

.entity-form-sheet {
  border: 0.5px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 56px rgba(18, 23, 43, 0.18);
  overflow: hidden;
}

.entity-form-modal-dialog.modal-lg {
  max-width: 760px;
}

.entity-form-modal .modal-header {
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
  border-bottom: 0.5px solid var(--border);
}

.entity-form-modal .modal-title {
  font-size: var(--fs-lg);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.entity-form-modal .modal-sub,
.modal-header .modal-sub {
  margin: 4px 0 0;
  font-size: var(--fs-md);
  color: var(--text-3);
}

.entity-form-modal .modal-body {
  padding: 16px 20px;
}

.entity-form-modal .modal-footer {
  gap: 8px;
  padding: 12px 20px 16px;
  border-top: 0.5px solid var(--border);
}

.entity-form-modal .form-actions,
.entity-form-modal [data-form-mode] {
  display: none;
}

.entity-form-modal .field-checks {
  padding-top: 8px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft);
  border: 0.5px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-2);
  line-height: 1.4;
  text-decoration: none;
}

a.chip:hover {
  color: var(--text-1);
  background: var(--surface);
}

.chip-active {
  background: var(--brand-soft, var(--surface));
  border-color: var(--brand, var(--border));
  color: var(--text-1);
  font-weight: 600;
}

.chip-count {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.chip-muted {
  color: var(--text-3);
}

.td-chips {
  max-width: 240px;
}

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

.sla-clocks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.sla-clock-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 10px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sla-clock-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sla-clock-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--text-2);
  flex-shrink: 0;
}

.sla-clock-icon .ti {
  font-size: 18px;
}

.sla-clock-title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
}

.sla-clock-total {
  margin-top: 2px;
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.sla-clock-bar {
  display: flex;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--surface-soft);
  gap: 2px;
}

.sla-clock-seg {
  display: block;
  height: 100%;
  border-radius: 99px;
}

.sla-clock-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sla-clock-list li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 0.5px solid var(--border);
}

.sla-clock-list li:first-child {
  border-top: 0;
}

.sla-clock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.sla-clock-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.sla-clock-count {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: var(--fs-md);
  line-height: 1;
}

.sla-clock-empty {
  font-size: var(--fs-sm);
  color: var(--text-3);
  padding: 4px 0 8px;
}

.sla-clock-seg.sla-tone-danger,
.sla-clock-dot.sla-tone-danger { background: var(--af-danger); }
.sla-clock-seg.sla-tone-warn,
.sla-clock-dot.sla-tone-warn { background: var(--af-amber); }
.sla-clock-seg.sla-tone-ok,
.sla-clock-dot.sla-tone-ok { background: var(--af-teal); }
.sla-clock-seg.sla-tone-late,
.sla-clock-dot.sla-tone-late { background: #fb923c; }
.sla-clock-seg.sla-tone-muted,
.sla-clock-dot.sla-tone-muted { background: #cbd5e1; }

.sla-clock-count.sla-tone-danger { color: var(--af-danger); }
.sla-clock-count.sla-tone-warn { color: var(--amber-800); }
.sla-clock-count.sla-tone-ok { color: var(--af-teal); }
.sla-clock-count.sla-tone-late { color: #c2410c; }
.sla-clock-count.sla-tone-muted { color: var(--text-3); }

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.sort-link:hover {
  color: var(--af-primary);
}

.sort-link .ti {
  font-size: 14px;
  opacity: 0.4;
}

.sort-link.is-active .ti {
  opacity: 1;
  color: var(--af-primary);
}

.scan-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.scan-mark-lg {
  margin-top: 8px;
  gap: 10px;
}

.scan-mark-bc {
  height: 28px;
  width: auto;
  max-width: 160px;
  background: #fff;
  border-radius: 2px;
}

.scan-mark-lg .scan-mark-bc {
  height: 48px;
  max-width: 220px;
}

.scan-mark-qr {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 4px;
}

.scan-mark-print {
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.scan-mark-print:hover {
  color: var(--af-primary);
  background: var(--af-primary-soft, rgba(37, 99, 235, .08));
}

@media print {
  .scan-mark-print { display: none; }
}


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

.search-suggest-host {
  position: relative;
}

.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 80;
  background: var(--surface);
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 320px;
  overflow: auto;
  padding: 4px;
}

.topbar-search .search-suggest {
  min-width: min(420px, 72vw);
}

.search-suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: var(--fs-base);
  cursor: pointer;
}

.search-suggest-item.is-active,
.search-suggest-item:hover {
  background: var(--blue-50);
}

.search-suggest-item .ss-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.search-suggest-item .ss-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-item .ss-sub {
  font-size: var(--fs-sm);
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggest-item .ss-kind {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-3);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 2px;
}

.search-suggest-empty {
  padding: 12px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  text-align: center;
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-4);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 0.5px solid transparent;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.status-chip strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.status-chip:hover {
  filter: brightness(0.97);
  color: inherit;
}

.status-chip.is-active {
  box-shadow: 0 0 0 2px currentColor;
  font-weight: 600;
}

.status-chip.sc-muted {
  background: var(--gray-50);
  color: var(--gray-800);
}

.status-chip.sc-info {
  background: var(--blue-50);
  color: var(--blue-800);
}

.status-chip.sc-warning {
  background: var(--amber-50);
  color: var(--amber-800);
}

.status-chip.sc-purple {
  background: var(--purple-50);
  color: var(--purple-800);
}

.status-chip.sc-teal {
  background: var(--teal-50);
  color: var(--teal-800);
}

.status-chip.sc-success {
  background: var(--green-50);
  color: var(--green-800);
}

.status-chip.sc-danger {
  background: var(--red-50);
  color: var(--red-800);
}

.dr-field {
  flex: 0 0 auto;
}

.filter-bar .dr-trigger {
  height: var(--filter-h);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-base);
  font-family: var(--font);
  white-space: nowrap;
  max-width: 260px;
  cursor: pointer;
}

.filter-bar .dr-trigger .ti-calendar {
  color: var(--text-3);
  font-size: 16px;
}

.filter-bar .dr-trigger .dr-caret {
  color: var(--text-3);
  font-size: 14px;
  margin-left: 2px;
}

.filter-bar .dr-trigger .dr-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-bar .dr-trigger:hover,
.filter-bar .dr-trigger.is-open {
  border-color: var(--af-primary);
}

.filter-bar .dr-trigger.is-active {
  border-color: var(--af-primary);
  color: var(--af-primary-dark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--af-primary) 16%, transparent);
}

.filter-bar .dr-trigger.is-active .ti-calendar {
  color: var(--af-primary);
}

.dr-popover {
  position: fixed;
  z-index: 240;
  width: min(760px, calc(100vw - 16px));
  background: var(--surface);
  border: 0.5px solid var(--border-md);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.dr-body {
  display: flex;
  min-height: 360px;
}

.dr-presets {
  width: 168px;
  flex-shrink: 0;
  padding: 12px 8px;
  background: var(--gray-50);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dr-presets-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 6px 10px 8px;
}

.dr-preset {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: var(--fs-sm);
  font-family: var(--font);
  cursor: pointer;
}

.dr-preset:hover {
  background: var(--surface);
}

.dr-preset.is-active {
  background: var(--blue-50);
  color: var(--af-primary-dark);
  font-weight: 600;
}

.dr-main {
  position: relative;
  flex: 1;
  padding: 16px 18px 8px;
  min-width: 0;
}

.dr-inputs {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.dr-input {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0.5px solid var(--border-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
}

.dr-arrow {
  color: var(--text-3);
}

.dr-cal-nav {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 62px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.dr-nav {
  pointer-events: auto;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dr-nav:hover {
  background: var(--gray-50);
  color: var(--text);
}

.dr-months {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dr-month-title {
  text-align: center;
  font-weight: 600;
  font-size: var(--fs-base);
  margin-bottom: 10px;
}

.dr-weekdays,
.dr-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.dr-weekdays span {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 0 8px;
}

.dr-day {
  height: 34px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-size: var(--fs-sm);
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
}

.dr-day.is-empty {
  pointer-events: none;
}

.dr-day:hover:not(.is-start):not(.is-end):not(.is-single) {
  background: var(--gray-50);
}

.dr-day.is-in {
  background: var(--blue-50);
  border-radius: 0;
}

.dr-day.is-start,
.dr-day.is-end,
.dr-day.is-single {
  background: var(--af-primary);
  color: #fff;
  font-weight: 600;
}

.dr-day.is-start.is-in:not(.is-single) {
  border-radius: 999px 0 0 999px;
}

.dr-day.is-end.is-in:not(.is-single) {
  border-radius: 0 999px 999px 0;
}

.dr-day.is-today:not(.is-start):not(.is-end):not(.is-single) {
  font-weight: 700;
  color: var(--af-primary);
}

.dr-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px 14px;
  border-top: 0.5px solid var(--border);
}

@media (max-width: 767px) {
  .filter-bar .dr-field,
  .filter-bar .dr-trigger {
    width: 100%;
    max-width: none;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  .dr-body {
    flex-direction: column;
    min-height: 0;
  }

  .dr-presets {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 0.5px solid var(--border);
  }

  .dr-months {
    grid-template-columns: 1fr;
  }
}

.link-order {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.link-order:hover {
  color: var(--af-primary);
  text-decoration: underline;
}

.kv {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.kv dt {
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 500;
}

.kv dd {
  margin: 0;
  word-break: break-word;
}

.od-totals {
  padding: 12px var(--space-5) 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 0.5px solid var(--border);
  background: var(--surface-soft);
}

.od-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.od-totals .od-total {
  font-size: var(--fs-base);
  color: var(--text);
  padding-top: 6px;
  border-top: 0.5px dashed var(--border);
}

.od-ship + .od-ship {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 0.5px solid var(--border);
}

.od-ship-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.od-timeline {
  list-style: none;
  margin: 16px 0 0;
  padding: 0 0 0 4px;
  border-left: 2px solid var(--border);
}

.od-timeline li {
  position: relative;
  padding: 0 0 14px 16px;
}

.od-timeline li:last-child {
  padding-bottom: 0;
}

.od-timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-md);
}

.od-timeline li.is-current::before {
  background: var(--af-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--af-primary) 20%, transparent);
}

.od-tl-label {
  font-weight: 600;
  font-size: var(--fs-sm);
}

.od-tl-time {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

tr.is-stock-short td {
  background: color-mix(in srgb, var(--af-danger) 6%, transparent);
}
