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

:root {
  --primary: #005dfd;
  --primary-dark: #0047c6;
  --primary-light: #e8f0fe;
  --primary-rgb: 0, 93, 253;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #005dfd;
  --bg-sidebar-hover: #0047c6;
  --bg-sidebar-active: #0047c6;

  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --border-strong: #6b7280;

  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #3b82f6;
  --info-bg: #dbeafe;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);

  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --transition: all 0.2s ease;

  --font-family: 'Inter', 'Segoe UI', 'Roboto', Arial, sans-serif;

  --sidebar-width: 260px;
  --sidebar-collapsed: 0px;
  --navbar-height: 64px;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #1e3a5f;

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --bg-body: #111827;
  --bg-card: #1f2937;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1e3a5f;

  --border: #374151;
  --border-light: #1f2937;
  --border-strong: #9ca3af;

  --success-bg: #064e3b;
  --warning-bg: #78350f;
  --danger-bg: #7f1d1d;
  --info-bg: #1e3a5f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.4);
}

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

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

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

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

::selection { background: var(--primary); color: #fff; }

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

h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--text-primary); }
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3, .card-title { font-size: 18px; }
h4 { font-size: 16px; }
h5 { font-size: 15px; }
h6 { font-size: 14px; }

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

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, width 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  min-height: var(--navbar-height);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  padding: 0.75rem 0;
  flex: 1;
}

.sidebar-section {
  padding: 0.5rem 1.25rem 0.25rem;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.4);
}

.sidebar-item { position: relative; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  cursor: pointer;
}

.sidebar-link:hover {
  color: #fff;
  background: var(--bg-sidebar-hover);
  border-left-color: rgba(255, 255, 255, 0.3);
}

.sidebar-link.active {
  color: #fff;
  background: var(--bg-sidebar-active);
  border-left-color: #fff;
}

.sidebar-link i { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-link .bi-chevron-down { margin-left: auto; font-size: 0.75rem; transition: transform 0.2s; }
.sidebar-link[aria-expanded="true"] .bi-chevron-down { transform: rotate(180deg); }

.sidebar-submenu {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.25rem 0;
}

.sidebar-submenu .sidebar-link {
  padding-left: 3.5rem;
  font-size: 13px;
}

.sidebar-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 12px; color: rgba(255, 255, 255, 0.6); }

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 999;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: var(--transition);
}

.sidebar-toggle:hover { background: var(--border-light); }

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

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

.topbar-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  padding: 0.4rem;
  cursor: pointer;
  border-radius: var(--radius);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

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

.user-dropdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
}

.user-dropdown:hover { background: var(--border-light); }

.user-dropdown-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.user-dropdown-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown-info { display: none; }
@media (min-width: 768px) {
  .user-dropdown-info { display: block; }
}

.user-dropdown-name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.user-dropdown-role { font-size: 12px; color: var(--text-secondary); }

.page-content {
  flex: 1;
  padding: 1.5rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.breadcrumb {
  background: none;
  padding: 0;
  margin: 0 0 0.5rem;
  font-size: 13px;
}

.breadcrumb-item { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.active { color: var(--text-primary); }

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

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

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 16px;
}

.card-body { padding: 1.25rem; }
.card-footer {
  background: transparent;
  border-top: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
}

.stats-card {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
}

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

.stats-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.stats-card-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stats-card-label { font-size: 14px; color: var(--text-secondary); margin-top: 0.25rem; }
.stats-card-change { font-size: 13px; margin-top: 0.5rem; }

.preview-param {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  padding: 0 4px;
  border-radius: 4px;
}

.preview-empty {
  background: var(--warning-bg);
  color: var(--warning);
  font-weight: 500;
  padding: 0 4px;
  border-radius: 4px;
}

.btn {
  font-size: 15px;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
}

.btn:hover { transform: translateY(-1px); }

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

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

.btn-outline-primary {
  color: var(--primary);
  border-color: var(--primary);
}

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

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-info { background: var(--info); border-color: var(--info); color: #fff; }

.btn-sm { font-size: 13px; padding: 0.375rem 0.75rem; min-height: 32px; }
.btn-lg { font-size: 16px; padding: 0.625rem 1.25rem; min-height: 48px; }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.form-control, .form-select {
  font-size: 15px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: var(--transition);
  min-height: 42px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
  outline: none;
}

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

.form-control-lg { font-size: 16px; padding: 0.75rem 1rem; min-height: 48px; }

.form-control.is-invalid, .form-select.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.invalid-feedback { font-size: 13px; color: var(--danger); }

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.contact-checkbox,
#contactSelectAll {
  width: 1.25em;
  height: 1.25em;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  box-shadow: none;
}

.contact-checkbox:checked,
#contactSelectAll:checked {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.25);
}

.form-switch .form-check-input {
  width: 2.5em;
  height: 1.25em;
  cursor: pointer;
}

.input-group-text {
  background: var(--border-light);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.table {
  color: var(--text-primary);
  margin: 0;
  font-size: 14px;
}

.table thead th {
  background: var(--border-light);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
  background: rgba(var(--primary-rgb), 0.03);
}

[data-theme="dark"] .table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.table-responsive { border-radius: var(--radius); }

.badge {
  font-size: 12px;
  font-weight: 500;
  padding: 0.25em 0.65em;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

.badge-outline-success { border: 1px solid var(--success); color: var(--success); background: transparent; }
.badge-outline-warning { border: 1px solid var(--warning); color: var(--warning); background: transparent; }
.badge-outline-danger { border: 1px solid var(--danger); color: var(--danger); background: transparent; }
.badge-outline-info { border: 1px solid var(--info); color: var(--info); background: transparent; }

.alert {
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  padding: 0.75rem 1rem;
}

.alert-success { background: var(--success-bg); color: #065f46; }
.alert-danger { background: var(--danger-bg); color: #991b1b; }
.alert-warning { background: var(--warning-bg); color: #92400e; }
.alert-info { background: var(--info-bg); color: #1e40af; }

[data-theme="dark"] .alert-success { color: var(--success); }
[data-theme="dark"] .alert-danger { color: var(--danger); }
[data-theme="dark"] .alert-warning { color: var(--warning); }
[data-theme="dark"] .alert-info { color: var(--info); }

.pagination {
  gap: 0.25rem;
}

.page-link {
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.375rem 0.75rem;
  font-size: 14px;
  transition: var(--transition);
  background: var(--bg-card);
}

.page-link:hover {
  background: var(--border-light);
  border-color: var(--border);
  color: var(--primary);
}

.page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.page-item.disabled .page-link {
  color: var(--text-muted);
  pointer-events: none;
}

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.375rem;
  font-size: 14px;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.dropdown-item i { font-size: 1rem; width: 18px; text-align: center; }
.dropdown-divider { border-color: var(--border); }

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.modal-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}

.modal-backdrop { background: rgba(0, 0, 0, 0.5); }

.nav-tabs {
  border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
  color: var(--text-secondary);
  border: none;
  padding: 0.75rem 1rem;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-tabs .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: var(--transition);
}

.nav-tabs .nav-link:hover { color: var(--text-primary); }

.nav-tabs .nav-link.active {
  color: var(--primary);
  background: none;
  border: none;
}

.nav-tabs .nav-link.active::after {
  background: var(--primary);
}

.nav-pills .nav-link {
  color: var(--text-secondary);
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-size: 14px;
}

.nav-pills .nav-link.active {
  background: var(--primary);
  color: #fff;
}

.progress {
  background: var(--border-light);
  border-radius: 9999px;
  height: 8px;
}

.progress-bar {
  background: var(--primary);
  border-radius: 9999px;
}

footer {
  background: var(--bg-card) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
  padding: 1rem 1.5rem !important;
  font-size: 13px;
}

.list-group-item {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 80px; height: 80px; font-size: 1.5rem; }
.avatar-xl { width: 120px; height: 120px; font-size: 2.5rem; }

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-text {
  color: var(--text-secondary);
  font-size: 14px;
}

.activity-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-light);
}

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

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.activity-text { font-size: 14px; flex: 1; }
.activity-time { font-size: 12px; color: var(--text-secondary); }

.filter-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #005dfd 0%, #0047c6 100%);
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  margin-bottom: 1rem;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0;
  color: var(--text-muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border);
}

.login-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 14px;
  color: var(--text-secondary);
}

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

.input-icon-group .form-control,
.input-icon-group .form-control-lg {
  padding-left: 2.75rem;
}

.input-icon-group .form-control ~ .password-toggle,
.input-icon-group .form-control-lg ~ .password-toggle {
  right: 12px;
}

.input-icon-group:has(.password-toggle) .form-control,
.input-icon-group:has(.password-toggle) .form-control-lg {
  padding-right: 2.75rem;
}

.input-icon {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 0.875rem;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 5;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.1rem;
  z-index: 5;
}

.password-toggle:hover { color: var(--text-secondary); }

.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dark-mode-toggle .form-check-input {
  cursor: pointer;
}

@media (max-width: 767.98px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar.show { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 1rem; }
  .login-card { padding: 1.5rem; }
  .page-title { font-size: 22px; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .sidebar { width: var(--sidebar-width); }
  .main-content { margin-left: var(--sidebar-width); }
  .page-content { padding: 1.25rem; }
}

@media (min-width: 992px) {
  .sidebar { width: var(--sidebar-width); }
  .main-content { margin-left: var(--sidebar-width); }
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { display: none; }

.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast-container { z-index: 9999; }

.required::after {
  content: '*';
  color: var(--danger);
  margin-left: 2px;
}

.clickable { cursor: pointer; }

.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-theme="dark"] .table {
  --bs-table-bg: var(--bg-card);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
  background: var(--bg-card);
}

[data-theme="dark"] .table thead th {
  background: var(--bg-body);
  border-bottom-color: var(--border);
  color: var(--text-muted);
}

[data-theme="dark"] .table td {
  border-bottom-color: var(--border);
  background: transparent;
}

[data-theme="dark"] .table tbody tr {
  background: transparent;
}

[data-theme="dark"] .dropdown-item:hover {
  background: var(--bg-body);
}

[data-theme="dark"] .btn-outline-primary {
  color: var(--primary);
}

[data-theme="dark"] .btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
}

[data-theme="dark"] .topbar {
  background: var(--bg-card);
  border-bottom-color: var(--border);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
