/* ==========================================================================
   ADMIN DASHBOARD TEMPLATE — style.css
   Single stylesheet shared by every page (login.html, dashboard.html, and
   any future page added to this admin panel).

   TABLE OF CONTENTS
   1.  Variables
   2.  Reset
   3.  Typography
   4.  Buttons
   5.  Forms
   6.  Cards
   7.  Sidebar
   8.  Navbar / Topbar
   9.  Tables
   10. Badges
   11. Alerts
   12. Dropdown
   13. Modal
   14. Pagination
   15. Dashboard Widgets
   16. Charts Placeholder
   17. Login Page
   18. Responsive Utilities
   19. Media Queries
   20. Dark Mode Ready Variables
   ========================================================================== */


/* ==========================================================================
   1. VARIABLES
   ========================================================================== */
:root {
  /* Brand */
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-light: #EEF2FF;

  /* Status */
  --color-success: #16A34A;
  --color-success-light: #DCFCE7;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF3C7;
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;
  --color-info: #0EA5E9;
  --color-info-light: #E0F2FE;

  /* Surfaces */
  --color-bg: #F8F9FA;
  --color-sidebar: #FFFFFF;
  --color-card: #FFFFFF;
  --color-topbar: #FFFFFF;

  /* Text */
  --color-text: #1F2937;
  --color-text-secondary: #6B7280;
  --color-text-muted: #9CA3AF;
  --color-text-inverse: #FFFFFF;

  /* Border */
  --color-border: #E5E7EB;
  --color-border-light: #F1F2F4;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Shadows (soft only) */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 4px 10px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 24px rgba(16, 24, 40, 0.08);

  /* Layout */
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 84px;
  --topbar-height: 72px;

  /* Typography */
  --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

/* --------------------------------------------------------------------------
   20. DARK MODE READY VARIABLES
   Not activated by default. Toggling `data-theme="dark"` on <html> (via a
   future settings page) will remap the surface/text tokens below.
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --color-bg: #101322;
  --color-sidebar: #171B2C;
  --color-card: #171B2C;
  --color-topbar: #171B2C;

  --color-text: #F3F4F6;
  --color-text-secondary: #9CA3AF;
  --color-text-muted: #6B7280;

  --color-border: #262B40;
  --color-border-light: #1F2436;

  --color-primary-light: #211F45;
  --color-success-light: #113322;
  --color-warning-light: #3A2C0E;
  --color-danger-light: #3A1518;
  --color-info-light: #0E2C3A;
}


/* ==========================================================================
   2. RESET
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family-base);
  font-size: var(--fs-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
}

img {
  max-width: 100%;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-text);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.text-secondary-custom {
  color: var(--color-text-secondary) !important;
}

.text-muted-custom {
  color: var(--color-text-muted) !important;
}

.section-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.page-description {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.breadcrumb-custom {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.breadcrumb-custom a {
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb-custom a:hover {
  color: var(--color-primary);
}

.breadcrumb-custom .breadcrumb-item.active {
  color: var(--color-text);
  font-weight: 500;
}


/* ==========================================================================
   4. BUTTONS
   ========================================================================== */
.btn {
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.55rem 1.1rem;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn:active {
  transform: translateY(0.5px);
}

.btn-primary-custom {
  background-color: var(--color-primary);
  border: 1px solid var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.btn-outline-custom {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline-custom:hover {
  background-color: var(--color-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-light-custom {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-light-custom:hover {
  background-color: var(--color-border-light);
}

.btn-danger-custom {
  background-color: var(--color-danger);
  border: 1px solid var(--color-danger);
  color: var(--color-text-inverse);
}

.btn-danger-custom:hover {
  background-color: #B91C1C;
  border-color: #B91C1C;
  color: var(--color-text-inverse);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.btn-sm-custom {
  padding: 0.35rem 0.75rem;
  font-size: var(--fs-xs);
}

/* Loading button state */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

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


/* ==========================================================================
   5. FORMS
   ========================================================================== */
.form-label {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-control,
.form-select {
  font-size: var(--fs-base);
  color: var(--color-text);
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-text-custom {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.input-group-custom {
  position: relative;
}

.input-group-custom .form-control {
  padding-right: 44px;
}

.input-toggle-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--fs-md);
  background: none;
  border: none;
}

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

.form-check-label {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.form-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* Search box (topbar) */
.search-box {
  position: relative;
  max-width: 340px;
  width: 100%;
}

.search-box .bi {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--fs-md);
}

.search-box input {
  padding-left: 40px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
}

.search-box input:focus {
  background-color: var(--color-card);
}


/* ==========================================================================
   6. CARDS
   ========================================================================== */
.dashboard-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base);
}

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

.table-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.card-title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.card-subtitle {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.shadow-sm-custom {
  box-shadow: var(--shadow-sm) !important;
}

.radius-md {
  border-radius: var(--radius-md) !important;
}

.radius-lg {
  border-radius: var(--radius-lg) !important;
}


/* ==========================================================================
   7. SIDEBAR
   ========================================================================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  height: 100%;
  min-height: 100%;
  background-color: var(--color-sidebar);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1030;
  transition: transform var(--transition-base), width var(--transition-base);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-height);
  padding: 0 22px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background-color: var(--color-border);
  border-radius: var(--radius-pill);
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 14px 12px 8px;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  margin-bottom: 2px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.sidebar-nav .nav-link .bi {
  font-size: var(--fs-lg);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.sidebar-nav .nav-link.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.sidebar-nav .nav-badge {
  margin-left: auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

/* Collapsed (desktop) state */
.main-wrapper.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
}

.main-wrapper.sidebar-collapsed .sidebar-brand-text,
.main-wrapper.sidebar-collapsed .sidebar-section-label,
.main-wrapper.sidebar-collapsed .nav-link-text,
.main-wrapper.sidebar-collapsed .nav-badge,
.main-wrapper.sidebar-collapsed .sidebar-footer {
  display: none;
}

.main-wrapper.sidebar-collapsed .sidebar-nav .nav-link {
  justify-content: center;
}

.main-wrapper.sidebar-collapsed .content-wrapper {
  margin-left: var(--sidebar-width-collapsed);
}

.main-wrapper.sidebar-collapsed .topbar {
  left: var(--sidebar-width-collapsed);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(17, 24, 39, 0.45);
  z-index: 1025;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}


/* ==========================================================================
   8. NAVBAR / TOPBAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  background-color: var(--color-topbar);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  z-index: 1020;
  transition: left var(--transition-base);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sidebar-toggle-btn {
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
  color: var(--color-text);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  transition: background-color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background-color: var(--color-bg);
}

.topbar-icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
  color: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.topbar-icon-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.topbar-icon-btn .notif-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-danger);
  border: 2px solid var(--color-card);
}

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: none;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.profile-trigger:hover {
  background-color: var(--color-bg);
  border-color: var(--color-border);
}

.profile-meta {
  text-align: left;
  line-height: 1.2;
}

.profile-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
}

.profile-role {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}


/* ==========================================================================
   9. TABLES
   ========================================================================== */
.table-custom {
  margin: 0;
  font-size: var(--fs-sm);
}

.table-custom thead th {
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
  padding: 14px 22px;
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 16px 22px;
  vertical-align: middle;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.table-custom tbody tr:last-child td {
  border-bottom: none;
}

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

.table-custom tbody tr:hover {
  background-color: var(--color-bg);
}

.table-responsive-custom {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-cell-primary {
  font-weight: 600;
  color: var(--color-text);
}

.table-cell-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}


/* ==========================================================================
   10. BADGES
   ========================================================================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-success-custom {
  background-color: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning-custom {
  background-color: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-danger-custom {
  background-color: var(--color-danger-light);
  color: var(--color-danger);
}

.badge-info-custom {
  background-color: var(--color-info-light);
  color: var(--color-info);
}

.badge-neutral-custom {
  background-color: var(--color-bg);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}


/* ==========================================================================
   11. ALERTS
   ========================================================================== */
.alert-custom {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: var(--fs-sm);
}

.alert-custom .bi {
  font-size: var(--fs-lg);
  margin-top: 1px;
}

.alert-success-custom {
  background-color: var(--color-success-light);
  border-color: #BBF0CE;
  color: #14532D;
}

.alert-warning-custom {
  background-color: var(--color-warning-light);
  border-color: #FDE6A8;
  color: #7C4A03;
}

.alert-danger-custom {
  background-color: var(--color-danger-light);
  border-color: #FBCACA;
  color: #7F1D1D;
}

.alert-info-custom {
  background-color: var(--color-info-light);
  border-color: #BAE6FD;
  color: #0C4A6E;
}


/* ==========================================================================
   12. DROPDOWN
   ========================================================================== */
.dropdown-menu-custom {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 220px;
}

.dropdown-menu-custom .dropdown-item {
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: var(--fs-sm);
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-menu-custom .dropdown-item .bi {
  font-size: var(--fs-md);
  color: var(--color-text-secondary);
  width: 18px;
}

.dropdown-menu-custom .dropdown-item:hover {
  background-color: var(--color-bg);
}

.dropdown-menu-custom .dropdown-item.text-danger-custom {
  color: var(--color-danger);
}

.dropdown-menu-custom .dropdown-item.text-danger-custom .bi {
  color: var(--color-danger);
}

.dropdown-menu-custom .dropdown-divider {
  margin: 6px 0;
  border-color: var(--color-border);
}

.dropdown-header-custom {
  padding: 10px 12px 6px;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}

.notification-item:hover {
  background-color: var(--color-bg);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--fs-md);
}


/* ==========================================================================
   13. MODAL
   ========================================================================== */
.modal-content-custom {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header-custom {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal-title-custom {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--color-text);
}

.modal-body-custom {
  padding: 24px;
}

.modal-footer-custom {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

.modal-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
}


/* ==========================================================================
   14. PAGINATION
   ========================================================================== */
.pagination-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.pagination-custom .page-item .page-link {
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.pagination-custom .page-item.active .page-link {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.pagination-custom .page-item .page-link:hover {
  background-color: var(--color-bg);
}

.pagination-summary {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}


/* ==========================================================================
   15. DASHBOARD WIDGETS
   ========================================================================== */
.stat-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-card-label {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  font-weight: 600;
  margin-top: 8px;
}

.trend-up {
  color: var(--color-success);
}

.trend-down {
  color: var(--color-danger);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--fs-sm);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: var(--fs-xs);
}

.avatar-lg {
  width: 56px;
  height: 56px;
  font-size: var(--fs-md);
}

.product-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.widget-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.widget-list-item:last-child {
  border-bottom: none;
}

.progress-custom {
  height: 6px;
  border-radius: var(--radius-pill);
  background-color: var(--color-bg);
  overflow: hidden;
}

.progress-custom .progress-bar {
  border-radius: var(--radius-pill);
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 12px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.quick-action-btn:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.quick-action-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

.quick-action-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
}


/* ==========================================================================
   16. CHARTS PLACEHOLDER
   ========================================================================== */
.chart-placeholder {
  height: 280px;
  border-radius: var(--radius-md);
  background-image:
    linear-gradient(var(--color-border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border-light) 1px, transparent 1px);
  background-size: 100% 20%, 12.5% 100%;
  background-color: var(--color-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  border: 1px dashed var(--color-border);
}

.chart-placeholder .placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-placeholder .bi {
  font-size: 1.75rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.chart-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}


/* ==========================================================================
   17. LOGIN PAGE
   ========================================================================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--color-bg);
  background-image: radial-gradient(circle at 1px 1px, var(--color-border) 1px, transparent 0);
  background-size: 28px 28px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  text-align: center;
  color: var(--color-text);
  margin-bottom: 4px;
}

.auth-subtitle {
  font-size: var(--fs-sm);
  text-align: center;
  color: var(--color-text-secondary);
  margin-bottom: 28px;
}

.auth-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  margin-top: 24px;
}

.auth-page-footer {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  margin-top: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--color-border);
}

.forgot-link {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--color-primary);
}

.forgot-link:hover {
  color: var(--color-primary-hover);
}


/* ==========================================================================
   18. RESPONSIVE UTILITIES
   ========================================================================== */
.main-wrapper {
  min-height: 100vh;
}

.content-wrapper {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--transition-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.app-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.d-mobile-only {
  display: none;
}


/* ==========================================================================
   19. MEDIA QUERIES
   ========================================================================== */

/* Laptop / small desktop */
@media (max-width: 1199.98px) {
  .content-body {
    padding: 22px;
  }
}

/* Tablet */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .main-wrapper.sidebar-mobile-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .content-wrapper,
  .main-wrapper.sidebar-collapsed .content-wrapper {
    margin-left: 0;
  }

  .topbar,
  .main-wrapper.sidebar-collapsed .topbar {
    left: 0;
  }

  .d-mobile-only {
    display: inline-flex;
  }

  .search-box {
    max-width: 260px;
  }
}

/* Mobile */
@media (max-width: 767.98px) {
  .content-body {
    padding: 16px;
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }

  .search-box {
    display: none;
  }

  .profile-meta {
    display: none;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-card {
    padding: 30px 22px;
  }

  .app-footer {
    justify-content: center;
    text-align: center;
  }

  .table-card-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* Small mobile */
@media (max-width: 575.98px) {
  .stat-card {
    flex-direction: column;
  }

  .quick-action-btn {
    padding: 16px 8px;
  }

  .auth-wrapper {
    padding: 16px;
  }
}


/* ==========================================================================
   21. MEMBER PORTAL — PRICING & KYC BADGES
   Reused across product cards, cart, checkout and the pricing engine.
   ========================================================================== */
.price-mrp {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.price-final {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--color-text);
}

.price-discount-tag {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-success);
  background-color: var(--color-success-light);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
}

.kyc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.rating-stars {
  color: var(--color-warning);
  font-size: var(--fs-xs);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.rating-stars .rating-count {
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-left: 4px;
}


/* ==========================================================================
   22. PRODUCT GRID & FILTERS (Explore Products)
   ========================================================================== */
.filter-panel {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--color-border-light);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.filter-chip.active,
.filter-chip:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.product-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.product-card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.product-card-wishlist {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}

.product-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-card-category {
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.product-card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.product-card-footer {
  padding: 0 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.qty-stepper button {
  width: 32px;
  height: 32px;
  border: none;
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
}

.qty-stepper button:hover {
  background-color: var(--color-border-light);
}

.qty-stepper input {
  width: 38px;
  height: 32px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
}

.qty-stepper input:focus {
  outline: none;
}


/* ==========================================================================
   23. CART & CHECKOUT
   ========================================================================== */
.cart-item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--color-border-light);
}

.cart-item-row:last-child {
  border-bottom: none;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cart-item-remove {
  color: var(--color-text-muted);
  background: none;
  border: none;
  font-size: var(--fs-lg);
  padding: 4px;
}

.cart-item-remove:hover {
  color: var(--color-danger);
}

.summary-card {
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--topbar-height) + 20px);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  padding: 8px 0;
}

.summary-row.summary-total {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 14px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-text);
}

.donation-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: var(--color-primary-light);
  border: 1px solid #DDD9FB;
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

/* Checkout stepper */
.checkout-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  font-weight: 600;
}

.checkout-step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: var(--color-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.checkout-step.active .checkout-step-circle,
.checkout-step.completed .checkout-step-circle {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.checkout-step.active {
  color: var(--color-text);
}

.checkout-step.completed {
  color: var(--color-success);
}

.checkout-step-divider {
  width: 32px;
  height: 1px;
  background-color: var(--color-border);
  flex-shrink: 0;
}

.invoice-type-toggle {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.invoice-type-toggle input {
  display: none;
}

.invoice-type-toggle label {
  padding: 8px 16px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.invoice-type-toggle input:checked + label {
  background-color: var(--color-primary);
  color: #fff;
}


/* ==========================================================================
   24. WALLET & REFERRAL
   ========================================================================== */
.wallet-balance-card {
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
  border-radius: var(--radius-lg);
  padding: 26px;
  color: #fff;
  box-shadow: var(--shadow-md);
}

.wallet-balance-label {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  margin-bottom: 6px;
}

.wallet-balance-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.wallet-balance-meta {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.75);
}

.ledger-type-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-md);
  flex-shrink: 0;
}

.referral-box {
  background-color: var(--color-bg);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.referral-code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.04em;
}

.nav-tabs-custom {
  border-bottom: 1px solid var(--color-border);
  gap: 4px;
}

.nav-tabs-custom .nav-link {
  border: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  padding: 10px 18px;
}

.nav-tabs-custom .nav-link.active {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}


/* ==========================================================================
   25. MEMBER RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 991.98px) {
  .summary-card {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .cart-item-row {
    flex-wrap: wrap;
    padding: 16px;
  }

  .wallet-balance-value {
    font-size: 1.6rem;
  }

  .checkout-step span.step-label {
    display: none;
  }
}


/* ==========================================================================
   26. REFERRAL / MLM ORG-CHART TREE
   Pure CSS connector-line tree (no JS libraries). Nodes are shown/hidden by
   toggling the `.collapsed` class on the relevant <li>, done from a small
   inline script on the tree page.
   ========================================================================== */
.org-tree-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 10px 40px;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.org-tree,
.org-tree ul {
  padding-top: 40px;
  position: relative;
  margin: 0 auto;
  width: fit-content;
}

.org-tree::after,
.org-tree ul::after {
  content: "";
  display: table;
  clear: both;
}

.org-tree {
  padding-top: 0;
}

.org-tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 40px 16px 0 16px;
}

.org-tree li::before,
.org-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  border-top: 2px solid var(--color-border);
  width: 50%;
  height: 40px;
}

.org-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--color-border);
}

.org-tree li:only-child::after,
.org-tree li:only-child::before {
  display: none;
}

.org-tree li:only-child {
  padding-top: 0;
}

.org-tree li:first-child::before,
.org-tree li:last-child::after {
  border: 0 none;
}

.org-tree li:last-child::before {
  border-right: 2px solid var(--color-border);
  border-radius: 0 6px 0 0;
}

.org-tree li:first-child::after {
  border-radius: 6px 0 0 0;
}

.org-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  border-left: 2px solid var(--color-border);
  width: 0;
  height: 40px;
}

.org-tree li.collapsed > ul {
  display: none;
}

/* Node card */
.tree-node-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 168px;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.tree-node-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.tree-node-card.is-root {
  border: 2px solid var(--color-primary);
  background-color: var(--color-primary-light);
}

.tree-node-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--fs-sm);
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  position: relative;
}

.tree-node-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--color-card);
}

.tree-node-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tree-node-id {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  font-family: 'SFMono-Regular', Consolas, monospace;
}

.tree-node-level {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.tree-node-meta {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.tree-toggle-btn {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  z-index: 2;
}

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

.tree-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tree-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.tree-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.tree-node-card.dim {
  opacity: 0.35;
}

.tree-node-card.match {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

@media (max-width: 575.98px) {
  .tree-node-card {
    width: 140px;
    padding: 10px 8px;
  }
}

/* ==========================================================================
   21. SHIMMER & SKELETON LOADERS
   ========================================================================== */
@keyframes shimmerAnim {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.shimmer-element {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.5s infinite ease-in-out;
  border-radius: 6px;
  display: inline-block;
}

.shimmer-circle {
  border-radius: 50% !important;
}

.shimmer-card {
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

