:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --success: #10B981;
  --success-light: #D1FAE5;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-secondary: #6B7280;
  --sidebar-bg: #1E293B;
  --sidebar-hover: #334155;
  --sidebar-active: #2563EB;
  --sidebar-text: #94A3B8;
  --sidebar-text-active: #FFFFFF;
  --topbar-height: 64px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.2s ease;
}

[data-bs-theme="dark"] {
  --bg: #0F172A;
  --card: #1E293B;
  --border: #334155;
  --text: #F1F5F9;
  --text-secondary: #94A3B8;
  --primary-light: #1E3A5F;
  --success-light: #14532D;
  --warning-light: #451A03;
  --danger-light: #450A0A;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.35);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* SIDEBAR */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1040;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  gap: 10px;
}

.sidebar-brand .brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  color: #fbad17;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed .brand-text { opacity: 0; width: 0; margin: 0; }

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: var(--sidebar-text);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.sidebar-collapse-btn:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar.collapsed .sidebar-collapse-btn { display: none; }

.sidebar-user {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-user { padding: 12px 15px; }

.sidebar-user .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.sidebar-user .user-info {
  margin-left: 12px;
  overflow: hidden;
  transition: opacity 0.2s;
}

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

.sidebar-user .user-info .name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar-user .user-info .role {
  color: var(--sidebar-text);
  font-size: 12px;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-nav .nav-label {
  padding: 8px 20px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sidebar-text);
  opacity: 0.6;
  white-space: nowrap;
}

.sidebar-nav .nav-section {
  padding: 20px 20px 8px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sidebar-text);
  opacity: 0.5;
  font-weight: 600;
  white-space: nowrap;
}

.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section { display: none; }

.sidebar-nav .nav-item { list-style: none; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--sidebar-text);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0;
  margin: 0;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  border-radius: 8px;
  margin: 0 12px;
  padding: 10px 14px;
  border-left: none;
}

.sidebar-nav .nav-link.active {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  margin: 0 12px;
  padding: 10px 14px;
  border-left: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-nav .nav-link.active i,
.sidebar-nav .nav-link.active .bi {
  color: #fff;
}

.sidebar-nav .nav-link.active .nav-text {
  color: #fff;
}

.sidebar-nav .nav-link i, .sidebar-nav .nav-link .bi {
  width: 22px;
  font-size: 18px;
  flex-shrink: 0;
  text-align: center;
}

.sidebar-nav .nav-link .nav-text {
  margin-left: 14px;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.sidebar.collapsed .nav-link .nav-text { opacity: 0; width: 0; margin: 0; overflow: hidden; }

.sidebar-nav .nav-link .badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar.collapsed .nav-link .badge { display: none; }

.sidebar-nav .nav-link .arrow {
  margin-left: auto;
  font-size: 12px;
  transition: transform 0.2s;
}

.sidebar.collapsed .nav-link .arrow { display: none; }

.sidebar-nav .nav-link .arrow.open { transform: rotate(90deg); }

.sidebar-nav .sub-nav {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}

.sidebar-nav .sub-nav.open { max-height: 300px; }

.sidebar-nav .sub-nav .nav-link {
  padding-left: 52px;
  font-size: 13px;
}

.sidebar-nav .sub-nav li.active .nav-link {
  background: rgba(37, 99, 235, 0.12);
  color: var(--sidebar-text-active);
  border-radius: 8px;
  margin: 0 12px;
  padding: 8px 14px 8px 42px;
  font-weight: 500;
}

.sidebar-nav .has-sub.active > .nav-link {
  background: none;
  color: var(--sidebar-text-active);
  border-left: 3px solid var(--primary);
  margin: 0;
  padding: 10px 20px;
  border-radius: 0;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1035;
}

/* SIDEBAR FOOTER */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-footer-text {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  font-size: 11px;
  opacity: 0.5;
}

.sidebar.collapsed .sidebar-footer-text .nav-text { display: none; }

/* NAV ICON */
.sidebar-nav .nav-icon {
  width: 22px;
  font-size: 18px;
  flex-shrink: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1030;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.sidebar.collapsed ~ .topbar, .topbar.sidebar-collapsed { left: var(--sidebar-collapsed); }

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

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-sidebar, .sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.toggle-sidebar:hover { background: var(--bg); color: var(--text); }

.topbar-search {
  position: relative;
  width: 320px;
}

.topbar-search input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  transition: all 0.2s;
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.08);
  background: var(--card);
}

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

.topbar-search i, .topbar-search .bi-search {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
}

.topbar-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font);
  line-height: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.topbar-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  font-size: 18px;
}

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

.topbar-btn .notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--card);
  line-height: 1;
}

.topbar-btn .dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--card);
}

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

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  margin: 0 8px;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 12px 4px 4px;
  border-radius: 12px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.topbar-profile:hover { background: var(--bg); border-color: var(--border); }

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.topbar-profile img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
}

.topbar-profile-info {
  display: flex;
  flex-direction: column;
}

.topbar-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.topbar-profile-role {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.topbar-profile .bi-chevron-down {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.2s;
}

/* NOTIFICATION DROPDOWN */
.notification-dropdown {
  width: 380px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  padding: 0;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.notif-dropdown-header h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.notif-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 8px;
}

.notif-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
}

.notif-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

.notif-empty i {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  opacity: 0.4;
}

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

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 20px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--bg);
  color: var(--text);
}

.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-item-dot.blue { background: var(--primary); }
.notif-item-dot.green { background: var(--success); }
.notif-item-dot.amber { background: var(--warning); }
.notif-item-dot.red { background: var(--danger); }

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.notif-item-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.notif-item-time {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-top: 2px;
}

.notif-dropdown-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.notif-dropdown-footer a {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.notif-dropdown-footer a:hover {
  color: var(--primary-dark);
}

/* PROFILE DROPDOWN */
.profile-dropdown-menu {
  width: 260px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  padding: 0;
  overflow: hidden;
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.profile-dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.profile-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.profile-dropdown-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.profile-dropdown-menu .dropdown-item {
  padding: 10px 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.profile-dropdown-menu .dropdown-item:hover {
  background: var(--bg);
}

.profile-dropdown-menu .dropdown-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.nav-icon-mobile {
  display: none;
}

/* MAIN CONTENT */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
  transition: var(--transition);
}

.sidebar.collapsed ~ .main-content, .main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* PAGE HEADER */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

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

.breadcrumb-modern {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.breadcrumb-modern a { color: var(--text-secondary); }
.breadcrumb-modern a:hover { color: var(--primary); }
.breadcrumb-modern span { color: var(--text); }

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* KPI CARDS */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

.kpi-card .kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.kpi-card .kpi-icon.blue { background: var(--primary-light); color: var(--primary); }
.kpi-card .kpi-icon.green { background: var(--success-light); color: var(--success); }
.kpi-card .kpi-icon.yellow { background: var(--warning-light); color: var(--warning); }
.kpi-card .kpi-icon.red { background: var(--danger-light); color: var(--danger); }

.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.kpi-card .kpi-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.kpi-card .kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 6px;
}

.kpi-card .kpi-trend.up { background: var(--success-light); color: var(--success); }
.kpi-card .kpi-trend.down { background: var(--danger-light); color: var(--danger); }

/* CARDS */
.card-modern {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-modern .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.card-modern .card-header h5 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-modern .card-body {
  padding: 20px;
}

.card-modern .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* BUTTONS */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-modern-primary { background: var(--primary); color: #fff; }
.btn-modern-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-modern-success { background: var(--success); color: #fff; }
.btn-modern-success:hover { background: #059669; color: #fff; }

.btn-modern-warning { background: var(--warning); color: #fff; }
.btn-modern-warning:hover { background: #D97706; color: #fff; }

.btn-modern-danger { background: var(--danger); color: #fff; }
.btn-modern-danger:hover { background: #DC2626; color: #fff; }

.btn-modern-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-modern-outline:hover { background: var(--bg); }

.btn-modern-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-modern-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-modern-sm { padding: 5px 12px; font-size: 12px; }
.btn-modern-lg { padding: 10px 20px; font-size: 14px; }

/* TABLES */
.table-modern {
  width: 100%;
  border-collapse: collapse;
}

.table-modern th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.table-modern td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table-modern tbody tr:hover { background: rgba(37,99,235,0.02); }

.table-modern .user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-modern .user-cell img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.table-modern .user-cell .user-name { font-weight: 600; font-size: 13px; }
.table-modern .user-cell .user-sub { font-size: 12px; color: var(--text-secondary); }

/* BADGES & STATUS */
.badge-modern {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-modern .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-success .dot { background: var(--success); }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-warning .dot { background: var(--warning); }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-danger .dot { background: var(--danger); }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-info .dot { background: var(--primary); }
.badge-neutral { background: #F3F4F6; color: #4B5563; }
.badge-neutral .dot { background: #9CA3AF; }

[data-bs-theme="dark"] .badge-success { background: #064E3B; color: #6EE7B7; }
[data-bs-theme="dark"] .badge-warning { background: #451A03; color: #FCD34D; }
[data-bs-theme="dark"] .badge-danger { background: #450A0A; color: #FCA5A5; }
[data-bs-theme="dark"] .badge-info { background: #1E3A5F; color: #93C5FD; }
[data-bs-theme="dark"] .badge-neutral { background: #374151; color: #D1D5DB; }

/* FORMS */
.form-modern {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--card);
  transition: var(--transition);
}

.form-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-modern::placeholder { color: var(--text-secondary); }

select.form-modern { cursor: pointer; }

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-modern { width: auto; min-width: 140px; }

/* KANBAN */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
}

.kanban-column {
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 400px;
}

.kanban-column .column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kanban-column .column-header h6 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.kanban-column .column-count {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  cursor: grab;
  transition: var(--transition);
}

.kanban-card:hover { box-shadow: var(--shadow-md); }

.kanban-card .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.kanban-card .card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.kanban-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card .card-avatars {
  display: flex;
}

.kanban-card .card-avatars img,
.kanban-card .card-avatars .avatar-placeholder {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--card);
  margin-left: -6px;
}

.kanban-card .card-avatars img:first-child,
.kanban-card .card-avatars .avatar-placeholder:first-child { margin-left: 0; }

.kanban-card .card-avatars .avatar-placeholder {
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

/* PROFILE DRAWER */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1050;
}

.drawer-overlay.show { display: block; }

.drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--card);
  z-index: 1055;
  transition: right 0.3s ease;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.drawer.open { right: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.drawer-header h5 { font-size: 16px; font-weight: 600; margin: 0; }

.drawer-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drawer-close:hover { background: var(--bg); color: var(--text); }

.drawer-body { padding: 20px; }

/* TIMELINE */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item .dot {
  position: absolute;
  left: -24px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  background: var(--card);
}

.timeline-item .dot.green { border-color: var(--success); }
.timeline-item .dot.yellow { border-color: var(--warning); }
.timeline-item .dot.red { border-color: var(--danger); }
.timeline-item .dot.gray { border-color: var(--text-secondary); }

.timeline-item .time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.timeline-item .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.timeline-item .desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* PROGRESS */
.progress-modern {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}

.progress-modern .progress-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-modern .progress-bar.blue { background: var(--primary); }
.progress-modern .progress-bar.green { background: var(--success); }
.progress-modern .progress-bar.yellow { background: var(--warning); }
.progress-modern .progress-bar.red { background: var(--danger); }

/* CHARTS */
.chart-container {
  position: relative;
  width: 100%;
}

.chart-container canvas {
  max-width: 100%;
}

/* CALENDAR */
.calendar-modern {
  width: 100%;
}

.calendar-modern .cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-modern .cal-header h6 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.calendar-modern .cal-nav {
  display: flex;
  gap: 4px;
}

.calendar-modern .cal-nav button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: var(--transition);
}

.calendar-modern .cal-nav button:hover { background: var(--bg); }

.calendar-modern .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-modern .cal-grid .day-name {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 6px 0;
}

.calendar-modern .cal-grid .day {
  text-align: center;
  padding: 8px 4px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
}

.calendar-modern .cal-grid .day:hover { background: var(--bg); }
.calendar-modern .cal-grid .day.today { background: var(--primary); color: #fff; font-weight: 600; }
.calendar-modern .cal-grid .day.other-month { color: var(--text-secondary); opacity: 0.5; }
.calendar-modern .cal-grid .day.has-event { font-weight: 600; position: relative; }
.calendar-modern .cal-grid .day.has-event::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

/* TABS */
.tabs-modern {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tabs-modern .tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.tabs-modern .tab:hover { color: var(--text); }

.tabs-modern .tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content-modern > .tab-pane { display: none; }
.tab-content-modern > .tab-pane.active { display: block; }

/* CHECKLIST */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checklist-item:last-child { border-bottom: none; }

.checklist-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border);
  accent-color: var(--primary);
  margin-top: 1px;
  cursor: pointer;
}

.checklist-item .item-content { flex: 1; }
.checklist-item .item-title { font-size: 14px; font-weight: 500; color: var(--text); }
.checklist-item .item-desc { font-size: 12px; color: var(--text-secondary); }
.checklist-item.completed .item-title { text-decoration: line-through; color: var(--text-secondary); }

/* MODAL */
.modal-modern .modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-modern .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-modern .modal-body { padding: 20px; }
.modal-modern .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* WhatsApp Integration */
.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #25D366;
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.whatsapp-btn:hover { background: #1DA851; color: #fff; }

/* LOADING SKELETON */
.skeleton {
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-card { height: 120px; }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
}

.empty-state i, .empty-state .bi {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 16px;
}

.empty-state h5 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; max-width: 400px; margin: 0 auto; }

/* AVATAR GROUP */
.avatar-group {
  display: flex;
}

.avatar-group .avatar-item {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--card);
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.avatar-group .avatar-item:first-child { margin-left: 0; }
.avatar-group .avatar-item img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* MODULE ICON WRAPPER */
.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.module-icon.blue { background: var(--primary-light); color: var(--primary); }
.module-icon.green { background: var(--success-light); color: var(--success); }
.module-icon.yellow { background: var(--warning-light); color: var(--warning); }
.module-icon.red { background: var(--danger-light); color: var(--danger); }
.module-icon.purple { background: #EDE9FE; color: #7C3AED; }
.module-icon.pink { background: #FCE7F3; color: #DB2777; }
.module-icon.indigo { background: #E0E7FF; color: #4F46E5; }
.module-icon.teal { background: #CCFBF1; color: #0D9488; }

/* RESPONSIVE */
@media (max-width: 1199.98px) {
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .kanban-board { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .sidebar-overlay.active { display: block; }
  .topbar { left: 0 !important; }
  .main-content { margin-left: 0 !important; }
  .nav-icon-mobile { display: block; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767.98px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .main-content { padding: 16px; }
  .page-header h2 { font-size: 18px; }
  .topbar-search { width: 200px; }
  .topbar-profile .topbar-profile-info { display: none; }
  .topbar-profile .bi-chevron-down { display: none; }
  .kanban-board { grid-template-columns: 1fr; }
  .drawer { width: 100%; right: -100%; }
  .filter-bar .form-modern { min-width: 120px; }
  .date-filter { display: none; }
  .topbar { padding: 0 12px; }
}

@media (max-width: 575.98px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-value { font-size: 22px; }
  .topbar-search { display: none; }
  .topbar { padding: 0 12px; }
  .page-actions .btn-modern { font-size: 12px; padding: 6px 12px; }
  .table-modern { font-size: 12px; }
  .table-modern th, .table-modern td { padding: 8px 10px; }
  .topbar-actions { gap: 4px; }
  .topbar-btn { width: 36px; height: 36px; }
  .notification-dropdown { width: 100vw; max-width: 380px; }
}

/* DATE FILTER */
.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.date-filter:hover { border-color: var(--primary); }

.date-filter i { font-size: 14px; color: var(--text-secondary); }

/* KPI HIGHLIGHT */
.kpi-card.kpi-highlight {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--card) 0%, var(--primary-light) 100%);
}

.kpi-card .kpi-subtitle {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
  margin-top: 2px;
}

.kpi-card .kpi-icon.purple { background: #EDE9FE; color: #7C3AED; }

/* CIRCULAR PROGRESS */
.circular-progress-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}

.circular-progress {
  position: relative;
  width: 100%;
  height: 100%;
}

.circular-progress canvas {
  width: 100% !important;
  height: 100% !important;
}

.circular-progress .progress-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.circular-progress .progress-value .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.circular-progress .progress-value .label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.breakdown-pct {
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
}

/* PIPELINE */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pipeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pipeline-item .pipe-label {
  min-width: 85px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.pipeline-item .pipe-track {
  flex: 1;
  height: 10px;
  background: var(--bg);
}

.pipeline-item .pipe-count {
  min-width: 40px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

/* OPEN ROLES */
.open-role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.open-role-item:last-child { border-bottom: none; }

.urgent-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--danger-light);
  color: var(--danger);
}

.applicant-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

/* TRAINING ITEMS */
.training-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.training-item:last-child { border-bottom: none; padding-bottom: 0; }

.training-item .training-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
}

.training-item .training-title .badge-modern { font-size: 11px; padding: 2px 8px; }

.training-item .progress-modern { height: 8px; }

.training-item .training-pct {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 4px;
}

/* APPROVAL ITEMS */
.approval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.approval-item:last-child { border-bottom: none; }

.approval-item .approval-info { flex: 1; min-width: 0; }

.approval-item .approval-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.approval-item .approval-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.approval-item .approval-detail i { font-size: 11px; margin-right: 4px; }

.approval-item .time-ago {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
  margin-left: 8px;
}

/* INTERVIEW CARDS */
.interview-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: var(--transition);
}

.interview-card:last-child { margin-bottom: 0; }

.interview-card:hover { box-shadow: var(--shadow-md); }

.interview-card .interview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
  gap: 8px;
}

.interview-card .interview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.interview-card .interview-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.interview-card .interview-time {
  font-size: 12px;
  color: var(--text-secondary);
}

.interview-card .interview-time i { margin-right: 4px; }

/* ACTIVITY FEED */
.activity-feed { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-item .activity-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-item .activity-icon.green { background: var(--success-light); color: var(--success); }
.activity-item .activity-icon.red { background: var(--danger-light); color: var(--danger); }
.activity-item .activity-icon.blue { background: var(--primary-light); color: var(--primary); }
.activity-item .activity-icon.yellow { background: var(--warning-light); color: var(--warning); }
.activity-item .activity-icon.purple { background: #EDE9FE; color: #7C3AED; }

.activity-item .activity-content { flex: 1; min-width: 0; }

.activity-item .activity-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.activity-item .activity-text strong { font-weight: 600; }

.activity-item .activity-time {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* AVATAR SMALL */
.avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

/* CARD FOOTER BORDER */
.card-modern .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* H-100 for equal height cards */
.h-100 { height: calc(100% - 20px) !important; }

[class*="col-"] > .card-modern { margin-bottom: 0; }

/* ADDITIONAL UTILITIES */
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.flex-wrap { flex-wrap: wrap; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.ms-auto { margin-left: auto; }
.w-100 { width: 100%; }
