/* =============================================
   PROFIL DUSUN — Web Admin Design System
   ============================================= */

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

:root {
  --sidebar-width: 260px;
  --sidebar-bg: #1e1b4b;
  --sidebar-accent: #4338ca;
  --sidebar-text: #c7d2fe;
  --sidebar-hover: rgba(99,102,241,0.18);
  --sidebar-active-bg: #4338ca;
  --topbar-h: 60px;
  --primary: #4338ca;
  --primary-light: #6366f1;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0284c7;
  --body-bg: #f1f5f9;
  --card-radius: 12px;
  --card-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --card-shadow-hover: 0 4px 8px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.1);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--body-bg);
  color: #1e293b;
  font-size: 0.875rem;
}

/* =============================================
   SIDEBAR
   ============================================= */
#sidebar-wrapper {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  min-height: 100vh;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.25s ease;
  box-shadow: 4px 0 24px rgba(30,27,75,.18);
  scrollbar-width: none;
}
#sidebar-wrapper::-webkit-scrollbar { display: none; }

/* Brand */
.sidebar-brand {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #818cf8, #4338ca);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.4);
}
.sidebar-brand-icon i { color: #fff; font-size: 1rem; }
.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text .name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.sidebar-brand-text .sub {
  font-size: 0.7rem;
  color: #a5b4fc;
  font-weight: 400;
}

/* Nav section label */
.sidebar-label {
  padding: 1rem 1.5rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
}

/* Nav items */
.sidebar-nav {
  padding: 0.5rem 0.75rem;
  flex: 1;
}
.sidebar-nav .nav-item { margin-bottom: 2px; }
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.sidebar-nav .nav-link i {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  opacity: 0.8;
  flex-shrink: 0;
}
.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
  transform: translateX(2px);
}
.sidebar-nav .nav-link:hover i { opacity: 1; }
.sidebar-nav .nav-link.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  box-shadow: 0 2px 8px rgba(67,56,202,.45);
}
.sidebar-nav .nav-link.active i { opacity: 1; }

/* Sidebar footer */
.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: auto;
}
.sidebar-footer-inner {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.5rem;
  border-radius: 8px;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #818cf8, #4338ca);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-avatar i { color: #fff; font-size: 0.85rem; }
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #e0e7ff;
  line-height: 1;
}
.sidebar-user-role {
  font-size: 0.68rem;
  color: #a5b4fc;
  margin-top: 2px;
}

/* =============================================
   TOPBAR
   ============================================= */
#wrapper {
  min-height: 100vh;
  width: 100%;
}

#page-content-wrapper {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.topbar-user i { color: #64748b; font-size: 0.875rem; }
.topbar-user span { font-size: 0.8rem; font-weight: 500; color: #475569; }
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #dc2626;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-logout:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

/* =============================================
   PAGE CONTENT
   ============================================= */
.page-body {
  padding: 1.75rem;
  flex: 1;
}

/* =============================================
   STAT CARDS (Dashboard)
   ============================================= */
.stat-card {
  background: #fff;
  border-radius: var(--card-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid #f1f5f9;
  transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}
.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon i { font-size: 1.35rem; }
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.blue i { color: #2563eb; }
.stat-icon.green   { background: #f0fdf4; }
.stat-icon.green i { color: #16a34a; }
.stat-icon.amber   { background: #fffbeb; }
.stat-icon.amber i { color: #d97706; }
.stat-icon.sky   { background: #f0f9ff; }
.stat-icon.sky i { color: #0284c7; }
.stat-icon.violet   { background: #f5f3ff; }
.stat-icon.violet i { color: #7c3aed; }
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
}
.stat-label {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 3px;
  font-weight: 500;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  border-radius: var(--card-radius) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: var(--card-shadow) !important;
}
.card-header {
  background: #fff !important;
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 1rem 1.25rem !important;
  border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
  font-size: 0.875rem;
}
.card-header.primary-header {
  background: linear-gradient(135deg, #4338ca, #6366f1) !important;
  color: #fff !important;
  border-bottom: none !important;
}
.card-body { padding: 1.25rem; }
.card-footer {
  background: #fafafa !important;
  border-top: 1px solid #f1f5f9 !important;
}

/* =============================================
   TABLES
   ============================================= */
.table {
  font-size: 0.85rem;
}
.table thead th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.table tbody td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
}
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: #f8fafc; }

/* =============================================
   FORMS
   ============================================= */
.form-control, .form-select {
  border-radius: 8px !important;
  border-color: #cbd5e1 !important;
  font-size: 0.875rem !important;
  padding: 0.5rem 0.875rem !important;
  transition: border-color 0.15s, box-shadow 0.15s !important;
}
.form-control:focus, .form-select:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.12) !important;
}
.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.form-text { font-size: 0.75rem; color: #94a3b8; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  border-radius: 8px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  transition: all 0.15s !important;
}
.btn-primary {
  background: linear-gradient(135deg, #4338ca, #6366f1) !important;
  border-color: #4338ca !important;
  box-shadow: 0 2px 4px rgba(67,56,202,.25) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3730a3, #4f46e5) !important;
  border-color: #3730a3 !important;
  box-shadow: 0 4px 8px rgba(67,56,202,.35) !important;
  transform: translateY(-1px);
}
.btn-outline-primary {
  border-color: #6366f1 !important;
  color: #4338ca !important;
}
.btn-outline-primary:hover {
  background: #4338ca !important;
  border-color: #4338ca !important;
  color: #fff !important;
}
.btn-success {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  border-color: #059669 !important;
  box-shadow: 0 2px 4px rgba(5,150,105,.25) !important;
}
.btn-success:hover { transform: translateY(-1px); }
.btn-sm { padding: 0.35rem 0.75rem !important; font-size: 0.78rem !important; }
.btn-icon { padding: 0.35rem 0.5rem !important; }
.btn-group .btn { border-radius: 6px !important; }
.btn-group .btn:not(:last-child) { margin-right: 2px; }
.btn-group { gap: 2px; }

/* =============================================
   BADGES
   ============================================= */
.badge {
  border-radius: 6px !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  padding: 0.3em 0.65em !important;
  letter-spacing: 0.02em;
}
.badge.bg-success  { background: #dcfce7 !important; color: #15803d !important; }
.badge.bg-warning  { background: #fef9c3 !important; color: #a16207 !important; }
.badge.bg-danger   { background: #fee2e2 !important; color: #b91c1c !important; }
.badge.bg-secondary{ background: #f1f5f9 !important; color: #64748b !important; }
.badge.bg-info     { background: #e0f2fe !important; color: #0369a1 !important; }
.badge.bg-primary  { background: #ede9fe !important; color: #5b21b6 !important; }

/* =============================================
   PAGINATION
   ============================================= */
.page-link {
  border-radius: 6px !important;
  border-color: #e2e8f0 !important;
  color: #4338ca !important;
  font-size: 0.8rem !important;
  padding: 0.3rem 0.65rem !important;
  margin: 0 2px;
}
.page-item.active .page-link {
  background: #4338ca !important;
  border-color: #4338ca !important;
  color: #fff !important;
}

/* =============================================
   ALERTS
   ============================================= */
.alert {
  border-radius: 10px !important;
  border: none !important;
  font-size: 0.875rem;
  padding: 0.875rem 1rem !important;
}
.alert-success { background: #f0fdf4 !important; color: #15803d !important; }
.alert-danger  { background: #fef2f2 !important; color: #b91c1c !important; }
.alert-warning { background: #fffbeb !important; color: #92400e !important; }

/* =============================================
   SECTION TITLE + PAGE HEADER
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.page-header-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* =============================================
   SECTION DIVIDER / LABEL
   ============================================= */
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

/* =============================================
   DETAIL FIELD
   ============================================= */
.detail-label { font-size: 0.75rem; font-weight: 600; color: #94a3b8; margin-bottom: 2px; }
.detail-value { font-size: 0.875rem; font-weight: 500; color: #1e293b; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #94a3b8;
}
.empty-state i { font-size: 2.5rem; margin-bottom: 0.75rem; display: block; opacity: 0.4; }
.empty-state p { margin: 0; font-size: 0.875rem; }

/* =============================================
   LOGIN PAGE
   ============================================= */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,.2) 0%, transparent 70%);
  top: -200px; right: -200px;
  pointer-events: none;
}
.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(167,139,250,.15) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  pointer-events: none;
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative;
  z-index: 1;
}
.auth-logo {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, #4338ca, #818cf8);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 14px rgba(67,56,202,.4);
}
.auth-logo i { color: #fff; font-size: 1.4rem; }
.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  margin-bottom: 4px;
}
.auth-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  margin-bottom: 2rem;
}
.auth-card .form-control {
  background: #f8fafc !important;
  height: 46px !important;
  font-size: 0.9rem !important;
}
.auth-card .form-control:focus { background: #fff !important; }
.auth-btn {
  height: 46px;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  width: 100%;
}

/* =============================================
   MISC
   ============================================= */
code {
  background: #f1f5f9;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: #4338ca;
  font-size: 0.82em;
}
hr { border-color: #f1f5f9; }
.text-muted { color: #94a3b8 !important; }

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

/* Transition on interactive elements */
a, button { transition: all 0.15s ease; }
