:root {
  --aff-navy: #0f1c33;
  --aff-navy-mid: #1a2d4d;
  --aff-accent: #1a6cff;
  --aff-accent-soft: #e8f0ff;
  --aff-surface: #f3f5f9;
  --aff-card: #ffffff;
  --aff-border: #e2e8f2;
  --aff-muted: #6b7a94;
  --aff-text: #152033;
  --aff-success: #0f9f6e;
  --aff-warning: #d97706;
  --aff-danger: #dc2626;
  --aff-radius: 14px;
  --aff-shadow: 0 1px 2px rgba(15, 28, 51, .04), 0 8px 24px rgba(15, 28, 51, .06);
  --aff-font: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--aff-font);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dbe7ff 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #e8eef8 0%, transparent 50%),
    var(--aff-surface);
  color: var(--aff-text);
  min-height: 100vh;
}

a { color: var(--aff-accent); text-decoration: none; }
a:hover { color: #0d4fd6; }

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--aff-border);
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  z-index: 1030;
  gap: .75rem;
  flex: 0 0 60px;
  align-items: center !important;
  flex-wrap: nowrap !important;
}


.topbar-left,
.topbar-actions {
  display: flex;
  align-items: center;
  min-height: 0;
}

.topbar-left { min-width: 0; }
.topbar-actions { gap: .5rem !important; }

.topbar-actions .dropdown > .btn {
  height: 36px;
  padding: .35rem .75rem;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 13px;
}

.topbar-actions .dropdown-menu {
  min-width: 11.5rem;
  padding: .35rem;
  border-radius: 12px;
  font-size: 13px;
}

.topbar-actions .dropdown-item {
  font-size: 13px;
  line-height: 1.25;
  padding: .4rem .65rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: .15rem;
}

.topbar-actions .dropdown-item i {
  font-size: 12px;
  width: 1.1rem;
  text-align: center;
  opacity: .85;
}

.topbar-actions .dropdown-divider {
  margin: .3rem .35rem;
}

.sidebar-head {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .85rem;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  flex: 0 0 60px;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  flex: 1 1 auto;
  color: #fff;
  line-height: 1.15;
}

.sidebar-brand-logo,
.brand-mark .logo {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a6cff, #0f9f6e);
  color: #fff;
  flex: 0 0 32px !important;
  font-size: 13px;
  line-height: 1;
  overflow: hidden;
}

.sidebar-brand-logo i,
.brand-mark .logo i,
.sidebar-toggle i,
.notif-bell i {
  width: 1em;
  height: 1em;
  line-height: 1;
  display: inline-block;
  flex: none;
}

.sidebar-brand-logo svg,
.brand-mark .logo svg,
.sidebar-toggle svg,
.notif-bell svg {
  width: 1em !important;
  height: 1em !important;
  max-width: 1em;
  max-height: 1em;
  vertical-align: -0.125em;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.15;
  white-space: nowrap;
}

.sidebar-brand-text .sub {
  font-size: 11px;
  font-weight: 500;
  color: #8fa3c1;
  letter-spacing: 0;
}

@media (min-width: 992px) {
  .app-topbar .brand-mark { display: none; }
}

.sidebar-toggle {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dbe7ff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .12);
  flex: 0 0 32px;
  margin-left: auto;
  line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.sidebar-toggle:hover {
  background: var(--aff-accent);
  color: #fff;
  border-color: transparent;
}

.sidebar-toggle [data-sidebar-icon] {
  font-size: 14px;
  line-height: 1;
}

.nav-section { position: relative; margin-bottom: .15rem; }
.nav-section-trigger {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #b7c4da;
  padding: 0;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.nav-section-trigger:hover,
.nav-section:hover > .nav-section-trigger {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.top-mega-nav {
  display: flex;
  align-items: center;
  height: 36px;
  gap: .35rem;
  margin-left: 0;
  margin-right: .15rem;
}

.mega-root { position: relative; }

.mega-panel-end {
  left: auto !important;
  right: 0;
}

.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 0;
  background: transparent;
  color: var(--aff-text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: .45rem .85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.mega-trigger:hover,
.mega-trigger[aria-expanded="true"],
.mega-trigger.active {
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
}

.mega-caret {
  font-size: 10px;
  opacity: .65;
  transition: transform .18s ease;
}

.mega-trigger[aria-expanded="true"] .mega-caret {
  transform: rotate(180deg);
}

.mega-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 640px;
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 28, 51, .14);
  padding: 1rem;
  z-index: 1050;
  animation: megaIn .16s ease;
}

.mega-panel-sm { min-width: 520px; }

.mega-panel[hidden] { display: none !important; }

@keyframes megaIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mega-panel-inner {
  display: grid;
  gap: .75rem 1rem;
}

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

/* —— Notifications bell —— */
.notif-root { position: relative; }

.notif-bell {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--aff-border);
  background: #fff;
  color: var(--aff-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex: 0 0 36px;
  align-self: center;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.notif-bell:hover,
.notif-bell[aria-expanded="true"] {
  background: var(--aff-accent-soft);
  border-color: #c9dbff;
  color: var(--aff-accent);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--aff-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 1.5rem));
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 28, 51, .14);
  z-index: 1050;
  overflow: hidden;
  animation: megaIn .16s ease;
}

.notif-panel[hidden] { display: none !important; }

.notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--aff-border);
}

.notif-panel-body {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef2f8;
  color: var(--aff-text);
  transition: background .12s ease;
}

.notif-item:hover { background: #f7f9fc; color: var(--aff-text); }

.notif-item.is-unread { background: #f3f7ff; }

.notif-item-title {
  font-size: 13.5px;
  font-weight: 650;
  margin-bottom: 2px;
}

.notif-item-body {
  font-size: 12.5px;
  color: var(--aff-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-meta {
  font-size: 11.5px;
  color: #93a0b5;
  margin-top: 4px;
}

.notif-panel-foot {
  display: block;
  text-align: center;
  padding: .75rem;
  font-size: 13px;
  font-weight: 600;
  border-top: 1px solid var(--aff-border);
  background: #fafbfd;
}

.notif-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.notif-row-unread { background: linear-gradient(90deg, #f3f7ff, transparent); }

.perm-check {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .7rem .8rem;
  border: 1px solid var(--aff-border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  height: 100%;
  transition: border-color .15s ease, background .15s ease;
}

.perm-check:hover { border-color: #c9dbff; background: #f7f9ff; }

.perm-check input { margin-top: .2rem; flex-shrink: 0; }

.perm-check strong { font-size: 13.5px; font-weight: 650; }

.nav-pills .nav-link.active {
  background: var(--aff-accent);
}

/* —— Leads list + Kanban pipeline —— */
.view-toggle .btn { min-width: 110px; }

a.lead-stat.kpi-card {
  display: block;
  color: inherit;
  height: 100%;
}
a.lead-stat.kpi-card:hover { color: inherit; }
a.lead-stat.is-active {
  box-shadow: 0 0 0 3px rgba(26, 108, 255, .18), var(--aff-shadow);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 1rem;
  align-items: start;
  overflow-x: auto;
  padding-bottom: .5rem;
}

.kanban-col {
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--aff-border);
  border-radius: 16px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--aff-shadow);
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--aff-border);
  border-radius: 16px 16px 0 0;
}

.kanban-col-new .kanban-col-head { background: linear-gradient(180deg, #eef3ff, #fff); }
.kanban-col-contacted .kanban-col-head { background: linear-gradient(180deg, #fff8e8, #fff); }
.kanban-col-won .kanban-col-head { background: linear-gradient(180deg, #eafaf1, #fff); }
.kanban-col-lost .kanban-col-head { background: linear-gradient(180deg, #feeeee, #fff); }

.kanban-col-title { font-weight: 700; font-size: 14px; }
.kanban-col-hint { font-size: 11.5px; color: var(--aff-muted); margin-top: 2px; }

.kanban-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--aff-text);
  font-size: 12.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.kanban-col-body {
  flex: 1;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 280px;
  transition: background .15s ease;
}

.kanban-col-body.is-over {
  background: #f3f7ff;
  outline: 2px dashed #9db7ff;
  outline-offset: -6px;
  border-radius: 12px;
}

.kanban-card {
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: 12px;
  padding: .75rem .85rem;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(15, 28, 51, .04);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}

.kanban-card:hover {
  border-color: #c9dbff;
  box-shadow: 0 8px 20px rgba(15, 28, 51, .08);
  transform: translateY(-1px);
}

.kanban-card.is-dragging {
  opacity: .55;
  cursor: grabbing;
}

.kanban-card-title {
  font-weight: 650;
  font-size: 13.5px;
  margin-bottom: .25rem;
}

.kanban-card-meta {
  font-size: 12px;
  color: var(--aff-muted);
  margin-top: 2px;
}

.kanban-card-tag {
  display: inline-block;
  margin-top: .45rem;
  padding: .15rem .45rem;
  border-radius: 6px;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
  font-size: 11.5px;
  font-weight: 600;
}

.kanban-card-foot {
  display: flex;
  justify-content: space-between;
  margin-top: .55rem;
  padding-top: .45rem;
  border-top: 1px dashed #e8edf5;
  font-size: 11.5px;
  color: #93a0b5;
}

@media (max-width: 991.98px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(240px, 1fr));
  }
}

.mega-col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--aff-muted);
  padding: .15rem .35rem .45rem;
}

.mega-link {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .65rem .7rem;
  border-radius: 12px;
  color: var(--aff-text);
  transition: background .15s ease, transform .15s ease;
}

.mega-link i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
  flex-shrink: 0;
  margin-top: 1px;
}

.mega-link strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
}

.mega-link small {
  display: block;
  color: var(--aff-muted);
  font-size: 12px;
  margin-top: 2px;
}

.mega-link:hover {
  background: #f5f8ff;
  color: var(--aff-text);
  transform: translateY(-1px);
}

.mega-link.active {
  background: linear-gradient(135deg, #edf3ff, #e8f0ff);
  box-shadow: inset 0 0 0 1px #c9dbff;
}

.mega-link.active i {
  background: var(--aff-accent);
  color: #fff;
}

.mega-backdrop {
  position: fixed;
  inset: 0;
  /* Dưới topbar (1030) để không che mega panel */
  z-index: 1020;
  background: transparent;
}

@media (max-width: 1199.98px) {
  .mega-panel { min-width: 520px; }
  .mega-panel-sm { min-width: 420px; }
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-weight: 700;
  color: var(--aff-navy);
  letter-spacing: -.01em;
}

.brand-mark .logo {
  border-radius: 10px;
  background: linear-gradient(145deg, #1a6cff, #0b3f9c);
  box-shadow: 0 6px 16px rgba(26,108,255,.35);
}

.brand-mark .sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--aff-muted);
  letter-spacing: .02em;
}

.sidebar {
  background: linear-gradient(180deg, var(--aff-navy) 0%, #0b1528 100%);
  position: sticky;
  top: 0;
  width: 260px;
  flex: 0 0 260px;
  max-width: 260px;
  height: 100vh;
  max-height: 100vh;
  overflow: visible;
  padding: 0 !important;
  border-right: 1px solid rgba(255,255,255,.04);
  transition: width .2s ease, flex-basis .2s ease, max-width .2s ease;
  display: flex;
  flex-direction: column;
  z-index: 1040;
}

.sidebar-scroll {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem .85rem 2rem;
}

.sidebar .nav-link {
  color: #b7c4da;
  border-radius: 10px;
  padding: .55rem .8rem;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.sidebar .nav-link i { opacity: .85; flex: 0 0 auto; }

@media (min-width: 992px) {
  .sidebar {
    transform: none !important;
    pointer-events: auto !important;
  }
  .sidebar-backdrop { display: none !important; }

  html.sidebar-collapsed .sidebar {
    width: 76px;
    flex: 0 0 76px;
    max-width: 76px;
  }
  html.sidebar-collapsed .sidebar-head {
    justify-content: center;
    padding: 0 .45rem;
    gap: .35rem;
  }
  html.sidebar-collapsed .sidebar-brand { display: none; }
  html.sidebar-collapsed .sidebar-toggle { margin-left: 0; }
  html.sidebar-collapsed .sidebar-scroll {
    padding-left: .55rem;
    padding-right: .55rem;
    overflow: visible;
  }
  html.sidebar-collapsed .nav-section-trigger { display: inline-flex; }
  html.sidebar-collapsed .nav-section:has(.nav-link.active) > .nav-section-trigger {
    color: #fff;
    background: rgba(26, 108, 255, .28);
    box-shadow: inset 0 0 0 1px rgba(26, 108, 255, .45);
  }
  html.sidebar-collapsed .nav-section-panel {
    display: none;
    position: absolute;
    left: calc(100% + 10px);
    top: 0;
    min-width: 230px;
    padding: .55rem .45rem .55rem;
    border-radius: 12px;
    background: linear-gradient(180deg, #152744 0%, #0f1c33 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    z-index: 60;
  }
  html.sidebar-collapsed .nav-section-panel::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 12px;
  }
  html.sidebar-collapsed .nav-section:hover > .nav-section-panel,
  html.sidebar-collapsed .nav-section:focus-within > .nav-section-panel {
    display: block;
  }
  html.sidebar-collapsed .nav-section-panel .nav-group {
    display: block;
    margin: 0 .35rem .45rem;
    padding: .15rem .35rem .45rem;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    color: #8fa3c1;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 11px;
  }
  html.sidebar-collapsed .nav-section-panel .nav-link {
    justify-content: flex-start;
    padding: .55rem .7rem;
    font-size: 13.5px;
    gap: 0;
  }
  html.sidebar-collapsed .nav-section-panel .nav-link i {
    font-size: 13px;
    margin-right: .5rem !important;
    width: 1.15em;
  }
  html.sidebar-collapsed .nav-section-panel .nav-link .badge,
  html.sidebar-collapsed .nav-section-panel .nav-link .ms-auto { display: inline-flex !important; }
  html.sidebar-collapsed .sidebar-toggle {
    background: var(--aff-accent);
    color: #fff;
    border-color: transparent;
  }
}

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

.sidebar .nav-link.active {
  background: linear-gradient(135deg, #1a6cff, #1558d6);
  color: #fff;
  box-shadow: 0 8px 18px rgba(26,108,255,.28);
}

.nav-group {
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #7f91b0;
  padding: 1.1rem .8rem .35rem;
  font-weight: 700;
  text-transform: uppercase;
}

.main-wrap { padding: 1.5rem 1.75rem 2.5rem; }

.page-crumb {
  font-size: 12.5px;
  color: var(--aff-muted);
  margin-bottom: .35rem;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 1.25rem;
  color: var(--aff-navy);
}

.card, .aff-card {
  background: var(--aff-card);
  border: 1px solid var(--aff-border);
  border-radius: var(--aff-radius);
  box-shadow: var(--aff-shadow);
}

.kpi-card {
  position: relative;
  overflow: hidden;
  padding: 1.05rem 1.15rem;
  border: 0;
  background: linear-gradient(160deg, #f8fbff 0%, #eef4ff 100%);
  transition: transform .18s ease, box-shadow .18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15,28,51,.1);
}

.kpi-card .kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}

.kpi-card .kpi-body { min-width: 0; flex: 1; }

.kpi-card .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: rgba(255,255,255,.72);
  color: var(--aff-accent);
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(15,28,51,.06);
}

.kpi-card .kpi-label {
  font-size: 12.5px;
  color: var(--aff-muted);
  font-weight: 600;
  margin-bottom: .2rem;
}

.kpi-card .kpi-value {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--aff-navy);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.kpi-card .kpi-value.kpi-value-sm {
  font-size: 1.15rem;
  letter-spacing: -.01em;
}

.kpi-card .kpi-hint {
  font-size: 11.5px;
  color: var(--aff-muted);
  margin-top: .35rem;
}

.kpi-card.kpi-blue {
  background: linear-gradient(160deg, #f4f8ff 0%, #dbe8ff 100%);
}
.kpi-card.kpi-blue .kpi-icon { color: #1a6cff; background: #fff; }

.kpi-card.kpi-amber {
  background: linear-gradient(160deg, #fffbeb 0%, #fde68a 100%);
}
.kpi-card.kpi-amber .kpi-icon { color: #d97706; background: #fff; }
.kpi-card.kpi-amber .kpi-value { color: #92400e; }

.kpi-card.kpi-green {
  background: linear-gradient(160deg, #f0fdf6 0%, #bbf7d0 100%);
}
.kpi-card.kpi-green .kpi-icon { color: #0f9f6e; background: #fff; }
.kpi-card.kpi-green .kpi-value { color: #166534; }

.kpi-card.kpi-indigo {
  background: linear-gradient(160deg, #f5f3ff 0%, #ddd6fe 100%);
}
.kpi-card.kpi-indigo .kpi-icon { color: #4f46e5; background: #fff; }
.kpi-card.kpi-indigo .kpi-value { color: #3730a3; }

.kpi-card.kpi-rose {
  background: linear-gradient(160deg, #fff1f2 0%, #fecdd3 100%);
}
.kpi-card.kpi-rose .kpi-icon { color: #e11d48; background: #fff; }
.kpi-card.kpi-rose .kpi-value { color: #9f1239; }

.kpi-card.kpi-cyan {
  background: linear-gradient(160deg, #ecfeff 0%, #a5f3fc 100%);
}
.kpi-card.kpi-cyan .kpi-icon { color: #0891b2; background: #fff; }
.kpi-card.kpi-cyan .kpi-value { color: #155e75; }

.kpi-card.kpi-slate {
  background: linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
}
.kpi-card.kpi-slate .kpi-icon { color: #475569; background: #fff; }

/* Unified button / action link size + icons */
.main-wrap .btn,
.auth-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  min-height: 34px;
  padding: .4rem .85rem;
  border-radius: 10px;
}

.main-wrap .btn.btn-sm,
.auth-card .btn.btn-sm {
  min-height: 34px;
  padding: .4rem .85rem;
  font-size: 13px;
}

.main-wrap .btn > i,
.auth-card .btn > i {
  width: 1em;
  text-align: center;
  font-size: .95em;
  line-height: 1;
  margin: 0 !important;
}

.main-wrap .btn.w-100 { width: 100%; }

.table {
  --bs-table-hover-bg: #f7f9fc;
  margin-bottom: 0;
}

.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--aff-muted);
  font-weight: 600;
  border-bottom-width: 1px;
  background: #f8fafc !important;
  white-space: nowrap;
}

.table td {
  font-size: 14px;
  vertical-align: middle;
  border-color: #eef2f7;
}

.btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
  padding: .45rem .9rem;
}

.btn-primary {
  background: linear-gradient(135deg, #1a6cff, #1557d4);
  border: none;
  box-shadow: 0 6px 14px rgba(26,108,255,.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1557d4, #0f4ab8);
}

.btn-outline-secondary {
  border-color: var(--aff-border);
  color: var(--aff-navy-mid);
}

.form-control, .form-select {
  border-radius: 10px;
  border-color: var(--aff-border);
  font-size: 14px;
  line-height: 1.5;
  min-height: 40px;
  padding: .55rem .8rem;
}

.form-control:focus, .form-select:focus {
  border-color: #8bb4ff;
  box-shadow: 0 0 0 .2rem rgba(26,108,255,.15);
}

.input-group-text {
  border-radius: 10px;
  border-color: var(--aff-border);
  background: #f8fafc;
  color: var(--aff-muted);
}

.badge-soft {
  font-weight: 600;
  font-size: 11.5px;
  padding: .35em .65em;
  border-radius: 999px;
}

.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }
.badge-soft-info { background: #e0e7ff; color: #3730a3; }
.badge-soft-muted { background: #eef2f7; color: #475569; }

.filter-bar {
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: var(--aff-radius);
  padding: .85rem 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--aff-shadow);
}

/* One-row filter toolbar */
.filter-bar > form.row {
  --bs-gutter-x: .5rem;
  --bs-gutter-y: .5rem;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  margin-left: 0;
  margin-right: 0;
}
.filter-bar > form.row > [class*="col"],
.filter-bar > form.row > .filter-date {
  flex: 1 1 0;
  width: auto !important;
  max-width: none !important;
  min-width: 0;
  padding-left: calc(var(--bs-gutter-x) * .5);
  padding-right: calc(var(--bs-gutter-x) * .5);
}
.filter-bar > form.row > .col-auto,
.filter-bar > form.row > [class*="col"]:has(> .btn),
.filter-bar > form.row > [class*="col"]:has(> a.btn),
.filter-bar > form.row > [class*="col"].d-flex,
.filter-bar > form.row > .filter-actions {
  flex: 0 0 auto !important;
  width: auto !important;
}
.filter-bar > form.row > .filter-date,
.filter-bar > form.row > [class*="col"]:has(> input[type="date"]) {
  flex: 0 1 148px !important;
  max-width: 168px !important;
}
.filter-bar > form.row > .filter-date:has(> input[type="date"]) {
  flex: 0 1 148px !important;
}
.filter-bar .form-label {
  display: block;
  margin-bottom: .2rem;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}

/* Filter actions match input / select height */
.filter-bar .form-control,
.filter-bar .form-select,
.filter-bar .input-group {
  min-height: 40px;
  height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}
.filter-bar .input-group .form-control,
.filter-bar .input-group .input-group-text {
  height: 40px;
  min-height: 40px;
}
.filter-bar textarea.form-control {
  height: auto;
  min-height: 80px;
  padding: .55rem .8rem;
}
.filter-bar .btn,
.filter-bar .btn.btn-sm,
.main-wrap .filter-bar .btn,
.main-wrap .filter-bar .btn.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  white-space: nowrap;
  min-height: 40px;
  height: 40px;
  padding: 0 .95rem;
  font-size: 14px;
  line-height: 1.2;
  border-radius: 10px;
}
.filter-bar .btn.w-100 { width: auto; }

@media (max-width: 991.98px) {
  .filter-bar > form.row {
    flex-wrap: wrap;
  }
  .filter-bar > form.row > [class*="col"] {
    flex: 1 1 140px;
  }
  .filter-bar > form.row > .filter-date,
  .filter-bar > form.row > [class*="col"]:has(> input[type="date"]) {
    flex: 1 1 140px;
    max-width: none !important;
  }
  .filter-bar > form.row > .col-auto,
  .filter-bar > form.row > [class*="col"]:has(> .btn),
  .filter-bar > form.row > [class*="col"].d-flex,
  .filter-bar > form.row > .filter-actions {
    flex: 1 1 auto !important;
  }
}

.panel {
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: var(--aff-radius);
  box-shadow: var(--aff-shadow);
  padding: 1.15rem;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--aff-navy);
  margin-bottom: .85rem;
}

.dash-queue {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.dash-queue-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
  padding: .7rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--aff-border);
  background: #f8fafc;
  color: inherit;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.dash-queue-item:hover {
  background: #fff;
  border-color: #9fbeff;
  box-shadow: 0 8px 18px rgba(26, 108, 255, .08);
  color: inherit;
}
.dash-queue-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
  font-size: .9rem;
}
.dash-queue-body { min-width: 0; }
.dash-queue-body strong {
  display: block;
  font-size: 13.5px;
  color: var(--aff-navy);
}
.dash-queue-body small {
  display: block;
  color: var(--aff-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-queue-count {
  min-width: 2rem;
  height: 1.75rem;
  padding: 0 .55rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  background: #e8eef8;
  color: var(--aff-navy-mid);
}
.dash-queue-count.is-hot {
  background: linear-gradient(135deg, #1a6cff, #1558d6);
  color: #fff;
}
.dash-queue-foot { padding-top: .25rem; }

.dash-top-list {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.dash-top-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .65rem .7rem;
  border-radius: 12px;
  border: 1px solid transparent;
  color: inherit;
}
.dash-top-item:hover {
  background: #f8fafc;
  border-color: var(--aff-border);
  color: inherit;
}
.dash-top-rank {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
}
.dash-top-body { min-width: 0; }
.dash-top-body strong {
  display: block;
  font-size: 13.5px;
  color: var(--aff-navy);
}
.dash-top-body small {
  color: var(--aff-muted);
  font-size: 12px;
}
.dash-top-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--aff-navy);
  white-space: nowrap;
}

.btn-group .btn { min-width: 34px; }

/* Compact icon actions in tables — equal size, equal gap */
.table-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  vertical-align: middle;
}
.table-actions > form {
  display: inline-flex;
  margin: 0;
}
.btn-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--aff-border);
  background: #fff;
  color: var(--aff-navy-mid);
  font-size: 13px;
  line-height: 1;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-icon:hover {
  background: #f5f8ff;
  border-color: #9fbeff;
  color: var(--aff-accent);
  box-shadow: 0 4px 12px rgba(26, 108, 255, .1);
}
.btn-icon:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(26, 108, 255, .18);
}
.btn-icon-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fff;
}
.btn-icon-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
  color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, .12);
}

/* btn-group in tables: keep flush, equal cells */
.table .btn-group {
  display: inline-flex;
  vertical-align: middle;
}
.table .btn-group > .btn,
.table .btn-group > form > .btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 0;
  line-height: 1;
}
.table .btn-group > :first-child.btn,
.table .btn-group > form:first-child > .btn {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
.table .btn-group > :last-child.btn,
.table .btn-group > form:last-child > .btn {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}
.table .btn-group > form {
  display: inline-flex;
  margin: 0;
}
.table .btn-group > .btn + .btn,
.table .btn-group > form + .btn,
.table .btn-group > .btn + form > .btn,
.table .btn-group > form + form > .btn {
  margin-left: -1px;
}

.auth-body {
  min-height: 100vh;
  margin: 0;
  background: #0b1526;
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  overflow: hidden;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(11, 21, 38, .88) 0%, rgba(15, 28, 51, .72) 45%, rgba(26, 108, 255, .42) 100%),
    url("/img/auth/bg-office.jpg") center / cover no-repeat;
  transform: scale(1.02);
  animation: authKenBurns 28s ease-in-out infinite alternate;
  z-index: 0;
}

.auth-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(26, 108, 255, .22), transparent 45%),
    linear-gradient(180deg, transparent 60%, rgba(8, 14, 26, .35));
  pointer-events: none;
}

@keyframes authKenBurns {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.5%, -1%, 0); }
}

.auth-frame {
  position: relative;
  z-index: 1;
  width: 100%;
}

.auth-hero-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 0.5rem 1.5rem 0;
  color: #fff;
}

.auth-kicker {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 1rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .9);
}

.auth-hero-panel h1 {
  color: #fff;
  font-size: clamp(1.7rem, 2.6vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 16ch;
}

.auth-lead {
  color: rgba(255, 255, 255, .82);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0 0 1.5rem;
  max-width: 34ch;
}

.auth-points {
  list-style: none;
  margin: 0;
  padding: 0;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: rgba(255, 255, 255, .88);
  font-size: 14.5px;
  margin-bottom: .65rem;
}

.auth-points i {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .12);
  color: #9ec0ff;
  font-size: 12px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 20px;
  padding: 2rem 1.85rem;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .28);
  animation: authCardIn .55s ease both;
}

.auth-card-wide { max-width: 640px; }

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

.auth-card-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--aff-navy);
  letter-spacing: -.02em;
  margin: 0 0 .35rem;
}

.auth-card-sub {
  color: var(--aff-muted);
  font-size: 13.5px;
  margin: 0 0 1.25rem;
}

/* ——— 2FA / OTP screens ——— */
.auth-2fa-card .auth-card-title { margin-bottom: .25rem; }

.auth-2fa-badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .75rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .01em;
}
.auth-2fa-badge > i { font-size: 11px; }

.auth-2fa-steps {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.auth-2fa-steps li {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 13px;
  color: #334155;
}
.auth-2fa-steps li > span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--aff-navy, #0f1c33);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.auth-2fa-setup {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.15rem;
  align-items: start;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid rgba(15, 28, 51, .06);
  margin-bottom: .25rem;
}

.auth-qr-panel {
  text-align: center;
}
.auth-qr-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  padding: 10px;
}
.auth-qr-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid #2563eb;
  pointer-events: none;
}
.auth-qr-corner-tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.auth-qr-corner-tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.auth-qr-corner-bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.auth-qr-corner-br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

.auth-qr-box {
  position: relative;
  width: 196px;
  height: 196px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(15, 28, 51, .08);
  box-shadow: 0 10px 28px rgba(15, 28, 51, .1);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.auth-qr-img {
  display: block;
  width: 188px;
  height: 188px;
  object-fit: contain;
  image-rendering: pixelated;
}
.auth-qr-badge {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(15, 28, 51, .1);
  box-shadow: 0 3px 10px rgba(15, 28, 51, .12);
  display: grid;
  place-items: center;
  color: #1d4ed8;
  font-size: 12px;
}
.auth-qr-fallback {
  display: grid;
  gap: .4rem;
  place-items: center;
  padding: 1rem;
  color: var(--aff-muted, #64748b);
  font-size: 12px;
  text-align: center;
}
.auth-qr-fallback > i { font-size: 1.6rem; color: #94a3b8; }
.auth-qr-caption {
  margin-top: .55rem;
  display: grid;
  gap: .1rem;
  font-size: 12.5px;
  color: #334155;
}
.auth-qr-caption-label {
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.auth-secret-row {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.auth-secret {
  flex: 1;
  display: block;
  padding: .55rem .7rem;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed rgba(15, 28, 51, .18);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--aff-navy, #0f1c33);
  word-break: break-all;
}

.auth-otp-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.65rem !important;
  font-weight: 650;
  letter-spacing: .42em;
  text-align: center;
  padding: .85rem .5rem .85rem .9rem !important;
  border-radius: 14px !important;
  border: 1.5px solid rgba(15, 28, 51, .14) !important;
  background: #f8fafc !important;
  color: var(--aff-navy, #0f1c33);
}
.auth-otp-input:focus {
  background: #fff !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12) !important;
}
.auth-otp-input::placeholder {
  letter-spacing: .42em;
  color: #cbd5e1;
}

.auth-recovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  padding: 1rem;
  border-radius: 14px;
  background: #0f1c33;
  margin-bottom: .25rem;
}
.auth-recovery-grid code {
  display: block;
  text-align: center;
  padding: .55rem .4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #e2e8f0;
  font-size: 13px;
  letter-spacing: .04em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 575.98px) {
  .auth-2fa-setup {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .auth-2fa-manual { width: 100%; text-align: left; }
  .auth-recovery-grid { grid-template-columns: 1fr; }
}

.auth-field {
  position: relative;
}
.auth-field > i {
  position: absolute;
  left: .95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  text-align: center;
  color: var(--aff-muted);
  font-size: .9rem;
  pointer-events: none;
  transition: color .15s ease;
}
.auth-field .form-control {
  padding-left: 2.55rem;
}
.auth-field:focus-within > i {
  color: var(--aff-accent);
}

.auth-hint {
  margin-top: 1rem;
  font-size: 12.5px;
  color: var(--aff-muted);
}

.auth-hero h1 {
  color: #fff;
  font-weight: 700;
  letter-spacing: -.02em;
}

.auth-hero p { color: rgba(255,255,255,.8); }

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .7rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
}

.product-name { font-weight: 600; color: var(--aff-navy); }
.product-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--aff-muted);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--aff-muted);
}

@media (max-width: 991.98px) {
  .app-shell { flex-direction: column; }

  .sidebar-mobile-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--aff-border);
    line-height: 1;
  }

  .sidebar-close {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    margin-left: auto;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #dbe7ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(300px, 88vw);
    flex: none !important;
    max-width: min(300px, 88vw);
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 1060;
    transform: translate3d(-104%, 0, 0);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1);
    will-change: transform;
    box-shadow: none;
    pointer-events: none;
  }

  .sidebar.is-open {
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
    box-shadow: 12px 0 40px rgba(8, 16, 32, .35);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(15, 28, 51, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }

  .sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-mobile-open {
    overflow: hidden;
    touch-action: none;
  }

  html.sidebar-collapsed .nav-section-trigger { display: none !important; }
  html.sidebar-collapsed .nav-section-panel {
    display: block !important;
    position: static !important;
    min-width: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
  }
  html.sidebar-collapsed .sidebar-brand { display: flex !important; }
  html.sidebar-collapsed .sidebar-brand-text { display: flex !important; }
}

/* Công việc — calendar */
.cal-panel { overflow-x: auto; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 1px;
  background: var(--aff-border);
  border: 1px solid var(--aff-border);
  border-radius: 12px;
  overflow: hidden;
  min-width: 780px;
}

.cal-dow {
  background: #f8fafc;
  padding: .55rem .65rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--aff-muted);
  text-align: center;
}

.cal-cell {
  background: #fff;
  min-height: 108px;
  padding: .45rem .5rem .55rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.cal-cell.muted {
  background: #f8fafc;
  color: #94a3b8;
}

.cal-cell.today {
  box-shadow: inset 0 0 0 2px rgba(26, 108, 255, .35);
}

.cal-daynum {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--aff-navy);
  align-self: flex-end;
}

.cal-cell.muted .cal-daynum { color: #94a3b8; font-weight: 600; }

.cal-cell.today .cal-daynum {
  background: var(--aff-blue, #1a6cff);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-height: 0;
}

.cal-chip {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: #eef3ff;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.35;
  cursor: default;
  overflow: hidden;
}

.cal-chip .cal-type {
  flex: 0 0 auto;
  font-weight: 700;
  opacity: .75;
  text-transform: uppercase;
  font-size: 10px;
}

.cal-chip .cal-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip.progress { background: #fef3c7; color: #92400e; }
.cal-chip.done { background: #dcfce7; color: #166534; opacity: .85; }
.cal-chip.cancelled { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.cal-chip.urgent { background: #fee2e2; color: #991b1b; }
.cal-chip.high { background: #ffedd5; color: #9a3412; }

.cal-more {
  font-size: 11px;
  color: var(--aff-muted);
  padding-left: 4px;
}

.view-toggle .btn { min-width: 0; }

/* —— Fraud alerts table —— */
.fraud-table .fraud-type {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  min-width: 11rem;
}
.fraud-type-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff1f2;
  color: #be123c;
  flex-shrink: 0;
  font-size: .9rem;
}
.fraud-ref {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--aff-navy-mid);
  background: #f1f5f9;
  border-radius: 8px;
  padding: .2rem .45rem;
  white-space: nowrap;
}
.fraud-note {
  max-width: 18rem;
  line-height: 1.4;
}
.fraud-row-open {
  background: #fffbfb;
}
.fraud-sev-critical {
  background: #9f1239 !important;
  color: #fff !important;
}
.fraud-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
}
.fraud-actions .form-select {
  width: auto;
  min-width: 8.5rem;
  min-height: 34px;
  height: 34px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 12.5px;
}
.fraud-lock {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--aff-navy-mid);
  white-space: nowrap;
  user-select: none;
}
.fraud-lock input {
  width: .95rem;
  height: .95rem;
  margin: 0;
  accent-color: var(--aff-accent);
}
.fraud-actions .btn {
  min-height: 34px;
  height: 34px;
  padding: 0 .75rem;
}

/* —— Ticket mailbox (Gmail-like) —— */
.mail-shell {
  display: grid;
  grid-template-columns: 180px minmax(280px, 1fr) minmax(0, 1.35fr);
  gap: 0;
  min-height: calc(100vh - 170px);
  background: #fff;
  border: 1px solid var(--aff-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--aff-shadow);
}

.mail-shell:not(.has-detail) {
  grid-template-columns: 180px 1fr;
}
.mail-shell:not(.has-detail) .mail-detail { display: none; }

.mail-nav {
  background: #f8fafc;
  border-right: 1px solid var(--aff-border);
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.mail-nav-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border-radius: 10px;
  color: var(--aff-text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.mail-nav-item i { width: 1.1em; text-align: center; color: var(--aff-muted); }
.mail-nav-item:hover { background: #eef2f7; color: var(--aff-text); }
.mail-nav-item.active {
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
}
.mail-nav-item.active i { color: var(--aff-accent); }
.mail-nav-item span.ms-auto {
  font-size: 11.5px;
  color: var(--aff-muted);
  font-weight: 700;
}

.mail-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--aff-border);
  background: #fff;
}

.mail-search {
  position: relative;
  padding: .75rem;
  border-bottom: 1px solid var(--aff-border);
}
.mail-search i {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--aff-muted);
  font-size: 13px;
}
.mail-search input {
  width: 100%;
  border: 1px solid var(--aff-border);
  border-radius: 999px;
  padding: .45rem .9rem .45rem 2.1rem;
  font-size: 13px;
  background: #f8fafc;
}
.mail-search input:focus {
  outline: none;
  border-color: #c9dbff;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,108,255,.12);
}

.mail-rows {
  overflow: auto;
  flex: 1;
}

/* List mode (detail open): compact single column */
.mail-shell.has-detail .mail-rows {
  display: flex;
  flex-direction: column;
}
.mail-shell.has-detail .mail-row {
  display: block;
  padding: .85rem 1rem;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  box-shadow: none;
}

/* Browse mode (no detail): multi-column cards — fill empty width */
.mail-shell:not(.has-detail) .mail-list {
  border-right: 0;
}
.mail-shell:not(.has-detail) .mail-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .75rem;
  padding: .85rem 1rem 1.1rem;
  align-content: start;
}
.mail-shell:not(.has-detail) .mail-row {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  height: 100%;
  padding: .95rem 1rem;
  border: 1px solid var(--aff-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(15, 28, 51, .04);
}
.mail-shell:not(.has-detail) .mail-row:hover {
  border-color: #9fbeff;
  box-shadow: 0 10px 24px rgba(26, 108, 255, .1);
  transform: translateY(-1px);
}
.mail-shell:not(.has-detail) .mail-subject {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
  margin-bottom: .15rem;
}
.mail-shell:not(.has-detail) .mail-empty {
  grid-column: 1 / -1;
}

.mail-row {
  color: inherit;
  text-decoration: none;
  transition: background .12s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mail-row:hover { background: #f8fafc; color: inherit; }
.mail-row.active {
  background: #eef4ff;
  box-shadow: inset 3px 0 0 var(--aff-accent);
}
.mail-shell:not(.has-detail) .mail-row.active {
  box-shadow: 0 0 0 2px rgba(26, 108, 255, .25), 0 10px 24px rgba(26, 108, 255, .1);
  border-color: #9fbeff;
  background: #f5f8ff;
}
.mail-row.unread .mail-subject,
.mail-row.unread .mail-from { font-weight: 700; color: var(--aff-navy); }
.mail-row.unread { background: #fcfdff; }

.mail-row-top {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .15rem;
}
.mail-from { font-size: 13px; font-weight: 600; }
.mail-time { font-size: 11.5px; color: var(--aff-muted); white-space: nowrap; }
.mail-subject {
  font-size: 13.5px;
  margin-bottom: .35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: auto; }
.mail-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--aff-muted);
}
.mail-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--aff-muted);
}

.mail-detail {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.mail-detail-empty {
  flex: 1;
  display: grid;
  place-content: center;
  gap: .75rem;
  color: var(--aff-muted);
  text-align: center;
  padding: 2rem;
}
.mail-detail-empty i { font-size: 2rem; opacity: .45; }

.mail-detail-head {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--aff-border);
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.mail-detail-code {
  font-size: 12px;
  color: var(--aff-muted);
  font-weight: 600;
  margin-bottom: .2rem;
}
.mail-detail-subject {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: var(--aff-navy);
  letter-spacing: -.02em;
}

.mail-thread {
  flex: 0 0 auto;
  overflow: visible;
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background:
    radial-gradient(800px 200px at 100% 0%, #f4f8ff 0%, transparent 55%),
    #fff;
}

.mail-msg {
  border: 1px solid var(--aff-border);
  border-radius: 14px;
  padding: .85rem 1rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,28,51,.03);
}
.mail-msg.staff { border-color: #cfe0ff; background: #f7faff; }
.mail-msg.guest { border-color: #e2e8f2; }
.mail-msg.note {
  border-style: dashed;
  background: #fffbeb;
  border-color: #f6de8d;
}
.mail-msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: .45rem;
  font-size: 12.5px;
}
.mail-msg-body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.55;
  color: var(--aff-text);
}

.mail-compose {
  flex: 0 0 auto;
  margin-top: 0;
  border-top: 1px solid var(--aff-border);
  padding: .9rem 1.15rem 1.1rem;
  background: #f8fafc;
  position: sticky;
  bottom: 0;
  z-index: 2;
  box-shadow: 0 -8px 20px rgba(15, 28, 51, .04);
}
.mail-compose textarea {
  border-radius: 12px;
  resize: vertical;
  min-height: 84px;
}

@media (max-width: 1199.98px) {
  .mail-shell,
  .mail-shell:not(.has-detail) {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .mail-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--aff-border);
  }
  .mail-shell.has-detail .mail-list,
  .mail-shell.has-detail .mail-nav { display: none; }
  .mail-shell.has-detail .mail-detail { display: flex; min-height: 70vh; }
  .mail-list { border-right: 0; max-height: 55vh; }
}

/* List sort + pager */
.th-sort {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
  font-weight: 700;
}
.th-sort:hover { color: var(--aff-accent); }
.th-sort .fa-solid { font-size: .7rem; opacity: .45; }
.th-sort.is-active { color: var(--aff-accent); }
.th-sort.is-active .fa-solid { opacity: 1; }
.list-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--aff-border);
}
.list-pager-meta {
  font-size: 12.5px;
  color: var(--aff-muted, #64748b);
}
.list-pager .pagination {
  --bs-pagination-padding-x: 0;
  --bs-pagination-padding-y: 0;
  --bs-pagination-font-size: 13px;
  --bs-pagination-color: var(--aff-navy-mid);
  --bs-pagination-bg: #fff;
  --bs-pagination-border-width: 1px;
  --bs-pagination-border-color: var(--aff-border);
  --bs-pagination-hover-color: var(--aff-accent);
  --bs-pagination-hover-bg: #f5f8ff;
  --bs-pagination-hover-border-color: #9fbeff;
  --bs-pagination-focus-color: var(--aff-accent);
  --bs-pagination-focus-bg: #f5f8ff;
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(26, 108, 255, .15);
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: linear-gradient(135deg, #1a6cff, #1558d6);
  --bs-pagination-active-border-color: transparent;
  --bs-pagination-disabled-color: #94a3b8;
  --bs-pagination-disabled-bg: #f1f5f9;
  --bs-pagination-disabled-border-color: var(--aff-border);
  gap: .3rem;
  margin: 0;
}
.list-pager .page-item { margin: 0; }
.list-pager .page-item .page-link,
.list-pager .page-item span.page-link {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px !important;
  border: 1px solid var(--aff-border);
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}
.list-pager .page-item:not(:first-child) .page-link {
  margin-left: 0;
}
.list-pager .page-item.active .page-link {
  background: linear-gradient(135deg, #1a6cff, #1558d6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 14px rgba(26, 108, 255, .28);
}
.list-pager .page-item.disabled .page-link {
  background: #f1f5f9;
  color: #94a3b8;
  opacity: 1;
}
.list-pager .page-link i {
  font-size: 11px;
  line-height: 1;
}

/* —— Detail pages —— */
.detail-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--aff-border);
  background:
    linear-gradient(135deg, rgba(26,108,255,.06), transparent 42%),
    linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: var(--aff-shadow);
}
.detail-hero-main { min-width: 0; flex: 1 1 280px; }
.detail-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--aff-muted);
  margin-bottom: .35rem;
}
.detail-hero .page-title {
  margin-bottom: .45rem;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}
.detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: .55rem;
}
.detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.detail-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--aff-navy-mid);
  font-size: 12px;
  font-weight: 600;
}
.detail-chip i { color: var(--aff-accent); font-size: 11px; }
.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}
.detail-meta-item {
  padding: .75rem .85rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--aff-border);
  min-width: 0;
}
.detail-meta-item .label {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--aff-muted);
  margin-bottom: .2rem;
}
.detail-meta-item .value {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--aff-navy);
  word-break: break-word;
}
.detail-meta-item .value a { font-weight: 650; }
.detail-side-card .panel-title { margin-bottom: .85rem; }
.detail-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .7rem;
}
.detail-timeline li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: .65rem;
  align-items: start;
}
.detail-timeline .dot {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--aff-accent-soft);
  color: var(--aff-accent);
  font-size: 12px;
}
.detail-timeline strong {
  display: block;
  font-size: 13px;
  color: var(--aff-navy);
}
.detail-timeline small {
  display: block;
  color: var(--aff-muted);
  font-size: 12px;
  margin-top: 1px;
}
.detail-pre {
  margin: 0;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: #0f1c33;
  color: #dbe7ff;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow: auto;
}
.detail-terms {
  white-space: pre-wrap;
  color: var(--aff-text);
  line-height: 1.55;
}


/* —— Attachments —— */
.attach-list { display: flex; flex-direction: column; gap: .45rem; }
.attach-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .7rem;
  align-items: center;
  padding: .65rem .75rem;
  border-radius: 12px;
  border: 1px solid var(--aff-border);
  background: #f8fafc;
  color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.attach-item:hover {
  border-color: #9fbeff;
  background: #fff;
  color: inherit;
}
.attach-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--aff-accent-soft); color: var(--aff-accent);
}
.attach-body { min-width: 0; }
.attach-body strong {
  display: block; font-size: 13px; color: var(--aff-navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attach-body small { display: block; color: var(--aff-muted); font-size: 11.5px; }
.attach-dl { color: var(--aff-accent); }


/* —— Profile / Change password —— */
.profile-page { max-width: 1100px; }
.profile-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem;
  padding: 1.1rem 1.25rem; margin-bottom: 1rem;
  border: 1px solid var(--aff-border); border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff 0%, #fff 55%, #f5f8fc 100%);
}
.profile-avatar {
  width: 56px; height: 56px; border-radius: 16px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 1.25rem; color: #fff;
  background: linear-gradient(145deg, var(--aff-accent), #1d4ed8);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .22);
}
.profile-hero-main { flex: 1 1 220px; min-width: 0; }
.profile-hero-meta {
  display: flex; flex-wrap: wrap; gap: .5rem .85rem; align-items: center;
  color: var(--aff-muted); font-size: 13px;
}
.profile-hero-meta i { margin-right: .35rem; opacity: .8; }
.profile-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.profile-secure-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.profile-req-list {
  list-style: none; padding: 0; margin: 0 0 1rem;
  display: grid; gap: .55rem;
}
.profile-req-list li {
  display: flex; gap: .55rem; align-items: flex-start;
  font-size: 13.5px; color: var(--aff-navy);
}
.profile-req-list i {
  margin-top: .15rem; color: var(--aff-accent); font-size: 12px;
}
.pwd-field { position: relative; }
.pwd-field .form-control { padding-right: 2.6rem; }
.pwd-toggle {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--aff-muted);
  width: 2rem; height: 2rem; border-radius: 8px;
  display: grid; place-items: center;
}
.pwd-toggle:hover { color: var(--aff-navy); background: #f1f5f9; }
.pwd-meter-bar {
  height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: .35rem;
}
.pwd-meter-bar span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: #ef4444; transition: width .2s ease, background .2s ease;
}
.pwd-meter[data-level="1"] .pwd-meter-bar span { background: #ef4444; }
.pwd-meter[data-level="2"] .pwd-meter-bar span { background: #f59e0b; }
.pwd-meter[data-level="3"] .pwd-meter-bar span { background: #3b82f6; }
.pwd-meter[data-level="4"] .pwd-meter-bar span { background: #16a34a; }
.pwd-meter small { color: var(--aff-muted); font-size: 12px; }


/* —— Line items editor —— */
.line-items-total {
  display: grid; gap: .35rem; justify-content: end; text-align: right;
  padding: .75rem 0 0; border-top: 1px dashed var(--aff-border); margin-top: .25rem;
}
.line-items-total > div {
  display: grid; grid-template-columns: auto 140px; gap: 1rem; align-items: baseline;
  font-size: 13.5px; color: var(--aff-muted);
}
.line-items-total strong { color: var(--aff-navy); font-variant-numeric: tabular-nums; }
.line-items-grand { font-size: 15px !important; }
.line-items-grand strong { font-size: 1.05rem; color: var(--aff-accent); }
.line-items-table-detail td { vertical-align: middle; }


.row-click { cursor: pointer; }
.row-click:hover > td { background: #f8fafc; }
.tracking-row-eye { pointer-events: none; }
.tracking-detail-drawer { --bs-offcanvas-width: min(420px, 100vw); }
.tracking-detail-drawer .offcanvas-header {
  border-bottom: 1px solid var(--aff-border);
  background: linear-gradient(180deg, #f8fbff, #fff);
}
.tracking-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .85rem 1rem;
  margin: 0;
}
.tracking-detail-grid > div { min-width: 0; }
.tracking-detail-grid dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--aff-muted);
  margin-bottom: .2rem;
}
.tracking-detail-grid dd { margin: 0; font-size: 13.5px; color: var(--aff-navy); }
.tracking-detail-span { grid-column: 1 / -1; }
