/* ============================================
   সমিতি Pro — Professional White Theme
   ============================================ */
:root {
  --primary: #0f766e;
  --primary-dark: #0d5c56;
  --primary-soft: #ecfdf5;
  --accent: #0891b2;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --nav-h: 68px;
  --font: "Hind Siliguri", "Inter", system-ui, sans-serif;
}

* { 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;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ---------- Page loader ---------- */
#page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity .35s ease, visibility .35s;
}
#page-loader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-ring {
  width: 52px; height: 52px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loader-text {
  margin-top: 14px; font-size: 14px; color: var(--text-muted); font-weight: 500;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}
.wrap-wide { max-width: 960px; }
.main { flex: 1; padding: 20px 0 100px; }
.main-admin { padding-bottom: 40px; }

/* ---------- Top header ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto;
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px;
  object-fit: cover; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15,118,110,.2);
  background: var(--primary-soft);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-text strong {
  display: block; font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small {
  display: block; font-size: 11px; color: var(--text-muted); margin-top: 1px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.card + .card { margin-top: 14px; }
.card-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.card-muted { color: var(--text-muted); font-size: 13px; }

/* ---------- Balance grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 520px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary);
}
.stat-card.savings::before { background: var(--primary); }
.stat-card.profit::before { background: #7c3aed; }
.stat-card.main::before { background: var(--accent); }
.stat-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-muted); margin-bottom: 6px;
}
.stat-value {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.02em;
}
.stat-value.teal { color: var(--primary); }
.stat-value.purple { color: #7c3aed; }
.stat-value.cyan { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
  border: none; cursor: pointer; transition: .18s ease;
  text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), #0d9488);
  color: #fff; box-shadow: 0 4px 14px rgba(15,118,110,.3);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary {
  background: #fff; color: var(--text); border: 1px solid var(--border);
}
.btn-secondary:hover { background: #f1f5f9; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-muted); border: none; padding: 8px 10px;
}
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 10px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-control {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; color: var(--text); font-size: 15px;
  transition: border .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 500;
  margin-bottom: 14px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ---------- Bottom nav (user) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  display: flex; justify-content: space-around; align-items: center;
  box-shadow: 0 -4px 24px rgba(15,23,42,.06);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; border-radius: 12px;
  color: var(--text-muted); font-size: 11px; font-weight: 500;
  transition: .15s;
  background: transparent; border: none; cursor: pointer;
}
.nav-item i { font-size: 20px; transition: .15s; }
.nav-item.active {
  color: var(--primary); font-weight: 700;
}
.nav-item.active i { transform: translateY(-1px); }
.nav-item:active { transform: scale(.95); }

/* ---------- Shortcut grid ---------- */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) {
  .shortcut-grid { grid-template-columns: repeat(4, 1fr); }
}
.shortcut {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px 10px;
  text-align: center; transition: .18s;
  box-shadow: var(--shadow);
}
.shortcut:hover {
  border-color: #99f6e4; background: var(--primary-soft);
  transform: translateY(-2px);
}
.shortcut-icon {
  width: 44px; height: 44px; margin: 0 auto 8px;
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.shortcut-icon.blue { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.shortcut-icon.purple { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.shortcut-icon.amber { background: linear-gradient(135deg, #d97706, #fbbf24); }
.shortcut-icon.green { background: linear-gradient(135deg, #059669, #34d399); }
.shortcut span {
  display: block; font-size: 12px; font-weight: 600; color: var(--text);
}

/* ---------- Auth pages ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at top, #ecfdf5 0%, transparent 55%),
    radial-gradient(ellipse at bottom right, #e0f2fe 0%, transparent 50%),
    #f8fafc;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 20px; padding: 28px 24px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px;
  object-fit: cover;
}
.auth-mark {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
}
.auth-title {
  text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 4px;
}
.auth-sub {
  text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 20px;
}

/* ---------- Landing ---------- */
.hero {
  text-align: center; padding: 36px 20px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow);
}
.hero h1 {
  font-size: 26px; font-weight: 800; line-height: 1.3; margin-bottom: 10px;
}
.hero p { color: var(--text-muted); font-size: 15px; max-width: 480px; margin: 0 auto 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.rules-list { list-style: none; }
.rules-list li {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border); font-size: 14px; color: #334155;
}
.rules-list li:last-child { border-bottom: none; }
.rule-num {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}

/* ---------- Profile ---------- */
.profile-hero {
  text-align: center; padding: 28px 20px;
}
.avatar {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 12px;
  object-fit: cover; border: 3px solid #fff;
  box-shadow: 0 4px 16px rgba(15,118,110,.2);
  background: var(--primary-soft);
}
.avatar-placeholder {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(15,118,110,.25);
}

/* ---------- Tables / lists ---------- */
.list-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.badge {
  display: inline-flex; align-items: center; padding: 4px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.badge-pending { background: #fffbeb; color: #b45309; }
.badge-approved { background: #ecfdf5; color: #047857; }
.badge-rejected { background: #fef2f2; color: #b91c1c; }

/* ---------- Admin ---------- */
.admin-shell { background: #f1f5f9; min-height: 100vh; }
.admin-topbar {
  background: #0f172a; color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-topbar strong { font-size: 15px; }
.admin-nav {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 12px; display: flex; gap: 8px; overflow-x: auto;
}
.admin-nav a {
  flex-shrink: 0; padding: 8px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  background: #f8fafc; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 6px;
}
.admin-nav a.active, .admin-nav a:hover {
  background: var(--primary-soft); color: var(--primary); border-color: #99f6e4;
}
.admin-main { max-width: 960px; margin: 0 auto; padding: 20px 16px 40px; }

/* ---------- Footer landing ---------- */
.site-footer {
  text-align: center; padding: 20px 16px; font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border); background: #fff;
}

/* ---------- Utilities ---------- */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* Click ripple feedback */
.nav-item.pop i { animation: pop .25s ease; }
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}
