/* ═══════════════════════════════════════════════════════════════════════════
   BackupMaster - Premium Dashboard Design v3.0
   Inspired by modern fintech & SaaS dashboards
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Core Colors */
  --bg-base: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-dark: #0f172a;
  --bg-dark-card: #1e293b;

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #f8fafc;

  /* Brand Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-subtle: #eef2ff;

  /* Status */
  --success: #10b981;
  --success-light: #d1fae5;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Borders & Shadows */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);

  /* Radius */
  --radius-sm: 3px;
  --radius: 4px;
  --radius-md: 5px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-2xl: 10px;
  --radius-full: 9999px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 150ms;
}

/* Dark Mode */
.dark {
  --bg-base: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body, body.bm-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT STRUCTURE - SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.bm-sidebar {
  width: 260px;
  background: var(--bg-dark);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform var(--duration) var(--ease);
}

.bm-sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.bm-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.bm-sidebar-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.bm-sidebar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.bm-sidebar-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sidebar Navigation */
.bm-sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

/* Sidebar scrollbar transparente */
.bm-sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

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

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

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

.bm-nav-section {
  margin-bottom: 24px;
}

.bm-nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
}

.bm-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--duration) var(--ease);
  margin-bottom: 4px;
  position: relative;
}

.bm-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.bm-nav-item.is-active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.bm-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.bm-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.bm-nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* Sidebar Footer */
.bm-sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.bm-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.bm-user-menu:hover {
  background: rgba(255,255,255,0.08);
}

.bm-user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
}

.bm-user-info {
  flex: 1;
  min-width: 0;
}

.bm-user-name {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* Main Content Area */
.bm-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Header Bar */
.bm-topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

.bm-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  gap: 16px;
}

.bm-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bm-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.bm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.bm-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.bm-breadcrumb a:hover {
  color: var(--primary);
}

.bm-topbar-actions, .bm-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bm-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  gap: 8px;
  width: 280px;
  transition: all var(--duration) var(--ease);
}

.bm-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.bm-search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}

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

.bm-icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  position: relative;
}

.bm-icon-btn:hover {
  background: var(--bg-base);
  border-color: var(--border);
  color: var(--text-primary);
}

.bm-icon-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Content Area */
.bm-content {
  flex: 1;
  padding: 32px;
  max-width: 1400px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADERS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-page-header {
  margin-bottom: 32px;
}

.bm-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.bm-page-sub {
  color: var(--text-secondary);
  font-size: 15px;
  margin: 0;
}

.bm-page-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO / WELCOME SECTION
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #a855f7 100%);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
}

.bm-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.bm-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 50%;
  height: 150%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.bm-hero-content {
  position: relative;
  z-index: 1;
}

.bm-hero-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.bm-hero-sub {
  font-size: 15px;
  opacity: 0.9;
  max-width: 500px;
}

.bm-hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 24px;
}

.bm-hero-stat {
  text-align: left;
}

.bm-hero-stat-value {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.bm-hero-stat-label {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   STATS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-stats-grid, .bm-cards4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.bm-stat-card, .bm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: all var(--duration) var(--ease);
  position: relative;
  overflow: hidden;
}

.bm-stat-card:hover, .bm-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.bm-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--duration) var(--ease);
}

.bm-stat-card:hover::before {
  opacity: 1;
}

.bm-stat-card.success::before { background: var(--success); }
.bm-stat-card.warning::before { background: var(--warning); }
.bm-stat-card.danger::before { background: var(--danger); }
.bm-stat-card.info::before { background: var(--info); }

.bm-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.bm-stat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.bm-stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.bm-stat-icon.success { background: var(--success-light); color: var(--success); }
.bm-stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.bm-stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.bm-stat-icon.info { background: var(--info-light); color: var(--info); }

.bm-stat-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.bm-stat-trend.up {
  background: var(--success-light);
  color: var(--success-dark);
}

.bm-stat-trend.down {
  background: var(--danger-light);
  color: var(--danger);
}

.bm-card-k, .bm-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
}

.bm-card-v, .bm-stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.bm-card-h, .bm-stat-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.bm-ok { color: var(--success); }
.bm-bad { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   PANELS / CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-grid2 {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
}

.bm-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: box-shadow var(--duration) var(--ease);
}

.bm-panel:hover {
  box-shadow: var(--shadow-sm);
}

.bm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bm-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.bm-panel-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.bm-panel-action {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bm-panel-action:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-table {
  width: 100%;
  border-collapse: collapse;
}

.bm-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
  background: var(--bg-base);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.bm-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}

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

.bm-table tbody tr:hover {
  background: var(--bg-base);
}

/* Tabela compacta */
.bm-table--compact {
  font-size: 12px;
}

.bm-table--compact thead th {
  font-size: 10px;
  padding: 10px 12px;
}

.bm-table--compact tbody td {
  padding: 8px 12px;
  font-size: 12px;
}

.bm-table--compact .bm-file-name {
  gap: 6px;
}

.bm-table--compact .bm-btn--sm {
  padding: 6px 10px;
  font-size: 11px;
}

.bm-table--compact .bm-btn-group {
  gap: 4px;
}


.bm-table-wrap {
  overflow-x: auto;
}

.bm-table-wrapper {
  overflow-x: auto;
}

.bm-tr {
  display: grid;
  gap: 10px;
  padding: 8px 12px;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--duration) var(--ease);
  font-size: 13px;
}

.bm-tr:last-child {
  border-bottom: none;
}

.bm-tr:not(.bm-th):hover {
  background: var(--bg-base);
}

.bm-th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: var(--bg-base);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: 1px solid var(--border);
}

.bm-td {
  font-size: 13px;
  color: var(--text-primary);
}

.bm-td-muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.bm-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.bm-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.bm-empty-text {
  font-size: 15px;
  margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES & STATUS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* Badge compacto */
.bm-badge--sm {
  padding: 3px 8px;
  font-size: 11px;
  gap: 4px;
}

.bm-badge--ok, .bm-badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

.bm-badge--bad, .bm-badge-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.bm-badge--info, .bm-badge-info {
  background: var(--info-light);
  color: var(--info);
}

.bm-badge--muted, .bm-badge-muted {
  background: var(--bg-base);
  color: var(--text-muted);
}

.bm-badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.bm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.bm-status-dot.active { background: var(--success); }
.bm-status-dot.inactive { background: var(--text-muted); }
.bm-status-dot.warning { background: var(--warning); }
.bm-status-dot.danger { background: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.bm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.bm-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.bm-btn--primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.bm-btn--primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

/* Secondary/Default Button */
.bm-btn--secondary, .bm-btn:not([class*="--"]) {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border);
}

.bm-btn--secondary:hover:not(:disabled), .bm-btn:not([class*="--"]):hover:not(:disabled) {
  background: var(--bg-base);
  border-color: var(--text-muted);
}

/* Ghost Button */
.bm-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.bm-btn--ghost:hover:not(:disabled) {
  background: var(--bg-base);
  color: var(--text-primary);
}

/* Danger Button */
.bm-btn--danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: transparent;
}

.bm-btn--danger:hover:not(:disabled) {
  background: var(--danger);
  color: white;
}

/* Success Button */
.bm-btn--success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.bm-btn--success:hover:not(:disabled) {
  background: var(--success-dark);
}

/* Small Button */
.bm-btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* Icon Button */
.bm-btn--icon {
  padding: 10px;
  width: 40px;
  height: 40px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

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

.bm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-field--full {
  grid-column: 1 / -1;
}

.bm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.bm-label-optional {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.bm-input, .bm-select, .bm-textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all var(--duration) var(--ease);
  outline: none;
}

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

.bm-input:hover, .bm-select:hover {
  border-color: var(--text-muted);
}

.bm-input:focus, .bm-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.bm-input:disabled, .bm-select:disabled {
  background: var(--bg-base);
  color: var(--text-muted);
  cursor: not-allowed;
}

.bm-input--error {
  border-color: var(--danger);
}

.bm-input--error:focus {
  box-shadow: 0 0 0 3px var(--danger-light);
}

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

.bm-error {
  font-size: 12px;
  color: var(--danger);
}

/* Checkbox & Radio */
.bm-checkbox, .bm-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.bm-checkbox input, .bm-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.bm-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bm-checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.bm-checkbox-row label {
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.bm-test-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  display: none;
}

.bm-test-result:not(:empty) {
  display: block;
}

.bm-test-result--loading {
  background: var(--bg-base);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.bm-test-result--ok {
  background: var(--success-light);
  border: 1px solid var(--success);
  color: var(--success);
}

.bm-test-result--error {
  background: var(--danger-light);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* Icon Action Buttons */
.bm-icon-action {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
}

.bm-icon-action:hover {
  background: var(--bg-base);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.bm-icon-action--primary {
  border-color: var(--primary);
  color: var(--primary);
}

.bm-icon-action--primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.bm-icon-action--danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

/* Select Styling */
.bm-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

/* Select Multiple */
.bm-select--multi {
  appearance: auto;
  background-image: none;
  padding-right: 12px;
  min-height: 100px;
  max-height: 140px;
  overflow-y: auto;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.bm-select--multi option {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin: 1px 0;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm-select--multi option:checked {
  background: linear-gradient(0deg, var(--primary-light) 0%, var(--primary-light) 100%);
  color: var(--primary);
  font-weight: 600;
}

.bm-select--multi option:hover {
  background: var(--bg-base);
}

/* Radio Cards */
.bm-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bm-card-radio {
  position: relative;
}

.bm-card-radio input {
  position: absolute;
  opacity: 0;
}

.bm-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-align: center;
}

.bm-choice:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.bm-card-radio input:checked + .bm-choice {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.bm-choice-ico {
  font-size: 28px;
}

.bm-choice-title {
  font-weight: 700;
  color: var(--text-primary);
}

.bm-choice-sub {
  font-size: 12px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-base);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  overflow-x: auto;
}

.bm-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--duration) var(--ease);
}

.bm-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.bm-tab.is-active svg {
  opacity: 1;
}

.bm-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.bm-tab.is-active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLASH MESSAGES / ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-flash, .bm-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  border: 1px solid;
}

.bm-flash--ok, .bm-alert-success {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success-dark);
}

.bm-flash--err, .bm-alert-danger {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.bm-alert-warning {
  background: var(--warning-light);
  border-color: var(--warning);
  color: var(--warning);
}

.bm-alert-info {
  background: var(--info-light);
  border-color: var(--info);
  color: var(--info);
}

.bm-flash ul {
  margin: 8px 0 0 20px;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bm-modal.is-open {
  display: flex;
}

.bm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 200ms var(--ease);
}

.bm-modal-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  animation: slideUp 300ms var(--ease);
}

.bm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border);
}

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

.bm-modal-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.bm-modal-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.bm-modal-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.bm-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
}

.bm-xbtn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 24px;
  transition: all var(--duration) var(--ease);
}

.bm-xbtn:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROGRESS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-progress {
  height: 8px;
  background: var(--bg-base);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bm-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #8b5cf6);
  border-radius: var(--radius-full);
  transition: width 300ms var(--ease);
}

.bm-progressmeta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UPCOMING / SCHEDULE ITEMS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-upcoming {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bm-upitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-base);
  border-radius: var(--radius);
  transition: all var(--duration) var(--ease);
}

.bm-upitem:hover {
  background: var(--primary-subtle);
}

.bm-update {
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bm-update .m {
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.bm-update .d {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.bm-uptext {
  flex: 1;
}

.bm-uptext .t {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1px;
}

.bm-uptext .s {
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FREQUENCY SELECTOR
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-freq {
  display: flex;
  gap: 8px;
}

.bm-chip {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.bm-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.bm-chip input {
  display: none;
}

.bm-chip.is-on {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}

/* Day of Week */
.bm-dow {
  display: flex;
  gap: 8px;
}

.bm-dow label {
  cursor: pointer;
}

.bm-dow input {
  display: none;
}

.bm-dow span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease);
}

.bm-dow span:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.bm-dow input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.bm-schedule {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.bm-weekly-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}

.bm-weekly-row .bm-field {
  min-width: 140px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LINKS
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   DROPDOWN
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-dd {
  position: relative;
}

.bm-ddmenu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--duration) var(--ease);
  z-index: 50;
}

.bm-dd.is-open .bm-ddmenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.bm-dditem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background var(--duration) var(--ease);
}

.bm-dditem:hover {
  background: var(--bg-base);
}

.bm-dditem--danger {
  color: var(--danger);
}

.bm-dditem--danger:hover {
  background: var(--danger-light);
}

.bm-ddsep {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.bm-emailbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--duration) var(--ease);
}

.bm-emailbtn:hover {
  background: var(--bg-base);
}

.bm-caret {
  font-size: 10px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DOCUMENTATION
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-docgrid {
  grid-template-columns: 1.3fr 0.9fr;
}

.bm-ol, .bm-ul {
  margin: 12px 0 0 24px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.bm-ol li, .bm-ul li {
  margin: 8px 0;
}

.bm-video {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-base);
}

.bm-video--placeholder {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

/* Documentation Layout with Sidebar */
.bm-docs-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  gap: 0;
}

.bm-docs-sidebar {
  width: 280px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
  flex-shrink: 0;
}

.bm-docs-sidebar-header {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.bm-docs-sidebar-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.bm-docs-sidebar-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.bm-docs-nav {
  padding: 0 12px;
}

.bm-docs-nav-section {
  margin-bottom: 8px;
}

.bm-docs-nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 12px 12px 8px;
}

.bm-docs-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all var(--duration) var(--ease);
  margin-bottom: 4px;
  position: relative;
}

.bm-docs-nav-item:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

.bm-docs-nav-item.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.bm-docs-nav-item.is-active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.bm-docs-nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.7;
  flex-shrink: 0;
}

.bm-docs-nav-item.is-active .bm-docs-nav-icon {
  opacity: 1;
}

.bm-docs-content {
  flex: 1;
  padding: 40px 48px;
  max-width: 1000px;
  min-width: 0;
}

.bm-docs-content-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.bm-docs-content-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.bm-docs-content-sub {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.bm-docs-section {
  margin-bottom: 40px;
}

.bm-docs-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bm-docs-section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.bm-docs-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.bm-docs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.bm-docs-card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--duration) var(--ease);
}

.bm-docs-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.bm-docs-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.bm-docs-card-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.bm-code {
  background: var(--bg-dark);
  color: var(--text-inverse);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
}

.bm-docs-cta {
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  border-radius: var(--radius-xl);
  padding: 32px;
  color: white;
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.bm-docs-cta-text {
  flex: 1;
}

.bm-docs-cta-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.bm-docs-cta-sub {
  font-size: 14px;
  opacity: 0.9;
}

.bm-docs-cta .bm-btn {
  background: white;
  color: var(--primary);
  border: none;
  box-shadow: var(--shadow-md);
}

.bm-docs-cta .bm-btn:hover {
  background: var(--bg-base);
  transform: translateY(-2px);
}

/* Responsive Docs Sidebar */
@media (max-width: 1024px) {
  .bm-docs-sidebar {
    width: 240px;
  }

  .bm-docs-content {
    padding: 32px;
  }
}

@media (max-width: 768px) {
  .bm-docs-layout {
    flex-direction: column;
  }

  .bm-docs-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }

  .bm-docs-sidebar-header {
    padding: 0 16px 16px;
    margin-bottom: 8px;
  }

  .bm-docs-nav {
    display: flex;
    padding: 0 16px;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bm-docs-nav-item {
    padding: 10px 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .bm-docs-nav-item.is-active::before {
    display: none;
  }

  .bm-docs-content {
    padding: 24px 16px;
  }

  .bm-docs-grid {
    grid-template-columns: 1fr;
  }

  .bm-docs-cta {
    flex-direction: column;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES - SPLIT SCREEN LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

/* Split Screen Container */
.bm-auth-split {
  display: flex;
  min-height: 100vh;
}

/* Left Side - Form */
.bm-auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-base);
}

.bm-auth-form-container {
  width: 100%;
  max-width: 420px;
}

/* Right Side - Image */
.bm-auth-image-side {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.bm-auth-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.bm-auth-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.8) 0%, rgba(139, 92, 246, 0.7) 50%, rgba(30, 41, 59, 0.9) 100%);
  z-index: 1;
}

.bm-auth-image-content {
  position: relative;
  z-index: 2;
  padding: 60px;
  color: white;
  max-width: 540px;
}

.bm-auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.bm-auth-brand-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.bm-auth-brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.bm-auth-image-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}

.bm-auth-image-desc {
  font-size: 16px;
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: 36px;
}

.bm-auth-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bm-auth-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
}

.bm-auth-feature svg {
  flex-shrink: 0;
  opacity: 0.9;
}

/* Auth Card (Form Container) */
.bm-auth-card {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  border: 1px solid var(--border);
}

.bm-auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.bm-auth-logo {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 800;
  color: white;
}

.bm-auth-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.bm-auth-sub {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.bm-authfooter {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.bm-authfooter a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--duration) var(--ease);
}

.bm-authfooter a:hover {
  color: var(--primary-hover);
}

/* Legacy wrapper support */
.bm-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--bg-base) 0%, #e0e7ff 100%);
}

/* Responsive - Mobile */
@media (max-width: 1024px) {
  .bm-auth-split {
    flex-direction: column-reverse;
  }

  .bm-auth-form-side {
    padding: 32px 24px;
  }

  .bm-auth-image-side {
    min-height: 280px;
    flex: none;
  }

  .bm-auth-image-content {
    padding: 32px;
    text-align: center;
  }

  .bm-auth-brand {
    justify-content: center;
    margin-bottom: 24px;
  }

  .bm-auth-image-title {
    font-size: 24px;
    margin-bottom: 12px;
  }

  .bm-auth-image-desc {
    font-size: 14px;
    margin-bottom: 24px;
  }

  .bm-auth-features {
    align-items: center;
  }

  .bm-auth-feature {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .bm-auth-form-side {
    padding: 24px 16px;
  }

  .bm-auth-card {
    padding: 28px 24px;
  }

  .bm-auth-title {
    font-size: 22px;
  }

  .bm-auth-image-side {
    min-height: 220px;
  }

  .bm-auth-image-content {
    padding: 24px;
  }

  .bm-auth-image-title {
    font-size: 20px;
  }

  .bm-auth-features {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ERROR PAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.bm-error-code {
  font-size: 120px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 16px;
}

.bm-error-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.bm-error-desc {
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 400px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .bm-stats-grid, .bm-cards4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .bm-sidebar {
    transform: translateX(-100%);
  }

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

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

  .bm-menu-toggle {
    display: flex;
  }

  .bm-grid2 {
    grid-template-columns: 1fr;
  }

  .bm-search-box {
    width: 200px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .bm-topbar {
    padding: 12px 16px;
  }

  .bm-content {
    padding: 20px 16px;
  }

  .bm-stats-grid, .bm-cards4 {
    grid-template-columns: 1fr;
  }

  .bm-formgrid {
    grid-template-columns: 1fr;
  }

  .bm-radio-grid {
    grid-template-columns: 1fr;
  }

  .bm-hero {
    padding: 24px;
  }

  .bm-hero-stats {
    flex-wrap: wrap;
    gap: 20px;
  }

  .bm-modal-card {
    max-width: 100%;
    border-radius: var(--radius-lg);
    margin: 16px;
  }

  .bm-modal-head {
    padding: 16px 16px 12px;
  }

  .bm-modal-body {
    padding: 16px;
  }

  .bm-modal-footer {
    padding: 12px 16px 16px;
  }

  .bm-modal-section {
    margin-top: 16px;
    padding-top: 16px;
  }

  .bm-search-box {
    display: none;
  }

  .bm-schedule {
    grid-template-columns: 1fr;
  }

  .bm-weekly-row {
    grid-template-columns: 1fr;
  }

  .bm-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bm-docgrid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .bm-actions {
    flex-direction: column;
  }

  .bm-btn {
    width: 100%;
  }

  .bm-freq {
    flex-direction: column;
  }

  .bm-dow {
    flex-wrap: wrap;
    justify-content: center;
  }

  .bm-page-title {
    font-size: 24px;
  }

  .bm-hero-title {
    font-size: 22px;
  }

  .bm-tr {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  .bm-th {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.hidden { display: none; }
.block { display: block; }

/* Focus States */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary);
  color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Brand styling for topbar (backwards compat) */
.bm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bm-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: white;
}

.bm-logotext {
  font-weight: 800;
}

.bm-brand-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

/* Navigation links for topbar */
.bm-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.bm-navlink {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--duration) var(--ease);
}

.bm-navlink:hover {
  background: var(--bg-base);
  color: var(--text-primary);
}

.bm-navlink.is-active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.bm-iconbtn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-iconbtn:hover {
  background: var(--bg-base);
}

/* Compat for old pill/dot classes */
.bm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-base);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.bm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.bm-dot--green {
  background: var(--success);
}

/* Rightcard compat */
.bm-rightcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.bm-rightimg {
  height: 140px;
  background: linear-gradient(135deg, var(--primary-subtle), var(--info-light));
}

.bm-rightbody {
  padding: 20px;
}

.bm-righttitle {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
}

.bm-rightmeta {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.bm-rightrow {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.bm-rightrow strong {
  color: var(--success);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NOTIFICATIONS PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.bm-tr--link {
  display: grid;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.bm-tr--link:hover {
  background: var(--bg-base);
}

.bm-tr--unread {
  background: var(--primary-subtle);
}

.bm-tr--unread:hover {
  background: var(--primary-light);
}

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

.bm-notif-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bm-notif-icon svg {
  width: 14px;
  height: 14px;
}

.bm-notif-icon--backup_failed {
  background: var(--danger-light);
  color: var(--danger);
}

.bm-notif-icon--disk_low {
  background: var(--warning-light);
  color: var(--warning);
}

.bm-notif-icon--login {
  background: var(--info-light);
  color: var(--info);
}

/* Detail View */
.bm-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bm-detail-row {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.bm-detail-row:last-child {
  border-bottom: none;
}

.bm-detail-label {
  width: 120px;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.bm-detail-value {
  font-size: 14px;
  color: var(--text-primary);
}

.bm-code-block {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 12px;
  overflow-x: auto;
}

.bm-code-block pre {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

/* Bell Icon Badge */
.bm-bell-wrapper {
  position: relative;
  display: inline-flex;
}

.bm-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pagination */
.bm-pagination {
  padding: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}

.bm-pagination nav {
  display: flex;
  gap: 4px;
}

.bm-pagination a,
.bm-pagination span {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius);
  text-decoration: none;
}

.bm-pagination a {
  color: var(--text-secondary);
  background: var(--bg-base);
}

.bm-pagination a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.bm-pagination span[aria-current="page"] span {
  background: var(--primary);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius);
}

/* Print */
@media print {
  .bm-sidebar,
  .bm-topbar,
  .bm-btn {
    display: none !important;
  }

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

  .bm-content {
    padding: 0;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tags de seleção (Bancos de dados selecionados)
   ═══════════════════════════════════════════════════════════════════════════ */
.bm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 0;
}

.bm-tags:empty {
  display: none;
}

.bm-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  background: var(--primary-subtle);
  border: 1px solid var(--primary-light);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  animation: tagIn 0.15s ease-out;
}

@keyframes tagIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.bm-tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  border-radius: 3px;
  opacity: 0.6;
  transition: opacity 0.1s, background 0.1s;
}

.bm-tag-remove:hover {
  opacity: 1;
  background: var(--primary-light);
}

.bm-tag--all {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success-dark);
  padding: 4px 10px;
}

.bm-tag--all .bm-tag-remove {
  display: none;
}
