:root {
  --sidebar-width: 268px;
  --sidebar-bg: #0a0a12;
  --sidebar-border: rgba(255, 255, 255, 0.06);
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-dark: #4f46e5;
  --accent: #22d3ee;
  --surface: #f0f2fa;
  --card: rgba(255, 255, 255, 0.92);
  --text: #0f172a;
  --muted: #64748b;
  --border: rgba(148, 163, 184, 0.28);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 60px rgba(99, 102, 241, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.32s var(--ease);
}

* { box-sizing: border-box; }

body.admin-body,
body.auth-body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ─── Global smooth ─── */
.btn, .form-control, .form-select, .input-group-text,
.card, .modal-content, .alert, .nav-link, .badge, .panel-card {
  transition: border-color var(--transition), background var(--transition),
              box-shadow var(--transition), transform var(--transition), color var(--transition);
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  border: none;
  font-weight: 600;
}

.btn-glow {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(99, 102, 241, 0.45);
}

.btn-inner { display: inline-flex; align-items: center; justify-content: center; }

.page-enter { animation: fadeUp 0.55s var(--ease) both; }

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

.stagger-in > * {
  animation: fadeUp 0.5s var(--ease) both;
}

/* ─── Admin shell ─── */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  width: var(--sidebar-width);
  background:
    linear-gradient(165deg, #0c0a1a 0%, #12102a 35%, #0a1628 70%, #0d1117 100%);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  transition: transform var(--transition), width var(--transition);
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-accent {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at -10% -5%, rgba(99, 102, 241, 0.35), transparent 55%),
    radial-gradient(ellipse 90% 60% at 110% 30%, rgba(34, 211, 238, 0.18), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(139, 92, 246, 0.2), transparent 55%);
}

.sidebar-accent::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
}

.sidebar-brand,
.sidebar-nav {
  position: relative;
  z-index: 1;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.4rem 1.2rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  font-size: 1.25rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.45);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon.brand-icon--logo {
  width: 50px;
  height: 50px;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 12px;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

.brand-icon.brand-icon--logo .brand-logo-img {
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.sidebar-brand strong { display: block; font-size: 1.02rem; letter-spacing: -0.02em; }
.sidebar-brand small { color: #94a3b8; font-size: 0.7rem; }

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 1rem;
  border-radius: 14px;
  color: #94a3b8;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  position: relative;
  overflow: hidden;
}

.sidebar-nav .nav-link i { font-size: 1.15rem; width: 1.3rem; }

.sidebar-nav .nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--accent), var(--primary-2));
  transition: transform var(--transition);
}

.sidebar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding-left: 1.15rem;
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(139, 92, 246, 0.12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}

.sidebar-nav .nav-link.active::before {
  transform: translateY(-50%) scaleY(1);
}

/* ─── Main panel ─── */
.admin-wrapper.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

.admin-wrapper.sidebar-collapsed .main-panel {
  margin-left: 0;
}

.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.top-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #475569;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: #eef2ff;
  color: var(--primary);
  border-color: #c7d2fe;
}

.sidebar-collapse-btn .bi-layout-sidebar {
  display: none;
}

.admin-wrapper.sidebar-collapsed .sidebar-collapse-btn .bi-layout-sidebar-inset {
  display: none;
}

.admin-wrapper.sidebar-collapsed .sidebar-collapse-btn .bi-layout-sidebar {
  display: inline-block;
}

.btn-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.65rem 0.35rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: #334155;
  font-weight: 600;
  font-size: 0.88rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.btn-nav-user:hover,
.btn-nav-user.show {
  background: #f8fafc;
  border-color: #c7d2fe;
  color: var(--primary-dark);
}

.btn-nav-user::after {
  margin-left: 0.15rem;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.82rem;
}

.avatar,
.avatar-sm {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.nav-user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-menu {
  border-radius: 14px;
  padding: 0.35rem;
  min-width: 200px;
}

.dropdown-item {
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.dropdown-item i {
  opacity: 0.75;
}
.main-panel {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: margin-left var(--transition);
}

.main-panel-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(99, 102, 241, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(139, 92, 246, 0.06), transparent);
}

.page-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-area {
  flex: 1;
  width: 100%;
  padding: 1.5rem 1.75rem 1.25rem;
  position: relative;
  z-index: 1;
}

.site-footer {
  flex-shrink: 0;
  padding: 0.9rem 1.75rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.84rem;
  position: relative;
  z-index: 1;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
}

.site-footer-sep { color: #cbd5e1; }

.site-footer-link {
  color: #16a34a;
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition);
}

.site-footer-link:hover { color: #15803d; }

.sidebar-toggle { color: #475569; text-decoration: none; padding: 0; }

.sidebar-collapse-btn {
  display: inline-grid;
}

@media (max-width: 991.98px) {
  .sidebar-collapse-btn { display: none; }
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 7, 15, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1035;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-backdrop.show { opacity: 1; visibility: visible; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .sidebar.open { transform: translateX(0); }
  .admin-wrapper.sidebar-collapsed .sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
  .admin-wrapper.sidebar-collapsed .sidebar.open { transform: translateX(0); }
  .main-panel,
  .admin-wrapper.sidebar-collapsed .main-panel { margin-left: 0; }
  .content-area { padding: 1.15rem; }
}

/* ─── Page head ─── */
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  width: 100%;
}

.page-head-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
}

.page-head-title {
  margin: 0 0 0.25rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-head-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ─── Panels & cards ─── */
.panel-card {
  width: 100%;
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}

.panel-card:hover {
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
}

.panel-alert {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.panel-alert-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.panel-alert h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 700;
}

.panel-alert p {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.panel-alert-danger {
  background: linear-gradient(135deg, #fff7ed, #fff);
  border-color: #fed7aa;
}
.panel-alert-danger .panel-alert-icon { background: #ffedd5; color: #ea580c; }
.panel-alert-danger h3 { color: #c2410c; }

.panel-alert-warning {
  background: linear-gradient(135deg, #fefce8, #fff);
  border-color: #fde68a;
}
.panel-alert-warning .panel-alert-icon { background: #fef9c3; color: #ca8a04; }
.panel-alert-warning h3 { color: #a16207; }

.panel-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 1.25rem 0;
}

.form-footnote {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.35;
  display: block;
  margin-bottom: 0.75rem;
}

/* ─── Forms ─── */
.form-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.input-modern .input-group-text,
.input-password-group .input-group-text {
  background: #f8fafc;
  border-color: var(--border);
  color: var(--primary);
  border-radius: 12px 0 0 12px;
  padding-left: 0.9rem;
}

.input-modern .form-control,
.input-password-group .form-control {
  border-color: var(--border);
  border-radius: 0;
  padding: 0.72rem 0.85rem;
  background: #fff;
  font-size: 0.92rem;
}

.input-password-group .form-control { border-right: none; }

.input-modern .form-control:focus,
.input-password-group .form-control:focus {
  border-color: var(--primary);
  box-shadow: none;
}

.input-modern .form-control:last-child,
.input-password-group .btn-password-toggle {
  border-radius: 0 12px 12px 0;
}

.input-modern:has(.form-control:focus) .input-group-text,
.input-password-group:has(.form-control:focus) .input-group-text {
  border-color: var(--primary);
  background: #eef2ff;
}

.btn-password-toggle {
  border: 1px solid var(--border);
  border-left: none;
  background: #f8fafc;
  color: var(--muted);
  padding: 0 0.9rem;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.btn-password-toggle:hover {
  background: #eef2ff;
  color: var(--primary);
}

.btn-password-toggle.is-visible {
  color: var(--primary);
}

.form-select-modern {
  border-radius: 12px;
  border-color: var(--border);
  padding: 0.72rem 0.85rem;
}

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

.glass-form {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.auth-form-card {
  width: min(440px, 100%);
}

/* ─── Auth page ─── */
.auth-body {
  min-height: 100vh;
  background: #eef1fb;
}

.auth-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
}

.auth-visual {
  background: linear-gradient(145deg, #07070f 0%, #1e1b4b 45%, #4338ca 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.auth-visual::before,
.auth-visual::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  animation: blobFloat 8s ease-in-out infinite;
}

.auth-visual::before {
  width: 480px;
  height: 480px;
  background: rgba(139, 92, 246, 0.15);
  top: -140px;
  right: -100px;
}

.auth-visual::after {
  width: 320px;
  height: 320px;
  background: rgba(34, 211, 238, 0.1);
  bottom: -80px;
  left: -60px;
  animation-delay: -4s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(1.05); }
}

.auth-visual-content { max-width: 440px; position: relative; z-index: 1; }

.auth-logo {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.auth-brand-mark {
  display: block;
  width: auto;
  height: auto;
  max-width: min(168px, 42vw);
  max-height: 168px;
  margin-bottom: 1.65rem;
  object-fit: contain;
  border-radius: 20px;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.42));
}

.auth-visual h2 {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.auth-visual p { color: rgba(255, 255, 255, 0.78); line-height: 1.65; }

.auth-features { list-style: none; padding: 0; margin: 1.75rem 0 0; }

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.7rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
}

.auth-features .bi-check-circle { color: var(--accent); }

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.auth-theme-wrap {
  position: absolute;
  top: 1.15rem;
  right: 1.15rem;
  z-index: 5;
}

.auth-form-wrap { width: min(460px, 100%); }

.auth-form-header h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.auth-form-header p { color: var(--muted); margin-bottom: 1.75rem; }

.auth-submit { border-radius: 14px; padding: 0.85rem; font-weight: 700; }

@media (max-width: 991.98px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-visual { min-height: 200px; padding: 1.75rem; }
  .auth-visual h2 { font-size: 1.55rem; }
  .auth-features { display: none; }
  .glass-form { padding: 1.5rem; border-radius: 20px; }
}

/* ─── Modals ─── */
.modal-glass {
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-glass .modal-title { font-weight: 700; }

/* ─── DataTables ─── */
.datatable-card { padding: 0; overflow: hidden; width: 100%; }
.datatable-card .table-responsive { padding: 0; overflow-x: auto; }

.dataTables_wrapper { padding: 1.15rem 1.35rem 1.25rem; width: 100%; }

.dataTables_wrapper .dt-toolbar,
.dataTables_wrapper .dt-footer {
  margin-left: 0;
  margin-right: 0;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.86rem;
  color: #475569;
  margin: 0;
  white-space: nowrap;
}

.dataTables_wrapper .dataTables_filter {
  text-align: right;
}

.dataTables_wrapper .dataTables_filter label {
  justify-content: flex-end;
  width: 100%;
}

.dataTables_wrapper .dataTables_filter input {
  width: 100%;
  max-width: 280px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.85rem;
  transition: all var(--transition);
}

.dataTables_wrapper .dataTables_filter input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dataTables_wrapper .dataTables_length select {
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.4rem 0.65rem;
  min-width: 72px;
}

.dataTables_wrapper .dataTables_info {
  color: var(--muted);
  font-size: 0.84rem;
  padding-top: 0.35rem;
}

.dataTables_wrapper .dataTables_paginate {
  text-align: right;
  padding-top: 0.15rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 10px !important;
  margin-left: 0.2rem;
  transition: all var(--transition) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important;
  border-color: transparent !important;
  color: #fff !important;
}

table.dataTable.table-modern {
  width: 100% !important;
  table-layout: fixed;
  margin-top: 0.75rem !important;
  margin-bottom: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
}

table.dataTable.table-modern thead th {
  white-space: nowrap;
}

table.dataTable.table-modern tbody td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table.dataTable.table-modern tbody td.col-notes {
  white-space: normal;
  word-break: break-word;
}

table.dataTable tbody tr { transition: background var(--transition); }
table.dataTable tbody tr:hover { background: rgba(99, 102, 241, 0.04) !important; }

.row-id {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.role-pill, .status-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.role-admin { background: #eef2ff; color: #4338ca; }
.role-user { background: #f1f5f9; color: #64748b; }
.status-success { background: #dcfce7; color: #166534; }
.status-failed, .status-failed { background: #fee2e2; color: #b91c1c; }
.status-partial { background: #fef9c3; color: #a16207; }
.status-blocked { background: #ffedd5; color: #c2410c; }

.btn-action-group { display: inline-flex; gap: 0.3rem; }

.btn-action {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #64748b;
  transition: all var(--transition);
}

.btn-action-edit:hover { background: #eef2ff; color: var(--primary); border-color: #c7d2fe; }
.btn-action-key:hover { background: #fef9c3; color: #ca8a04; border-color: #fde68a; }
.btn-action-delete:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

.table-modern thead th {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  background: #f8fafc;
}

.table-modern tbody td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  vertical-align: middle;
}

.kpj-chip {
  font-size: 0.82rem;
  background: #eef2ff;
  color: #4338ca;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.content-area .topbar,
.content-area .footer { display: none; }

.alert {
  border-radius: 14px;
  border: none;
  font-size: 0.9rem;
}

.alert-danger { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #f0fdf4; color: #166534; }

.input-modern .form-control {
  border-radius: 0 12px 12px 0;
}

/* Loading overlay */
body.is-loading { overflow: hidden; }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 15, 0.55);
  backdrop-filter: blur(6px);
  padding: 1rem;
}

.loading-overlay[hidden] { display: none !important; }

.loading-box {
  width: min(380px, 100%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.4s var(--ease) both;
}

.loading-title { margin: 0.85rem 0 0.35rem; font-size: 1.05rem; font-weight: 700; }
.loading-status { margin: 0; color: var(--primary); font-size: 0.88rem; line-height: 1.5; min-height: 2.6em; }
.loading-hint { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.78rem; }

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 3px solid #e0e7ff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

/* ─── Settings page ─── */
.settings-layout { max-width: 1080px; }

.settings-preview-card {
  background: linear-gradient(180deg, #f8fafc, #fff);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.15rem;
  height: 100%;
}

.settings-preview-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
}

.settings-preview-sidebar {
  background: linear-gradient(180deg, #0f172a, #1e293b);
  border-radius: 14px;
  padding: 1rem;
}

.settings-preview-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-preview-brand .brand-text strong {
  color: #f8fafc;
  font-size: 0.95rem;
}

.settings-preview-brand .brand-text small {
  color: #94a3b8;
}

.settings-preview-auth {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e1b4b 0%, #4338ca 100%);
  border: none;
}

.settings-preview-auth .auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 0.65rem;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  overflow: hidden;
}

.settings-preview-auth .auth-brand-mark,
.settings-preview-auth .preview-auth-logo-img {
  display: block;
  max-width: 108px;
  max-height: 108px;
  margin: 0 auto 0.65rem;
  object-fit: contain;
  border-radius: 14px;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
}

.settings-preview-auth strong {
  display: block;
  font-size: 1.05rem;
  color: #fff;
}

.settings-preview-auth small {
  display: block;
  margin-top: 0.2rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
}

.preview-icon-wrap { min-width: 44px; justify-content: center; }
