/* BackFrame ERP — Crystal Clear UI (screenshot-inspired) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

:root {
  --bf-navy: #1a2238;
  --bf-navy-2: #243049;
  --bf-orange: #f15a24;
  --bf-orange-dark: #d94c1a;
  --bf-orange-soft: #fff0ea;
  --bf-blue: #007bff;
  --bf-blue-soft: #e8f2ff;
  --bf-green: #2e7d32;
  --bf-green-soft: #e8f5e9;
  --bf-ink: #1c2434;
  --bf-ink-soft: #4a5568;
  --bf-muted: #8b95a5;
  --bf-line: #e8edf3;
  --bf-line-strong: #d5dde8;
  --bf-surface: #ffffff;
  --bf-canvas: #f4f7fb;
  --bf-rail: #f8fafc;
  --bf-danger: #d32f2f;
  --bf-danger-soft: #fdecea;
  --bf-warn: #ed6c02;
  --bf-warn-soft: #fff4e5;
  --bf-radius: 12px;
  --bf-radius-lg: 20px;
  --bf-radius-sm: 10px;
  --bf-shadow: 0 1px 2px rgba(26, 34, 56, 0.04), 0 8px 24px rgba(26, 34, 56, 0.05);
  --bf-shadow-lg: 0 16px 48px rgba(26, 34, 56, 0.14);
  --bf-font: "DM Sans", system-ui, sans-serif;
  --bf-rail-w: 68px;
  --bf-menu-w: 232px;
  --bf-top-h: 56px;
  --bf-body-bg:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(64, 140, 255, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 10%, rgba(255, 140, 90, 0.32), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(120, 170, 255, 0.25), transparent 45%),
    linear-gradient(160deg, #dce8f8 0%, #f5f7fb 40%, #fde8dc 100%);

  /* aliases used by existing markup */
  --bf-brand: var(--bf-orange);
  --bf-brand-dark: var(--bf-orange-dark);
  --bf-brand-soft: var(--bf-orange-soft);
  --bf-accent: var(--bf-orange);
  --bf-accent-soft: var(--bf-orange-soft);
  --bf-charcoal: var(--bf-navy);
  --bf-charcoal-soft: var(--bf-navy-2);
  --bf-info: var(--bf-blue);
  --bf-info-soft: var(--bf-blue-soft);
  --bf-success: var(--bf-green);
  --bf-success-soft: var(--bf-green-soft);
  --bf-sidebar: var(--bf-navy);
  --bf-sidebar-active: var(--bf-orange);
  --bf-display: var(--bf-font);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--bf-font);
  color: var(--bf-ink);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: var(--bf-body-bg);
}
a { color: var(--bf-blue); text-decoration: none; }
a:not(.btn):hover { color: var(--bf-orange); }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { font-family: var(--bf-font); letter-spacing: -0.02em; margin: 0; font-weight: 700; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ========== Login ========== */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-page.login-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  place-items: stretch;
  padding: 0;
  max-width: none;
}
.login-visual {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 20% 20%, rgba(241, 90, 36, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(0, 123, 255, 0.25), transparent 50%),
    linear-gradient(145deg, #1a2238 0%, #243049 55%, #1a2238 100%);
  color: #fff;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  pointer-events: none;
}
.login-brand {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 14px;
}
.brand-mark {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: #fff;
  display: grid; place-items: center;
  overflow: hidden;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(241, 90, 36, 0.25);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text strong { display: block; font-size: 18px; }
.brand-text span { font-size: 13px; opacity: 0.7; }
.login-hero { position: relative; z-index: 1; max-width: 460px; }
.login-hero h1 { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.15; margin-bottom: 14px; }
.login-hero p { font-size: 15px; opacity: 0.78; margin: 0 0 24px; }
.login-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.login-pills span {
  font-size: 12px; font-weight: 600;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.login-foot { position: relative; z-index: 1; font-size: 13px; opacity: 0.55; }
.login-foot strong { color: var(--bf-orange); }

.login-panel {
  display: grid; place-items: center;
  padding: 40px 32px;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(8px);
}
.login-card {
  width: min(420px, 100%);
  background: var(--bf-surface);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 24px;
  padding: 36px 32px;
  box-shadow: var(--bf-shadow-lg);
  animation: rise 0.45s ease both;
}
.login-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.login-card-logo img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--bf-line);
  padding: 10px;
  box-shadow: var(--bf-shadow);
}
.login-card h2 { font-size: 26px; margin-bottom: 6px; text-align: center; }
.login-card .sub { color: var(--bf-muted); margin-bottom: 24px; font-size: 14px; text-align: center; }

/* ERP Login (Sign In) */
.erp-login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  overflow: hidden;
}
.erp-login-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 15%, rgba(241, 90, 36, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(0, 123, 255, 0.12), transparent 50%),
    linear-gradient(145deg, #eef2f8 0%, #f8fafc 45%, #eef2f8 100%);
  pointer-events: none;
}
.erp-login-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 34, 56, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 34, 56, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 72%);
}
.erp-login-wrap {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
}
.erp-login-card {
  background: var(--bf-surface);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: var(--bf-shadow-lg);
  overflow: hidden;
  animation: rise 0.45s ease both;
}
.erp-login-banner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 22px 24px 56px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #1a2238 0%, #243049 55%, #1a2238 100%);
  color: #fff;
  overflow: hidden;
}
.erp-login-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
  pointer-events: none;
}
.erp-login-banner-copy {
  position: relative;
  z-index: 1;
}
.erp-login-banner-copy h5 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}
.erp-login-banner-copy p {
  margin: 0;
  font-size: 13px;
  opacity: 0.82;
  max-width: 220px;
}
.erp-login-banner-visual {
  position: relative;
  z-index: 1;
  width: 118px;
  height: 92px;
  flex-shrink: 0;
}
.erp-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
}
.erp-login-orb-a {
  width: 72px;
  height: 72px;
  right: 0;
  bottom: 0;
  background: rgba(241, 90, 36, 0.28);
}
.erp-login-orb-b {
  width: 44px;
  height: 44px;
  right: 48px;
  top: 8px;
  background: rgba(255, 255, 255, 0.12);
}
.erp-login-icon-stack {
  position: absolute;
  right: 6px;
  bottom: 8px;
  display: grid;
  gap: 6px;
}
.erp-login-icon-stack span {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 17px;
  color: #fff;
  backdrop-filter: blur(4px);
}
.erp-login-icon-stack span:nth-child(2) {
  margin-left: 18px;
}
.erp-login-body {
  position: relative;
  padding: 0 28px 28px;
  margin-top: -34px;
}
.erp-login-logo {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 10px 28px rgba(26, 34, 56, 0.12);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 8px;
}
.erp-login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.erp-login-edition {
  margin: 0 0 18px;
  text-align: right;
  font-size: 13px;
  color: var(--bf-muted);
}
.erp-login-edition strong {
  display: block;
  color: var(--bf-orange-dark);
  font-size: 14px;
  margin-bottom: 2px;
}
.erp-login-form .form-group {
  margin-bottom: 14px;
}
.erp-login-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--bf-ink);
}
.login-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.login-input-group:focus-within {
  border-color: #f5b59a;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12);
}
.login-input-icon {
  display: grid;
  place-items: center;
  min-width: 44px;
  padding: 0 12px;
  background: #f8fafc;
  border-right: 1px solid var(--bf-line);
  color: var(--bf-muted);
  font-size: 18px;
}
.login-input-group .form-control {
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 44px;
  padding-left: 12px;
}
.login-input-group .form-control:focus {
  box-shadow: none;
}
.erp-login-btn {
  width: 100%;
  margin-top: 6px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.erp-login-btn .bx {
  font-size: 18px;
}
.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}
.erp-login-error {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--bf-danger);
}
.erp-login-footer {
  margin: 22px 0 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--bf-muted);
}
.erp-login-footer strong {
  color: var(--bf-orange-dark);
}

@media (max-width: 520px) {
  .erp-login-page { padding: 24px 14px; }
  .erp-login-body { padding: 0 20px 22px; }
  .erp-login-banner { padding: 18px 18px 52px; }
  .erp-login-banner-visual { width: 96px; height: 80px; }
  .erp-login-edition { text-align: center; }
}

/* ========== Status pages (Access Denied, Error) ========== */
.status-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  overflow: hidden;
}
.status-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 15%, rgba(241, 90, 36, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(0, 123, 255, 0.14), transparent 50%),
    linear-gradient(145deg, #eef2f8 0%, #f8fafc 45%, #eef2f8 100%);
  pointer-events: none;
}
.status-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(26, 34, 56, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 34, 56, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 25%, transparent 72%);
}
.status-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 28px;
  box-shadow: var(--bf-shadow-lg);
  backdrop-filter: blur(12px);
  padding: 32px 32px 28px;
  text-align: center;
}
.status-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.status-brand .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}
.status-brand .brand-text {
  text-align: left;
}
.status-brand .brand-text strong {
  display: block;
  font-size: 15px;
  color: var(--bf-ink);
}
.status-brand .brand-text span {
  display: block;
  font-size: 12px;
  color: var(--bf-muted);
}
.status-icon-wrap {
  position: relative;
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
}
.status-code {
  position: absolute;
  top: -8px;
  right: -10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bf-danger-soft);
  color: var(--bf-danger);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.status-icon {
  width: 100%;
  height: 100%;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #fff0ea 0%, #fdecea 100%);
  border: 1px solid #f5c4bc;
  color: #d94c1a;
  font-size: 52px;
  box-shadow: 0 14px 30px rgba(211, 47, 47, 0.12);
}
.access-denied-card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 34px);
  line-height: 1.15;
  color: var(--bf-ink);
}
.status-sub {
  margin: 0 0 8px;
  color: var(--bf-ink-soft);
  font-size: 15px;
  line-height: 1.55;
}
.status-sub strong {
  color: var(--bf-ink);
}
.status-hint {
  margin: 0 0 18px;
  color: var(--bf-muted);
  font-size: 13px;
  line-height: 1.5;
}
.status-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  margin-bottom: 22px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid var(--bf-line);
  max-width: 100%;
}
.status-meta span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bf-muted);
}
.status-meta code {
  font-size: 12px;
  color: var(--bf-ink-soft);
  word-break: break-all;
}
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.status-actions .btn {
  min-width: 148px;
}
@media (max-width: 560px) {
  .status-card {
    padding: 24px 18px 20px;
    border-radius: 22px;
  }
  .status-actions .btn {
    width: 100%;
    min-width: 0;
  }
}
.role-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.role-chip {
  border: 1px solid var(--bf-line-strong);
  background: #fff;
  color: var(--bf-ink-soft);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}
.role-chip.active, .role-chip:hover {
  background: var(--bf-orange-soft);
  border-color: #f5b59a;
  color: var(--bf-orange-dark);
}

/* ========== App Stage / Frame ========== */
.app-stage {
  min-height: 100vh;
  padding: 6px 14px 14px;
  display: flex;
}
.app-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--bf-shadow-lg);
  backdrop-filter: blur(10px);
  min-height: calc(100vh - 20px);
}

/* Top navy bar */
.topnav {
  height: var(--bf-top-h);
  background: var(--bf-navy);
  color: #fff;
  display: grid;
  grid-template-columns: 1fr minmax(240px, 420px) 1fr;
  align-items: center;
  column-gap: 20px;
  padding: 0 18px;
  flex-shrink: 0;
}
.topnav-left, .topnav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topnav-right { justify-content: flex-end; }
.topnav-brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px;
  white-space: nowrap;
}
.topnav-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; padding: 3px;
  box-shadow: none;
}
.topnav-brand span { opacity: 0.55; font-weight: 500; font-size: 12px; margin-left: 2px; }
.menu-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.menu-chip-ico { font-size: 14px; line-height: 1; }
.menu-chip:hover { background: rgba(255,255,255,0.14); }
.top-search {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 999px;
  padding: 0 16px;
  color: var(--bf-muted);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.top-search-ico {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
  opacity: 0.7;
}
.top-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  min-width: 0;
  height: 100%;
  color: var(--bf-ink);
  font-size: 13.5px;
  line-height: 1;
  padding: 0;
}
.top-search input::placeholder { color: #9aa3b2; }
.top-icon {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer; position: relative;
}
.top-icon .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--bf-orange);
}
.top-icon .dot.hidden { display: none; }
.company-pill {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  cursor: pointer;
}
.company-pill:hover,
.user-menu-wrap.is-open .company-pill { background: rgba(255,255,255,0.14); }
.company-pill img, .company-pill .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; object-fit: contain;
}
.company-pill .avatar.avatar-photo,
.user-menu-head .avatar.avatar-photo {
  padding: 0;
  overflow: hidden;
  background: #fff;
}
.avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.company-pill-photo {
  padding: 4px 10px 4px 4px;
}
.company-pill #topUserLabel {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.company-pill .avatar {
  display: grid; place-items: center;
  color: var(--bf-navy); font-size: 11px; font-weight: 800;
}
.user-menu-caret {
  font-size: 10px;
  opacity: 0.7;
  margin-left: -2px;
}
.user-menu-wrap { position: relative; }
.user-menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(240px, calc(100vw - 24px));
  background: #fff;
  color: var(--bf-ink);
  border: 1px solid var(--bf-line);
  border-radius: 14px;
  box-shadow: var(--bf-shadow-lg);
  z-index: 80;
  overflow: hidden;
  padding: 6px;
  animation: rise 0.2s ease both;
}
.user-menu-panel[hidden] { display: none !important; }
.user-menu-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--bf-line);
  margin-bottom: 4px;
}
.user-menu-head .avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bf-navy); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.user-menu-head strong {
  display: block;
  font-size: 13px;
  line-height: 1.3;
}
.user-menu-head span {
  display: block;
  font-size: 12px;
  color: var(--bf-muted);
  font-weight: 500;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--bf-ink);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.user-menu-item:hover {
  background: #f4f7fb;
  color: var(--bf-ink);
}
.user-menu-item.user-menu-danger {
  color: var(--bf-danger);
}
.user-menu-item.user-menu-danger:hover {
  background: var(--bf-danger-soft);
  color: var(--bf-danger);
}
.user-menu-ico {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notify-wrap { position: relative; }
.notify-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, calc(100vw - 40px));
  background: #fff;
  color: var(--bf-ink);
  border: 1px solid var(--bf-line);
  border-radius: 16px;
  box-shadow: var(--bf-shadow-lg);
  z-index: 80;
  overflow: hidden;
  animation: rise 0.2s ease both;
}
.notify-panel[hidden] { display: none !important; }
.notify-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 14px 14px 10px;
  border-bottom: 1px solid var(--bf-line);
}
.notify-panel-head strong { display: block; font-size: 14px; }
.notify-count {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bf-orange);
}
.notify-list {
  max-height: 360px;
  overflow-y: auto;
}
.notify-item {
  width: 100%;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--bf-line);
  background: #fff;
  padding: 12px 14px;
  cursor: pointer;
}
.notify-item:hover { background: #f8fafc; }
.notify-item.unread { background: #fffaf7; }
.notify-item.unread:hover { background: #fff3eb; }
.notify-ico {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800;
  flex-shrink: 0;
}
.notify-ico.warn { background: var(--bf-warn-soft); color: var(--bf-warn); }
.notify-ico.info { background: var(--bf-blue-soft); color: var(--bf-blue); }
.notify-ico.brand { background: var(--bf-orange-soft); color: var(--bf-orange-dark); }
.notify-ico.danger { background: var(--bf-danger-soft); color: var(--bf-danger); }
.notify-ico.muted { background: #eef2f7; color: var(--bf-muted); }
.notify-body { display: grid; gap: 2px; min-width: 0; }
.notify-body strong { font-size: 13px; color: var(--bf-ink); }
.notify-body span { font-size: 12px; color: var(--bf-muted); line-height: 1.35; }
.notify-body em { font-style: normal; font-size: 11px; color: #a0a8b5; margin-top: 2px; }
.notify-panel-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--bf-line);
  background: #fafbfd;
}

.profile-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}
.profile-card-body {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-avatar-lg {
  width: 88px; height: 88px; border-radius: 24px;
  background: linear-gradient(135deg, #f15a24, #1a2238);
  color: #fff;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(241, 90, 36, 0.25);
}
.profile-card-body h3 { font-size: 18px; }
.profile-card-body .muted { color: var(--bf-muted); font-size: 13px; margin: 4px 0 0; }
.profile-meta {
  width: 100%;
  margin-top: 18px;
  text-align: left;
  border-top: 1px solid var(--bf-line);
  padding-top: 12px;
}
.profile-meta > div {
  display: flex; justify-content: space-between;
  gap: 10px; padding: 8px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--bf-line);
}
.profile-meta > div:last-child { border-bottom: none; }
.profile-meta span { color: var(--bf-muted); }
.profile-meta strong { color: var(--bf-ink); }
.profile-avatar-lg .profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
}
.company-logo-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bf-line);
}
.company-logo-preview {
  width: 88px;
  height: 88px;
  border-radius: 16px;
  background: var(--bf-surface-2, #f4f6fa);
  border: 1px solid var(--bf-line);
  display: grid;
  place-items: center;
  font-size: 36px;
  color: var(--bf-muted);
  overflow: hidden;
  flex-shrink: 0;
}
.company-logo-preview .company-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.company-logo-hint { font-size: 12px; margin-top: 6px; }
.company-meta { margin-top: 12px; font-size: 12.5px; }
.company-addplace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.company-addplace-head .btn-row { flex-shrink: 0; }
.tabs .tab.tab-disabled,
.tabs .tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.profile-tabs-wrap {
  position: relative;
  min-height: 220px;
}
.profile-tabs-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
  padding: 40px 20px;
  text-align: center;
  color: var(--bf-muted);
}
.profile-tabs-loader[hidden] { display: none !important; }
.profile-tabs-loader p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.bf-page-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--bf-line);
  border-top-color: var(--bf-orange);
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}
.profile-tab-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--bf-line);
}
.profile-tab-foot-compact {
  margin-top: 12px;
  padding-top: 10px;
}
.profile-form-compact {
  gap: 10px 12px;
}
.profile-form-compact .form-group {
  gap: 4px;
}
.profile-form-compact label {
  font-size: 11.5px;
}
.profile-form-compact .form-control,
.profile-form-compact .form-select,
.profile-form-compact .select2-container .select2-selection--single {
  padding: 7px 10px;
  min-height: 36px;
  font-size: 13px;
}
.profile-form-compact .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 20px;
  font-size: 13px;
}
.profile-form-compact .select2-container .select2-selection--single .select2-selection__arrow {
  height: 34px;
}

/* Quick Launch Setup (User Profile) */
.ql-setup-intro {
  margin: 0 0 14px;
  font-size: 13px;
}
.ql-setup-section {
  margin-bottom: 16px;
}
.ql-setup-heading {
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--bf-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--bf-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ql-setup-heading i {
  color: var(--bf-orange);
  font-size: 18px;
}
.ql-order-list,
.ql-available-list {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 44px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.ql-order-item,
.ql-available-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bf-line);
  background: #fff;
}
.ql-order-item:last-child,
.ql-available-item:last-child {
  border-bottom: none;
}
.ql-in-launcher {
  background: rgba(34, 197, 94, 0.06);
  border-left: 3px solid var(--bf-green);
}
.quick-launch-available-in-launcher {
  background: rgba(34, 197, 94, 0.04);
}
.ql-order-empty {
  padding: 16px 12px;
  color: var(--bf-muted);
  font-size: 13px;
  text-align: center;
}
.ql-order-error {
  color: var(--bf-danger);
}
.ql-drag-handle {
  color: var(--bf-muted);
  cursor: grab;
  display: inline-flex;
  align-items: center;
  font-size: 16px;
  padding: 2px 4px;
}
.ql-item-icon {
  font-size: 18px;
  color: var(--bf-orange-dark);
  flex-shrink: 0;
}
.ql-item-text {
  flex: 1;
  min-width: 0;
}
.ql-item-name {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--bf-ink);
}
.ql-available-item .ql-item-name {
  flex: 1;
  min-width: 0;
}
.ql-available-item .btn-add-to-launcher,
.ql-available-item .ql-in-badge {
  margin-left: auto;
  flex-shrink: 0;
}
.btn-add-to-launcher {
  background: var(--bf-navy);
  color: #fff;
  border-color: transparent;
}
.btn-add-to-launcher:hover {
  background: var(--bf-navy-2);
  color: #fff;
}
.ql-item-menu {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--bf-muted);
}
.ql-in-badge {
  flex-shrink: 0;
  font-size: 10px;
  padding: 3px 8px;
}
.ql-acc {
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}
.ql-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: #f8fafc;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bf-ink);
  cursor: pointer;
  text-align: left;
}
.ql-acc-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ql-acc-head .chev {
  font-size: 16px;
  color: var(--bf-muted);
  transition: transform 0.2s ease;
}
.ql-acc.open .ql-acc-head {
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
}
.ql-acc.open .ql-acc-head .chev {
  transform: rotate(90deg);
}
.ql-acc-body {
  display: none;
  border-top: 1px solid var(--bf-line);
}
.ql-acc.open .ql-acc-body {
  display: block;
}
.ql-acc-body .ql-available-list {
  border: none;
  border-radius: 0;
}
.gu-mirror {
  position: fixed !important;
  margin: 0 !important;
  z-index: 9999 !important;
  opacity: 0.85;
  list-style: none;
  box-shadow: 0 8px 24px rgba(26, 34, 56, 0.12);
  border-radius: 10px;
  background: #fff;
}
.gu-hide {
  display: none !important;
}
.gu-unselectable {
  user-select: none !important;
}
.gu-transit {
  opacity: 0.35;
}

.profile-quicklaunch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.profile-quicklaunch-panel h4 {
  margin: 0 0 4px;
  font-size: 15px;
}
.profile-quicklaunch-panel .muted {
  margin: 0 0 10px;
  font-size: 12px;
}
.profile-app-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 120px;
  padding: 12px;
  border: 1px dashed var(--bf-line-strong);
  border-radius: 12px;
  background: #fafbfd;
}
.profile-app-placeholder {
  width: 100%;
  text-align: center;
  color: var(--bf-muted);
  font-size: 13px;
  padding: 28px 12px;
}
.profile-app-error {
  color: var(--bf-danger);
}
.profile-app-tile {
  width: calc(50% - 5px);
  min-width: 120px;
  padding: 10px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: #fff;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.profile-app-tile:hover {
  border-color: #f5b59a;
  box-shadow: 0 4px 14px rgba(26, 34, 56, 0.06);
}
.profile-app-tile.is-dragging {
  opacity: 0.55;
}
.profile-app-tile-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
  display: grid;
  place-items: center;
  font-size: 18px;
}
.profile-app-tile-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--bf-ink);
  line-height: 1.25;
}
.profile-app-tile-meta {
  font-size: 10px;
  color: var(--bf-muted);
  line-height: 1.2;
}
@media (max-width: 900px) {
  .profile-quicklaunch-grid { grid-template-columns: 1fr; }
  .profile-app-tile { width: 100%; }
  .profile-form-compact.form-grid.cols-3 { grid-template-columns: 1fr; }
}
.pref-checks {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.pref-checks .check-row { margin: 0; }

@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; }
}

/* Workspace: rail + menu + content */
.workspace {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--bf-canvas);
}
.workspace-no-nav .main {
  width: 100%;
}

.icon-rail {
  width: var(--bf-rail-w);
  background: var(--bf-rail);
  border-right: 1px solid var(--bf-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 6px;
  flex-shrink: 0;
}
.rail-btn {
  width: 44px; height: 44px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--bf-muted);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 18px;
  transition: 0.15s ease;
  position: relative;
  text-decoration: none;
}
.rail-btn i {
  font-family: boxicons !important;
  font-size: 1.35rem;
  line-height: 1;
  display: block;
  font-style: normal;
  font-weight: 400;
}
.rail-btn:hover { background: #eef2f7; color: var(--bf-navy); }
.rail-btn.active {
  background: var(--bf-orange-soft);
  color: var(--bf-orange);
  box-shadow: inset 0 0 0 1px #f5b59a;
}
.rail-btn .tip {
  display: none;
  position: absolute;
  left: calc(100% + 10px);
  top: 50%; transform: translateY(-50%);
  background: var(--bf-navy); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 6px 8px; border-radius: 8px;
  white-space: nowrap; z-index: 20;
}
.rail-btn:hover .tip { display: block; }
.rail-spacer { flex: 1; }

.menu-panel {
  width: var(--bf-menu-w);
  background: #fff;
  border-right: 1px solid var(--bf-line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.22s ease, opacity 0.18s ease, border-color 0.18s ease;
}
.menu-panel.collapsed {
  width: 0;
  min-width: 0;
  opacity: 0;
  border-right-color: transparent;
  pointer-events: none;
}
.menu-backdrop {
  display: none;
}
.menu-panel-head {
  padding: 18px 16px 10px;
  border-bottom: 1px solid var(--bf-line);
}
.menu-panel-head h2 { font-size: 15px; }
.menu-panel-head p { margin: 4px 0 0; font-size: 12px; color: var(--bf-muted); }
.menu-panel-nav {
  flex: 1; overflow-y: auto; padding: 10px;
  scrollbar-width: thin;
}
.menu-link {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  border: none; background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--bf-ink-soft);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer;
  margin-bottom: 2px;
}
.menu-link:hover { background: #f4f7fb; color: var(--bf-ink); }
.menu-link.active {
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
  font-weight: 650;
}
.menu-link .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.45;
}
.menu-group-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--bf-muted);
  padding: 12px 12px 6px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bf-body-bg);
  background-attachment: fixed;
}
.content-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 0;
  flex-wrap: wrap;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--bf-muted); flex-wrap: wrap;
}
.breadcrumb strong { color: var(--bf-ink); font-weight: 650; }
.breadcrumb .sep { opacity: 0.4; }
.content-bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.saved-pill {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--bf-green); font-size: 12.5px; font-weight: 700;
}
.toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--bf-ink-soft);
}
.toggle-track {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--bf-green); position: relative;
}
.toggle-track::after {
  content: "";
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
}

.content { padding: 14px 22px 28px; flex: 1; overflow: auto; }
.page { display: none; animation: rise 0.3s ease both; }
.page.active { display: block; }

.app-footer {
  flex-shrink: 0;
  background: transparent;
  border-top: 1px solid var(--bf-line);
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--bf-ink-soft);
  z-index: 20;
}
.app-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.app-footer .footer-left,
.app-footer .footer-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.app-footer .sep {
  margin: 0 8px;
  opacity: 0.45;
}
.app-footer .text-warning {
  color: #f1b44c;
  font-weight: 700;
}
.app-footer .footer-ico {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.app-footer .footer-ico svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.role-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--bf-line);
  margin-bottom: 14px;
  box-shadow: var(--bf-shadow);
}
.role-banner select {
  border: 1px solid var(--bf-line-strong);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  color: var(--bf-ink);
}

/* ========== UI primitives ========== */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; }
.page-head p { margin: 4px 0 0; color: var(--bf-muted); font-size: 13.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px; font-weight: 650;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--bf-orange); color: #fff; }
.btn-primary:hover { background: var(--bf-orange-dark); color: #fff; }
.btn-accent { background: var(--bf-orange); color: #fff; }
.btn-accent:hover { background: var(--bf-orange-dark); color: #fff; }
.btn-info { background: var(--bf-navy); color: #fff; }
.btn-info:hover { background: var(--bf-navy-2); color: #fff; }
.btn-success { background: var(--bf-green); color: #fff; }
.btn-success:hover { color: #fff; }
.btn-danger { background: var(--bf-danger); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-outline {
  background: #fff; border-color: var(--bf-line-strong); color: var(--bf-ink-soft);
}
.btn-outline:hover {
  border-color: #f5b59a; color: var(--bf-orange-dark); background: var(--bf-orange-soft);
}
.btn-ghost { background: transparent; color: var(--bf-ink-soft); }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { padding: 12px 18px; font-size: 14px; }
.btn .btn-ico {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn .btn-ico svg,
.btn svg.btn-ico {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--bf-line);
  background: #fff;
  display: grid; place-items: center;
  cursor: pointer; color: var(--bf-ink-soft);
  position: relative;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.kpi {
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 18px;
  box-shadow: var(--bf-shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute; right: -18px; top: -18px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--kpi-tint, var(--bf-orange-soft));
  opacity: 0.85;
}
.kpi-label { font-size: 12px; color: var(--bf-muted); font-weight: 600; position: relative; }
.kpi-value { font-size: 28px; font-weight: 700; margin-top: 6px; position: relative; }
.kpi-meta { font-size: 12px; margin-top: 6px; color: var(--bf-green); position: relative; font-weight: 600; }
.kpi-meta.down { color: var(--bf-danger); }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.panel {
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--bf-line);
  background: #fff;
}
.panel-head h3 { font-size: 14.5px; font-weight: 700; }
.panel-head .muted { font-size: 12px; color: var(--bf-muted); font-weight: 500; }
.panel-body { padding: 18px; }
.panel-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--bf-line);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #fafbfd;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative; }
.form-group.span-2 { grid-column: span 2; }
.form-group.span-3 { grid-column: span 3; }
.form-group.span-4 { grid-column: span 4; }
label { font-size: 12px; font-weight: 650; color: var(--bf-ink-soft); }
label .req { color: var(--bf-danger); margin-left: 2px; }
.form-control, .form-select, textarea.form-control {
  width: 100%;
  border: 1px solid var(--bf-line-strong);
  background: #fff;
  border-radius: var(--bf-radius-sm);
  padding: 10px 12px;
  color: var(--bf-ink);
  outline: none;
  transition: 0.15s ease;
}
.form-control:focus, .form-select:focus, textarea.form-control:focus {
  border-color: #f5b59a;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.15);
}
.form-control:disabled, .form-control[readonly] {
  background: #f7f9fc; color: var(--bf-ink-soft);
}
.hint { font-size: 11.5px; color: var(--bf-muted); }

/* Bootstrap maxlength counter (MaxThreshold) */
.bf-maxlength-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.bf-maxlength-wrap > .form-control {
  width: 100%;
}
.bf-maxlength-wrap > .form-control[maxlength],
.bf-maxlength-wrap > textarea[maxlength] {
  padding-right: 4.5rem;
}
.bf-maxlength-wrap > .bootstrap-maxlength.bf-maxlength,
.bf-maxlength-wrap > .bf-maxlength {
  position: absolute !important;
  top: auto !important;
  left: auto !important;
  right: 8px !important;
  bottom: 6px !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 2;
}
.bf-maxlength-wrap-textarea > .bootstrap-maxlength.bf-maxlength,
.bf-maxlength-wrap-textarea > .bf-maxlength {
  bottom: 8px !important;
}
.bf-maxlength {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 999px;
  pointer-events: none;
}
.bf-maxlength-warning {
  background: #fff4ec;
  color: #b45309;
  border: 1px solid #fcd9bd;
}
.bf-maxlength-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.section-banner {
  background: #f7f9fc;
  border: 1px solid var(--bf-line);
  color: var(--bf-ink-soft);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px; font-weight: 650;
  margin: 4px 0 8px;
  grid-column: 1 / -1;
}
.section-banner.teal, .section-banner.amber {
  background: var(--bf-orange-soft);
  border-color: #f5b59a;
  color: var(--bf-orange-dark);
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.filter-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 14px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 14px;
  box-shadow: var(--bf-shadow);
}

.table-wrap { overflow-x: auto; }
.panel > .table-wrap {
  overflow: visible;
}
.panel > .table-wrap > .dataTables_wrapper {
  margin: 0;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  color: #495057;
}
table.data th {
  text-align: left;
  padding: 12px 14px;
  background: #eef2f8;
  color: #1a2238;
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  border-bottom: 1px solid #dbe3ef;
  white-space: nowrap;
  vertical-align: middle;
}
table.data td {
  padding: 12px 14px;
  border-top: 1px solid #eff2f7;
  border-bottom: none;
  vertical-align: middle;
}
table.data tbody tr:hover { background: transparent; }
table.data tbody tr:hover td { background: #f8f9fa; }
table.data th.col-actions,
table.data td.col-actions,
table.data th:last-child,
table.data td.actions,
table.data td:has(.actions),
table.data td:has(.btn-icon) {
  width: 118px;
  min-width: 118px;
  text-align: center !important;
  white-space: nowrap;
}
table.data .actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  width: auto;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: #eef2f7;
  color: #495057;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
  box-shadow: none;
}
.btn-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-icon:hover {
  transform: none;
  box-shadow: none;
}
.btn-icon.view {
  color: #556ee6;
  background: rgba(85, 110, 230, 0.12);
}
.btn-icon.view:hover {
  color: #fff;
  background: #556ee6;
}
.btn-icon.edit {
  color: #f1b44c;
  background: rgba(241, 180, 76, 0.18);
}
.btn-icon.edit:hover {
  color: #fff;
  background: #f1b44c;
}
.btn-icon.delete {
  color: #f46a6a;
  background: rgba(244, 106, 106, 0.14);
}
.btn-icon.delete:hover {
  color: #fff;
  background: #f46a6a;
}
.btn-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.16);
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge-success { background: var(--bf-green-soft); color: var(--bf-green); }
.badge-warn { background: var(--bf-warn-soft); color: var(--bf-warn); }
.badge-info { background: var(--bf-blue-soft); color: var(--bf-blue); }
.badge-danger { background: var(--bf-danger-soft); color: var(--bf-danger); }
.badge-muted { background: #eef2f7; color: var(--bf-muted); }
.badge-brand { background: var(--bf-orange-soft); color: var(--bf-orange-dark); }

.tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--bf-line);
  margin-bottom: 16px;
  padding: 0 4px;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}
.tab {
  border: none; background: transparent;
  padding: 12px 14px;
  font-size: 13px; font-weight: 650;
  color: var(--bf-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab.active {
  color: var(--bf-orange);
  border-bottom-color: var(--bf-orange);
  background: #fff;
  border-radius: 10px 10px 0 0;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: rise 0.25s ease both; }

.status-pipeline {
  display: flex; gap: 0; overflow-x: auto; padding: 4px 0 10px;
}
.status-step {
  flex: 1; min-width: 100px;
  text-align: center; position: relative;
  padding: 10px 8px;
}
.status-step::before {
  content: "";
  width: 12px; height: 12px; border-radius: 50%;
  background: #d5dde8;
  display: block; margin: 0 auto 8px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #d5dde8;
  position: relative; z-index: 1;
}
.status-step::after {
  content: "";
  position: absolute; top: 15px; left: 50%; right: -50%;
  height: 2px; background: #d5dde8; z-index: 0;
}
.status-step:last-child::after { display: none; }
.status-step.done::before { background: var(--bf-orange); box-shadow: 0 0 0 1px var(--bf-orange); }
.status-step.done::after { background: var(--bf-orange); }
.status-step.current::before {
  background: var(--bf-navy);
  box-shadow: 0 0 0 1px var(--bf-navy), 0 0 0 5px rgba(241,90,36,0.2);
}
.status-step span { font-size: 11px; font-weight: 650; color: var(--bf-muted); }
.status-step.done span, .status-step.current span { color: var(--bf-ink); }

.box-plan { display: grid; gap: 10px; }
.box-card {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: center;
  padding: 14px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: #fafbfd;
}
.box-card .qr {
  width: 64px; height: 64px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, #1a2238 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, #1a2238 0 2px, transparent 2px 4px);
  background-size: 8px 8px;
  border: 1px solid var(--bf-line);
}
.box-card h4 { font-size: 14px; margin-bottom: 2px; }
.box-card p { margin: 0; font-size: 12.5px; color: var(--bf-muted); }

.upload-zone {
  border: 1.5px dashed var(--bf-line-strong);
  border-radius: 12px;
  padding: 22px;
  text-align: center;
  background: #fafbfd;
  color: var(--bf-muted);
  cursor: pointer;
}
.upload-zone strong { color: var(--bf-orange); display: block; margin-bottom: 4px; }

.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 16px 1fr; gap: 12px; }
.timeline-item .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bf-orange); margin-top: 4px;
  box-shadow: 0 0 0 4px var(--bf-orange-soft);
}
.timeline-item h4 { font-size: 13px; }
.timeline-item p { margin: 2px 0 0; font-size: 12px; color: var(--bf-muted); }

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(26, 34, 56, 0.45);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: min(720px, 100%);
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--bf-shadow-lg);
  max-height: 90vh;
  overflow: auto;
  animation: rise 0.25s ease both;
}
.modal.xl { width: min(980px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--bf-navy);
  color: #fff;
  border-bottom: 3px solid var(--bf-orange);
}
.modal-head h3 { font-size: 15px; color: #fff; }
.modal-body { padding: 18px; }
.modal-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--bf-line);
  display: flex; justify-content: space-between; gap: 10px;
}

/* Right-side operation drawer (slide-over) */
@keyframes drawerIn {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26, 34, 56, 0.38);
  backdrop-filter: blur(3px);
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  z-index: 110;
  padding: 14px;
}
.drawer-backdrop.open { display: flex; }
.drawer {
  width: min(560px, 100%);
  max-height: calc(100vh - 28px);
  min-height: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--bf-shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: drawerIn 0.28s ease both;
}
.drawer.lg { width: min(640px, 100%); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--bf-line);
  background: #fff;
  flex-shrink: 0;
}
.drawer-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}
.drawer-head-main h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--bf-ink);
}
.drawer-id {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef2f7;
  color: #74788d;
  font-size: 11px;
  font-weight: 700;
}
.drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.drawer-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--bf-muted);
  font-size: 12px;
  font-weight: 600;
}
.drawer-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--bf-line);
  background: #fff;
  color: var(--bf-ink-soft);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.drawer-nav-btn:hover {
  border-color: var(--bf-orange);
  color: var(--bf-orange);
}
.drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--bf-line);
  background: #fff;
  color: var(--bf-ink-soft);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
}
.drawer-close:hover {
  background: #f4f7fb;
  color: var(--bf-ink);
}
.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 18px 18px;
}
.drawer-section {
  padding: 14px 0;
  border-bottom: 1px solid #eef2f7;
}
.drawer-section:last-child { border-bottom: none; }
.drawer-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--bf-ink);
  margin-bottom: 12px;
}
.drawer-person {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.drawer-person .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bf-navy);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.drawer-person strong {
  display: block;
  font-size: 14px;
}
.drawer-person span {
  display: block;
  font-size: 12px;
  color: var(--bf-muted);
}
.drawer-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.drawer-meta-item span {
  display: block;
  font-size: 11px;
  color: var(--bf-muted);
  font-weight: 600;
  margin-bottom: 2px;
}
.drawer-meta-item strong {
  font-size: 13px;
  color: var(--bf-ink);
  font-weight: 650;
}
.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.drawer-tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f4f7fb;
  border: 1px solid var(--bf-line);
  color: var(--bf-ink-soft);
  font-size: 12px;
  font-weight: 600;
}
.drawer-note {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  border: 1px solid var(--bf-line);
  border-radius: 10px;
  background: #fafbfd;
  color: var(--bf-ink-soft);
  font-size: 13px;
  resize: vertical;
}
.drawer-timeline {
  display: grid;
  gap: 0;
}
.drawer-timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.drawer-timeline-item:last-child { padding-bottom: 0; }
.drawer-timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  bottom: 0;
  width: 2px;
  background: #e8edf3;
}
.drawer-timeline-item:last-child::before { display: none; }
.drawer-timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--bf-orange);
  margin-top: 2px;
  z-index: 1;
}
.drawer-timeline-item.done .drawer-timeline-dot {
  border-color: var(--bf-green);
  background: var(--bf-green);
}
.drawer-timeline-item.current .drawer-timeline-dot {
  border-color: var(--bf-orange);
  box-shadow: 0 0 0 4px rgba(241, 90, 36, 0.15);
}
.drawer-timeline-body h4 {
  font-size: 13px;
  margin-bottom: 2px;
}
.drawer-timeline-body p {
  margin: 0;
  font-size: 12px;
  color: var(--bf-muted);
}
.drawer-foot {
  flex-shrink: 0;
  padding: 14px 18px;
  border-top: 1px solid var(--bf-line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: #fafbfd;
}
.drawer-foot .btn {
  min-width: 110px;
  justify-content: center;
}

@media (max-width: 900px) {
  .drawer-backdrop { padding: 0; }
  .drawer,
  .drawer.lg {
    width: 100%;
    max-height: 100%;
    border-radius: 16px 16px 0 0;
    align-self: flex-end;
    max-height: min(92vh, 100%);
  }
  .drawer-meta-grid { grid-template-columns: 1fr; }
}

.toast {
  position: fixed; right: 24px; bottom: 24px;
  background: var(--bf-navy); color: #fff;
  padding: 12px 16px; border-radius: 12px;
  box-shadow: var(--bf-shadow-lg);
  z-index: 200; display: none;
  font-size: 13px; font-weight: 600;
  border-left: 4px solid var(--bf-orange);
}
.toast.show { display: block; animation: rise 0.25s ease both; }

.chart-bars {
  display: flex; align-items: flex-end; gap: 10px;
  height: 160px; padding-top: 10px;
}
.chart-bars .bar {
  flex: 1; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, #ff7a45, #f15a24);
  position: relative; min-height: 12px;
}
.chart-bars .bar span {
  position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--bf-muted); font-weight: 600;
}

.mini-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--bf-line);
  font-size: 13px;
}
.mini-stat:last-child { border-bottom: none; }
.mini-stat strong { font-weight: 700; }

.prod-flow {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px;
}
.prod-flow a, .prod-flow .step-link {
  display: block; text-align: center;
  padding: 14px 8px;
  border-radius: 12px;
  border: 1px solid var(--bf-line);
  background: #fff;
  color: var(--bf-ink);
  font-size: 12px; font-weight: 650;
  transition: 0.15s;
  cursor: pointer;
  box-shadow: var(--bf-shadow);
}
.prod-flow a:hover, .prod-flow .step-link:hover {
  border-color: #f5b59a;
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
}
.prod-flow .num {
  display: grid; place-items: center;
  width: 28px; height: 28px; margin: 0 auto 8px;
  border-radius: 8px;
  background: var(--bf-navy); color: #fff;
  font-size: 12px;
}

.check-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.check-row:not(.bf-switch) input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--bf-orange); }
.bf-switch.bf-switch-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
}
.bf-switch-caption {
  font-size: 13px;
  font-weight: 500;
  color: var(--bf-ink);
  flex: 1;
}
.pref-checks .bf-switch { margin-top: 0; }
.pref-checks .bf-switch + .bf-switch { margin-top: 10px; }

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--bf-line-strong);
  background: #fff;
  color: var(--bf-ink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12.5px; font-weight: 650;
  cursor: pointer;
}
.pill.active {
  background: var(--bf-navy);
  border-color: var(--bf-navy);
  color: #fff;
}

.list-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1px solid var(--bf-line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 10px;
}
.list-card:hover { border-color: #f5b59a; background: #fffaf7; }
.list-card h4 { font-size: 14px; color: var(--bf-blue); margin-bottom: 2px; }
.list-card p { margin: 0; font-size: 12px; color: var(--bf-muted); }

.mobile-toggle { display: none; }
.search-box { display: none; }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .filter-bar { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .prod-flow { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  :root {
    --bf-rail-w: 0px;
    --bf-top-h: 56px;
    --bf-bottom-nav-h: 72px;
  }

  .login-page.login-split { grid-template-columns: 1fr; }
  .login-visual { min-height: 240px; padding: 24px; }
  .app-stage { padding: 0; }
  .app-frame {
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Top bar: logo + menu | actions */
  .topnav {
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    padding: 0 10px;
    height: var(--bf-top-h);
  }
  .top-search { display: none !important; }
  .topnav-left { gap: 8px; }
  .topnav-brand {
    font-size: 14px;
    gap: 8px;
  }
  .topnav-brand .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .topnav-brand span { font-size: 11px; opacity: 0.7; }
  .menu-chip {
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-radius: 10px;
    gap: 0;
  }
  .menu-chip-label { display: none; }
  .menu-chip-ico { font-size: 18px; line-height: 1; }
  .topnav-right { gap: 6px; }
  .company-pill {
    padding: 3px;
    gap: 0;
  }
  .company-pill #topUserLabel,
  .company-pill .user-menu-caret { display: none; }
  .user-menu-panel {
    position: fixed;
    top: calc(var(--bf-top-h) + 8px);
    right: 10px;
    width: min(260px, calc(100vw - 20px));
  }
  .top-icon {
    width: 34px;
    height: 34px;
  }
  .notify-panel {
    position: fixed;
    top: calc(var(--bf-top-h) + 8px);
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
  }

  /* Workspace + bottom nav */
  .workspace {
    position: relative;
    overflow: hidden;
    padding-bottom: var(--bf-bottom-nav-h);
  }

  .icon-rail {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    height: var(--bf-bottom-nav-h);
    flex-direction: row;
    justify-content: flex-start;
    align-items: stretch;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
    border-right: none;
    border-top: 1px solid var(--bf-line);
    background: #fff;
    z-index: 45;
    box-shadow: 0 -6px 20px rgba(26, 34, 56, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .icon-rail::-webkit-scrollbar { display: none; }
  .icon-rail .rail-spacer { display: none; }
  .rail-btn {
    flex: 0 0 auto;
    width: auto;
    min-width: 58px;
    height: auto;
    border-radius: 12px;
    font-size: 15px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px;
  }
  .rail-btn i {
    font-size: 1.15rem;
  }
  .rail-btn .tip {
    display: block !important;
    position: static !important;
    left: auto;
    top: auto;
    transform: none !important;
    background: transparent !important;
    color: inherit !important;
    font-size: 9px !important;
    font-weight: 650;
    padding: 0 !important;
    border-radius: 0;
    white-space: nowrap;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rail-btn.active {
    background: var(--bf-orange-soft);
    color: var(--bf-orange);
    box-shadow: none;
  }

  .menu-acc {
    border: 1px solid var(--bf-line);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
  }
  .menu-acc-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: none;
    background: #f8fafc;
    padding: 12px 14px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--bf-ink);
    cursor: pointer;
    text-align: left;
  }
  .menu-acc-head .chev {
    font-size: 11px;
    color: var(--bf-muted);
    transition: transform 0.2s ease;
  }
  .menu-acc.open .menu-acc-head {
    background: var(--bf-orange-soft);
    color: var(--bf-orange-dark);
  }
  .menu-acc.open .menu-acc-head .chev { transform: rotate(90deg); }
  .menu-acc-body {
    display: none;
    padding: 6px;
    border-top: 1px solid var(--bf-line);
  }
  .menu-acc.open .menu-acc-body { display: block; }

  .menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 34, 56, 0.45);
    z-index: 50;
    border: none;
    padding: 0;
    cursor: pointer;
  }
  .menu-backdrop.show { display: block; }

  .menu-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: auto;
    width: min(300px, 86vw);
    max-width: 300px;
    z-index: 55;
    opacity: 1;
    transform: translateX(-105%);
    pointer-events: none;
    box-shadow: var(--bf-shadow-lg);
    border-right: 1px solid var(--bf-line);
    transition: transform 0.25s ease;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .menu-panel.collapsed {
    width: min(300px, 86vw);
    min-width: 0;
    opacity: 1;
    transform: translateX(-105%);
    pointer-events: none;
  }
  .menu-panel.is-open {
    transform: translateX(0);
    pointer-events: auto;
    opacity: 1;
  }

  .main {
    width: 100%;
    min-width: 0;
  }

  .content-bar {
    padding: 10px 12px 0;
  }
  .content-bar-actions { display: none; }
  .content {
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
  }
  .app-footer {
    padding: 8px 12px calc(8px + var(--bf-bottom-nav-h));
    font-size: 11.5px;
  }
  .app-footer .footer-right {
    display: none;
  }

  .role-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    margin-bottom: 12px;
    gap: 8px;
  }
  .role-banner > div span { display: none; }
  .role-banner select { width: 100%; }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 12px;
  }
  .page-head h1 { font-size: 20px; }
  .page-head .btn-row {
    width: 100%;
  }
  .page-head .btn-row .btn {
    flex: 1;
    justify-content: center;
  }

  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .form-grid, .filter-bar { grid-template-columns: 1fr; }
  .filter-bar { padding: 12px; }
  .prod-flow { grid-template-columns: 1fr 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .status-pipeline { gap: 0; }
  .status-step { min-width: 84px; }

  /* Tables: horizontal scroll instead of crushing columns */
  .panel { overflow: hidden; }
  .panel > .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel .dt-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .panel table.data,
  .panel table.dataTable {
    width: auto !important;
    min-width: 880px !important;
    max-width: none !important;
  }
  table.data .actions {
    flex-wrap: nowrap;
  }

  .mobile-toggle { display: grid; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topnav-brand {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rail-btn { width: 42px; height: 42px; font-size: 15px; }
  .page-head .btn-row { flex-direction: column; }
  .page-head .btn-row .btn { width: 100%; }
}

/* ── Admin Tools: list, filters, drawer form, select2 ── */
.admin-filter-panel {
  margin-bottom: 14px;
  background: linear-gradient(180deg, #f8fafc 0%, #f3f6fa 100%);
  border: 1px solid #dbe3ef;
  border-left: 4px solid var(--bf-orange);
  border-radius: var(--bf-radius);
  overflow: visible;
}
.admin-filter-head {
  padding: 10px 16px;
  border-bottom: 1px solid #e3e9f2;
  background: rgba(255, 255, 255, 0.72);
}
.admin-filter-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bf-orange-dark);
}
.admin-filter-body {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 16px;
}
.admin-filter-body .form-group {
  min-width: 200px;
  flex: 1;
  max-width: 280px;
  margin: 0;
}
.admin-filter-actions {
  flex: 0 0 auto;
  margin-left: auto;
  align-self: flex-end;
}
.admin-filter-actions .btn {
  white-space: nowrap;
}
.admin-filter-body .form-control {
  height: 38px;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px;
}
.admin-filter-body .select2-container {
  width: 100% !important;
}
.admin-filter-body .select2-container--default .select2-selection--single {
  height: 38px;
  min-height: 38px;
  border: 1px solid var(--bf-line-strong);
  border-radius: 8px;
  background: #fff;
}
.admin-filter-body .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 12px;
  font-size: 13px;
}
.admin-filter-body .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  right: 8px;
}
.admin-filter-panel select.select2-hidden-accessible {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.admin-list-panel {
  background: #fff;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  overflow: hidden;
}
.admin-list-panel > .table-wrap {
  padding: 0;
}
.admin-list-panel .dataTables_wrapper .dt-toolbar {
  border-top: none;
  padding: 10px 14px;
}
.admin-list-panel .dataTables_wrapper .dt-footer {
  padding: 8px 14px;
}
.admin-list-panel .dataTables_wrapper .dataTables_length label,
.admin-list-panel .dataTables_wrapper .dataTables_filter label,
.admin-list-panel .dataTables_wrapper .dataTables_info {
  font-size: 12px;
}
.admin-list-panel .dataTables_wrapper .dataTables_length select,
.admin-list-panel .dataTables_wrapper .dataTables_filter input {
  height: 32px;
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
}
.admin-table thead th {
  padding: 8px 10px !important;
  font-size: 11px !important;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5a6478 !important;
}
.admin-table tbody td {
  padding: 7px 10px !important;
  font-size: 12px !important;
  line-height: 1.35;
  vertical-align: middle !important;
  position: relative;
}
.admin-table .cfg-value {
  padding-right: 4.5rem;
}
.admin-table td .bootstrap-maxlength,
.admin-table td .bf-maxlength,
.admin-table .bf-maxlength-wrap > .bootstrap-maxlength.bf-maxlength {
  z-index: 2;
}
.admin-table .col-sno {
  width: 40px !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
  color: var(--bf-muted);
  text-align: center;
}
.admin-table .col-id,
.admin-table .col-order,
.admin-table .col-flag {
  white-space: nowrap;
  text-align: center;
}
.admin-table .col-actions {
  width: 72px !important;
}
.admin-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}
.admin-act-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--bf-line);
  border-radius: 7px;
  background: #fff;
  color: var(--bf-ink-soft);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: 0.15s ease;
}
.admin-act-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-act-btn .bx {
  font-size: 14px;
  line-height: 1;
}
.admin-act-btn:hover {
  border-color: var(--bf-orange);
  color: var(--bf-orange);
  background: var(--bf-orange-soft);
}
.admin-act-btn-primary {
  border-color: #dbe3ef;
  color: var(--bf-orange);
}
.admin-act-btn-primary:hover {
  background: var(--bf-orange);
  border-color: var(--bf-orange);
  color: #fff;
}
.admin-act-btn-danger:hover {
  border-color: #e55353;
  color: #e55353;
  background: #fef2f2;
}
.admin-act-btn-labeled {
  width: auto;
  min-height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.admin-table.role-permission-table .col-actions {
  width: 110px !important;
}
.role-module-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  max-width: 240px;
}
.admin-module-chip {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  background: var(--bf-blue-soft);
  color: var(--bf-blue);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-module-chip-more {
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
  max-width: none;
  flex-shrink: 0;
}
.admin-module-chip-select {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid var(--bf-line-strong);
  background: #fff;
  color: var(--bf-ink-soft);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
}
.admin-module-chip-select input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.admin-module-chip-select:has(input:checked) {
  background: var(--bf-success-soft);
  border-color: #9fd4b0;
  color: var(--bf-green);
}
.admin-module-chip-select:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.65;
}
.admin-table .col-modules .admin-chip-row {
  max-width: 220px;
}
.admin-table.roles-table .col-actions {
  width: 96px !important;
}
.admin-table .badge {
  font-size: 10px;
  padding: 2px 7px;
  line-height: 1.3;
}
.admin-cell-ellipsis {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.admin-record-log {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--bf-border);
  font-size: 12px;
  color: var(--bf-muted);
}

.role-permission-layout-panel {
  padding: 0;
}
.role-perm-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 420px;
}
.role-perm-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-right: 1px solid var(--bf-line);
  background: #fafbfd;
}
.role-perm-nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--bf-ink-soft);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.role-perm-nav-btn i {
  font-size: 16px;
  flex-shrink: 0;
}
.role-perm-nav-btn.active,
.role-perm-nav-btn:hover {
  background: var(--bf-orange-soft);
  border-color: #f3d5c8;
  color: var(--bf-orange-dark);
}
.role-perm-content {
  padding: 12px 14px 16px;
  min-width: 0;
}
.role-perm-pane {
  display: none;
}
.role-perm-pane.active {
  display: block;
}
.role-perm-crumb {
  margin-bottom: 10px;
  font-size: 12px;
}
.role-perm-table {
  table-layout: fixed;
  width: 100%;
}
.role-perm-table col.col-perm-all,
.role-perm-table col.col-perm-flag {
  width: 72px;
}
.role-perm-table col.col-perm-page {
  width: auto;
}
.role-perm-table thead th {
  white-space: nowrap;
  vertical-align: middle;
}
.role-perm-table thead th.col-perm-all,
.role-perm-table thead th.col-perm-flag,
.role-perm-table tbody td.col-perm-cell {
  width: 72px;
  min-width: 72px;
  max-width: 72px;
  text-align: center !important;
  vertical-align: middle !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.role-perm-table thead th.col-perm-page,
.role-perm-table tbody td.col-perm-page {
  text-align: left !important;
  vertical-align: middle !important;
}
.role-perm-table .role-perm-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 28px;
  margin: 0 auto;
  vertical-align: middle;
}
.role-perm-table .role-perm-switch .bf-switch-state {
  display: none;
}
.role-perm-table .role-perm-switch .bf-switch-track {
  box-shadow: inset 0 0 0 1px rgba(26, 34, 56, 0.08);
}
.role-perm-table .role-perm-switch:hover .bf-switch-track {
  box-shadow: inset 0 0 0 1px rgba(46, 125, 50, 0.28);
}
.role-perm-table .role-perm-switch input:checked + .bf-switch-track {
  background: var(--bf-success);
}
.role-perm-table .role-perm-switch:has(input:focus-visible) .bf-switch-track {
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.18);
}
.role-perm-table .page-name {
  font-weight: 500;
}
@media (max-width: 900px) {
  .role-perm-shell {
    grid-template-columns: 1fr;
  }
  .role-perm-nav {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--bf-line);
  }
  .role-perm-nav-btn {
    width: auto;
    flex: 1 1 auto;
  }
}

.admin-form-drawer { width: min(520px, 100%); }
.admin-form-drawer.lg { width: min(640px, 100%); }
.admin-form-drawer .drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 20px 20px;
  overflow-y: auto;
  overflow-x: hidden;
}
.admin-form-drawer .form-group {
  position: relative;
  z-index: 1;
}
.admin-form-drawer .form-group.is-select2-open {
  z-index: 2;
}
.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.admin-form-grid .form-group.span-2,
.admin-form-grid .form-group.span-full {
  grid-column: 1 / -1;
}
.admin-form-drawer label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--bf-ink-soft);
  margin-bottom: 0;
}
.admin-form-drawer .form-control,
.admin-form-drawer .form-select,
.admin-form-drawer .select2-container--default .select2-selection--single {
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
  font-size: 13px;
  border-radius: 8px;
  border-color: var(--bf-line-strong);
}
.admin-form-drawer input.form-control,
.admin-form-drawer input.form-select {
  padding: 8px 12px;
  line-height: 1.35;
}
.admin-form-drawer textarea.form-control {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.45;
}
.admin-form-drawer .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 12px;
  padding-right: 28px;
  color: var(--bf-ink);
}
.admin-form-drawer .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  right: 8px;
}
.admin-form-drawer .check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 500;
  color: var(--bf-ink);
}

/* Toggle switch — admin form fields */
.bf-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  cursor: pointer;
  user-select: none;
}
.bf-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.bf-switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 999px;
  background: #c8ced8;
  transition: background 0.2s ease;
  overflow: hidden;
}
.bf-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(26, 34, 56, 0.2);
  transition: transform 0.2s ease;
}
.bf-switch input:checked + .bf-switch-track {
  background: var(--bf-orange);
}
.bf-switch input:checked + .bf-switch-track::after {
  transform: translateX(20px);
}
.bf-switch-state {
  font-size: 13px;
  font-weight: 600;
  color: var(--bf-ink-soft);
  min-width: 56px;
}
.bf-switch input:checked ~ .bf-switch-state {
  color: var(--bf-orange-dark);
}
.bf-switch:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.65;
}
.bf-switch:has(input:focus-visible) .bf-switch-track {
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.15);
}

/* Compact toggle variants — after base rules so checked transform is not overridden */
.bf-switch.bf-switch-sm {
  min-height: 28px;
  gap: 6px;
}
.bf-switch.bf-switch-sm .bf-switch-track {
  width: 32px;
  height: 18px;
}
.bf-switch.bf-switch-sm .bf-switch-track::after {
  width: 12px;
  height: 12px;
  top: 3px;
  left: 3px;
}
.bf-switch.bf-switch-sm input:checked + .bf-switch-track::after {
  transform: translateX(14px);
}
.bf-switch.bf-switch-sm .bf-switch-state {
  font-size: 11px;
  min-width: 36px;
}
.bf-switch.bf-switch-module {
  min-height: 24px;
  gap: 5px;
}
.bf-switch.bf-switch-module .bf-switch-state {
  display: none;
}
.bf-switch.bf-switch-module .bf-switch-caption {
  font-size: 12px;
  font-weight: 500;
  color: var(--bf-ink);
  line-height: 1.2;
}
.bf-switch.bf-switch-module .bf-switch-track {
  width: 28px;
  height: 16px;
}
.bf-switch.bf-switch-module .bf-switch-track::after {
  width: 10px;
  height: 10px;
  top: 3px;
  left: 3px;
}
.bf-switch.bf-switch-module input:checked + .bf-switch-track::after {
  transform: translateX(12px);
}

.drawer-foot.admin-form-foot {
  flex-shrink: 0;
  justify-content: space-between;
  align-items: center;
}
.drawer-foot.admin-form-foot .drawer-foot-actions {
  display: flex;
  gap: 10px;
}
body.admin-panel-open { overflow: hidden; }

/* Select2 — match backframe form controls */
.select2-container { width: 100% !important; font-size: 13px; }
.select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid var(--bf-line-strong);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px;
  padding-left: 12px;
  padding-right: 28px;
  color: var(--bf-ink);
}
.select2-container--default .select2-selection--single .select2-selection__placeholder {
  color: #9aa3b2;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  right: 8px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #74788d transparent transparent transparent;
  margin-top: -2px;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: #f5b59a;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12);
  outline: none;
}
.select2-dropdown {
  border: 1px solid var(--bf-line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(26, 34, 56, 0.12);
  overflow: hidden;
  z-index: 1205;
}
.select2-container--default .select2-results__option {
  padding: 8px 12px;
  font-size: 13px;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--bf-orange);
}
.select2-container--default .select2-search--dropdown {
  padding: 8px;
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid var(--bf-line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  outline: none;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #f5b59a;
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.12);
}
.drawer-backdrop.open .select2-container,
.modal-backdrop.open .select2-container { z-index: 1200; }
.select2-container--open { z-index: 1300 !important; }
.select2-dropdown { z-index: 1300 !important; }
body.admin-panel-open .select2-container--open,
body.admin-panel-open .select2-dropdown { z-index: 1300 !important; }

@media (max-width: 640px) {
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-filter-body .form-group { max-width: none; }
}

/* ========== App Launcher ========== */
.app-launcher-welcome {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: var(--bf-radius);
  background: linear-gradient(135deg, var(--bf-navy) 0%, var(--bf-navy-2) 55%, #1e2844 100%);
  box-shadow: var(--bf-shadow);
  color: #fff;
}
.app-launcher-welcome-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 82%, rgba(255,255,255,0.18) 0%, transparent 52%),
    radial-gradient(circle at 82% 18%, rgba(241,90,36,0.22) 0%, transparent 42%);
}
.app-launcher-welcome-body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  flex-wrap: wrap;
}
.app-launcher-greeting {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}
.app-launcher-tagline {
  margin: 0 0 6px;
  font-size: 13px;
  color: rgba(255, 196, 140, 0.95);
}
.app-launcher-last-login {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-launcher-welcome-side {
  display: flex;
  align-items: center;
  gap: 18px;
}
.app-launcher-clock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}
.app-launcher-clock i { font-size: 18px; }
.app-launcher-welcome-icon i {
  font-size: 3.2rem;
  color: rgba(255, 255, 255, 0.88);
}
.app-launcher-panel .panel-body { padding-top: 18px; }
.app-launcher-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.app-launcher-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.app-launcher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px;
}
.app-launcher-loading,
.app-launcher-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 36px 20px;
}
.app-launcher-loading p,
.app-launcher-empty p { margin: 8px 0 0; }
.app-launcher-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border: 3px solid var(--bf-line);
  border-top-color: var(--bf-orange);
  border-radius: 50%;
  animation: bf-spin 0.8s linear infinite;
}
@keyframes bf-spin { to { transform: rotate(360deg); } }
.app-launcher-empty i {
  font-size: 2.5rem;
  color: var(--bf-muted);
  display: block;
  margin-bottom: 8px;
}
.app-launcher-empty h4 { margin: 0 0 6px; font-size: 15px; }
.app-launcher-empty .btn { margin-top: 12px; }
.app-launcher-error i { color: var(--bf-danger); }
.app-launcher-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  padding: 14px 10px;
  border-radius: var(--bf-radius-sm);
  background: linear-gradient(160deg, var(--bf-navy) 0%, #243456 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(26, 34, 56, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.app-launcher-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(241, 90, 36, 0.45);
  box-shadow: 0 10px 24px rgba(26, 34, 56, 0.24);
  color: #fff !important;
}
.app-launcher-tile-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-launcher-tile-icon i { font-size: 1.35rem; color: #fff; }
.app-launcher-tile-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: #fff;
}
@media (max-width: 720px) {
  .app-launcher-welcome-side { width: 100%; justify-content: space-between; }
  .app-launcher-welcome-icon { display: none; }
}

/* Static menu items (Release Updates) */
.rail-btn-static { margin-top: 4px; }
.menu-nav-divider {
  height: 1px;
  background: var(--bf-line);
  margin: 8px 0;
}
.menu-link-static {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-link-static i { font-size: 16px; opacity: 0.85; }

/* Release Updates page */
.release-head-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.release-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.release-search-ico {
  color: var(--bf-muted);
  font-size: 18px;
  flex-shrink: 0;
}
.release-search-bar .form-control { flex: 1; min-width: 0; }
.release-search-empty { margin-bottom: 14px; }
.release-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.release-main { display: grid; gap: 14px; }
.release-card-head {
  align-items: flex-start;
}
.release-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12px;
  color: var(--bf-muted);
}
.release-card-meta i { color: var(--bf-orange); }
.release-module-block + .release-module-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bf-line);
}
.release-module-title {
  margin: 0 0 8px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--bf-navy);
}
.release-module-title i { color: var(--bf-orange); }
.release-note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--bf-ink-soft);
  font-size: 13px;
  line-height: 1.55;
}
.release-note-list li + li { margin-top: 6px; }
.release-sidebar { display: grid; gap: 14px; }
.release-build-info > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--bf-line);
}
.release-build-info > div:last-child { border-bottom: none; }
.release-build-info span { color: var(--bf-muted); }
.release-version-index { display: grid; gap: 8px; }
.release-version-link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  padding: 10px 12px;
  border: 1px solid var(--bf-line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--bf-ink);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.release-version-link:hover {
  border-color: #f5b59a;
  background: #fff8f4;
}
.release-version-link span { font-weight: 700; font-size: 13px; }
.release-version-link small {
  grid-column: 1;
  color: var(--bf-muted);
  font-size: 11.5px;
}
.release-version-link .badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
@media (max-width: 1100px) {
  .release-layout { grid-template-columns: 1fr; }
}

/* Lock screen */
.lock-screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lock-screen-overlay[hidden] { display: none !important; }
.lock-screen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 34, 0.62);
  backdrop-filter: blur(6px);
}
.lock-screen-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: var(--bf-shadow-lg);
}
.lock-screen-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--bf-navy) 0%, #243456 100%);
  color: #fff;
}
.lock-screen-user strong {
  display: block;
  font-size: 15px;
  line-height: 1.3;
}
.lock-screen-user span {
  display: block;
  font-size: 12px;
  opacity: 0.88;
  margin-top: 2px;
}
.lock-screen-avatar,
.lock-screen-avatar-img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  flex-shrink: 0;
}
.lock-screen-avatar {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 18px;
  font-weight: 800;
}
.lock-screen-avatar-img {
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.lock-screen-body {
  padding: 22px 20px 20px;
  text-align: center;
}
.lock-screen-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--bf-orange-soft);
  color: var(--bf-orange-dark);
  display: grid;
  place-items: center;
  font-size: 26px;
}
.lock-screen-body h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--bf-ink);
}
.lock-screen-timer,
.lock-screen-datetime {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--bf-muted);
}
.lock-screen-datetime {
  font-weight: 600;
  color: var(--bf-ink-soft);
  margin-bottom: 10px;
}
.lock-screen-msg {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--bf-muted);
}
.lock-screen-password-wrap {
  text-align: left;
  margin-bottom: 12px;
}
.lock-screen-error {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--bf-danger);
}
.lock-screen-error[hidden] { display: none !important; }
.lock-screen-signout {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--bf-muted);
}
.lock-screen-signout a {
  font-weight: 600;
  color: var(--bf-orange-dark);
  text-decoration: none;
}
.lock-screen-signout a:hover { text-decoration: underline; }
