/* ═══════════════════════════════════════════
   Hanuman Sangam — Design System
   Orange Saffron Theme · Futuristic
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700;800&display=swap');

:root {
  /* Brand Colors */
  --saffron:       #FF6B00;
  --saffron-dark:  #E05500;
  --saffron-deeper:#C04400;
  --saffron-light: #FFF3E8;
  --saffron-glow:  rgba(255,107,0,.15);
  --gold:          #F5A623;
  --gold-light:    #FFF8E8;

  /* Status */
  --green:         #16A34A;
  --green-light:   #DCFCE7;
  --green-glow:    rgba(22,163,74,.12);
  --red:           #DC2626;
  --red-light:     #FEE2E2;
  --red-glow:      rgba(220,38,38,.12);
  --yellow:        #D97706;
  --yellow-light:  #FEF3C7;
  --blue:          #2563EB;
  --blue-light:    #DBEAFE;

  /* Background */
  --bg:            #FFFAF5;
  --bg2:           #FFF3E8;
  --bg3:           #FFE8D0;
  --card:          #FFFFFF;
  --border:        #EDD9C5;
  --border2:       #F0E0CC;

  /* Text */
  --text:          #1A0F00;
  --text-muted:    #7C5C3A;
  --text-light:    #A8845E;

  /* Effects */
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     20px;
  --shadow:        0 2px 16px rgba(200,100,0,.08);
  --shadow-md:     0 4px 24px rgba(200,100,0,.12);
  --shadow-lg:     0 8px 40px rgba(200,100,0,.16);
  --shadow-glow:   0 0 32px rgba(255,107,0,.2);

  /* Typography */
  --font:          'Inter', system-ui, sans-serif;
  --font-head:     'Space Grotesk', 'Inter', sans-serif;

  /* Nav */
  --nav-h:         64px;

  /* Transitions */
  --ease:          cubic-bezier(.4,0,.2,1);
  --duration:      .2s;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background:  var(--bg);
  color:       var(--text);
  min-height:  100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--saffron); border-radius: 99px; }

/* ── Navbar ───────────────────────────────── */
.navbar {
  position:   sticky; top: 0; z-index: 100;
  display:    flex; align-items: center; gap: 1rem;
  padding:    0 1.5rem;
  height:     var(--nav-h);
  background: linear-gradient(135deg, #FF6B00 0%, #E05500 60%, #C04400 100%);
  box-shadow: 0 2px 20px rgba(255,107,0,.35);
}
.navbar::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
}
.nav-brand {
  font-family: var(--font-head);
  font-size: 1.15rem; font-weight: 800;
  color: #fff; white-space: nowrap;
  letter-spacing: -.01em;
}
.nav-links { display:flex; gap:.2rem; list-style:none; margin-left:.75rem; flex:1; }
.nav-links a {
  color: rgba(255,255,255,.82); text-decoration: none;
  padding: .4rem .85rem; border-radius: 8px;
  font-size: .88rem; font-weight: 500;
  transition: all var(--duration) var(--ease);
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; right: 50%;
  height: 2px; background: #fff; border-radius: 99px;
  transition: all .25s var(--ease);
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.15); }
.nav-links a.active {
  background: rgba(255,255,255,.2); color: #fff; font-weight: 700;
}
.nav-links a.active::after { left: 20%; right: 20%; }

.nav-right  { display:flex; align-items:center; gap:.75rem; margin-left:auto; }
.nav-user   { color:rgba(255,255,255,.92); font-size:.85rem; font-weight:600; }
.btn-logout {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: .35rem .9rem; border-radius: 8px;
  cursor: pointer; font-size: .83rem; font-weight: 600;
  transition: all var(--duration); font-family: var(--font);
}
.btn-logout:hover { background: rgba(255,255,255,.25); transform: translateY(-1px); }

/* Mobile hamburger (hidden by default) */
.nav-hamburger {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.5rem; cursor: pointer; padding: 0;
}

/* ── Mobile Nav ───────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .nav-hamburger { display: block; }
  .nav-links {
    display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: linear-gradient(135deg, #E05500, #C04400);
    flex-direction: column; padding: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,.2); z-index: 99; gap: .25rem;
    border-bottom: 1px solid rgba(255,255,255,.15);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .75rem 1rem; border-radius: 10px; font-size: .95rem; }
  .nav-user { display: none; }
}

/* ── Offline Banner ───────────────────────── */
.offline-banner {
  background: #FEF3C7; border-bottom: 2px solid #F59E0B;
  color: #92400E; text-align: center;
  padding: .6rem 1rem; font-size: .88rem; font-weight: 500;
}

/* ── Toast (legacy single-toast) ─────────── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  padding: .75rem 1.25rem; border-radius: 12px;
  font-size: .88rem; font-weight: 600; color: #fff;
  transform: translateY(80px); opacity: 0;
  transition: all .3s var(--ease); pointer-events: none;
  max-width: 340px; box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
#toast.show       { transform: translateY(0); opacity: 1; }
.toast-success    { background: var(--green); }
.toast-error      { background: var(--red); }
.toast-warning    { background: var(--yellow); }
.toast-info       { background: var(--blue); }

/* ── Badges ───────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .65rem; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
}
.badge-approved { background: var(--green-light); color: var(--green); }
.badge-pending  { background: var(--yellow-light); color: var(--yellow); }
.badge-rejected { background: var(--red-light);   color: var(--red); }

/* ── Buttons ──────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: 10px; border: none;
  font-family: var(--font); font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: all var(--duration) var(--ease);
  white-space: nowrap; position: relative; overflow: hidden;
}
.btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
  opacity: 0; transition: opacity .2s;
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.btn-primary  {
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dark));
  color: #fff; box-shadow: 0 4px 16px rgba(255,107,0,.3);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(255,107,0,.4); }

.btn-secondary {
  background: var(--bg2); color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { background: var(--bg3); }

.btn-approve {
  background: var(--green-light); color: var(--green);
  border: 1px solid #BBF7D0;
}
.btn-approve:hover { background: #BBF7D0; }

.btn-reject {
  background: var(--red-light); color: var(--red);
  border: 1px solid #FECACA;
}
.btn-reject:hover { background: #FECACA; }

.btn-add      { background: var(--green-light); color: var(--green); border: 1px solid #BBF7D0; }
.btn-add:hover { background: #BBF7D0; }
.btn-subtract { background: var(--red-light); color: var(--red); border: 1px solid #FECACA; }
.btn-subtract:hover { background: #FECACA; }
.btn-auto     { background: var(--blue-light); color: var(--blue); border: 1px solid #BFDBFE; }
.btn-auto:hover { background: #BFDBFE; }

.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.w-100  { width: 100%; justify-content: center; }

/* ── Section Cards ────────────────────────── */
.section-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 1.5rem;
  transition: box-shadow .2s;
}
.section-card:hover { box-shadow: var(--shadow-md); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--border2);
  background: linear-gradient(135deg, var(--bg2), var(--bg));
}
.section-title { font-family: var(--font-head); font-size: .95rem; font-weight: 700; }
.header-right  { display: flex; align-items: center; gap: .75rem; }
.section-card-body { padding: 1.25rem; }
.member-count {
  font-size: .78rem; color: var(--text-muted);
  background: var(--bg2); padding: .2rem .65rem;
  border-radius: 20px; font-weight: 600;
  border: 1px solid var(--border);
}

/* ── Tables ───────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: linear-gradient(135deg, var(--bg2), var(--bg));
  padding: .7rem 1rem; text-align: left;
  font-size: .75rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .05em; white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
tbody td {
  padding: .7rem 1rem; font-size: .875rem;
  border-bottom: 1px solid var(--bg2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--saffron-light); }
.paid-cell    { color: var(--green); font-weight: 700; }
.pending-cell { color: var(--yellow); font-weight: 700; }
.empty-state  {
  text-align: center; color: var(--text-muted);
  font-style: italic; padding: 2.5rem;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.skeleton-row { animation: pulse 1.2s infinite; color: var(--border); }

/* ── Forms ────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: .4rem; }
.form-label  {
  font-size: .75rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}

input, select, textarea {
  width: 100%; padding: .6rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem; font-family: var(--font);
  background: var(--card); color: var(--text);
  outline: none; transition: all var(--duration) var(--ease);
  -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
input:focus, select:focus, textarea:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px var(--saffron-glow);
  background: var(--saffron-light);
}

/* ── Modal ────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 999; backdrop-filter: blur(4px);
}
.modal-box {
  background: var(--card); border-radius: var(--radius-lg);
  padding: 2rem 2.5rem; text-align: center;
  min-width: 300px; max-width: 420px; width: 90%;
  box-shadow: var(--shadow-lg); animation: slideUp .25s var(--ease);
  border: 1px solid var(--border);
}
@keyframes slideUp { from{transform:translateY(20px);opacity:0} to{transform:none;opacity:1} }
.modal-icon  { font-size: 2.5rem; margin-bottom: .5rem; }
.modal-title { font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; margin-bottom: .4rem; }
.modal-msg   { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; line-height: 1.6; }
.modal-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── Footer ───────────────────────────────── */
footer {
  text-align: center; padding: 1.5rem;
  color: var(--text-muted); font-size: .82rem;
  border-top: 1px solid var(--border2); margin-top: 2rem;
  background: var(--bg2);
}

/* ── Spinner ──────────────────────────────── */
.spinner {
  display: none; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Animations ───────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: none; }
}

.animate-fade-up  { animation: fadeInUp .4s var(--ease) both; }
.animate-fade     { animation: fadeIn   .3s var(--ease) both; }
.animate-scale-in { animation: scaleIn  .3s var(--ease) both; }

/* ── Utility ──────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.font-head   { font-family: var(--font-head); }

/* ── Reduced Motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
