/* ═══════════════════════════════════════════════════════
   JOHREP GROUP — ADMIN PORTAL
   Revamped Premium Design · All class names preserved
═══════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400;1,600&family=DM+Sans:wght@300;400;500;600;700&family=Bebas+Neue&display=swap");

:root {
  --G: #50a03c;
  --GD: #2d6b1f;
  --GL: #e8f5e3;
  --GP: #f2faf0;
  --R: #dc283c;
  --RL: #fff0f1;
  --BK: #0d0d0d;
  --DK: #1c1c1e;
  --GR: #6b7280;
  --GRL: #9ca3af;
  --BD: #e5e7eb;
  --BG: #ffffff;
  --BG2: #f5f6f8;
  --GOLD: #dc283c;
  --FB: "DM Sans", sans-serif;
  --FH: "Bebas Neue", sans-serif;
  --FD: "Cormorant Garamond", serif;

  /* Sidebar tokens */
  --SB-BG: #111318;
  --SB-BG2: #181b22;
  --SB-BORDER: rgba(255, 255, 255, 0.06);
  --SB-TEXT: rgba(255, 255, 255, 0.55);
  --SB-TEXT-ACTIVE: #ffffff;
  --SB-ACTIVE-BG: rgba(80, 160, 60, 0.15);
  --SB-HOVER-BG: rgba(255, 255, 255, 0.05);
  --SB-W: 268px;

  /* Surface tokens */
  --SURFACE: #ffffff;
  --SURFACE-RAISED: #fefefe;
  --SHADOW-SM: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --SHADOW-MD: 0 4px 16px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.04);
  --SHADOW-LG: 0 12px 40px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
  --RADIUS: 14px;
  --RADIUS-SM: 8px;
  --RADIUS-LG: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--FB);
  background: var(--BG2);
  color: var(--DK);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(
      ellipse 900px 600px at 80% -10%,
      rgba(80, 160, 60, 0.04) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse 600px 500px at -5% 90%,
      rgba(220, 40, 60, 0.03) 0%,
      transparent 60%
    );
  pointer-events: none;
  z-index: 0;
}

/* ── LAYOUT ── */
.dashboard {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── MOBILE NAVBAR ── */
.mobile-navbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: #ffffff;
  z-index: 200;
  padding: 0 16px 0 18px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--BD);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.07);
}

/* Brand block in the navbar — logo image + name */
.mobile-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

/* Style the JG initials mark in the light navbar */
.mobile-navbar-brand .sidebar-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--G) 0%, var(--GD) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--FH);
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(80, 160, 60, 0.3);
}

/* Logo image inside the light navbar (full colour, no invert) */
.mobile-navbar-brand img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

.mobile-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.mobile-logo img {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* Brand name text */
.mobile-navbar-brand span {
  font-family: var(--FH);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--BK);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hamburger button */
.hamburger {
  background: var(--BG2);
  border: 1.5px solid var(--BD);
  color: var(--DK);
  font-size: 0.95rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: var(--RADIUS-SM);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.hamburger:hover {
  background: var(--GL);
  border-color: var(--G);
  color: var(--G);
}

/* ── MOBILE MENU OVERLAY ── */
/* The overlay IS the drawer — it slides in from the left */
@keyframes overlayFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes drawerSlideIn {
  from {
    transform: translateX(-100%);
    opacity: 0.6;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow: hidden;
  pointer-events: none;
  /* Dark backdrop via pseudo-element so the drawer itself isn't blurred */
}

/* Backdrop */
.mobile-menu-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.mobile-menu-overlay.show {
  pointer-events: all;
}

.mobile-menu-overlay.show::before {
  background: rgba(0, 0, 0, 0.5);
  
  /* -webkit- */
}

/* The actual visible drawer panel — built from the overlay's own content */
.mobile-menu-overlay {
  /* When hidden, slide the content off-screen */
  display: block !important; /* always in DOM, controlled by transform */
  transform: translateX(-100%);
  width: min(300px, 88vw);
  background: var(--SB-BG);
  top: 0;
  left: 0;
  bottom: 0;
  right: auto;
  overflow-y: auto;
  box-shadow: none;
  transition:
    transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.32s ease;
}

.mobile-menu-overlay.show {
  transform: translateX(0);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.4);
}

/* ── MOBILE MENU HEADER (logo + close button) ── */
.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--SB-BORDER);
  flex-shrink: 0;
  gap: 12px;
}

/* Style the JG mark inside the dark drawer */
.mobile-menu-header .sidebar-logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--G) 0%, var(--GD) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--FH);
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 10px rgba(80, 160, 60, 0.35);
}

/* Logo image inside the dark drawer — inverted to white */
.mobile-menu-header img {
  height: 28px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Portal label text next to logo in drawer */
.mobile-menu-header .mobile-menu-logo-text {
  font-family: var(--FH);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: #fff;
  flex: 1;
}

/* Close button */
.mobile-menu-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-left: auto;
}

.mobile-menu-close:hover {
  background: var(--R);
  border-color: var(--R);
  color: #fff;
  transform: rotate(90deg);
}

/* ── MOBILE NAV LINKS ── */
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 12px;
  flex: 1;
}

.mobile-nav-section-title {
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  padding: 16px 8px 8px;
  font-weight: 700;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-radius: var(--RADIUS-SM);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.18s ease;
}

.mobile-nav-item:hover {
  background: var(--SB-HOVER-BG);
  color: rgba(255, 255, 255, 0.9);
}

.mobile-nav-item.active {
  background: var(--SB-ACTIVE-BG);
  color: #6ecf57;
  font-weight: 600;
}

.mobile-nav-item i {
  width: 18px;
  font-size: 0.88rem;
  opacity: 0.75;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.mobile-nav-item:hover i,
.mobile-nav-item.active i {
  opacity: 1;
}

/* ── MOBILE MENU FOOTER (user info row) ── */
.mobile-menu-footer {
  padding: 16px 18px;
  border-top: 1px solid var(--SB-BORDER);
  flex-shrink: 0;
}

/* Repurpose mobile-user-info if present inside footer */
.mobile-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--RADIUS-SM);
}

/* ── MOBILE LOGOUT BUTTON ── */
.mobile-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  width: 100%;
  justify-content: center;
  background: rgba(220, 40, 60, 0.1);
  border: 1.5px solid rgba(220, 40, 60, 0.25);
  border-radius: var(--RADIUS-SM);
  color: #f87171;
  font-size: 0.835rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
  font-family: var(--FB);
  text-transform: uppercase;
}

.mobile-logout-btn i {
  font-size: 0.85rem;
}

.mobile-logout-btn:hover {
  background: var(--R);
  border-color: var(--R);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 40, 60, 0.35);
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--SB-BG);
  width: var(--SB-W);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 100px;
  border-right: 1px solid var(--SB-BORDER);
  display: block;
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(80, 160, 60, 0.3);
  border-radius: 4px;
}

/* ── MAIN CONTENT ── */
.main {
  margin-left: var(--SB-W);
  padding: 28px 32px;
  width: calc(100% - var(--SB-W));
  min-height: 100vh;
  position: relative;
}

/* ── SIDEBAR HEADER ── */
.sidebar-header {
  padding: 26px 20px 22px;
  border-bottom: 1px solid var(--SB-BORDER);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.sidebar-logo:hover {
  opacity: 0.82;
}

/* Sidebar logo image — shown when <img> tag is added to the HTML */
.sidebar-logo img,
.sidebar-logo-img {
  height: 36px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* Branded initials mark — visible when no img tag is present */
.sidebar-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--G) 0%, var(--GD) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--FH);
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 12px rgba(80, 160, 60, 0.4);
}

.sidebar-logo-text {
  font-family: var(--FH);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  color: #fff;
  line-height: 1;
}

.sidebar-logo-sub {
  font-size: 0.6rem;
  color: var(--GOLD);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 5px;
  font-weight: 600;
}

/* ── SIDEBAR NAV ── */
.sidebar-nav {
  padding: 20px 0;
}

.nav-section {
  margin-bottom: 28px;
}

.nav-section-title {
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
  padding: 0 22px 10px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 11px 14px 11px 18px;
  margin: 2px 12px;
  color: var(--SB-TEXT);
  text-decoration: none;
  border-radius: var(--RADIUS-SM);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--R);
  border-radius: 0 3px 3px 0;
  transition: height 0.25s ease;
}

.nav-item:hover {
  background: var(--SB-HOVER-BG);
  color: var(--SB-TEXT-ACTIVE);
}

.nav-item:hover::after {
  height: 55%;
}

.nav-item.active {
  background: var(--SB-ACTIVE-BG);
  color: #6ecf57;
  font-weight: 600;
}

.nav-item.active::after {
  height: 65%;
  background: var(--R);
}

.nav-item i {
  width: 20px;
  margin-right: 12px;
  font-size: 0.9rem;
  opacity: 0.8;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.nav-item:hover i,
.nav-item.active i {
  opacity: 1;
}

/* ── SIDEBAR FOOTER ── */
.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 16px;
  border-top: 1px solid var(--SB-BORDER);
  background: var(--SB-BG);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--RADIUS-SM);
  transition: background 0.2s;
}

.user-info:hover {
  background: rgba(255, 255, 255, 0.07);
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--G), var(--GOLD));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
}

.user-role {
  font-size: 0.65rem;
  color: rgba(220, 40, 60, 0.8);
  letter-spacing: 0.06em;
  margin-top: 2px;
  text-transform: uppercase;
}

.logout-btn {
  background: transparent;
  border: 1px solid rgba(220, 40, 60, 0.25);
  color: rgba(220, 40, 60, 0.7);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: var(--R);
  border-color: var(--R);
  color: #fff;
}

/* ── HEADER ── */
.header {
  background: var(--SURFACE);
  border-radius: var(--RADIUS);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--SHADOW-SM);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--BD);
  position: relative;
  overflow: hidden;
}

.header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--R);
}

.page-title {
  font-family: var(--FD);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--BK);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--GR);
  margin-top: 5px;
  line-height: 1.5;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--RADIUS-SM);
  font-size: 0.835rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-family: var(--FB);
  position: relative;
  overflow: hidden;
}

.btn i {
  font-size: 0.85em;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--G);
  color: #fff;
  border-color: var(--G);
  box-shadow: 0 2px 8px rgba(80, 160, 60, 0.28);
}

.btn-primary:hover {
  background: var(--GD);
  border-color: var(--GD);
  box-shadow: 0 4px 16px rgba(80, 160, 60, 0.38);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--SURFACE);
  color: var(--DK);
  border-color: var(--BD);
  box-shadow: var(--SHADOW-SM);
}

.btn-secondary:hover {
  border-color: var(--G);
  color: var(--G);
  background: var(--GP);
}

.btn-danger {
  background: var(--R);
  color: #fff;
  border-color: var(--R);
  box-shadow: 0 2px 8px rgba(220, 40, 60, 0.28);
}

.btn-danger:hover {
  background: #b91c2c;
  border-color: #b91c2c;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.78rem;
  gap: 5px;
  border-radius: 6px;
}

/* ── CARDS ── */
.card {
  background: var(--SURFACE);
  border-radius: var(--RADIUS);
  padding: 24px;
  box-shadow: var(--SHADOW-SM);
  margin-bottom: 24px;
  border: 1px solid var(--BD);
  position: relative;
  overflow: hidden;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

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

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--R);
  opacity: 0;
  transition: opacity 0.25s;
}

.card:hover::before {
  opacity: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--BD);
}

.card-title {
  font-family: var(--FD);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--BK);
  line-height: 1.2;
}

.card-subtitle {
  font-size: 0.82rem;
  color: var(--GR);
  margin-top: 3px;
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--SURFACE);
  border-radius: var(--RADIUS);
  padding: 24px;
  box-shadow: var(--SHADOW-SM);
  border: 1px solid var(--BD);
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

.stat-card:hover {
  box-shadow: var(--SHADOW-MD);
  transform: translateY(-3px);
}

/* Coloured left accent bar */
.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--R);
  border-radius: 4px 0 0 4px;
}

/* Faint background watermark */
.stat-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 110px;
  height: 110px;
  background: radial-gradient(
    circle,
    rgba(80, 160, 60, 0.06) 0%,
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--GL);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--G);
  margin-bottom: 18px;
  transition: all 0.25s ease;
  position: relative;
  z-index: 1;
}

.stat-card:hover .stat-icon {
  background: var(--G);
  color: #fff;
  box-shadow: 0 6px 20px rgba(80, 160, 60, 0.3);
}

.stat-value {
  font-family: var(--FH);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--BK);
  line-height: 1;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
  letter-spacing: 0.02em;
}

.stat-value-full {
  font-size: 0.68rem;
  color: var(--GRL);
  margin-top: 4px;
  font-weight: 400;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--GR);
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.stat-change {
  font-size: 0.75rem;
  margin-top: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}

.stat-change.positive {
  color: var(--GD);
  background: var(--GL);
}

.stat-change.negative {
  color: #b91c2c;
  background: var(--RL);
}

/* ── TABLES ── */
.table-container {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--RADIUS-SM);
  border: 1px solid var(--BD);
  max-width: 100%;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.table th {
  background: var(--BG2);
  padding: 14px 18px;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--GR);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  border-bottom: 1px solid var(--BD);
}

.table td {
  padding: 15px 18px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.875rem;
  color: var(--DK);
  transition: background 0.15s;
  vertical-align: middle;
}

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

.table tbody tr:hover td {
  background: #fafbff;
}

.table-actions {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ── FORMS ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.835rem;
  font-weight: 600;
  color: var(--DK);
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 15px;
  border: 1.5px solid var(--BD);
  border-radius: var(--RADIUS-SM);
  font-size: 0.875rem;
  color: var(--DK);
  background: var(--SURFACE);
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  font-family: var(--FB);
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--G);
  box-shadow: 0 0 0 3px rgba(80, 160, 60, 0.1);
  background: #fff;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--GRL);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-file {
  padding: 10px;
}

.form-error {
  font-size: 0.78rem;
  color: var(--R);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ── MODALS ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.show {
  display: flex;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(16px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content {
  background: var(--SURFACE);
  border-radius: var(--RADIUS-LG);
  padding: 32px;
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
  border: 1px solid var(--BD);
}

.modal-content table {
  max-width: none;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--BD);
}

.modal-title {
  font-family: var(--FD);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--BK);
}

.modal-close {
  background: var(--BG2);
  border: 1px solid var(--BD);
  color: var(--GR);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--R);
  border-color: var(--R);
  color: #fff;
  transform: rotate(90deg);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--BD);
}

/* ── ALERTS ── */
@keyframes alertIn {
  from {
    transform: translateX(420px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.alert {
  padding: 14px 20px;
  border-radius: var(--RADIUS-SM);
  display: flex;
  align-items: center;
  gap: 12px;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--SHADOW-LG);
  animation: alertIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
  border: 1px solid;
  font-size: 0.875rem;
  font-weight: 500;
}

.alert i {
  font-size: 1rem;
  flex-shrink: 0;
}

.alert-success {
  background: var(--SURFACE);
  color: var(--GD);
  border-color: var(--G);
  border-left: 4px solid var(--G);
}

.alert-error {
  background: var(--SURFACE);
  color: #b91c2c;
  border-color: var(--R);
  border-left: 4px solid var(--R);
}

.alert-info {
  background: var(--SURFACE);
  color: #0066cc;
  border-color: #0099ff;
  border-left: 4px solid #0099ff;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.badge-success {
  background: var(--GL);
  color: var(--GD);
}

.badge-warning {
  background: #fef3cd;
  color: #92600a;
}

.badge-danger {
  background: var(--RL);
  color: #b91c2c;
}

.badge-info {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ── LOADING ── */
.loading {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--BD);
  border-radius: 50%;
  border-top-color: var(--G);
  animation: spin 0.75s linear infinite;
}

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

/* ── REFERRAL SECTION ── */
.referral-link {
  background: linear-gradient(135deg, var(--GP) 0%, var(--GL) 100%);
  border: 1.5px solid rgba(80, 160, 60, 0.25);
  border-radius: var(--RADIUS);
  padding: 22px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.referral-link::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  width: 220px;
  height: 220px;
  background: radial-gradient(
    circle,
    rgba(220, 40, 60, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.referral-link h4 {
  font-family: var(--FD);
  font-size: 1.2rem;
  margin-bottom: 8px;
  color: var(--GD);
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-link p {
  font-size: 0.875rem;
  color: var(--GR);
  margin-bottom: 14px;
  line-height: 1.6;
}

.referral-url {
  font-family: "Courier New", monospace;
  background: var(--SURFACE);
  padding: 12px 16px;
  border-radius: var(--RADIUS-SM);
  border: 1.5px solid var(--BD);
  margin: 10px 0;
  word-break: break-all;
  font-size: 0.82rem;
  color: var(--DK);
}

.copy-btn {
  font-size: 0.82rem;
  padding: 9px 18px;
  margin-top: 6px;
}

/* ── UTILITIES ── */
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.mb-0 {
  margin-bottom: 0;
}
.mb-16 {
  margin-bottom: 16px;
}
.mb-24 {
  margin-bottom: 24px;
}
.hidden {
  display: none !important;
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}

/* ── SECTION STYLES ── */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--BD);
}

.section-title {
  font-family: var(--FD);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--BK);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--BG2);
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--G);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .mobile-navbar {
    display: flex;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    margin-top: 62px;
    padding: 20px 16px;
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 1.6rem;
  }
  .stat-value {
    font-size: 1.9rem;
  }

  .modal-content {
    padding: 24px;
  }
  .card {
    padding: 18px;
  }
  .table-container {
    overflow-x: auto;
  }

  .alert {
    min-width: 260px;
    max-width: calc(100vw - 32px);
    right: 16px;
  }
}

@media (max-width: 540px) {
  .main {
    padding: 14px 12px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .page-title {
    font-size: 1.4rem;
  }
  .stat-value {
    font-size: 1.7rem;
  }
  .stat-card {
    padding: 18px;
  }
  .btn {
    padding: 9px 16px;
    font-size: 0.8rem;
  }
  .header-actions .btn,
  .header-actions .form-input,
  .header-actions .form-select {
    width: 100%;
  }
}


/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(80, 160, 60, 0.35); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(80, 160, 60, 0.6); }
* { scrollbar-width: thin; scrollbar-color: rgba(80, 160, 60, 0.35) transparent; }
