@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────── */
:root {
  --sp:        #7c3aed;
  --sp-lt:     #a78bfa;
  --sp-dark:   #5b21b6;
  --sg:        #10b981;
  --sr:        #f43f5e;
  --sa:        #f59e0b;
  --sb:        #0ea5e9;
  --st:        #14b8a6;

  --bg:        #f5f3ff;
  --surface:   #ffffff;
  --border:    #e9e4ff;
  --border2:   #d0c9ff;
  --text:      #1e1b35;
  --muted:     #6b7094;
  --muted2:    #9ca3af;

  --r:         12px;
  --r-lg:      18px;
  --shadow:    0 4px 24px rgba(124,58,237,.10);
  --shadow-lg: 0 12px 40px rgba(124,58,237,.16);
}

/* ── Base ──────────────────────────────────────────────────────────── */
.smc-pub-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.smc-pub-wrap {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

/* ── Portal Header ────────────────────────────────────────────────── */
.smc-pub-header {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 60%, #0ea5e9 100%);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.smc-pub-header::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.07);
}
.smc-pub-header-left h2 { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
.smc-pub-header-left p  { font-size: .85rem; opacity: .82; margin-top: 4px; }
.smc-pub-header-right { text-align: right; }
.smc-pub-flat-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 30px;
  padding: 6px 18px;
  font-size: .85rem;
  font-weight: 700;
  margin-bottom: 5px;
}
.smc-pub-header-right .date { font-size: .78rem; opacity: .75; }

/* ── Stat Strip ───────────────────────────────────────────────────── */
.smc-pub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.smc-pub-stat {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.smc-pub-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.smc-pub-stat .ico  { font-size: 1.6rem; margin-bottom: 8px; }
.smc-pub-stat .val  { font-size: 1.5rem; font-weight: 800; color: var(--sp); font-family: 'JetBrains Mono', monospace; line-height: 1; }
.smc-pub-stat .lbl  { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.smc-pub-stat.green .val { color: var(--sg); }
.smc-pub-stat.red   .val { color: var(--sr); }
.smc-pub-stat.amber .val { color: var(--sa); }

/* ── Card ─────────────────────────────────────────────────────────── */
.smc-pub-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.smc-pub-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1.5px solid var(--border);
  background: linear-gradient(135deg, rgba(124,58,237,.04), rgba(79,70,229,.02));
}
.smc-pub-card-head h3 {
  font-size: .98rem; font-weight: 800; color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.smc-pub-card-body { padding: 22px; }

/* ── Due Amount Box ───────────────────────────────────────────────── */
.smc-pub-due-box {
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  border: 2px solid #c4b5fd;
  border-radius: var(--r);
  padding: 22px;
  text-align: center;
  margin-bottom: 20px;
}
.smc-pub-due-box .due-label { font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7c3aed; margin-bottom: 6px; }
.smc-pub-due-box .due-amount { font-size: 2.4rem; font-weight: 800; color: #5b21b6; font-family: 'JetBrains Mono', monospace; line-height: 1; }
.smc-pub-due-box .due-month  { font-size: .83rem; color: #6d28d9; margin-top: 5px; }
.smc-pub-due-box.paid {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-color: #6ee7b7;
}
.smc-pub-due-box.paid .due-label  { color: #065f46; }
.smc-pub-due-box.paid .due-amount { color: #065f46; }

/* ── Breakdown Table ──────────────────────────────────────────────── */
.smc-pub-breakdown { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.smc-pub-breakdown tr { border-bottom: 1px solid var(--border); }
.smc-pub-breakdown tr:last-child { border-bottom: none; }
.smc-pub-breakdown td { padding: 9px 4px; font-size: .875rem; }
.smc-pub-breakdown td:first-child { color: var(--muted); }
.smc-pub-breakdown td:last-child  { text-align: right; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.smc-pub-breakdown .total-row td  { font-size: 1rem; color: var(--sp-dark); border-top: 2px solid var(--border2); padding-top: 12px; }

/* ── QR Box ───────────────────────────────────────────────────────── */
.smc-pub-qr-wrap {
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  padding: 20px;
  text-align: center;
}
.smc-pub-qr-wrap img {
  width: 200px; height: 200px;
  border-radius: 10px;
  background: white;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(124,58,237,.15);
}
.smc-pub-qr-wrap .upi-id   { font-family: 'JetBrains Mono', monospace; font-size: .9rem; color: var(--sp); font-weight: 700; margin-top: 10px; }
.smc-pub-qr-wrap .upi-name { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.smc-pub-qr-steps { text-align: left; margin-top: 14px; }
.smc-pub-qr-steps li { font-size: .8rem; color: var(--muted); padding: 3px 0; list-style: none; padding-left: 20px; position: relative; }
.smc-pub-qr-steps li::before { content: '→'; position: absolute; left: 0; color: var(--sp); font-weight: 700; }

/* ── Payment Form ─────────────────────────────────────────────────── */
.smc-pub-form .smc-pub-field { margin-bottom: 14px; }
.smc-pub-form label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 5px;
}
.smc-pub-form input,
.smc-pub-form select {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .9rem; color: var(--text);
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.smc-pub-form input:focus,
.smc-pub-form select:focus {
  outline: none; border-color: var(--sp);
  box-shadow: 0 0 0 3px rgba(124,58,237,.12);
}
.smc-pub-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:600px){ .smc-pub-form-grid { grid-template-columns: 1fr; } }

/* ── Buttons ──────────────────────────────────────────────────────── */
.smc-pub-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 24px; border-radius: 9px; border: none;
  cursor: pointer; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: .9rem; font-weight: 700; line-height: 1;
  transition: opacity .15s, transform .12s; text-decoration: none;
  width: 100%; margin-top: 6px;
}
.smc-pub-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.smc-pub-btn-primary  { background: linear-gradient(135deg, var(--sp), #4f46e5); color: white; }
.smc-pub-btn-success  { background: var(--sg); color: white; }
.smc-pub-btn-ghost    { background: white; color: var(--sp); border: 1.5px solid var(--border2); }
.smc-pub-btn-sm       { padding: 7px 16px; font-size: .82rem; border-radius: 7px; width: auto; margin-top: 0; }

/* ── Month Nav ────────────────────────────────────────────────────── */
.smc-pub-month-nav {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-bottom: 20px;
}
.smc-pub-month-nav button {
  background: var(--surface); border: 1.5px solid var(--border2);
  border-radius: 8px; width: 34px; height: 34px;
  cursor: pointer; font-size: 15px; color: var(--sp);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.smc-pub-month-nav button:hover { background: #ede9fe; }
.smc-pub-month-nav .cur-month {
  font-weight: 800; font-size: .95rem; color: var(--text);
  min-width: 130px; text-align: center;
}

/* ── Statement Table ──────────────────────────────────────────────── */
.smc-pub-table-wrap { overflow-x: auto; }
.smc-pub-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.smc-pub-table th {
  background: rgba(124,58,237,.06);
  padding: 10px 12px; text-align: left;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1.5px solid var(--border2);
  white-space: nowrap;
}
.smc-pub-table td {
  padding: 11px 12px; border-bottom: 1px solid var(--border);
  font-size: .875rem; color: var(--text); vertical-align: middle;
}
.smc-pub-table tr:last-child td { border-bottom: none; }
.smc-pub-table tr:hover td { background: rgba(124,58,237,.03); }
.smc-pub-table .mono { font-family: 'JetBrains Mono', monospace; font-size: .82rem; }

/* ── Badge ────────────────────────────────────────────────────────── */
.smc-pub-badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.smc-pub-badge.paid     { background: #d1fae5; color: #065f46; }
.smc-pub-badge.unpaid   { background: #fee2e2; color: #991b1b; }
.smc-pub-badge.partial  { background: #fef3c7; color: #92400e; }
.smc-pub-badge.overpaid { background: #dbeafe; color: #1e40af; }

/* ── Notice / Alert ───────────────────────────────────────────────── */
.smc-pub-alert {
  padding: 13px 18px; border-radius: 10px;
  font-size: .875rem; font-weight: 600; margin-bottom: 16px;
  display: none;
}
.smc-pub-alert.show   { display: block; }
.smc-pub-alert.success { background: #d1fae5; border: 1px solid #6ee7b7; color: #065f46; }
.smc-pub-alert.error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.smc-pub-alert.info    { background: #ede9fe; border: 1px solid #c4b5fd; color: #5b21b6; }

/* ── Login / No-member Wall ───────────────────────────────────────── */
.smc-pub-login-wall {
  background: var(--surface); border: 2px dashed var(--border2);
  border-radius: var(--r-lg); padding: 48px 32px;
  text-align: center; margin: 16px 0;
}
.smc-pub-login-icon { font-size: 3rem; margin-bottom: 14px; }
.smc-pub-login-wall h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 8px; }
.smc-pub-login-wall p  { color: var(--muted); font-size: .875rem; margin-bottom: 18px; }

/* ── Profile Card ─────────────────────────────────────────────────── */
.smc-pub-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:600px){ .smc-pub-profile-grid { grid-template-columns: 1fr; } }
.smc-pub-profile-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.smc-pub-profile-item:nth-last-child(-n+2) { border-bottom: none; }
.smc-pub-profile-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.smc-pub-profile-value { font-size: .9rem; font-weight: 600; color: var(--text); }

/* ── Available Flats Grid ─────────────────────────────────────────── */
.smc-pub-flats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.smc-pub-flat-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.smc-pub-flat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.smc-pub-flat-card-stripe { height: 5px; background: linear-gradient(90deg, var(--sp), var(--st)); }
.smc-pub-flat-card-body { padding: 18px; }
.smc-pub-flat-no   { font-size: 1.1rem; font-weight: 800; color: var(--text); }
.smc-pub-flat-blk  { font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.smc-pub-flat-specs { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); margin-bottom: 10px; }
.smc-pub-flat-rent { font-size: 1.35rem; font-weight: 800; color: var(--sp); font-family: 'JetBrains Mono', monospace; }
.smc-pub-flat-rent span { font-size: .75rem; font-weight: 400; color: var(--muted); }
.smc-pub-flat-amenities { font-size: .75rem; color: var(--muted); margin-top: 8px; }

/* ── Society Info ─────────────────────────────────────────────────── */
.smc-pub-society-card {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: var(--r-lg); padding: 28px 32px; color: white;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.smc-pub-society-card .smc-pub-stat-item { text-align: center; }
.smc-pub-society-card .smc-pub-stat-item .n { font-size: 1.8rem; font-weight: 800; }
.smc-pub-society-card .smc-pub-stat-item .l { font-size: .72rem; opacity: .8; letter-spacing: .06em; text-transform: uppercase; }

/* ── Spinner ──────────────────────────────────────────────────────── */
.smc-pub-spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: smc-pub-spin .6s linear infinite; }
@keyframes smc-pub-spin { to { transform: rotate(360deg); } }
.smc-pub-loading { text-align: center; padding: 40px; color: var(--muted); }
.smc-pub-loading .smc-pub-spin { border-color: rgba(124,58,237,.2); border-top-color: var(--sp); width: 30px; height: 30px; }

/* ── Divider ──────────────────────────────────────────────────────── */
.smc-pub-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted2); font-size: .78rem; }
.smc-pub-divider::before, .smc-pub-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── Tab strip ────────────────────────────────────────────────────── */
.smc-pub-tabs { display: flex; gap: 4px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 12px; padding: 4px; width: 100%; margin-bottom: 20px; }
.smc-pub-tab { flex: 1; text-align: center; padding: 9px; border-radius: 9px; font-size: .83rem; font-weight: 700; cursor: pointer; border: none; background: transparent; color: var(--muted); transition: .15s; }
.smc-pub-tab.active { background: var(--sp); color: white; box-shadow: 0 2px 8px rgba(124,58,237,.3); }
.smc-pub-tab-pane { display: none; }
.smc-pub-tab-pane.active { display: block; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media(max-width: 680px) {
  .smc-pub-header { padding: 20px; }
  .smc-pub-header-left h2 { font-size: 1.1rem; }
  .smc-pub-stats { grid-template-columns: repeat(2,1fr); }
  .smc-pub-card-body { padding: 16px; }
  .smc-pub-due-box .due-amount { font-size: 1.8rem; }
}

@media print {
  .smc-pub-btn, .smc-pub-tabs, .smc-pub-month-nav button { display: none !important; }
  .smc-pub-card { box-shadow: none; border: 1px solid #ccc; }
}
