:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --sidebar-width: 260px;
  --sidebar-bg: #ffffff;
  --bg: #f1f5f9;
  --text-dark: #0f172a;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #e2e8f0;
  --card-shadow: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.04);
  --card-shadow-hover: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --sidebar-shadow: 4px 0 24px rgba(0,0,0,0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  box-shadow: var(--sidebar-shadow);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand img {
  max-height: 46px;
  width: auto;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  overflow-y: auto;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0.5rem 0.75rem 0.25rem;
  margin-top: 0.5rem;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-link-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link-menu i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link-menu:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.nav-link-menu.active {
  background: linear-gradient(135deg, var(--primary-light), rgba(99,102,241,0.05));
  color: var(--primary);
  font-weight: 600;
}

.nav-link-menu.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.nav-link-menu.text-danger { color: #ef4444; }
.nav-link-menu.text-danger:hover { background: var(--danger-light); color: var(--danger); }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

body.sidebar-hidden .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-width)));
}

body.sidebar-hidden .main-wrapper {
  margin-left: 0;
}

/* ===== TOP HEADER ===== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 1040;
  height: 72px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.75rem;
}

.top-header .d-flex { width: 100%; }

.page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
}

#sidebar-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
}

#sidebar-toggle:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* ===== CONTENT ===== */
.content-area {
  padding: 2rem 1.75rem;
  flex: 1;
}

/* ===== CARDS ===== */
.card-soft {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  overflow: hidden;
}

.card-soft:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
  border-color: #c7d2fe;
}

.card-soft-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-soft-header h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}

.card-soft-body {
  padding: 1.5rem;
}

/* ===== BADGES ===== */
.badge-soft-primary { background: var(--primary-light); color: var(--primary); font-weight: 500; }
.badge-soft-success { background: var(--success-light); color: var(--success); font-weight: 500; }
.badge-soft-danger  { background: var(--danger-light);  color: var(--danger);  font-weight: 500; }
.badge-soft-warning { background: var(--warning-light); color: var(--warning); font-weight: 500; }

/* ===== ICON BOX ===== */
.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.icon-box-primary { background: var(--primary-light); color: var(--primary); }
.icon-box-success { background: var(--success-light); color: var(--success); }
.icon-box-danger  { background: var(--danger-light);  color: var(--danger);  }
.icon-box-warning { background: var(--warning-light); color: var(--warning); }

/* ===== OVERLAY ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1045;
  transition: var(--transition);
}

/* ===== UTILITIES ===== */
.text-muted-soft { color: var(--text-muted); }
.text-light-soft { color: var(--text-light); }
.bg-soft-danger  { background: var(--danger-light); }
.bg-soft-success { background: var(--success-light); }

/* ===== STAT CARD ===== */
.stat-card {
  position: relative;
  overflow: visible;
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* ===== DATATABLE Styling ===== */
table.dataTable {
  border-collapse: collapse !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 8px !important;
  margin: 0 2px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  transition: var(--transition);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(99,102,241,0.4);
  background: linear-gradient(135deg, var(--primary-dark), #4338ca);
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.8);
}

.login-brand {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-subtitle {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control-soft {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  transition: var(--transition);
  background: #fafafa;
}

.form-control-soft:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px var(--primary-glow);
  outline: none;
}

.form-label-soft {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

.btn-login {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  padding: 0.75rem;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  width: 100%;
  font-size: 0.9375rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102,126,234,0.5);
  opacity: 0.95;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .content-area {
    padding: 1.25rem 1rem;
  }

  .top-header {
    padding: 0 1rem;
  }
}

@media (max-width: 576px) {
  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 16px;
  }
}

/* ===== FOOTER (same as admin) ===== */
.mon-footer {
  background: linear-gradient(90deg, #08111f, #172554 45%, #073b3a);
  color: #dbeafe;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, .14);
  padding: 0.6rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  width: 100%;
}

.footer-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 28px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 26px rgba(52, 97, 255, .22);
  backdrop-filter: blur(8px);
}

.footer-credit-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #e0f2fe;
  font-size: 13px;
  white-space: nowrap;
}

.footer-credit a {
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  text-shadow: 0 0 12px rgba(34, 211, 238, .8);
}

.footer-credit a:hover {
  color: #7dd3fc;
}

.footer-divider {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 12px #22d3ee;
}

.footer-brand b {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, .8);
}

@media (max-width: 767px) {
  .mon-footer {
    padding: 12px 1rem;
  }
  .footer-credit {
    flex-direction: column;
    gap: 6px;
    border-radius: 14px;
  }
  .footer-divider {
    display: none;
  }
  .footer-credit-item {
    white-space: normal;
    text-align: center;
  }
}
