/* QubAcademy Modernized & Glassmorphic UI Design System */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #e0e7ff;
  --secondary: #7c3aed;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-radius: 14px;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --hover-shadow: 0 16px 32px -4px rgba(79, 70, 229, 0.15), 0 6px 16px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Dashboard Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #818cf8, #c084fc, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  list-style: none;
  padding: 20px 12px;
  flex-grow: 1;
}

.sidebar-nav-item {
  margin-bottom: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--sidebar-text);
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition);
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
  color: var(--sidebar-text-active);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.main-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 72px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

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

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.content-body {
  padding: 32px;
  flex-grow: 1;
}

/* Page Headers */
.page-header {
  margin-bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #0f172a, #334155);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Metric Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius);
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hover-shadow);
}
.stat-card:hover::before {
  opacity: 1;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 800;
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Modern Card Component */
.card {
  background: var(--bg-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  padding: 24px;
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table th {
  background: #f8fafc;
  padding: 14px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

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

.table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-main);
}
.btn-secondary:hover {
  background: #cbd5e1;
}

.btn-outline {
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* Form Styling */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Course Grid */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-surface);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--hover-shadow);
}

.course-thumb {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
}

.course-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.course-category {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.course-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
}

/* Checkout & Payment Gateways Component Styling */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.gateway-card {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-surface);
}
.gateway-card:hover, .gateway-card.selected {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.15);
}
.gateway-card i {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--primary);
}
.gateway-card .gateway-name {
  font-weight: 700;
  font-size: 0.9rem;
}

/* Progress Bar */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 10px;
  transition: width 0.4s ease;
}

/* Modal System */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: var(--bg-surface);
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-dialog {
  transform: translateY(0);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: #0f172a;
  color: #fff;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Auth Page Layout */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a, #1e1b4b);
  padding: 24px;
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

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

.auth-logo {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

/* ==========================================================================
   Shared UI kit (panels, forms, tables, modals, utilities)
   ========================================================================== */

/* Sidebar groups & scrolling */
.sidebar { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.15) transparent; }
.sidebar-logo-icon { font-size: 1.5rem; color: #818cf8; }
.sidebar-heading {
  padding: 18px 16px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
}
.sidebar-nav-link { width: 100%; background: transparent; border: none; cursor: pointer; text-align: left; font-size: 0.93rem; }
.sidebar-nav-link span { flex-grow: 1; }
.sidebar-nav-link.is-parent-active { color: #fff; }
.sidebar-caret { font-size: 0.7rem; transition: transform 0.2s ease; }
.sidebar-nav-item.open > .sidebar-nav-link .sidebar-caret { transform: rotate(180deg); }
.sidebar-subnav { list-style: none; display: none; padding: 4px 0 8px 44px; }
.sidebar-nav-item.open > .sidebar-subnav { display: block; }
.sidebar-subnav-link { display: block; padding: 7px 12px; color: var(--sidebar-text); font-size: 0.88rem; border-radius: 8px; }
.sidebar-subnav-link:hover { color: #fff; background: rgba(255,255,255,0.06); }
.sidebar-subnav-link.active { color: #fff; background: rgba(129, 140, 248, 0.22); font-weight: 600; }
.sidebar-overlay { display: none; }

/* Topbar */
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-heading { font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-toggle { display: none; }
.topbar-identity { text-align: right; line-height: 1.25; }
.topbar-name { font-weight: 700; font-size: 0.95rem; color: var(--text-main); }
.topbar-role { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.topbar-lang .form-control { width: auto; padding: 7px 30px 7px 12px; font-size: 0.85rem; font-weight: 600; border-radius: 10px; height: 38px; }
.topbar-bell { position: relative; }
.topbar-bell-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-avatar-img { object-fit: cover; }

/* Buttons */
.btn:disabled, .btn.disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; }
.btn-block { width: 100%; }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-light { background: #f1f5f9; color: var(--text-main); }
.btn-light:hover { background: #e2e8f0; }
.btn-link { background: none; color: var(--primary); padding: 0; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* Badges */
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Forms */
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.form-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 20px; }
.form-span-2 { grid-column: span 2; }
.form-span-full { grid-column: 1 / -1; }
textarea.form-control { min-height: 110px; resize: vertical; }
select.form-control { appearance: auto; }
select.form-control[multiple] { min-height: 120px; }
.form-control[readonly], .form-control:disabled { background: #f8fafc; color: var(--text-muted); }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: 0.8rem; margin-top: 6px; }
.form-check { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; font-size: 0.92rem; }
.form-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border-color); margin-top: 8px; }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: 0; }
.input-group > :first-child { border-radius: 10px 0 0 10px; }
.input-group > :last-child { border-radius: 0 10px 10px 0; }
.input-group-text { display: flex; align-items: center; padding: 0 14px; background: #f1f5f9; border: 1px solid var(--border-color); color: var(--text-muted); font-size: 0.9rem; }
.form-section-title { font-size: 1rem; font-weight: 700; margin: 8px 0 16px; padding-bottom: 8px; border-bottom: 1px dashed var(--border-color); }

/* Switch toggle: <label class="switch"><input type="checkbox"><span class="slider"></span></label> */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cbd5e1; border-radius: 24px; cursor: pointer; transition: var(--transition); }
.switch .slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.setting-row:last-child { border-bottom: none; }
.setting-row-title { font-weight: 600; }
.setting-row-desc { font-size: 0.82rem; color: var(--text-muted); }

/* Image / file inputs */
.image-preview { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border-color); background: #f8fafc; }
.image-preview-wide { width: 100%; max-width: 320px; height: 140px; border-radius: 12px; object-fit: cover; border: 1px solid var(--border-color); background: #f8fafc; }
.image-input { display: flex; align-items: center; gap: 16px; }
.dropzone { border: 2px dashed var(--border-color); border-radius: var(--border-radius); padding: 32px; text-align: center; color: var(--text-muted); background: #f8fafc; cursor: pointer; transition: var(--transition); }
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-light); }

/* Tables */
.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn + .btn { margin-left: 4px; }
.table-loading { text-align: center; color: var(--text-muted); padding: 28px !important; }
.table-media { display: flex; align-items: center; gap: 12px; }
.table-media img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: #f1f5f9; }
.table-media .title { font-weight: 600; }
.table-media .subtitle { font-size: 0.8rem; color: var(--text-muted); }
.table-sm td, .table-sm th { padding: 10px 12px; }

/* Toolbar (search & filters above tables) */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.toolbar-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.toolbar .form-control { width: auto; min-width: 180px; padding: 9px 14px; }
.toolbar-search { position: relative; }
.toolbar-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.toolbar-search .form-control { padding-left: 38px; min-width: 240px; }

/* Pagination */
.pagination-wrapper { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination-info { font-size: 0.85rem; color: var(--text-muted); }
.page-link { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff; color: var(--text-main); cursor: pointer; font-weight: 600; font-size: 0.85rem; }
.page-link:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-link.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-link:disabled { opacity: 0.45; cursor: not-allowed; }
.page-gap { color: var(--text-muted); padding: 0 4px; }

/* Tabs: <div class="tabs" data-tabs><a class="tab-link active" data-tab-target="#pane"></a></div> + .tab-pane */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; overflow-x: auto; }
.tab-link { padding: 10px 16px; font-weight: 600; font-size: 0.9rem; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; cursor: pointer; }
.tab-link:hover { color: var(--text-main); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 12px; font-size: 0.9rem; margin-bottom: 18px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid transparent; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* Modal extras (.modal-backdrop + .modal-dialog defined above) */
body.modal-open { overflow: hidden; }
.modal-backdrop.hidden { display: none; }
.modal-dialog { max-height: calc(100vh - 48px); overflow-y: auto; margin: 24px; }
.modal-sm { max-width: 420px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1140px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 16px; }
.modal-title { font-size: 1.2rem; font-weight: 800; }
.modal-close { background: none; border: none; font-size: 1.25rem; color: var(--text-muted); cursor: pointer; }
.modal-close:hover { color: var(--text-main); }
.modal-body { margin-bottom: 8px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-color); }

/* Toast variants */
.toast { transition: opacity 0.3s ease, transform 0.3s ease; max-width: 420px; }
.toast-success { background: #059669; }
.toast-danger { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #4f46e5; }
.toast-hide { opacity: 0; transform: translateY(10px); }

/* Empty state & skeleton */
.empty-state { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.empty-state i { font-size: 2.2rem; margin-bottom: 10px; color: #cbd5e1; display: block; }
.skeleton { background: linear-gradient(90deg, #eef2f7 25%, #e2e8f0 37%, #eef2f7 63%); background-size: 400% 100%; animation: skeleton 1.4s ease infinite; border-radius: 8px; }
.skeleton-row { display: flex; gap: 14px; padding: 14px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 12px; }
.skeleton-line.short { width: 60%; }
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Avatars, lists, detail views */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #e2e8f0; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 72px; height: 72px; }
.avatar-xl { width: 110px; height: 110px; }
.list-group { list-style: none; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
.list-group-item { padding: 12px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-group-item:last-child { border-bottom: none; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.detail-label { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-value { font-weight: 600; margin-top: 2px; word-break: break-word; }
.profile-header { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 16px; background: #f1f5f9; font-size: 0.8rem; font-weight: 600; margin: 2px; }
.rich-content { line-height: 1.75; }
.rich-content img { max-width: 100%; height: auto; }

/* Layout utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.grid-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-none, .hidden { display: none !important; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.p-0 { padding: 0 !important; }
.w-100 { width: 100%; }
.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-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.error-card { text-align: center; }
.error-code { font-size: 4.5rem; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.error-title { font-size: 1.4rem; margin: 12px 0 8px; }

/* Responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-sidebar { grid-template-columns: 1fr; }
  .form-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 99; }
  .main-wrapper { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar-toggle { display: inline-flex; }
  .topbar-identity, .topbar-user .btn-sm, .topbar-lang { display: none; }
  .content-body { padding: 20px 16px; }
  .grid-2, .grid-3, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 600px) {
  .grid-4, .form-row-4 { grid-template-columns: 1fr; }
  .toolbar .form-control, .toolbar-search .form-control { min-width: 0; width: 100%; }
}

/* ==========================================================================
   Polish: accessibility, small variants, print
   ========================================================================== */
:focus-visible { outline: 3px solid rgba(79, 70, 229, 0.35); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus-visible, .page-link:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.18); }
.form-control-sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: #f1f5f9; color: var(--text-main); }
.badge-light { background: #f1f5f9; color: #475569; }
.text-nowrap { white-space: nowrap; }
.mt-32 { margin-top: 32px; }
.mb-32 { margin-bottom: 32px; }
.page-header > .btn, .page-header .page-header-actions { flex-shrink: 0; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.table-responsive { scrollbar-width: thin; }
.table-responsive::-webkit-scrollbar { height: 8px; }
.table-responsive::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.card .card:last-child { margin-bottom: 0; }
.divider { border: 0; border-top: 1px solid var(--border-color); margin: 20px 0; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; background: #f1f5f9; border: 1px solid var(--border-color); border-radius: 6px; padding: 1px 6px; }
@media print {
  .sidebar, .sidebar-overlay, .topbar, #toast-container, .no-print, .front-header, .front-footer, .front-back-to-top, .front-cookie { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .content-body { padding: 0 !important; }
  .card { box-shadow: none !important; border-color: #cbd5e1 !important; break-inside: avoid; }
  body { background: #fff !important; }
}
