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

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sidebar-width: 14rem;
  --sidebar-bg: #1a1d29;
  --sidebar-hover: #262a3a;
  --sidebar-active: #2d3246;
  --sidebar-text: #a0a5b8;
  --sidebar-text-active: #fff;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --accent: #6366f1;
  --accent-light: #818cf8;
  --bg-body: #f1f5f9;
  --card-border: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --transition: 180ms ease;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Login ── */
.bg-gradient-primary {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #3730a3 100%) !important;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--sidebar-bg) !important;
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  transition: width var(--transition);
}

.sidebar .nav-item .nav-link {
  color: var(--sidebar-text);
  padding: 0.7rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 450;
  border-left: 3px solid transparent;
  transition: all var(--transition);
}

.sidebar .nav-item .nav-link:hover {
  color: var(--sidebar-text-active);
  background: var(--sidebar-hover);
  border-left-color: var(--accent);
}

.sidebar .nav-item .nav-link.active {
  color: var(--sidebar-text-active);
  background: var(--sidebar-active);
  border-left-color: var(--accent);
}

.sidebar .nav-item .nav-link i {
  color: inherit;
  font-size: 0.9rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-brand {
  background: var(--brand-gradient) !important;
  padding: 1.25rem 1rem !important;
}

.sidebar-brand-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-brand-icon i {
  font-size: 1.25rem;
}

.sidebar .sidebar-heading {
  color: #525980;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 1.25rem 0.5rem;
}

.sidebar .sidebar-divider {
  border-color: rgba(255, 255, 255, 0.06);
}

/* ── Topbar ── */
.topbar {
  background: #fff !important;
  border-bottom: 1px solid var(--card-border);
  box-shadow: none !important;
  padding: 0.5rem 1.5rem;
}

.topbar .nav-link {
  color: var(--text-secondary) !important;
}

/* ── Cards ── */
.card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0 !important;
}

.card-body {
  padding: 1.25rem;
}

/* Dashboard stat cards */
.border-left-primary { border-left: 4px solid var(--accent) !important; }
.border-left-success { border-left: 4px solid var(--success) !important; }
.border-left-info { border-left: 4px solid var(--info) !important; }

/* ── Tables ── */
.table {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin-bottom: 0;
}

.table thead th {
  border-bottom: 2px solid var(--card-border);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.85rem 0.75rem;
}

.table td {
  padding: 0.75rem;
  vertical-align: middle;
  border-color: #f1f5f9;
}

.table tbody tr {
  transition: background var(--transition);
}

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

.table-bordered {
  border-color: var(--card-border);
}

.table-bordered th,
.table-bordered td {
  border-color: var(--card-border);
}

/* ── Buttons ── */
.btn {
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

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

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

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

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

.btn-danger:hover {
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

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

.btn-success:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

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

.btn-circle {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* ── Form Controls ── */
.form-control {
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  outline: none;
}

.form-control-user {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  border-radius: 10px;
}

select.form-control {
  cursor: pointer;
}

/* ── Alerts ── */
.alert {
  border: none;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.85rem 1.1rem;
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
}

.alert-danger {
  background: #fef2f2;
  color: #991b1b;
}

/* ── CKEditor ── */
.cke_chrome {
  border-color: var(--card-border) !important;
  border-radius: 8px !important;
  overflow: hidden;
}

/* ── Dropdown ── */
.dropdown-menu {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.dropdown-item {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: #f1f5f9;
}

/* ── Modals ── */
.modal-content {
  border: none;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

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

.modal-body {
  padding: 1.5rem;
}

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

.close {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.5;
  transition: opacity var(--transition);
}

.close:hover {
  opacity: 1;
}

/* ── Footer ── */
footer.sticky-footer {
  background: #fff !important;
  border-top: 1px solid var(--card-border);
  padding: 0.85rem 0;
}

footer .copyright {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* ── Tab panels ── */
.nav-tabs .nav-link {
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.75rem 1.25rem;
  transition: all var(--transition);
}

.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: transparent;
}

/* ── Image grid ── */
.img-profile {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 50%;
}

/* ── Page heading ── */
.h3.mb-4.text-gray-800 {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

/* ── Wrapper fixes ── */
#wrapper {
  display: flex;
}

#content-wrapper {
  flex: 1;
  min-width: 0;
}

.container-fluid {
  padding: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    width: 6.5rem !important;
    min-width: 6.5rem !important;
  }
  .container-fluid {
    padding: 1rem;
  }
}

/* ── DataTable search box ── */
.dataTables_filter input {
  border: 1.5px solid var(--card-border);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-sans);
}

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

/* ── Navigation tabs glow ── */
.nav-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
