/* ═══ BSSAJ Design System ═══ */

:root {
  --green:   #006A4E;
  --green-l: #E1F5EE;
  --green-d: #004d38;
  --red:     #D4213D;
  --gold:    #B8860B;
  --gold-l:  #FAEEDA;

  --bg:       #F4F6F8;
  --surface:  #fff;
  --surface2: #F1F3F5;
  --border:   #E2E6EA;
  --border2:  #CDD3DA;

  --text:  #1A1D23;
  --text2: #6B7280;
  --text3: #9CA3AF;

  --r:   10px;
  --rsm: 6px;

  --font-bn: 'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-bn);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ═══ Layout ═══ */

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 224px;
  background: var(--green);
  color: #fff;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.brand {
  padding: 4px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; gap: 12px;
}
.brand-logo {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border-radius: 8px;
  display: grid; place-items: center;
  font-weight: 700; font-size: 15px;
  font-family: var(--font-en);
}
.brand-title { font-size: 16px; font-weight: 700; }
.brand-sub   { font-size: 11px; opacity: .75; }

.nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}
.nav-item {
  padding: 10px 14px;
  border-radius: var(--rsm);
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.12); }
.nav-item.active { background: rgba(255,255,255,.2); font-weight: 600; }
.nav-item.soon { opacity: .55; }
.nav-item.soon::after { content: ' ⏳'; font-size: 10px; }

.side-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 12px;
}
.year-ctl label { display: block; margin-bottom: 6px; opacity: .8; }
.year-ctl input {
  width: 100%;
  padding: 6px 10px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  border-radius: var(--rsm);
  font-family: var(--font-en);
}
.conn {
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; opacity: .85;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text3);
  display: inline-block;
}
.dot.on  { background: #A8E6A3; box-shadow: 0 0 6px #A8E6A3; }
.dot.off { background: #F7B1B1; }

.main {
  margin-left: 224px;
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

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

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-sub { color: var(--text2); font-size: 13px; margin-top: 4px; }

/* ═══ Components ═══ */

.btn {
  padding: 9px 16px;
  border-radius: var(--rsm);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-d); }
.btn.ghost { background: #fff; color: var(--text); border-color: var(--border2); }
.btn.ghost:hover { background: var(--surface2); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 18px;
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  background: var(--surface2);
  font-size: 14px;
}
.card-body { padding: 18px; }

/* ─── Metrics ─── */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
}
.m-label { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.m-value {
  font-size: 28px; font-weight: 700; color: var(--green);
  font-family: var(--font-en); line-height: 1.1;
}
.m-foot { font-size: 11px; color: var(--text3); margin-top: 6px; }

/* ─── Grid ─── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

/* ─── Finance block ─── */
.fin-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 13.5px;
}
.fin-row strong { font-family: var(--font-en); color: var(--text); }
.fin-row.total  { font-weight: 600; padding-top: 10px; }
.fin-row.total strong { color: var(--green); font-size: 15px; }
.fin-div { height: 1px; background: var(--border); margin: 8px 0; }

/* ─── Toolbar ─── */
.toolbar {
  margin-bottom: 14px;
  display: flex; gap: 10px; align-items: center;
}
.toolbar input[type="text"] {
  flex: 1; max-width: 320px;
  padding: 9px 13px;
  border: 1px solid var(--border2);
  border-radius: var(--rsm);
  background: #fff;
}
.toolbar input:focus { outline: none; border-color: var(--green); }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--surface2); }
th {
  text-align: left;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }

.mcell { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-l); color: var(--green);
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  font-family: var(--font-en);
  flex-shrink: 0;
}
.td-name { font-weight: 500; }
.td-org { color: var(--text2); font-size: 12.5px; }

/* ─── Badges ─── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 500;
}
.b-green { background: #C0DD97; color: #173404; }
.b-gold  { background: #FAC775; color: #412402; }
.b-red   { background: #F7C1C1; color: #501313; }
.b-blue  { background: #B5D4F4; color: #042C53; }
.b-gray  { background: #D3D1C7; color: #2C2C2A; }

/* ─── Tabs ─── */
.tabs {
  display: flex; gap: 2px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13.5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--text2);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Forms ─── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.col-2 { grid-column: span 2; }
.field label { font-size: 12px; color: var(--text2); font-weight: 500; }
.field input, .field select, .field textarea {
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--rsm);
  background: #fff;
  color: var(--text);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green);
}
.field textarea { resize: vertical; min-height: 60px; font-family: inherit; }

.form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ─── Attendance controls ─── */
.att-ctrl {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--green-l);
  border-radius: var(--rsm);
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.att-count { font-weight: 600; color: var(--green-d); font-size: 14px; }
.att-btns { display: flex; gap: 8px; }

/* ─── Modal ─── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r);
  width: 560px; max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s;
}
@keyframes modalIn { from { transform: translateY(-20px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
}
.modal-close:hover { background: var(--surface2); color: var(--text); }
.modal form { padding: 18px 22px 22px; }

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 12px 22px;
  border-radius: var(--r);
  font-size: 13px;
  z-index: 999;
  transform: translateY(80px);
  opacity: 0;
  transition: all .3s;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green); color: #fff; }
.toast.error   { background: var(--red);   color: #fff; }

/* ─── Soon placeholder pages ─── */
.soon-page {
  text-align: center;
  padding: 80px 20px;
  color: var(--text2);
}
.soon-icon { font-size: 56px; margin-bottom: 18px; }
.soon-page h2 { font-size: 22px; margin-bottom: 10px; color: var(--text); }
.soon-page p { max-width: 460px; margin: 0 auto; font-size: 13.5px; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main    { margin-left: 200px; padding: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.col-2 { grid-column: span 1; }
}
@media (max-width: 560px) {
  .sidebar {
    position: relative;
    width: 100%; height: auto;
    flex-direction: row; overflow-x: auto;
    padding: 12px;
  }
  .main { margin-left: 0; }
  .brand { padding: 0 12px; border-bottom: 0; border-right: 1px solid rgba(255,255,255,.15); }
  .nav { display: flex; flex: 1; padding: 0 8px; }
  .nav-item { white-space: nowrap; }
  .side-foot { display: none; }
}

/* ═══ Auth page (login/signup) ═══ */

.auth-body {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-d) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.auth-brand {
  text-align: center;
  margin-bottom: 24px;
}

.auth-brand .brand-logo {
  width: 52px; height: 52px;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px;
  margin: 0 auto 12px;
  font-family: var(--font-en);
}

.auth-brand .brand-title {
  font-size: 22px; font-weight: 700;
  color: var(--green);
}

.auth-brand .brand-sub {
  font-size: 12px;
  color: var(--text2);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  transition: all .15s;
}

.auth-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-form .field { margin-bottom: 14px; }
.auth-form label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 5px;
  font-weight: 500;
}
.auth-form input, .auth-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--rsm);
  font-size: 14px;
}
.auth-form input:focus, .auth-form select:focus {
  outline: none;
  border-color: var(--green);
}

.auth-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-weight: 600;
}

.auth-note {
  font-size: 12px;
  color: var(--text3);
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}

.auth-msg {
  margin-top: 14px;
  padding: 10px;
  border-radius: var(--rsm);
  font-size: 13px;
  text-align: center;
  display: none;
}
.auth-msg.error   { display: block; background: #FEE2E2; color: #991B1B; }
.auth-msg.success { display: block; background: #D1FAE5; color: #065F46; }
.auth-msg.info    { display: block; background: #E0E7FF; color: #3730A3; }

/* ═══ User box in sidebar ═══ */

.user-box {
  padding: 10px 12px;
  background: rgba(255,255,255,.08);
  border-radius: var(--rsm);
  margin: 0 16px 12px;
  font-size: 12px;
}
.user-box .ub-name {
  font-weight: 600;
  color: #fff;
  font-size: 13px;
  margin-bottom: 2px;
  word-break: break-word;
}
.user-box .ub-role {
  color: rgba(255,255,255,.7);
  font-size: 11px;
  margin-bottom: 4px;
}
.user-box .btn {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
}
.user-box .btn:hover {
  background: rgba(255,255,255,.25);
}

.badge.b-yellow { background: #FEF3C7; color: #92400E; }

/* ═══ Dashboard notice banner (pending fees) ═══ */

.notice-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #FEF3C7;
  border-left: 4px solid var(--gold);
  border-radius: var(--rsm);
  margin-bottom: 16px;
}
.notice-banner .nb-icon { font-size: 22px; }
.notice-banner .nb-body { flex: 1; }
.notice-banner .nb-body strong { color: #92400E; display: block; font-size: 14px; }
.notice-banner .nb-sub {
  font-size: 12px; color: #78350F; margin-top: 3px;
}

.notice-banner-info {
  background: #DBEAFE;
  border-left-color: #2563EB;
}
.notice-banner-info .nb-body strong { color: #1E3A8A; }
.notice-banner-info .nb-sub { color: #1E40AF; }

/* Sidebar pending badge */
.nav-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-en);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 8px;
  min-width: 18px;
  text-align: center;
}

/* Pending account row highlight */
tr.row-pending { background: #FFFBEB; }
tr.row-pending td { font-weight: 500; }

.account-actions { white-space: nowrap; }
.account-actions .btn { margin-right: 4px; }

/* Media uploader (photo / logo) — preview + action buttons, no URL exposed. */
.media-uploader {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 4px;
}
.media-preview {
  width: 130px;
  height: 130px;
  border-radius: var(--rsm);
  border: 1px dashed var(--border2);
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.media-preview.has-image img { display: block; }
.media-preview.has-image .media-placeholder { display: none; }
.media-placeholder {
  text-align: center;
  color: var(--text3);
  font-size: 32px;
  line-height: 1.2;
}
.media-placeholder small {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  color: var(--text3);
}

/* Progress overlay during upload */
.media-preview.uploading::after {
  content: attr(data-progress);
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-en);
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 120px;
}
.media-actions .btn { justify-content: center; }

/* Photo-based avatar in member list */
.avatar.avatar-img {
  padding: 0;
  overflow: hidden;
}
.avatar.avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.metric.alert-metric .m-value { color: var(--red); }

/* ═══ Fee grid (monthly payments) ═══ */

.fee-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.fs-box {
  background: var(--surface2);
  border-radius: var(--rsm);
  padding: 8px 14px;
  min-width: 130px;
}
.fs-label { font-size: 11px; color: var(--text2); }
.fs-value {
  font-weight: 700;
  font-family: var(--font-en);
  margin-top: 2px;
}
.fs-value.green { color: var(--green); }
.fs-value.red   { color: var(--red);  }

.page-head-meta { margin-left: auto; }

.fee-grid {
  width: 100%;
  border-collapse: collapse;
}
.fee-grid th, .fee-grid td {
  padding: 8px 4px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.fee-grid .fee-name-col {
  text-align: left;
  padding-left: 12px;
  min-width: 180px;
}
.fee-grid .fee-month {
  font-size: 11px;
  color: var(--text2);
  font-weight: 500;
}
.fee-grid .fee-month.future { color: var(--text3); }

.fee-cell {
  font-weight: 700;
  font-family: var(--font-en);
  transition: background .1s;
}
.fee-cell.paid    { background: #D1FAE5; color: var(--green); }
.fee-cell.due     { background: #FEE2E2; color: var(--red); }
.fee-cell.future  { color: var(--text3); }
.fee-cell.prejoin { color: var(--text3); background: var(--surface2); font-weight: 400; }
.fee-cell.clickable { cursor: pointer; }
.fee-cell.clickable:hover { filter: brightness(0.93); }

/* ═══ Fee month badges (profile page) ═══ */

.fee-months {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fee-month-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.fee-month-badge.paid { background: #D1FAE5; color: #065F46; }
.fee-month-badge.due  { background: #FEE2E2; color: #991B1B; }

.field-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 4px;
  line-height: 1.5;
}

.form-hint {
  font-size: 12px;
  color: var(--text2);
  background: var(--surface2);
  padding: 8px 12px;
  border-radius: var(--rsm);
  margin: 12px 0 0;
}

/* ═══ BSSAJ identifier badges ═══ */

.code-row {
  font-family: var(--font-en);
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.code-tag {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
}

/* Identifier card on profile */
.id-card {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-d) 100%);
  color: #fff;
}
.id-card .card-body { padding: 18px 20px; }
.id-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.id-label {
  font-size: 11px;
  color: rgba(255,255,255,.7);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.id-value {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  word-break: break-all;
}
@media (max-width: 600px) {
  .id-grid { grid-template-columns: 1fr; }
}

/* ═══ Designation badge (member list) ═══ */

.designation-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--green-l);
  color: var(--green-d);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Disabled input (profile read-only fields) */
.auth-form input:disabled,
input:disabled,
textarea:disabled {
  background: var(--surface2);
  color: var(--text2);
  cursor: not-allowed;
}


