:root {
  color-scheme: light;
  /* Ukrainian Flag Palette: Regal Navy / Cobalt Blue & Golden Yellow */
  --ua-navy: #081c44;
  --ua-navy-hover: #0e2a63;
  --ua-cobalt: #0057b7;
  --ua-cobalt-dark: #004494;
  --ua-yellow: #ffd700;
  --ua-yellow-soft: #fef9c3;
  --ua-yellow-border: #facc15;
  --ua-yellow-deep: #b45309;

  --p-brand-sidebar-bg: var(--ua-navy);
  --p-brand-sidebar-mid: var(--ua-cobalt);
  --p-brand-sidebar-item-active-bg: rgba(255, 215, 0, 0.14);
  --p-brand-sidebar-hover-bg: var(--ua-navy-hover);
  --p-brand-navbar-bg: linear-gradient(90deg, #081c44 0%, #0047a0 65%, #0057b7 100%);
  --confirm-header: var(--ua-cobalt);
  --p-bg-ccolor: #f4f6fa;

  --if-surface: #ffffff;
  --if-surface-muted: #f8fafc;
  --if-surface-subtle: #f1f5f9;
  --if-surface-hover: #eef2f7;
  --if-border: #e2e8f0;
  --if-border-strong: #cbd5e1;
  --if-text: #0f172a;
  --if-text-muted: #64748b;
  --if-text-subtle: #94a3b8;
  --theme-blue-color: var(--ua-cobalt);
  --bm-select-menu-color: #eff6ff;

  --success-color: #059669;
  --warning-color: #d97706;
  --danger-color: #e11d48;

  --if-radius-lg: 16px;
  --if-radius-md: 12px;
  --if-radius-sm: 9px;
  --if-shadow-sm: 0 1px 2px rgba(8, 28, 68, .04), 0 1px 3px rgba(8, 28, 68, .05);
  --if-shadow-md: 0 12px 28px -8px rgba(8, 28, 68, .14), 0 2px 6px rgba(8, 28, 68, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Inter", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: var(--if-text);
  background: var(--p-bg-ccolor);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}
button, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--ua-cobalt); outline-offset: 2px; border-radius: 8px; }
.num, td, strong { font-variant-numeric: tabular-nums; }
a { color: var(--ua-cobalt); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== AUTH / LOGIN SPLIT SCREEN ====== */
.bm-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 18% 20%, rgba(0, 87, 183, 0.12) 0%, transparent 45%),
              radial-gradient(circle at 85% 80%, rgba(255, 215, 0, 0.14) 0%, transparent 45%),
              #f4f6fa;
}
.login-card {
  width: 100%;
  max-width: 940px;
  min-height: 510px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid var(--if-border);
  box-shadow: 0 24px 54px -16px rgba(8, 28, 68, 0.18);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}
.login-left {
  padding: 42px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.login-sub {
  font-size: 13px;
  color: #475569;
  line-height: 1.55;
  margin-bottom: 24px;
}
.login-pill-input {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--if-border-strong);
  border-radius: 999px;
  padding: 10px 16px;
  margin-bottom: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.login-pill-input:focus-within {
  border-color: var(--ua-cobalt);
  box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.14);
}
.login-pill-input i { color: #64748b; font-size: 14px; }
.login-pill-input input {
  border: none;
  outline: none;
  width: 100%;
  font-size: 12.5px;
  color: var(--if-text);
  background: transparent;
}
.login-pill-input input::placeholder { color: #64748b; font-weight: 500; }
.login-forgot {
  width: 100%;
  max-width: 340px;
  text-align: right;
  font-size: 11.5px;
  margin-top: -4px;
  margin-bottom: 18px;
}
.login-submit-btn {
  width: 190px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: var(--ua-navy);
  color: var(--ua-yellow);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.login-submit-btn:hover { background: var(--ua-cobalt); color: #fff; }
.login-divider {
  width: 100%;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
}
.login-divider::before, .login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.google-signin__frame {
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ua-cobalt) 0%, var(--ua-yellow) 50%, var(--ua-cobalt) 100%);
  margin-bottom: 14px;
  cursor: pointer;
}
.google-signin__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ua-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 26px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  min-width: 245px;
}
.google-signin__inner:hover { background: #0f2e6b; }
.login-right {
  position: relative;
  background: linear-gradient(155deg, #05122e 0%, #081c44 55%, #0047a0 100%);
  color: #fff;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  overflow: hidden;
  border-left: 3px solid var(--ua-yellow);
}
.login-right canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.login-right > * { position: relative; z-index: 1; }
.login-hero-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--ua-yellow);
}
.login-legal {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  max-width: 340px;
}

/* ====== MAIN APP SHELL ====== */
.nxl-shell { min-height: 100vh; display: flex; flex-direction: column; }
.nxl-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: var(--p-brand-navbar-bg);
  border-bottom: 2px solid var(--ua-yellow);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  color: #fff;
}
.nxl-header-left { display: flex; align-items: center; height: 100%; }
.nxl-brand-slot {
  width: 260px;
  height: 100%;
  background: var(--ua-navy);
  display: flex;
  align-items: center;
  padding: 0 22px;
  position: relative;
  transition: width .24s ease, padding .24s ease;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 215, 0, 0.22);
}
.shell-collapsed .nxl-brand-slot { width: 76px; padding: 0 16px; justify-content: center; }
.shell-collapsed .nxl-brand-text { display: none; }
.nxl-hamburger {
  background: transparent; border: none; color: #fff;
  font-size: 24px; line-height: 1; padding: 8px 14px; cursor: pointer; display: flex; align-items: center;
}
.nxl-header-right { display: flex; align-items: center; gap: 14px; position: relative; }
.nxl-quick-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.55);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.nxl-quick-btn i { color: var(--ua-yellow); }
.nxl-quick-btn:hover { background: rgba(255, 215, 0, 0.18); }
.nxl-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ua-yellow);
  color: var(--ua-navy);
  border: 2px solid rgba(255, 255, 255, 0.65);
  font-weight: 800; font-size: 12.5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bm-popover {
  position: absolute; top: 48px; right: 0; width: 250px;
  background: #fff; color: var(--if-text);
  border-radius: 14px; border: 1px solid var(--if-border);
  box-shadow: var(--if-shadow-md); z-index: 1200; padding: 8px;
}
.bm-popover-item {
  display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: transparent;
  padding: 9px 12px; border-radius: 8px; font-size: 12.5px; color: var(--if-text); cursor: pointer; text-align: left;
}
.bm-popover-item:hover { background: var(--bm-select-menu-color); color: var(--ua-cobalt); }

/* Sidebar */
.nxl-navigation {
  position: fixed; top: 64px; left: 0; bottom: 0; width: 260px;
  background: var(--p-brand-sidebar-bg);
  color: rgba(255, 255, 255, 0.9);
  z-index: 990;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: width .24s ease, transform .24s ease;
  user-select: none;
  border-right: 1px solid rgba(255, 215, 0, 0.14);
}
.shell-collapsed .nxl-navigation { width: 76px; }
.nxl-collapse-circle {
  position: absolute; top: 18px; right: -13px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--ua-yellow); color: var(--ua-navy);
  border: 2px solid var(--ua-navy);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; font-weight: 700; z-index: 1005;
}
.nxl-navbar { list-style: none; margin: 0; padding: 10px 0; overflow-y: auto; flex: 1; }
.nxl-item-link {
  display: flex; align-items: center; justify-content: space-between;
  height: 46px; padding: 0 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.nxl-item-link:hover { background: var(--p-brand-sidebar-hover-bg); color: #fff; text-decoration: none; }
.nxl-item-link.active {
  background: var(--p-brand-sidebar-item-active-bg);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--ua-yellow);
}
.nxl-item-link.active i { color: var(--ua-yellow); }
.nxl-item-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.nxl-item-left i { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.shell-collapsed .nxl-item-label,
.shell-collapsed .nxl-arrow,
.shell-collapsed .nxl-submenu { display: none; }
.shell-collapsed .nxl-item-link { justify-content: center; padding: 0; }
.nxl-submenu { list-style: none; margin: 0; padding: 2px 0 6px 0; background: rgba(0, 0, 0, 0.18); }
.nxl-sub-link {
  display: block; padding: 7px 22px 7px 55px; font-size: 12px;
  color: rgba(255, 255, 255, 0.76); cursor: pointer;
}
.nxl-sub-link:hover, .nxl-sub-link.active { color: var(--ua-yellow); background: rgba(255, 255, 255, 0.06); text-decoration: none; font-weight: 600; }
.nxl-sidebar-bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 6px 0; }

/* Main Container */
.nxl-container {
  margin-top: 64px; margin-left: 260px; min-height: calc(100vh - 64px);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: margin-left .24s ease;
}
.shell-collapsed .nxl-container { margin-left: 76px; }
.nxl-content { padding: 22px 26px 36px; max-width: 1480px; width: 100%; }

.bm-footer {
  min-height: 44px; background: #fff; border-top: 1px solid var(--if-border);
  padding: 10px 26px; display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: var(--if-text-muted); flex-wrap: wrap; gap: 8px;
}

/* ====== EXECUTIVE CARDS, BANNERS, HEADERS ====== */
.bm-page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.bm-page-title-wrap { display: flex; align-items: center; gap: 12px; }
.bm-page-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: #eff6ff; color: var(--ua-cobalt); border: 1px solid #bfdbfe;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.bm-page-title { font-size: 18px; font-weight: 700; color: var(--ua-navy); margin: 0; line-height: 1.25; }
.bm-page-sub { font-size: 12px; color: var(--if-text-muted); margin: 2px 0 0; }

.if-card {
  background: var(--if-surface);
  border: 1px solid var(--if-border);
  border-radius: var(--if-radius-lg);
  box-shadow: var(--if-shadow-sm);
  padding: 20px;
  margin-bottom: 16px;
}

.ce-kpi-card {
  background: #fff;
  border: 1px solid var(--if-border);
  border-radius: var(--if-radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--if-shadow-sm);
  border-top: 3px solid var(--ua-cobalt);
}
.ce-kpi-card.gold { border-top-color: var(--ua-yellow-border); }
.ce-kpi-label { font-size: 11.5px; font-weight: 600; color: var(--if-text-muted); margin-bottom: 4px; }
.ce-kpi-val { font-size: 20px; font-weight: 700; color: var(--ua-navy); line-height: 1.2; }

.ce-quick-bar {
  background: linear-gradient(90deg, var(--ua-navy) 0%, #0c2b6b 100%);
  color: #fff;
  border-radius: var(--if-radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--ua-yellow);
}
.ce-btn-gold {
  background: var(--ua-yellow);
  color: var(--ua-navy);
  border: none;
  border-radius: 8px;
  height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.ce-btn-gold:hover { background: #fde047; }

.bm-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--if-border); margin-bottom: 16px; overflow-x: auto; }
.bm-tab {
  background: transparent; border: none; padding: 10px 4px; font-size: 13px; font-weight: 500;
  color: var(--if-text-muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap;
}
.bm-tab.active { color: var(--ua-navy); font-weight: 700; border-bottom-color: var(--ua-yellow-border); }

/* Toolbar, Inputs & Buttons */
.bm-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.bm-toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bm-search-box { position: relative; min-width: 240px; }
.bm-search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; }
.bm-search-box input {
  width: 100%; height: 34px; border: 1px solid var(--if-border-strong); border-radius: 7px;
  padding: 0 10px 0 32px; font-size: 12px; outline: none; background: #fff;
}
.bm-search-box input:focus { border-color: var(--ua-cobalt); }

.bm-btn-primary {
  background: var(--ua-navy); color: #fff; border: 1px solid var(--ua-navy);
  border-radius: 7px; height: 34px; padding: 0 14px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bm-btn-primary:hover { background: var(--ua-cobalt); border-color: var(--ua-cobalt); }
.bm-btn-outline {
  background: #fff; color: var(--ua-navy); border: 1px solid var(--ua-cobalt);
  border-radius: 7px; height: 34px; padding: 0 14px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bm-btn-outline:hover { background: #eff6ff; }
.bm-btn-export {
  background: #fffbeb; color: #92400e; border: 1px solid var(--ua-yellow-border);
  border-radius: 7px; height: 34px; padding: 0 14px; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bm-btn-export:hover { background: #fef3c7; }
.bm-btn-soft {
  background: var(--if-surface-subtle); color: var(--if-text); border: 1px solid var(--if-border);
  border-radius: 7px; height: 34px; padding: 0 12px; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.bm-btn-soft:hover { background: var(--if-surface-hover); }

/* Segmented Control */
.bm-segmented {
  display: inline-flex; background: var(--if-surface-subtle); padding: 3px;
  border-radius: 999px; border: 1px solid var(--if-border); gap: 2px;
}
.bm-segmented button {
  border: none; background: transparent; color: var(--if-text-muted); font-size: 12px;
  font-weight: 500; padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.bm-segmented button.active { background: var(--ua-navy); color: var(--ua-yellow); font-weight: 700; }

/* Inputs, Dashed Ghost Box & Progressive Disclosure */
.bm-label { display: block; font-size: 11.5px; font-weight: 600; color: #334155; margin-bottom: 4px; }
.bm-label .req { color: var(--danger-color); margin-left: 2px; }
.bm-input, .bm-select, .bm-textarea {
  width: 100%; border: 1px solid var(--if-border-strong); border-radius: 7px;
  padding: 6px 10px; font-size: 12.5px; color: var(--if-text); background: #fff; outline: none;
}
.bm-input, .bm-select { height: 36px; }
.bm-input:focus, .bm-select:focus, .bm-textarea:focus {
  border-color: var(--ua-cobalt);
  box-shadow: 0 0 0 3px rgba(0, 87, 183, 0.12);
}
.if-ghost__box {
  height: 36px; border: 1px dashed var(--if-border-strong); border-radius: 7px;
  background: repeating-linear-gradient(-45deg, #f8fafc, #f8fafc 6px, #ffffff 6px, #ffffff 12px);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 11.5px; color: var(--if-text-muted);
}

details.ce-advanced {
  border: 1px solid var(--if-border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px 16px;
  margin-bottom: 16px;
}
details.ce-advanced > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ua-navy);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.ce-advanced[open] > summary { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--if-border); }

/* Tables */
.bm-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--if-border); border-radius: 10px; background: #fff; }
.bm-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bm-table thead th {
  height: 40px; padding: 8px 12px; background: #f8fafc; color: var(--ua-navy);
  font-weight: 700; border-bottom: 2px solid var(--if-border); white-space: nowrap; text-align: left;
}
.bm-table tbody td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; white-space: nowrap; }
.bm-table tbody tr:hover { background: #f8faff; }
.bm-empty-state {
  min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: #64748b; padding: 28px; text-align: center;
}
.bm-empty-state i { font-size: 28px; color: #cbd5e1; }
.bm-pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; font-size: 12px; color: var(--if-text-muted); }

/* Badges */
.bm-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.bm-badge-success { background: #dcfce7; color: #166534; }
.bm-badge-warning { background: var(--ua-yellow-soft); color: #854d0e; border: 1px solid #fde047; }
.bm-badge-danger { background: #ffe4e6; color: #be123c; }
.bm-badge-info { background: #dbeafe; color: #1e40af; }
.bm-badge-primary { background: #e0e7ff; color: var(--ua-navy); }
.bm-badge-secondary { background: #f1f5f9; color: #475569; }

/* Entity Cards (Cari Ekle) */
.bm-entity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.bm-entity-card {
  border: 1.5px solid var(--if-border); border-radius: 12px; padding: 12px 14px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; background: #fff; transition: all .15s;
}
.bm-entity-card.active {
  border-color: var(--ua-cobalt); background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(0, 87, 183, 0.14);
}
.bm-entity-icon {
  width: 36px; height: 36px; border-radius: 9px; background: #f1f5f9; color: #475569;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.bm-entity-card.active .bm-entity-icon { background: var(--ua-navy); color: var(--ua-yellow); }

.bm-customer-dash {
  border: 1.5px dashed var(--if-border-strong); border-radius: 12px; min-height: 205px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px; text-align: center; background: #fafcff;
}
.bm-sticky-summary {
  position: sticky; bottom: 14px; background: #fff;
  border: 1px solid var(--if-border); border-top: 3px solid var(--ua-cobalt);
  border-radius: 14px; box-shadow: var(--if-shadow-md);
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; z-index: 40;
}
.bm-chip {
  border: 1px solid var(--if-border-strong); background: #f8fafc; color: #334155;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.bm-chip:hover { background: #fef9c3; border-color: var(--ua-yellow-border); color: var(--ua-navy); }

/* Modals, Drawers, Toasts */
.bm-backdrop {
  position: fixed; inset: 0; background: rgba(8, 28, 68, 0.45); z-index: 1500;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.bm-modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 580px;
  max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(8, 28, 68, 0.28);
}
.bm-modal.bm-modal-lg { max-width: 880px; }
.bm-modal-head {
  padding: 15px 20px; border-bottom: 1px solid var(--if-border);
  display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; color: var(--ua-navy);
}
.bm-modal-body { padding: 20px; }
.bm-modal-foot { padding: 14px 20px; border-top: 1px solid var(--if-border); display: flex; justify-content: flex-end; gap: 10px; }

.bm-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(8, 28, 68, 0.35); z-index: 1550; display: flex; justify-content: flex-end;
}
.bm-drawer {
  width: 100%; max-width: 520px; height: 100%; background: #fff;
  box-shadow: -10px 0 35px rgba(8, 28, 68, 0.18); display: flex; flex-direction: column;
}
.bm-drawer-body { padding: 20px; overflow-y: auto; flex: 1; }

.bm-toast-host { position: fixed; top: 78px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.bm-toast {
  background: #fff; border-left: 4px solid var(--ua-cobalt); border-radius: 10px;
  padding: 12px 16px; box-shadow: var(--if-shadow-md); display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px;
}
.bm-toast.success { border-left-color: #059669; }
.bm-toast.error { border-left-color: #e11d48; }
.bm-toast.warning { border-left-color: #eab308; }

.bm-tour-card {
  position: fixed; bottom: 82px; left: 280px; width: 330px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px; box-shadow: var(--if-shadow-md);
  border: 2px solid var(--ua-yellow-border); padding: 16px; z-index: 1400;
}
.shell-collapsed .bm-tour-card { left: 96px; }

/* Charts */
.bm-bar-chart {
  height: 200px; display: grid; grid-template-columns: repeat(12, 1fr);
  gap: 8px; align-items: end; padding: 16px 8px 4px;
}
.bm-bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bm-bar-pair { display: flex; gap: 4px; align-items: flex-end; height: 155px; width: 100%; justify-content: center; }
.bm-bar-in { width: 12px; background: var(--ua-cobalt); border-radius: 4px 4px 0 0; min-height: 4px; }
.bm-bar-out { width: 12px; background: #eab308; border-radius: 4px 4px 0 0; min-height: 4px; }

/* Mobile-only elements hidden on desktop */
.ce-mobile-back,
.ce-mobile-title,
.nxl-mobile-backdrop,
.ce-mobile-bottombar { display: none; }
.ce-table-select { height: 32px; width: 150px; }
.ce-rate-inp { width: 140px; }
.ce-flex-input { width: 220px; }
.ce-row-actions { min-width: 245px; }
.ce-statement-hero { border-left: 4px solid var(--ua-cobalt); background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%); }
.ce-ba-tag {
  display: inline-block; padding: 1px 6px; border-radius: 999px; font-size: 10.5px; font-weight: 700; vertical-align: middle; margin-left: 3px;
}
.ce-ba-tag.is-b { background: #dbeafe; color: #1e40af; }
.ce-ba-tag.is-a { background: #ffe4e6; color: #be123c; }
.ce-ba-tag.is-m { background: #f1f5f9; color: #475569; }

@media print {
  .nxl-header, .nxl-navigation, .bm-footer, .ce-mobile-bottombar, .nxl-mobile-backdrop, .no-print { display: none !important; }
  .nxl-container { margin: 0 !important; }
  body { background: #fff !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ====== MOBILE ZERO-FRICTION STANDARD (<= 991.98px) ====== */
@media (max-width: 991.98px) {
  /* Auth & 320px-safe Login/Register */
  .bm-auth-wrap { padding: 14px; align-items: flex-start; padding-top: max(18px, env(safe-area-inset-top)); }
  .login-card { grid-template-columns: 1fr; min-height: auto; border-radius: 18px; }
  .login-left { padding: 26px 18px; }
  .login-right { display: none; }
  .login-pill-input { max-width: 100%; min-height: 50px; padding: 0 14px; }
  .login-pill-input input { font-size: 16px; min-height: 48px; }
  .login-forgot { max-width: 100%; margin-bottom: 16px; }
  .login-forgot a, #registerLink, #backLogin { display: inline-flex; align-items: center; min-height: 48px; padding: 0 6px; }
  .login-submit-btn { width: 100%; max-width: 100%; min-height: 50px; font-size: 14px; }
  .google-signin__frame { width: 100%; max-width: 100%; }
  .google-signin__inner { width: 100%; min-width: 0; min-height: 48px; padding: 10px 16px; font-size: 14px; }

  /* Mobile Top Header with Safe-Area, Back & Context Title */
  .nxl-header {
    height: calc(60px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 10px 0 6px;
    gap: 6px;
  }
  .nxl-brand-slot { display: none; }
  .nxl-header-left { flex: 1; min-width: 0; gap: 2px; }
  .nxl-hamburger {
    width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 12px; font-size: 24px; flex-shrink: 0;
  }
  .nxl-hamburger:active { background: rgba(255,255,255,0.14); }
  .ce-mobile-back {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border: none; background: transparent; color: #fff;
    border-radius: 12px; font-size: 20px; cursor: pointer; flex-shrink: 0;
  }
  .ce-mobile-back[hidden] { display: none !important; }
  .ce-mobile-title {
    display: block; font-size: 15px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px;
  }
  .nxl-header-right { gap: 6px; flex-shrink: 0; }
  .nxl-quick-btn { min-width: 48px; min-height: 48px; padding: 0 12px; font-size: 13px; justify-content: center; }
  .nxl-quick-btn .ce-qlabel { display: none; }
  .nxl-avatar-btn { width: 48px; height: 48px; font-size: 14px; }
  #togglePass { min-width: 48px; min-height: 48px; margin: 0 -10px 0 0; display: grid; place-items: center; }
  .nxl-content .btn-sm:not(#a4InvoicePrint *), #btnStartTour { min-height: 48px !important; min-width: 48px !important; }
  #dashCurrency, #dashMonth { flex: 1 1 130px; min-width: 0; width: auto !important; }
  .bm-popover { top: 56px; right: 0; width: min(290px, calc(100vw - 20px)); }
  .bm-popover-item { min-height: 48px; font-size: 14px; padding: 10px 14px; }

  /* Mobile Sidebar Drawer + Backdrop Scrim */
  .nxl-navigation {
    top: calc(60px + env(safe-area-inset-top));
    bottom: 0;
    transform: translateX(-104%);
    width: min(290px, 84vw);
    z-index: 1020;
  }
  .shell-mobile-open .nxl-navigation { transform: translateX(0); box-shadow: 12px 0 36px rgba(8, 28, 68, 0.36); }
  .shell-mobile-open .nxl-mobile-backdrop {
    display: block; position: fixed; inset: 0; top: calc(60px + env(safe-area-inset-top));
    background: rgba(8, 28, 68, 0.48); z-index: 1015; backdrop-filter: blur(2px);
  }
  .nxl-collapse-circle { display: none; }
  .nxl-item-link { min-height: 48px; height: auto; padding: 10px 20px; font-size: 14px; }
  .nxl-sub-link { min-height: 48px; display: flex; align-items: center; padding: 8px 20px 8px 52px; font-size: 13.5px; }

  /* Content Container & Footer Spacing */
  .nxl-container {
    margin-top: calc(60px + env(safe-area-inset-top));
    margin-left: 0 !important;
    min-height: calc(100dvh - 60px - env(safe-area-inset-top));
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }
  .shell-form-mode .nxl-container { padding-bottom: env(safe-area-inset-bottom); }
  .nxl-content { padding: 14px 12px 24px; }
  .bm-footer { padding: 12px 14px; justify-content: center; text-align: center; }

  /* Sticky Mobile Bottom Tab Bar (Thumb-Zone Standard) */
  .ce-mobile-bottombar {
    position: fixed; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--if-border-strong);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    z-index: 985;
    box-shadow: 0 -6px 20px rgba(8, 28, 68, 0.08);
  }
  .shell-form-mode .ce-mobile-bottombar { display: none !important; }
  .ce-btab {
    min-height: 54px; padding: 4px 2px; border: none; background: transparent; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--if-text-muted); font-size: 11px; font-weight: 600; cursor: pointer;
  }
  .ce-btab i { font-size: 19px; line-height: 1; }
  .ce-btab.active { background: #eff6ff; color: var(--ua-cobalt); font-weight: 700; }

  /* WCAG 2.2 >= 48px Touch Controls & 16px Anti-Zoom Form Inputs */
  .bm-input, .bm-select, .form-control, .form-select,
  .bm-search-box input {
    min-height: 48px !important; height: auto !important; font-size: 16px !important; padding: 10px 12px;
  }
  .bm-search-box input { padding-left: 36px; }
  .bm-textarea { min-height: 96px; font-size: 16px !important; padding: 10px 12px; }
  .bm-btn-primary, .bm-btn-outline, .bm-btn-export, .bm-btn-soft, .ce-btn-gold {
    min-height: 48px; height: auto; padding: 10px 14px; font-size: 13.5px; justify-content: center;
  }
  .bm-chip, .bm-tab, .bm-segmented button { min-height: 48px; display: inline-flex; align-items: center; font-size: 13px; }
  .bm-segmented { width: 100%; justify-content: stretch; }
  .bm-segmented button { flex: 1; justify-content: center; padding: 8px 10px; }
  .form-check { min-height: 48px; display: flex; align-items: center; gap: 10px; }
  .form-check-input { width: 22px; height: 22px; margin-top: 0; }
  .ce-table-select, .ce-rate-inp, .ce-flex-input { width: 100% !important; min-width: 0; }
  .bm-search-box { min-width: 0; width: 100%; flex: 1 1 100%; }
  .bm-toolbar { gap: 10px; }
  .bm-toolbar-group { width: 100%; }
  .bm-toolbar-group > .bm-btn-primary,
  .bm-toolbar-group > .bm-btn-outline,
  .bm-toolbar-group > .bm-btn-export,
  .bm-toolbar-group > .bm-btn-soft,
  .bm-toolbar-group > label { flex: 1 1 calc(50% - 4px); }
  .if-card { padding: 14px; border-radius: 14px; }
  .bm-page-title { font-size: 16.5px; }
  .bm-entity-grid { grid-template-columns: 1fr; }
  .ce-kpi-val { font-size: 18px; }
  .ce-quick-bar { padding: 14px; }
  .ce-quick-bar .bm-toolbar-group button { flex: 1 1 calc(50% - 4px); }
  .bm-sticky-summary {
    bottom: 8px; padding: 14px; gap: 12px; flex-direction: column; align-items: stretch;
  }
  .bm-sticky-summary > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .bm-tour-card { left: 12px !important; right: 12px; width: auto; bottom: calc(74px + env(safe-area-inset-bottom)); }

  /* Non-Blocking Responsive Toast Positioning */
  .bm-toast-host {
    top: calc(68px + env(safe-area-inset-top)); left: 12px; right: 12px; max-width: none; pointer-events: none;
  }
  .bm-toast { pointer-events: auto; font-size: 13.5px; }
}

/* ====== PHONE SCREEN TABLES & BOTTOM SHEETS (<= 767.98px) ====== */
@media (max-width: 767.98px) {
  /* Bottom-Sheet Modals & Full-Screen Mobile Drawers */
  .bm-backdrop { align-items: flex-end; padding: 0; }
  .bm-modal {
    max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92dvh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bm-modal-head { padding: 14px 16px; min-height: 56px; }
  .bm-modal-head .btn-close {
    width: 48px; height: 48px; margin: -10px -10px -10px 0; padding: 14px;
  }
  .bm-modal-body, .bm-drawer-body { padding: 16px; }
  .bm-modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .bm-modal-foot > button { flex: 1 1 0; }
  .bm-drawer { max-width: 100%; width: 100%; }

  /* Stacked Card Transformation for All ERP Data Tables (Zero Horizontal Scroll) */
  .bm-table-wrap:has(.bm-table:not(.ce-keep-table)) {
    border: none; background: transparent; overflow-x: visible;
  }
  .bm-table:not(.ce-keep-table) { display: block; width: 100%; }
  .bm-table:not(.ce-keep-table) thead { display: none; }
  .bm-table:not(.ce-keep-table) tbody { display: grid; gap: 10px; }
  .bm-table:not(.ce-keep-table) tbody tr {
    display: block; background: #fff; border: 1px solid var(--if-border);
    border-radius: 14px; padding: 10px 14px; box-shadow: var(--if-shadow-sm);
  }
  .bm-table:not(.ce-keep-table) tbody tr.ce-empty-tr { padding: 0; border-style: dashed; }
  .bm-table:not(.ce-keep-table) tbody td {
    display: grid; grid-template-columns: minmax(92px, 42%) minmax(0, 1fr);
    align-items: center; justify-items: end; gap: 2px 10px;
    white-space: normal; text-align: right; padding: 8px 0; border-bottom: 1px dashed var(--if-border);
    font-size: 13.5px; word-break: break-word;
  }
  .bm-table:not(.ce-keep-table) tbody td > * { grid-column: 2; max-width: 100%; }
  .bm-table:not(.ce-keep-table) tbody tr.ce-empty-tr td { display: block; text-align: center; border-bottom: none; padding: 0; }
  .bm-table:not(.ce-keep-table) tbody td:last-child { border-bottom: none; padding-bottom: 2px; }
  .bm-table:not(.ce-keep-table) tbody td[data-label]::before {
    content: attr(data-label); grid-column: 1; grid-row: 1 / span 4; justify-self: start;
    font-size: 12px; font-weight: 600; color: var(--if-text-muted); text-align: left;
  }
  #a4InvoicePrint td:nth-child(4), #a4InvoicePrint td:nth-child(6), #a4InvoicePrint strong { white-space: nowrap; }
  .ce-row-actions { min-width: 0 !important; width: 100%; justify-content: flex-end; }
  .bm-table:not(.ce-keep-table) tbody td .d-flex > button,
  .ce-row-actions > button { min-height: 48px; min-width: 48px; padding: 8px 12px !important; }

  /* Keep multi-month analytics chart cleanly readable */
  .bm-bar-chart { min-width: 520px; }
  .if-card:has(.bm-bar-chart) { overflow-x: auto; }
}

@media (max-width: 575.98px) {
  .input-group { flex-wrap: wrap; gap: 6px; }
  .input-group > .form-select,
  .input-group > .form-control { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; border-radius: 10px !important; margin-left: 0 !important; }
}

@media (max-width: 359.98px) {
  .nxl-content { padding: 10px 10px 20px; }
  .if-card { padding: 12px; }
  .bm-toolbar-group > * { flex: 1 1 100%; }
  .ce-quick-bar .bm-toolbar-group button { flex: 1 1 100%; }
  .bm-sticky-summary > div:last-child { grid-template-columns: 1fr; }
}
