/* =====================================================================
   DailyKhata — dark theme with glassmorphism + neon accents.
   Tailwind (CDN) handles layout utilities; this file holds the
   reusable component classes so markup stays short and consistent.
   ===================================================================== */

/* Ambient neon glow behind the whole app */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(640px 420px at 12% -5%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(720px 520px at 88% 8%, rgba(139, 92, 246, 0.15), transparent 60%),
    radial-gradient(900px 640px at 50% 110%, rgba(16, 185, 129, 0.07), transparent 60%);
}

/* Frosted glass surface */
.glass {
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Form controls */
.input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.65rem 0.9rem;
  font-size: 0.875rem;
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.input::placeholder { color: #64748b; }
select.input option { background: #0f172a; color: #e2e8f0; }
input[type="date"].input::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }
input[type="file"].input { padding: 0.5rem 0.75rem; }
input[type="file"].input::file-selector-button {
  margin-right: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  padding: 0.35rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
input[type="file"].input::file-selector-button:hover { background: rgba(255, 255, 255, 0.12); }

.label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(90deg, #22d3ee, #8b5cf6);
  color: #020617;
  box-shadow: 0 8px 24px -10px rgba(34, 211, 238, 0.55);
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ghost {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: #cbd5e1;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.btn-danger {
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }
.btn-success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
}
.btn-success:hover { background: rgba(16, 185, 129, 0.24); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; border-radius: 0.6rem; }

/* Status pills (see status_badge() in functions.php) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Flash messages */
.flash {
  border: 1px solid;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  animation: flash-in 0.25s ease;
}
.flash-success { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.35); color: #6ee7b7; }
.flash-error   { background: rgba(244, 63, 94, 0.10);  border-color: rgba(244, 63, 94, 0.35);  color: #fda4af; }
.flash-info    { background: rgba(34, 211, 238, 0.08); border-color: rgba(34, 211, 238, 0.30); color: #67e8f9; }
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Data tables */
table.data { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
table.data th {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7c8aa0;
  white-space: nowrap;
}
table.data td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Hide horizontal nav scrollbar on mobile */
nav::-webkit-scrollbar { display: none; }

/* Slim dark scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.4); }

/* =====================================================================
   ADMIN PANEL — "admin-vivid" theme: vibrant indigo→purple gradients,
   left sidebar shell, glowing stat cards. Scoped to body.admin-vivid so
   the member/agent panels keep the original dark theme untouched.
   ===================================================================== */

body.admin-vivid {
  background-color: #150e33;
  background-image: linear-gradient(165deg, #1b1247 0%, #251659 32%, #361a6e 58%, #1e1250 100%);
  background-attachment: fixed;
}
body.admin-vivid .bg-aurora {
  background:
    radial-gradient(900px 520px at 88% -10%, rgba(217, 70, 239, 0.20), transparent 60%),
    radial-gradient(820px 520px at -12% 18%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(900px 620px at 55% 115%, rgba(139, 92, 246, 0.22), transparent 62%);
}

/* ---- Sidebar -------------------------------------------------------- */
.admin-sidebar {
  background: linear-gradient(180deg, rgba(38, 24, 84, 0.92), rgba(19, 12, 48, 0.97));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 30px 0 60px -40px rgba(0, 0, 0, 0.8);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.admin-sidebar.open { transform: translateX(0); }
@media (min-width: 1024px) {
  .admin-sidebar { transform: none; }
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #beb5e8;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.side-link:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.side-link.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.45), rgba(217, 70, 239, 0.30));
  box-shadow: inset 0 0 0 1px rgba(165, 120, 255, 0.4), 0 10px 26px -14px rgba(217, 70, 239, 0.65);
}
.side-link.active svg { color: #67e8f9; }
.side-link-logout:hover {
  background: rgba(244, 63, 94, 0.14);
  color: #fda4af;
}

/* ---- Cards: gradient surfaces + glow hover -------------------------- */
body.admin-vivid .glass {
  border-radius: 1.25rem;
  border-color: rgba(255, 255, 255, 0.13);
  background: linear-gradient(150deg, rgba(148, 118, 255, 0.13), rgba(255, 255, 255, 0.04) 60%);
  box-shadow: 0 24px 50px -35px rgba(0, 0, 0, 0.9);
}

/* Stat cards get their own tint via --tint1/--tint2 and a neon top edge
   plus glow hover via --glow1/--glow2/--hover-glow (set inline). */
body.admin-vivid .stat-card {
  background: linear-gradient(150deg, var(--tint1, rgba(148, 118, 255, 0.16)), var(--tint2, rgba(255, 255, 255, 0.04)) 65%);
}
.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stat-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--glow1, #22d3ee), var(--glow2, #d946ef));
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 55px -28px var(--hover-glow, rgba(139, 92, 246, 0.6));
}

/* ---- Buttons, badges, misc ------------------------------------------ */
body.admin-vivid .btn-primary {
  background: linear-gradient(90deg, #818cf8, #d946ef);
  box-shadow: 0 10px 28px -12px rgba(217, 70, 239, 0.6);
}
body.admin-vivid .btn-primary:hover { box-shadow: 0 14px 34px -12px rgba(217, 70, 239, 0.8); }

/* Soft-blue informational badge (e.g. "Administrator", active states) */
.badge-info {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
}

/* Mini comparison bars in the growth widget */
.mini-bar {
  width: 100%;
  border-radius: 0.6rem;
  background: linear-gradient(180deg, #22d3ee, #6366f1);
  box-shadow: 0 8px 20px -8px rgba(34, 211, 238, 0.55);
}
.mini-bar.dim {
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.45), rgba(99, 102, 241, 0.35));
  box-shadow: none;
}

body.admin-vivid .input { background: rgba(255, 255, 255, 0.06); }
body.admin-vivid .flash-info { background: rgba(56, 189, 248, 0.10); border-color: rgba(56, 189, 248, 0.35); color: #7dd3fc; }

/* Public Terms & Conditions page (admin-authored simple HTML) */
.terms-body h1, .terms-body h2, .terms-body h3 { color: #ffffff; font-weight: 800; margin: 0.9rem 0 0.3rem; font-size: 1.05rem; }
.terms-body ul { list-style: disc; padding-left: 1.25rem; }
.terms-body ol { list-style: decimal; padding-left: 1.25rem; }
.terms-body a { color: #67e8f9; text-decoration: underline; }
.terms-body strong { color: #e2e8f0; }
