/* ==========================================================================
   Radicate Microfinance Foundation — Design System
   Color palette: Maroon + Beige (HDFC-inspired)
   ========================================================================== */

:root {
  /* Brand */
  --maroon: #7A1F2B;
  --maroon-dark: #5A1521;
  --maroon-light: #A03240;
  --maroon-tint: #F4E6E8;

  --beige: #F5EDE0;
  --beige-light: #FAF6EE;
  --beige-dark: #E8DCC5;

  --gold: #C9A961;
  --gold-light: #E2C684;

  /* Status */
  --success: #2E7D5B;
  --success-bg: #E5F2EC;
  --danger: #B43A3A;
  --danger-bg: #FBE9E9;
  --warning: #D4A017;
  --warning-bg: #FBF3DA;
  --info: #1F5BA8;
  --info-bg: #E6EEF8;

  /* Neutral */
  --text: #1F1F1F;
  --text-muted: #6B6B6B;
  --text-light: #9A9A9A;
  --border: #E0D6C2;
  --border-light: #EFE7D6;
  --bg: #FFFFFF;
  --bg-alt: var(--beige-light);

  /* Layout */
  --container: 1200px;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(31, 16, 20, 0.05);
  --shadow: 0 4px 14px rgba(31, 16, 20, 0.08);
  --shadow-lg: 0 12px 32px rgba(31, 16, 20, 0.12);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Georgia", "Playfair Display", "Times New Roman", serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--maroon); text-decoration: none; }
a:hover { color: var(--maroon-dark); text-decoration: underline; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 0.6em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
small { color: var(--text-muted); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Top Bar (utility strip)
   ========================================================================== */
.topbar {
  background: var(--maroon-dark);
  color: #f3e8d5;
  font-size: 12.5px;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar a { color: #f3e8d5; }
.topbar .left, .topbar .right { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.topbar .right a:hover { color: var(--gold-light); text-decoration: none; }

/* ==========================================================================
   Header / Nav
   ========================================================================== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -1px;
  box-shadow: var(--shadow-sm);
}
.brand-mark-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #F6EBD9;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-text { line-height: 1.1; }
.brand-name { font-family: var(--font-serif); font-size: 19px; font-weight: 700; color: var(--maroon); }
.brand-tag  { font-size: 11.5px; color: var(--text-muted); letter-spacing: 0.5px; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 14.5px;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  position: relative;
}
.nav a:hover { color: var(--maroon); background: var(--maroon-tint); }
.nav a.active { color: var(--maroon); }
.nav a.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 2px; background: var(--maroon); border-radius: 2px;
}

.nav-cta { display: flex; gap: 10px; align-items: center; margin-left: 12px; }

.menu-toggle { display: none; background: none; border: 0; font-size: 24px; color: var(--maroon); cursor: pointer; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); color: #fff; text-decoration: none; }
.btn-outline { background: transparent; color: var(--maroon); border-color: var(--maroon); }
.btn-outline:hover { background: var(--maroon); color: #fff; text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--maroon-dark); }
.btn-gold:hover { background: var(--gold-light); color: var(--maroon-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--beige); color: var(--maroon); text-decoration: none; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 15.5px; }
.btn-block { display: flex; width: 100%; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  background:
    linear-gradient(135deg, rgba(122,31,43,0.92) 0%, rgba(90,21,33,0.95) 100%),
    radial-gradient(at top right, #A03240, transparent 60%);
  color: #fff;
  padding: 70px 0 90px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 20%, rgba(201,169,97,0.25), transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(245,237,224,0.08), transparent 40%);
  pointer-events: none;
}
.hero .container { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; gap: 60px; align-items: center; }
.hero h1 { color: #fff; font-size: 2.8rem; margin-bottom: 18px; }
.hero h1 span { color: var(--gold-light); }
.hero p.lede { font-size: 1.1rem; opacity: 0.92; margin-bottom: 28px; max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 28px;
  max-width: 540px;
}
.hero-stat .num { font-family: var(--font-serif); font-size: 1.7rem; color: var(--gold-light); font-weight: 700; }
.hero-stat .lbl { font-size: 12.5px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.5px; }

.hero-card {
  background: var(--bg);
  color: var(--text);
  padding: 28px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-top: 4px solid var(--gold);
}
.hero-card h3 { color: var(--maroon); margin-bottom: 6px; }
.hero-card .quick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.hero-card .quick-row a {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--beige-light);
  border-radius: var(--radius); border: 1px solid var(--border-light);
  color: var(--text); font-weight: 500; font-size: 14px;
}
.hero-card .quick-row a:hover { background: var(--beige); border-color: var(--gold); text-decoration: none; }
.hero-card .quick-row .ic {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--maroon-tint); color: var(--maroon);
  display: grid; place-items: center; font-size: 16px; font-weight: 700;
}

/* ==========================================================================
   Sections
   ========================================================================== */
section { padding: 70px 0; }
section.alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head .eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  color: var(--maroon);
  font-weight: 600;
  margin-bottom: 12px;
}
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: 16px; }

/* ==========================================================================
   Grid utilities
   ========================================================================== */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border); }
.card .ic-wrap {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--maroon-tint); color: var(--maroon);
  display: grid; place-items: center; font-size: 22px;
  margin-bottom: 16px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--maroon-dark); }
.card p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 12px; }
.card .arrow { color: var(--maroon); font-weight: 600; font-size: 13.5px; }

/* People card */
.person {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-align: center;
  transition: all 0.18s ease;
}
.person:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.person .avatar {
  height: 220px;
  background: linear-gradient(135deg, var(--beige) 0%, var(--beige-dark) 100%);
  display: grid; place-items: center;
  color: var(--maroon);
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 700;
}
.person .body { padding: 20px 18px 24px; }
.person h4 { margin: 0 0 4px; }
.person .role { color: var(--maroon); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.person .bio { color: var(--text-muted); font-size: 13.5px; }

/* Leadership rows — horizontal bio cards (photo left, name + details right) */
.leader-list { display: flex; flex-direction: column; gap: 24px; max-width: 880px; margin: 0 auto; }
.leader-row { display: flex; text-align: left; align-items: stretch; }
.leader-row .photo { flex: 0 0 240px; }
.leader-row .photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.leader-row .photo-initials {
  width: 100%; height: 100%; min-height: 240px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
  color: var(--beige);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 76px; font-weight: 800; font-style: italic; letter-spacing: 2px;
}
.leader-row .body { flex: 1; padding: 26px 28px; }
.leader-row h4 { font-size: 22px; margin-bottom: 4px; }
@media (max-width: 640px) {
  .leader-row { flex-direction: column; }
  .leader-row .photo { flex: 0 0 auto; }
  .leader-row .photo img { height: 300px; }
  .leader-row .photo-initials { min-height: 220px; }
}

/* ==========================================================================
   Stats strip
   ========================================================================== */
.stat-strip {
  background: var(--maroon);
  color: #fff;
  padding: 50px 0;
}
.stat-strip .grid-4 { gap: 30px; }
.stat-strip .stat { text-align: center; }
.stat-strip .num { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 700; color: var(--gold-light); }
.stat-strip .lbl { font-size: 13.5px; opacity: 0.9; text-transform: uppercase; letter-spacing: 1px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #2A0E13;
  color: #cdbfa9;
  padding: 60px 0 20px;
  font-size: 14px;
}
.site-footer .grid-4 { gap: 40px; align-items: flex-start; }
.site-footer h5 { color: #fff; font-family: var(--font-sans); font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 18px; }
.site-footer a { color: #cdbfa9; display: block; padding: 4px 0; }
.site-footer a:hover { color: var(--gold-light); text-decoration: none; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-tag  { color: #b9a98c; }
.site-footer p { color: #b9a98c; margin-bottom: 14px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 40px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #8e8068;
}
.footer-bottom a { display: inline; padding: 0; }

/* ==========================================================================
   Forms
   ========================================================================== */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row.full { grid-template-columns: 1fr; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px var(--maroon-tint);
}
.field .hint { font-size: 12.5px; color: var(--text-muted); margin-top: 5px; }
.field .err { font-size: 12.5px; color: var(--danger); margin-top: 5px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }

/* ==========================================================================
   Page header strip (interior pages)
   ========================================================================== */
.page-head {
  background: linear-gradient(120deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #fff;
  padding: 60px 0 70px;
  position: relative;
}
.page-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 40px; background: var(--beige-light);
  clip-path: polygon(0 100%, 100% 100%, 100% 40%, 0 100%);
}
.page-head h1 { color: #fff; margin-bottom: 8px; }
.page-head .breadcrumb { font-size: 13px; opacity: 0.85; }
.page-head .breadcrumb a { color: var(--gold-light); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
table.data {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data th, table.data td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
table.data thead th {
  background: var(--beige);
  font-weight: 600;
  color: var(--maroon-dark);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--gold);
}
table.data tbody tr:hover { background: var(--beige-light); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-paid { background: var(--success-bg); color: var(--success); }
.badge-due  { background: var(--warning-bg); color: #8a6a0c; }
.badge-overdue { background: var(--danger-bg); color: var(--danger); }
.badge-upcoming { background: var(--info-bg); color: var(--info); }

/* ==========================================================================
   Portal layout
   ========================================================================== */
.portal {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 76px);
  background: var(--bg-alt);
}
.portal-side {
  background: var(--maroon-dark);
  color: #f3e8d5;
  padding: 30px 0;
}
.portal-side .user {
  padding: 0 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}
.portal-side .user .av {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--gold); color: var(--maroon-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 20px;
  margin-bottom: 10px;
}
.portal-side .user .name { color: #fff; font-weight: 600; }
.portal-side .user .id { font-size: 12px; color: #cdbfa9; }
.portal-side nav a {
  display: flex; align-items: center; gap: 12px;
  color: #cdbfa9; padding: 12px 24px; font-size: 14.5px;
  border-left: 3px solid transparent;
}
.portal-side nav a:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.portal-side nav a.active { background: rgba(255,255,255,0.08); color: #fff; border-left-color: var(--gold); }
.portal-side nav a .ic { width: 18px; text-align: center; }

.portal-main { padding: 36px 40px; }
.portal-main .page-title { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.portal-main .page-title h1 { margin: 0; font-size: 1.8rem; }
.portal-main .page-title .sub { color: var(--text-muted); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 32px; }
.tile {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--maroon);
}
.tile.warn::before { background: var(--warning); }
.tile.danger::before { background: var(--danger); }
.tile.success::before { background: var(--success); }
.tile .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.tile .val { font-family: var(--font-serif); font-size: 1.8rem; color: var(--maroon-dark); font-weight: 700; margin-top: 6px; }
.tile .meta { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.panel {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.panel h3 { margin: 0 0 18px; font-size: 1.15rem; color: var(--maroon-dark); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel h3 .actions { display: flex; gap: 8px; }

/* Progress bar */
.progress { background: var(--beige); border-radius: 999px; height: 10px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--maroon) 0%, var(--gold) 100%); }

/* Login centered */
.auth-wrap {
  min-height: calc(100vh - 76px);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--beige) 0%, var(--beige-dark) 100%);
  padding: 40px 16px;
}
.auth-card {
  background: #fff;
  max-width: 440px;
  width: 100%;
  padding: 40px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-top: 5px solid var(--gold);
}
.auth-card h2 { margin: 0 0 6px; color: var(--maroon-dark); }
.auth-card .sub { color: var(--text-muted); margin-bottom: 28px; }
.auth-card .divider { text-align: center; margin: 20px 0; color: var(--text-muted); font-size: 12px; position: relative; }
.auth-card .divider::before, .auth-card .divider::after {
  content: ""; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.auth-card .divider::before { left: 0; }
.auth-card .divider::after  { right: 0; }
.auth-card .help { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 18px; }

/* Steps (loan application) */
.steps { display: flex; gap: 0; margin-bottom: 32px; border-bottom: 1px solid var(--border-light); }
.steps .step {
  flex: 1;
  padding: 16px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  position: relative;
}
.steps .step .n {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--border-light); color: var(--text-muted);
  font-weight: 700; font-size: 13px; margin-right: 8px;
}
.steps .step.active { color: var(--maroon); border-bottom-color: var(--maroon); font-weight: 600; }
.steps .step.active .n { background: var(--maroon); color: #fff; }
.steps .step.done .n { background: var(--success); color: #fff; }

/* Alert */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  border-left: 4px solid;
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-info { background: var(--info-bg); border-color: var(--info); color: #143b6e; }
.alert-warn { background: var(--warning-bg); border-color: var(--warning); color: #6e520b; }
.alert-danger { background: var(--danger-bg); border-color: var(--danger); color: #7a2424; }
.alert-success { background: var(--success-bg); border-color: var(--success); color: #1e533c; }
.alert-error { background: var(--danger-bg); border-color: var(--danger); color: #7a2424; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 960px) {
  .hero { padding: 50px 0 60px; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: 2.1rem; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .portal { grid-template-columns: 1fr; }
  .portal-side { padding: 16px 0; }
  .portal-side .user { display: none; }
  .portal-side nav { display: flex; overflow-x: auto; }
  .portal-side nav a { padding: 10px 16px; border-left: 0; border-bottom: 3px solid transparent; flex-shrink: 0; }
  .portal-side nav a.active { border-left: 0; border-bottom-color: var(--gold); }
  .portal-main { padding: 24px 18px; }
}
@media (max-width: 720px) {
  .nav { display: none; position: absolute; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; border-top: 1px solid var(--border-light); box-shadow: var(--shadow); padding: 10px 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 24px; border-radius: 0; }
  .nav-cta { display: none; }
  .menu-toggle { display: block; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .topbar .left, .topbar .right { gap: 12px; }
  .steps .step { padding: 12px 8px; font-size: 12px; }
  .steps .step .lbl-text { display: none; }
  .brand-mark-img { width: 40px; height: 40px; }
  .brand-name { font-size: 17px; }
  .brand-tag  { font-size: 10.5px; }
}

/* ==========================================================================
   Mobile layer — force inline multi-column grids to stack, keep tables
   horizontally scrollable, and tidy the portal chrome on small screens.
   Uses !important so it also overrides inline grid-template-columns.
   ========================================================================== */
@media (max-width: 760px) {
  /* Prevent page-level horizontal scroll */
  html, body { max-width: 100%; overflow-x: hidden; }

  /* Portal layout: single column, and let columns shrink (min-width:0) so
     wide content scrolls *inside* its box instead of widening the page */
  .portal { grid-template-columns: 1fr !important; }
  .portal-side, .portal-main { min-width: 0; max-width: 100%; }
  .portal-side nav { max-width: 100%; }

  /* Any inline/CSS grid that uses multiple columns collapses to one column */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }

  /* Keep small KPI/2-up stat grids as two columns for density */
  .tiles { grid-template-columns: 1fr 1fr !important; }
  .rmf-upi-apps { grid-template-columns: 1fr 1fr !important; }

  /* Page header stacks; action buttons go full width and wrap */
  .portal-main .page-title { flex-direction: column; align-items: stretch; }
  .portal-main .page-title .btn { width: 100%; text-align: center; }

  /* Data tables: don't squish — scroll horizontally inside their wrapper */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.data { min-width: 600px; }

  /* Admin top bar: allow wrapping, hide the location chip to save space */
  .admin-bar .container { flex-wrap: wrap; gap: 6px 12px; }

  /* Comfortable tap targets + spacing */
  .portal-main { padding: 20px 14px; }
  .panel { padding: 16px; }
  .btn { padding: 11px 16px; }
  .quick-action { grid-template-columns: auto 1fr !important; }
}

@media (max-width: 460px) {
  .tiles { grid-template-columns: 1fr !important; }
  .hero-stats { grid-template-columns: 1fr 1fr !important; }
  .portal-main .page-title h1 { font-size: 1.5rem; }
  /* UPI sheet uses near-full width on tiny screens */
  .rmf-upi-card { max-width: 100% !important; }
  .rmf-upi-apps { grid-template-columns: 1fr !important; }
}

/* ==========================================================================
   Customer-portal readability — larger type and touch targets for first-time
   smartphone users on the logged-in customer pages only.
   ========================================================================== */
:is(body[data-page="dashboard"], body[data-page="statement"], body[data-page="dues"],
    body[data-page="profile"], body[data-page="mandate"], body[data-page="grievances"]) {
  font-size: 16px;
  line-height: 1.65;
}
@media (max-width: 760px) {
  :is(body[data-page="dashboard"], body[data-page="statement"], body[data-page="dues"],
      body[data-page="profile"], body[data-page="mandate"], body[data-page="grievances"]) .btn {
    min-height: 48px;
    font-size: 16px;
  }
  :is(body[data-page="dashboard"], body[data-page="statement"], body[data-page="dues"],
      body[data-page="profile"], body[data-page="mandate"], body[data-page="grievances"]) :is(td, th) {
    padding: 12px 10px;
    font-size: 14.5px;
  }
  :is(body[data-page="dashboard"], body[data-page="statement"], body[data-page="dues"],
      body[data-page="profile"], body[data-page="mandate"], body[data-page="grievances"]) input,
  :is(body[data-page="dashboard"], body[data-page="statement"], body[data-page="dues"],
      body[data-page="profile"], body[data-page="mandate"], body[data-page="grievances"]) select {
    font-size: 16px;   /* prevents iPhone auto-zoom on focus */
    min-height: 48px;
  }
}
