@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS VARIABLES — Light Theme
   ============================================================ */
:root {
  --bg-base: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-elevated: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #CBD5E1;

  --primary: #BEA0E2;
  --primary-dim: rgba(190, 160, 226, 0.10);
  --primary-glow: rgba(190, 160, 226, 0.20);
  --accent: #A78BFA;
  --accent-dim: rgba(167, 139, 250, 0.10);
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;

  /* Sidebar — light surface */
  --sidebar-text: #374151;
  --sidebar-text-muted: #9CA3AF;
  --sidebar-active-bg: rgba(190, 160, 226, 0.08);
  --sidebar-active-text: #BEA0E2;
  --sidebar-hover-bg: #F1F5F9;
  --sidebar-border: #E2E8F0;

  --sidebar-w: 260px;
  --sidebar-collapsed: 64px;
  --header-h: 60px;
  --radius: 8px;
  --radius-lg: 12px;

  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

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

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F5F3FF 0%, #F1F5F9 50%, #EDE9FE 100%);
  position: relative;
  overflow: hidden;
}

/* Animated grid background */
.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(190, 160, 226, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(190, 160, 226, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: gridShift 20s linear infinite;
}

/* Radial glow orbs */
.login-page::after {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(190, 160, 226, 0.08) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
  animation: pulseOrb 6s ease-in-out infinite alternate;
}

@keyframes gridShift {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(40px, 40px);
  }
}

@keyframes pulseOrb {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow:
    0 0 0 1px rgba(190, 160, 226, 0.06),
    0 20px 48px rgba(15, 23, 42, 0.10),
    0 4px 12px rgba(190, 160, 226, 0.06);
  animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.login-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #9E6DC9);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.login-logo .logo-icon svg {
  color: #fff;
}

.login-logo .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-logo .logo-text span {
  color: var(--primary);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 28px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius) !important;
  padding: 10px 14px !important;
  font-size: 14px !important;
  transition: var(--transition) !important;
}

.form-control:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-dim) !important;
  outline: none !important;
}

.form-control::placeholder {
  color: var(--text-muted) !important;
}

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

.input-icon-wrap .icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrap .form-control {
  padding-left: 38px !important;
}

.input-icon-wrap .icon-right {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.input-icon-wrap .icon-right:hover {
  color: var(--text-primary);
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), #9E6DC9);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--primary-glow);
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: var(--transition);
}

.btn-login:hover::before {
  background: rgba(255, 255, 255, 0.08);
}

.btn-login:hover {
  box-shadow: 0 6px 24px rgba(190, 160, 226, 0.4);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   SIDEBAR — Clean Light
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #FFFFFF;
  border-right: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

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

/* ── Brand ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--header-h);
  border-bottom: 1px solid #F1F5F9;
  flex-shrink: 0;
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand .brand-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar-brand .brand-text span {
  color: var(--primary);
}

.sidebar.collapsed .brand-text {
  opacity: 0;
  pointer-events: none;
}

/* ── Nav scroll area ── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 10px;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
  display: none;
}

/* ── Section label ── */
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  padding: 14px 8px 4px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-section-label {
  opacity: 0;
}

/* .sidebar.collapsed .sidebar-nav {
  padding-left: 0;
  padding-right: 0;
} */

/* ── Nav item wrapper ── */
.nav-item-wrap {
  position: relative;
}

/* ── Parent nav item ── */
.nav-link-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s, color 0.15s;
  color: #64748B;
  position: relative;
  white-space: nowrap;
  user-select: none;
}

.nav-link-item:hover {
  background: #F8FAFC;
  color: #1E293B;
}

.nav-link-item.active {
  background: rgba(190, 160, 226, 0.08);
  color: #BEA0E2;
}

/* Left accent bar for active */
.nav-link-item.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

/* ── Nav icon ── */
.nav-link-item .nav-icon {
  width: 17px;
  height: 17px;
  min-width: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.65;
  transition: opacity 0.15s;
}

.nav-link-item:hover .nav-icon,
.nav-link-item.active .nav-icon {
  opacity: 1;
}

/* ── Nav label ── */
.nav-link-item .nav-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.2s;
  overflow: hidden;
}

.sidebar.collapsed .nav-label {
  opacity: 0;
  width: 0;
  flex: 0
}

/* ── Chevron ── */
.nav-link-item .nav-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.2s;
  opacity: 0.35;
  flex-shrink: 0;
}

.nav-link-item.open .nav-chevron {
  transform: rotate(90deg);
}

.sidebar.collapsed .nav-chevron {
  opacity: 0;
  width: 0;
}

/* ── Sub-menu ── */
.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-submenu.open {
  max-height: 600px;
}

.sidebar.collapsed .nav-submenu {
  display: none;
}

/* Sub-item container adds a vertical line on left */
.nav-submenu {
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1.5px solid #E2E8F0;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  color: #94A3B8;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-size: 12.5px;
  font-weight: 400;
  white-space: nowrap;
  position: relative;
}

.nav-sub-item:hover {
  background: #F8FAFC;
  color: #475569;
}

.nav-sub-item.active {
  color: #BEA0E2;
  font-weight: 500;
  background: rgba(190, 160, 226, 0.07);
}

/* ── Collapsed: center icons ── */
.sidebar.collapsed .nav-link-item {
  justify-content: center;
  padding: 8px 0;
  gap: 0;
}

.sidebar.collapsed .nav-link-item .nav-icon {
  margin: 0 auto;
}

/* In collapsed mode the ::before is at left:-10px which gets clipped.
   Re-anchor it to the sidebar's left edge. */
.sidebar.collapsed .nav-link-item.active::before {
  /* left: 0; */
  border-radius: 0 3px 3px 0;
  width: 3px;
}

/* Slightly stronger bg so the tint is visible even with icon-only layout */
.sidebar.collapsed .nav-link-item.active {
  background: rgba(190, 160, 226, 0.13);
}

.sidebar.collapsed .nav-sub-item {
  display: none;
}

/* ── Collapsed flyout submenu ── */
.sidebar-flyout {
  position: fixed;
  left: var(--sidebar-collapsed);
  z-index: 1100;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06);
  padding: 6px;
  min-width: 190px;
  animation: flyoutIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: left center;
}

@keyframes flyoutIn {
  from {
    opacity: 0;
    transform: translateX(-6px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.sidebar-flyout-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  padding: 4px 10px 6px;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 4px;
}

.sidebar-flyout-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}

.sidebar-flyout-item:hover {
  background: rgba(190, 160, 226, 0.08);
  color: #BEA0E2;
}

.sidebar-flyout-item.active {
  background: rgba(190, 160, 226, 0.12);
  color: #BEA0E2;
  font-weight: 600;
}

/* ── Sidebar footer / user card ── */
.sidebar-footer {
  border-top: 1px solid #F1F5F9;
  padding: 10px 12px;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 0.15s;
}

.user-info:hover {
  background: #F8FAFC;
}

.user-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-details {
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.2s;
}

.sidebar.collapsed .user-details {
  opacity: 0;
  width: 0;
}

.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #0F172A;
  line-height: 1.3;
}

.user-role {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 1px;
}



/* ============================================================
   HEADER

   ============================================================ */
.app-header {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-w);
  z-index: 900;
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-header.collapsed {
  left: var(--sidebar-collapsed);
}

.header-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}

.header-toggle:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.breadcrumb-item {
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

.breadcrumb-item:first-child {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}

.header-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 6px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #9E6DC9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px var(--primary-glow);
  border: 2px solid rgba(190, 160, 226, 0.3);
}

.header-avatar:hover {
  box-shadow: 0 4px 16px var(--primary-glow);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.app-main {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 24px 32px;
  min-height: calc(100vh - var(--header-h));
  transition: margin-left 0.3s ease;
  overflow: visible;
  /* Ensure DRP panel isn't clipped */
  flex: 1;
}

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

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-bo {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Fira Code', monospace;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* ============================================================
   TABLE
   ============================================================ */
.table-bo {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-bo thead th {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-bo thead th:first-child {
  border-radius: 8px 0 0 0;
}

.table-bo thead th:last-child {
  border-radius: 0 8px 0 0;
}

.table-bo tbody tr {
  transition: var(--transition);
  cursor: pointer;
}

.table-bo tbody tr:hover td {
  background: var(--bg-elevated);
}

.table-bo tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  background: var(--bg-card);
  transition: var(--transition);
}

/* Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.badge-status.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

.badge-status.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.badge-status.info {
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-bo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--primary), #9E6DC9);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 12px var(--primary-glow);
}

.btn-primary-bo:hover {
  box-shadow: 0 4px 20px rgba(190, 160, 226, 0.4);
  transform: translateY(-1px);
}

.btn-secondary-bo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary-bo:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
  background: var(--bg-card);
}

/* ============================================================
   SEARCH INPUT
   ============================================================ */
.search-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
  padding: 8px 14px 8px 36px;
  font-size: 13px;
  transition: var(--transition);
  outline: none;
  width: 240px;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state h5 {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

.empty-state p {
  font-size: 13px;
  margin: 0;
}

/* ============================================================
   RESPONSIVE UTILITIES & MOBILE OVERLAY
   ============================================================ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  backdrop-filter: blur(2px);
}

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

@media (max-width: 992px) {
  .app-main { padding: 20px; }
  .search-input { width: auto; min-width: 100%; }
}

@media (max-width: 768px) {
  .sidebar { left: calc(-1 * var(--sidebar-w)); }
  .sidebar.mobile-open { left: 0; }
  .sidebar-overlay.active { display: block; }

  .app-header {
    left: 0 !important;
    padding: 0 16px;
  }

  .app-main {
    margin-left: 0 !important;
    padding: 16px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ============================================================
   UTILITY
   ============================================================ */
.text-primary-color {
  color: var(--primary) !important;
}

.text-muted-bo {
  color: var(--text-muted) !important;
}

.text-success-bo {
  color: var(--success) !important;
}

.text-danger-bo {
  color: var(--danger) !important;
}

.font-mono {
  font-family: 'Fira Code', monospace;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

/* Loading spinner */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ============================================================
   MUDBLAZOR OVERRIDES — neutralize MudBlazor global resets
   so they don't conflict with bo-style.css
   ============================================================ */
body {
  font-family: 'Inter', sans-serif !important;
  background: var(--bg-base) !important;
  color: var(--text-primary) !important;
}

/* PartnerTreeSelect — style MudSelect to match bo design */
.mud-input-control {
  font-family: 'Inter', sans-serif;
}

.mud-select-input,
.mud-input {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

/* Prevent MudBlazor from adding margins/padding to the app shell */
.mud-popover-provider { position: fixed; z-index: 9999; }

/* Ensure sidebar and header are not affected by MudBlazor resets */
.sidebar, .app-header, .app-main { font-family: 'Inter', sans-serif; }