/* ============================================================
   Milan Setu Admin — Premium Dark Theme
   ============================================================ */
:root {
  --bg: #0a0c12;
  --bg-2: #0e1119;
  --sidebar: #0d1017;
  --card: #141826;
  --card-2: #1b2032;
  --card-3: #222842;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --text: #eef1fa;
  --muted: #8b93a8;
  --faint: #5c6377;

  --accent: #ff4d6d;
  --accent-2: #c9184a;
  --accent-deep: #7a0415;
  --grad: linear-gradient(135deg, #ff4d6d 0%, #c9184a 55%, #7a0415 100%);
  --gold: #f5c542;
  --green: #3ddc84;
  --green-bg: rgba(61, 220, 132, 0.12);
  --red: #ff6b6b;
  --red-bg: rgba(255, 107, 107, 0.12);
  --blue: #5b8cff;
  --blue-bg: rgba(91, 140, 255, 0.12);
  --gold-bg: rgba(245, 197, 66, 0.12);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --font-d: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --font-b: "Inter", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .brand-name, .sidebar-title { font-family: var(--font-d); }
button { font-family: inherit; }
.hidden { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #2a3045; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::placeholder { color: var(--faint); }

/* ============================================================
   AUTH / LOGIN
   ============================================================ */
.auth {
  position: fixed; inset: 0; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -5%, rgba(201, 24, 74, 0.28), transparent 60%),
    radial-gradient(800px 500px at 105% 110%, rgba(122, 4, 21, 0.35), transparent 60%),
    linear-gradient(160deg, #0b0e16 0%, #090b11 100%);
}
.auth-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 50% 40%, #000 20%, transparent 100%);
}
.auth-panel {
  position: relative; z-index: 1;
  width: 980px; max-width: 100%;
  display: grid; grid-template-columns: 1.05fr 1fr;
  border-radius: 22px;
  border: 1px solid var(--border-2);
  background: linear-gradient(165deg, rgba(20,24,38,0.9), rgba(13,16,23,0.95));
  box-shadow: 0 40px 90px rgba(0,0,0,.55);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.auth-brand {
  padding: 44px 44px 38px;
  background:
    radial-gradient(420px 260px at -20% -20%, rgba(255,77,109,.35), transparent 60%),
    linear-gradient(160deg, rgba(201,24,74,.16), rgba(10,12,18,0) 55%),
    rgba(255,255,255,.015);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.brand-top { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 54px; height: 54px; flex-shrink: 0;
  border-radius: 16px;
  background: var(--grad);
  color: #fff; font-size: 30px; font-weight: 800; font-family: var(--font-d);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 30px rgba(201,24,74,.4);
}
.brand-logo.sm { width: 40px; height: 40px; font-size: 22px; border-radius: 12px; }
.brand-logo.xs { width: 34px; height: 34px; font-size: 18px; border-radius: 10px; box-shadow: none; }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.brand-tag { color: var(--muted); font-size: 12.5px; }
.brand-head { font-size: 30px; line-height: 1.18; font-weight: 800; margin-top: 40px; }
.brand-head em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-desc { color: var(--muted); margin-top: 14px; font-size: 14.5px; max-width: 380px; }
.brand-feats { list-style: none; margin-top: 26px; display: flex; flex-direction: column; gap: 13px; }
.brand-feats li { display: flex; align-items: center; gap: 12px; color: #c7cde0; font-size: 13.5px; }
.brand-feats .fi {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  color: var(--accent);
}
.brand-foot { margin-top: auto; padding-top: 28px; display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 44px 40px; }
.login-card { width: 100%; max-width: 360px; }
.lc-head h2 { font-size: 24px; font-weight: 800; }
.lc-head p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.field { margin-top: 20px; }
.field label { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.in-wrap { position: relative; display: flex; align-items: center; }
.in-icon {
  position: absolute; left: 14px; color: var(--faint); font-size: 14px; pointer-events: none;
}
.in-wrap input {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 13px 42px 13px 40px;
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.in-wrap input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,77,109,.18); }
.eye-btn {
  position: absolute; right: 12px; background: none; border: none; color: var(--faint);
  font-size: 15px; cursor: pointer; padding: 4px;
}
.eye-btn:hover { color: var(--text); }

.login-btn {
  margin-top: 26px;
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 0 12px 30px rgba(255,77,109,.28);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(255,77,109,.38); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .7; cursor: not-allowed; }
.lb-arrow { font-size: 18px; }
.login-error { color: #ff7a8a; font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }
.lc-hint { margin-top: 20px; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.6; }
.lc-hint b { color: var(--muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: flex; min-height: 100vh; background: var(--bg-2); }
.sidebar {
  width: 244px; flex-shrink: 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 16px; border-bottom: 1px solid var(--border); }
.sb-id { flex: 1; min-width: 0; }
.sidebar-title { font-weight: 800; font-size: 15px; letter-spacing: .2px; }
.sidebar-sub { color: var(--muted); font-size: 12px; }
.sb-close { display: none; background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 6px; }

.nav { margin-top: 14px; display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.nav-label { color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; padding: 12px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: none;
  color: var(--muted);
  text-align: left;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  position: relative;
}
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item:active { transform: scale(.97); }
.nav-item.active {
  background: linear-gradient(120deg, rgba(255,77,109,.16), rgba(201,24,74,.05));
  color: #fff; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255,77,109,.35);
}
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px;
  border-radius: 3px; background: var(--grad);
}
.ni-ic { width: 20px; text-align: center; font-size: 15px; }
.ni-count {
  margin-left: auto; min-width: 20px; padding: 2px 7px;
  border-radius: 999px; background: var(--card-3); color: var(--muted);
  font-size: 11px; font-weight: 700; text-align: center;
}
.ni-count.gold { background: var(--gold-bg); color: var(--gold); }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.admin-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.admin-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.admin-avatar.sm { width: 32px; height: 32px; font-size: 14px; border-radius: 50%; }
.admin-info { min-width: 0; }
.admin-name { font-weight: 700; font-size: 13.5px; }
.admin-mail { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.logout { color: #ff9aa8; }

.scrim {
  display: none; position: fixed; inset: 0; z-index: 45;
  background: rgba(5,6,10,.6); backdrop-filter: blur(2px);
}

/* ---------- MAIN ---------- */
.main { flex: 1; padding: 22px 28px 60px; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.tb-left { display: flex; align-items: center; gap: 12px; }
.topbar h2 { font-size: 22px; font-weight: 800; letter-spacing: .2px; }
.crumbs { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.crumb-route {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  color: var(--gold);
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  margin-right: 6px;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.last-updated { color: var(--faint); font-size: 12px; }
.top-admin { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-weight: 600; font-size: 13px; }
.hamburger {
  display: none; flex-direction: column; gap: 4.5px;
  background: var(--card); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 11px; cursor: pointer;
}
.hamburger span { width: 17px; height: 2px; background: var(--text); border-radius: 2px; }

.tab-panel { display: none; animation: fadeIn .2s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none; } }

/* ---------- CARDS ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.card h3 { font-size: 15.5px; font-weight: 700; }
.card h4 { font-size: 13px; margin-bottom: 10px; color: var(--muted); font-weight: 600; }
.card.inner { background: var(--card-2); margin-top: 14px; padding: 16px; }
.card.mt { margin-top: 18px; }
.danger-card { border-color: rgba(255,107,107,.3); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
.mt { margin-top: 18px; }
.empty { color: var(--faint); text-align: center; padding: 24px 10px; font-size: 13px; }

/* ---------- INPUTS / BTNS ---------- */
.input {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,77,109,.16); }
.select { min-width: 150px; }
input[type="date"].select { min-width: 150px; color-scheme: dark; }

.btn {
  border: none; border-radius: 11px;
  padding: 11px 16px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s, box-shadow .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn.sm { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px rgba(201,24,74,.28); }
.btn.ghost { background: var(--card-2); border: 1px solid var(--border-2); color: var(--text); }
.btn.danger { background: var(--red-bg); border: 1px solid rgba(255,107,107,.35); color: var(--red); }
a.btn { text-decoration: none; }
.btn.wa-link { background: rgba(37,211,102,.14); border: 1px solid rgba(37,211,102,.4); color: #3ddc84; }
.btn.tel-link { background: var(--blue-bg); border: 1px solid rgba(91,140,255,.4); color: var(--blue); }
.btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px; border-radius: 8px; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.link-btn { background: none; border: none; color: var(--accent); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row.right { justify-content: flex-end; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input { min-width: 150px; }
.tb-title { flex: 1; min-width: 140px; }
.panel-title { font-size: 17px; font-weight: 800; }
.add-row { display: flex; gap: 10px; min-width: 300px; }
.add-row .input { flex: 1; }
.search-box { position: relative; flex: 1; min-width: 230px; }
.s-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--faint); pointer-events: none; }
.search-box .input { width: 100%; padding-left: 36px; }
.count-pill {
  background: var(--card-2);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 500;
}

/* ---------- STAT CARDS ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; background: rgba(255,255,255,.025);
}
.stat-ic {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; margin-bottom: 14px;
  background: var(--card-3); border: 1px solid var(--border);
}
.stat-label { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 5px; font-family: var(--font-d); }
.stat-sub { color: var(--faint); font-size: 12px; margin-top: 3px; }
.stat-card.rose .stat-ic { background: rgba(255,77,109,.14); border-color: rgba(255,77,109,.25); color: var(--accent); }
.stat-card.green .stat-ic { background: var(--green-bg); border-color: rgba(61,220,132,.25); color: var(--green); }
.stat-card.blue .stat-ic { background: var(--blue-bg); border-color: rgba(91,140,255,.25); color: var(--blue); }
.stat-card.gold .stat-ic { background: var(--gold-bg); border-color: rgba(245,197,66,.25); color: var(--gold); }
.stat-card .stat-value.green { color: var(--green); }
.stat-card .stat-value.gold { color: var(--gold); }

/* ---------- DASHBOARD ROWS ---------- */
.dash-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; margin-top: 14px; }
.mini-tag {
  background: var(--green-bg); color: var(--green); border: 1px solid rgba(61,220,132,.25);
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
}
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 26px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 6px 6px 2px 2px;
  min-height: 3px;
  transition: height .4s ease;
  position: relative;
}
.bar.zero { background: var(--card-3); }
.bar-day { color: var(--faint); font-size: 10px; margin-top: 2px; }
.bar-val {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text); font-weight: 700; background: var(--card-3);
  padding: 1px 6px; border-radius: 6px; white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.bar:hover .bar-val { opacity: 1; }

.plan-perf { display: flex; flex-direction: column; gap: 14px; }
.pp-row { display: flex; flex-direction: column; gap: 6px; }
.pp-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; gap: 10px; }
.pp-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pp-amt { color: var(--gold); font-weight: 700; font-size: 13px; }
.pp-bar { height: 8px; border-radius: 6px; background: var(--card-3); overflow: hidden; }
.pp-fill { height: 100%; border-radius: 6px; background: var(--grad); width: 0; transition: width .5s ease; }
.pp-sub { color: var(--faint); font-size: 11.5px; display: flex; justify-content: space-between; }

.mini-list { display: flex; flex-direction: column; }
.ml-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px dashed var(--border); min-width: 0;
}
.ml-row:last-child { border-bottom: none; }
.ml-av {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--card-3); display: flex; align-items: center; justify-content: center; color: var(--faint);
}
.ml-info { flex: 1; min-width: 0; }
.ml-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-right { text-align: right; flex-shrink: 0; }
.ml-amt { font-weight: 800; font-size: 13.5px; color: var(--gold); }
.ml-time { color: var(--faint); font-size: 11px; }

/* ---------- BADGES ---------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.badge.green { background: var(--green-bg); color: var(--green); border: 1px solid rgba(61,220,132,.25); }
.badge.gray { background: rgba(140,148,175,.12); color: var(--muted); border: 1px solid rgba(140,148,175,.22); }
.badge.gold { background: var(--gold-bg); color: var(--gold); border: 1px solid rgba(245,197,66,.25); }
.badge.red { background: var(--red-bg); color: var(--red); border: 1px solid rgba(255,107,107,.25); }
.badge.blue { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(91,140,255,.25); }
.badge.rose { background: rgba(255,77,109,.14); color: var(--accent); border: 1px solid rgba(255,77,109,.3); }

/* ---------- TABLE ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 880px; }
thead th {
  text-align: left;
  padding: 13px 15px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
tbody td { padding: 12px 15px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--card-2); }
tbody tr:last-child td { border-bottom: none; }
.user-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-cell img {
  width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: var(--card-3); flex-shrink: 0;
}
.user-cell .u-name { font-weight: 600; }
.user-cell .u-meta { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.row-btns { display: flex; gap: 6px; }
.row-btns .btn { padding: 7px 11px; font-size: 12px; border-radius: 8px; }

/* ---------- TRANSACTIONS ---------- */
.txn-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.txn-toolbar { margin-bottom: 12px; }
.list-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 8px; }
.pager-btn {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--card-2); border: 1px solid var(--border-2); color: var(--text);
  font-size: 16px; cursor: pointer;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-label { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ---------- PLANS ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 15px; }
.plan-card {
  background: linear-gradient(165deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.plan-card:hover { transform: translateY(-2px); border-color: var(--border-2); box-shadow: var(--shadow); }
.plan-card.live { border-color: rgba(245,197,66,.5); box-shadow: 0 0 0 1px rgba(245,197,66,.25) inset, 0 10px 34px rgba(245,197,66,.07); }
.plan-card .plan-name { font-size: 17px; font-weight: 800; font-family: var(--font-d); }
.plan-card .plan-price { font-size: 26px; font-weight: 800; color: var(--gold); margin: 8px 0 4px; font-family: var(--font-d); }
.plan-card .plan-price small { font-size: 13px; color: var(--faint); font-weight: 600; }
.plan-card .plan-meta { color: var(--muted); font-size: 13px; line-height: 1.8; }
.plan-card .plan-meta b { color: #c7cde0; font-weight: 600; }
.live-tag {
  position: absolute; top: 16px; right: 16px;
  background: linear-gradient(135deg, #f5c542, #e0a81f); color: #201501;
  font-size: 10.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: .6px;
}

/* ---------- CASTES ---------- */
.caste-list { display: flex; flex-direction: column; }
.maint-card { padding: 18px; }
.maint-card .maint-info { margin-bottom: 12px; }
.maint-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.maint-head h3 { margin: 0; }
.maint-info p { margin: 0; color: var(--muted); font-size: 13px; }
.maint-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.maint-controls .input { flex: 1; min-width: 220px; }
.caste-summary { display: flex; gap: 10px; padding: 14px 2px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.tb-actions { display: flex; align-items: center; gap: 10px; }
.tb-actions .input { width: 220px; }
#castePageLabel { min-width: 90px; text-align: center; }
.ps-select { width: auto !important; padding: 5px 8px; font-size: 12.5px; }
.pager { display: flex; align-items: center; gap: 8px; }
.cs-item { display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--card-2); }
.cs-num { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1; }
.cs-lbl { font-size: 12px; color: var(--muted); }
.caste-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 2px; border-bottom: 1px solid var(--border);
}
.caste-row:last-child { border-bottom: none; }
.caste-count { color: var(--muted); font-size: 13px; min-width: 74px; display: flex; align-items: center; gap: 6px; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--red-bg); border: 1px solid rgba(255,77,109,.3); color: var(--accent); font-weight: 800; font-size: 13.5px; }
.caste-name { flex: 1; font-weight: 700; min-width: 160px; }
.caste-row .input { width: 210px; }
.enquiry-table {
  width: 100%;
}
.enquiry-row {
  display: grid;
  grid-template-columns: 52px minmax(120px, 1.4fr) 1fr 1fr 1fr 76px;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
}
.enquiry-row:last-child { border-bottom: none; }
.enquiry-head {
  border-bottom: 1px solid var(--border);
  padding: 6px 4px;
}
.enquiry-head .enquiry-cell {
  text-transform: uppercase;
  font-size: 11.5px;
  letter-spacing: .6px;
  color: var(--muted);
  font-weight: 700;
}
.enquiry-cell { min-width: 0; }
.enquiry-sn { font-weight: 800; color: var(--accent); font-size: 13px; }
.enquiry-name { font-weight: 700; font-size: 14px; }
.enquiry-caste { font-size: 13.5px; }
.enquiry-mobile { font-size: 13.5px; font-weight: 600; }
.enquiry-mobile a { color: var(--accent); text-decoration: none; }
.enquiry-date { font-size: 12.5px; color: var(--muted); }
.enquiry-actions { text-align: right; }
.export-wrap { position: relative; }
.export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 230px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.export-menu.hidden { display: none; }
.export-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}
.export-menu button:hover { background: var(--card-2); color: var(--accent); }
.caste-dist { display: flex; flex-wrap: wrap; gap: 10px; }
.caste-chip {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
.caste-chip b { color: var(--gold); background: var(--gold-bg); padding: 2px 8px; border-radius: 999px; font-size: 11.5px; }

/* ---------- MODALS ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5,6,10,.72); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  width: 540px;
  max-width: 100%;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: popIn .18s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(6px);} to { opacity: 1; transform: none; } }
.modal-panel.modal-lg { width: 940px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; font-weight: 800; }
.mh-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mh-sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-body label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.modal-body .input { width: 100%; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; cursor: pointer; margin-top: 14px !important; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.limits-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.limits-row label { margin: 0; }
.limits-row .input { width: 130px; }
.assign-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.assign-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
}
.assign-row.live-row { border-color: rgba(245,197,66,.35); }
.assign-row .a-info { flex: 1; min-width: 0; }
.assign-row .a-name { font-weight: 700; }
.assign-row .a-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.assign-row .a-badges { display: flex; gap: 6px; margin-top: 5px; }

.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kv-list { display: flex; flex-direction: column; }
.kv-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.kv-row span:first-child { color: var(--muted); flex-shrink: 0; }
.kv-row span:last-child { text-align: right; word-break: break-word; font-weight: 500; }
.user-plan-box { background: var(--card-2); border: 1px solid var(--border); border-radius: 11px; padding: 6px 14px; line-height: 1.7; font-size: 13px; }

/* ---------- PROFILE MODAL ENHANCEMENTS ---------- */
.profile-modal-panel {
  width: 980px;
  max-width: 96vw;
  max-height: 92vh;
  border-radius: 20px;
  background: var(--card);
}
.profile-modal-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(155, 17, 17, 0.18) 0%, rgba(20, 22, 32, 0.95) 100%);
  border-bottom: 1px solid var(--border);
}
.pm-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.pm-avatar {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #d32f2f 100%);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(155, 17, 17, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  overflow: hidden;
}
.pm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pm-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--card);
  background: var(--green);
}
.pm-status-dot.inactive {
  background: var(--red);
}
.pm-meta-wrap {
  flex: 1;
  min-width: 0;
}
.pm-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pm-title-row h3 {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.pm-id-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}
.pm-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-pills {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pm-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-2);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.close-btn:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.05);
}
.profile-nav-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 20px;
  background: var(--card-2);
  border-bottom: 1px solid var(--border);
}
.ptab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  transition: all .15s ease;
}
.ptab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.ptab-btn.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 12px rgba(155, 17, 17, 0.3);
}
.profile-modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}
.ptab-panel {
  display: none;
}
.ptab-panel.active {
  display: block;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.form-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.form-section-title.mt {
  margin-top: 24px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.col-span-2 {
  grid-column: span 2;
}
.form-group label {
  margin: 0 !important;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.caste-select-row {
  display: flex;
  gap: 8px;
}
.caste-select-row .select {
  flex: 1;
}
.profile-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: var(--card-2);
  border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .form-grid-3, .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-group.col-span-2 {
    grid-column: span 1;
  }
  .profile-modal-header {
    flex-wrap: wrap;
  }
}

@media (min-width: 821px) and (max-width: 1120px) {
  .form-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-group.col-span-2 {
    grid-column: span 2;
  }
  .profile-nav-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .profile-nav-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
  .profile-nav-tabs .ptab-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-left: 4px solid var(--green);
  padding: 14px 18px;
  border-radius: 12px;
  max-width: 360px;
  box-shadow: 0 16px 44px rgba(0,0,0,.5);
  z-index: 300;
  font-weight: 500;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(12px);} to { opacity: 1; transform: none; } }
.toast.error { border-left-color: var(--red); }
.toast.hidden { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .main { padding: 18px 18px 50px; }
  .dash-row { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-panel { grid-template-columns: 1fr; width: 460px; }
  .auth-brand { border-right: none; border-bottom: 1px solid var(--border); padding: 28px 30px; }
  .brand-head { margin-top: 22px; font-size: 25px; }
  .brand-feats { margin-top: 18px; }
  .brand-foot { margin-top: 20px; }
  .auth-form-wrap { padding: 32px 30px; }

  .detail-columns { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    width: 270px;
    box-shadow: 20px 0 60px rgba(0,0,0,.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sb-close { display: block; }
  .scrim.show { display: block; }
  .hamburger { display: flex; }
  body.nav-lock { overflow: hidden; }
  .top-admin span { display: none; }
}

@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 22px; }
  .two-col { grid-template-columns: 1fr; }
  .modal { padding: 10px; }
  .modal-panel, .modal-panel.modal-lg { width: 100%; max-height: calc(100vh - 20px); border-radius: 14px; }
  .add-row { flex-direction: column; min-width: 0; width: 100%; }
  .card { padding: 16px; }
  .auth { padding: 14px; }
  .auth-panel { border-radius: 18px; }
  .caste-row .input { width: 100%; }
  .caste-row .btn { flex: 1; }
  .caste-name { min-width: 100%; }
  .enquiry-head { display: none; }
  .enquiry-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 2px;
  }
  .enquiry-actions { text-align: left; }

  /* ---------- profile modal mobile ---------- */
  .profile-modal-panel { max-width: 100vw; max-height: 100vh; border-radius: 0; }
  .profile-modal-header { padding: 14px; gap: 12px; align-items: flex-start; }
  .pm-avatar { width: 50px; height: 50px; font-size: 22px; border-radius: 13px; }
  .pm-title-row h3 { font-size: 17px; }
  .pm-id-badge { font-size: 10.5px; padding: 2px 7px; }
  .pm-sub { font-size: 12px; }
  .pm-header-actions { margin-left: auto; }
  .profile-nav-tabs { padding: 8px 12px; }
  .ptab-btn { padding: 9px 8px; font-size: 12px; }
  .profile-modal-body { padding: 14px; }
  .form-section-title { font-size: 12px; }
  .profile-modal-foot { padding: 12px 14px; flex-wrap: wrap; }
  .modal-body { padding: 14px; }
  .limits-row { flex-direction: column; align-items: stretch; }
  .limits-row .input { width: 100%; }
  .assign-row { flex-wrap: wrap; }
  .caste-select-row { flex-direction: column; }
}
  .main { padding: 16px 14px 46px; }
  .stats-grid .stat-card { padding: 15px; }
}