/* ─────────────────────────────────────────────
   MFS Registration System — Design System
   Padakhep Manabik Unnayan Kendra
   ───────────────────────────────────────────── */

:root {
  /* Brand — Padakhep Purple rgb(108, 69, 161) */
  --primary:        #6C45A1;
  --primary-hover:  #5B3A88;
  --primary-light:  #F2EDF9;
  --primary-border: #C9B5E6;

  /* Sidebar */
  --sidebar-bg:     #1A0E2E;
  --sidebar-w:      240px;

  /* Status palette */
  --s-draft:        #64748B;
  --s-draft-bg:     #F1F5F9;
  --s-submitted:    #2563EB;
  --s-submitted-bg: #EFF6FF;
  --s-correction:   #D97706;
  --s-correction-bg:#FFFBEB;
  --s-ready:        #059669;
  --s-ready-bg:     #F0FDF4;
  --s-generated:    #0891B2;
  --s-generated-bg: #E0F2FE;

  /* Provider badge colors */
  --bkash:   #E2136E;
  --nagad:   #F0861A;
  --rocket:  #8B14CC;
  --upay:    #039153;

  /* Neutrals */
  --bg:       #F1F5F9;
  --card:     #FFFFFF;
  --border:   #E2E8F0;
  --text:     #0F172A;
  --muted:    #64748B;
  --radius:   10px;
  --radius-sm:6px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,.07), 0 4px 6px -2px rgba(0,0,0,.04);

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Reset & base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Admin layout — sidebar + main ─────────── */
.layout-admin {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand .org-name {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 4px;
}

.sidebar-brand .app-name {
  font-size: 15px;
  font-weight: 700;
  color: #F8FAFC;
  line-height: 1.2;
}

.sidebar-brand .app-name span {
  color: #B794E8;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 4px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #475569;
  padding: 8px 8px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-link:hover {
  background: rgba(255,255,255,.06);
  color: #E2E8F0;
  text-decoration: none;
}

.sidebar-link.active {
  background: rgba(108,69,161,.25);
  color: #C9A8F0;
}

.sidebar-link .bi {
  font-size: 16px;
  flex-shrink: 0;
  opacity: .8;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-size: 12.5px;
}

.sidebar-user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #2D1A48;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: #C9A8F0;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; color: #E2E8F0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info span { font-size: 11px; color: #475569; }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: #94A3B8;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s;
  text-decoration: none;
  margin-top: 4px;
}
.sidebar-logout:hover { color: #FCA5A5; text-decoration: none; }

/* Main content area */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-body {
  padding: 28px;
  flex: 1;
}

/* ── Branch layout — topbar only ───────────── */
.layout-branch {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.branch-topbar {
  background: var(--sidebar-bg);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.branch-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.branch-app-name {
  font-size: 15px;
  font-weight: 700;
  color: #F8FAFC;
}
.branch-app-name span { color: #B794E8; }

.branch-divider {
  width: 1px; height: 24px;
  background: rgba(255,255,255,.15);
}

.branch-info {
  font-size: 12.5px;
  color: #94A3B8;
}
.branch-info strong { color: #CBD5E1; font-weight: 600; }

.branch-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branch-nav-link {
  font-size: 13px;
  color: #94A3B8;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.branch-nav-link:hover { background: rgba(255,255,255,.06); color: #E2E8F0; text-decoration: none; }
.branch-nav-link.active { color: #C9A8F0; }

.branch-body {
  flex: 1;
  padding: 28px 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* ── Auth pages ─────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
}

.auth-brand-panel {
  width: 42%;
  background: linear-gradient(145deg, #1A0E2E 0%, #2D1A48 55%, #6C45A1 100%);
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: rgba(108,69,161,.15);
}

.auth-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -60px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(108,69,161,.1);
}

.auth-brand-inner { position: relative; z-index: 1; }

.auth-org-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(108,69,161,.3);
  border: 1px solid rgba(147,197,253,.2);
  color: #C9A8F0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 32px;
}

.auth-headline {
  font-size: 28px;
  font-weight: 800;
  color: #F8FAFC;
  line-height: 1.25;
  margin-bottom: 16px;
}
.auth-headline span { color: #B794E8; }

.auth-sub {
  font-size: 14px;
  color: #94A3B8;
  line-height: 1.65;
  margin-bottom: 40px;
}

.auth-features { display: flex; flex-direction: column; gap: 12px; }

.auth-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #CBD5E1;
  font-size: 13px;
}

.auth-feature-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: rgba(108,69,161,.25);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #B794E8;
  font-size: 13px;
}

.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 40px;
  background: var(--card);
}

.auth-form-box {
  width: 100%;
  max-width: 380px;
}

.auth-form-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* ── Cards ─────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-body { padding: 20px; }

/* Stat cards */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: var(--shadow-sm); }
a.stat-card:hover { box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,.12)); transform: translateY(-1px); transition: box-shadow .15s, transform .15s; }
a.stat-card { display: flex; }
.stat-card.stat-card-active { outline: 2px solid var(--primary); outline-offset: 2px; }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -.02em;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.stat-card.accent-blue  { border-left: 3px solid var(--primary); }
.stat-card.accent-green { border-left: 3px solid #059669; }
.stat-card.accent-amber { border-left: 3px solid #D97706; }
.stat-card.accent-violet { border-left: 3px solid #7C3AED; }
.stat-card.accent-red   { border-left: 3px solid #DC2626; }
.stat-card.accent-slate { border-left: 3px solid #64748B; }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.btn-primary   { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }

.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--text); }

.btn-danger    { background: #DC2626; color: #fff; border-color: #DC2626; }
.btn-danger:hover { background: #B91C1C; }

.btn-ghost     { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-success   { background: #059669; color: #fff; border-color: #059669; }
.btn-success:hover { background: #047857; color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }

.btn-provider {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
}
.btn-bkash  { background: #FDE8F1; color: var(--bkash); border: 1px solid #F9C0D8; }
.btn-bkash:hover  { background: #fbd4e6; color: var(--bkash); }
.btn-nagad  { background: #FEF3E2; color: var(--nagad); border: 1px solid #FDD7A0; }
.btn-nagad:hover  { background: #fde8c0; color: var(--nagad); }

/* ── Status badges ──────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-draft       { background: var(--s-draft-bg);       color: var(--s-draft);       }
.badge-draft::before { background: var(--s-draft); }

.badge-submitted   { background: var(--s-submitted-bg);   color: var(--s-submitted);   }
.badge-submitted::before { background: var(--s-submitted); }

.badge-correction  { background: var(--s-correction-bg);  color: var(--s-correction);  }
.badge-correction::before { background: var(--s-correction); }

.badge-ready       { background: var(--s-ready-bg);       color: var(--s-ready);       }
.badge-ready::before { background: var(--s-ready); }

.badge-generated   { background: var(--s-generated-bg);   color: var(--s-generated);   }
.badge-generated::before { background: var(--s-generated); }

.badge-pme { background: #E0F2FE; color: #0369A1; font-size: 11px; }
.badge-pmf { background: #F3E8FF; color: #7E22CE; font-size: 11px; }

/* ── Forms ──────────────────────────────────── */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.form-label .required { color: #DC2626; margin-left: 2px; }

.form-control, .form-select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--card);
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--font);
  line-height: 1.5;
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,69,161,.12);
}

.form-control:disabled, .form-control[readonly] {
  background: #F8FAFC;
  color: var(--muted);
  cursor: not-allowed;
}

.form-control.is-invalid, .form-select.is-invalid {
  border-color: #DC2626;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.invalid-feedback {
  font-size: 12px;
  color: #DC2626;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.form-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.form-section-header {
  padding: 14px 20px;
  background: #FAFAFA;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.form-section-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.form-section-body {
  padding: 20px;
}

.field-group { margin-bottom: 16px; }
.field-group:last-child { margin-bottom: 0; }

textarea.form-control { resize: vertical; min-height: 80px; }

/* File input styling */
.file-input-wrapper {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-input-wrapper:hover { border-color: var(--primary); background: var(--primary-light); }
.file-input-wrapper input[type="file"] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.file-input-label { cursor: pointer; display: block; }

/* Read-only fields in forms */
.readonly-field {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--muted);
  display: block;
  width: 100%;
}

/* ── Tables ──────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  background: #FAFAFA;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
  transition: background .1s;
}
.data-table tbody tr:hover { background: #FAFBFC; }

.data-table tbody tr.status-row-draft        td:first-child { border-left: 3px solid var(--s-draft); }
.data-table tbody tr.status-row-submitted     td:first-child { border-left: 3px solid var(--s-submitted); }
.data-table tbody tr.status-row-correction    td:first-child { border-left: 3px solid var(--s-correction); }
.data-table tbody tr.status-row-ready         td:first-child { border-left: 3px solid var(--s-ready); }
.data-table tbody tr.status-row-generated     td:first-child { border-left: 3px solid var(--s-generated); }

.table-wrapper {
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Program cards ───────────────────────────── */
.program-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  cursor: pointer;
  transition: all .18s;
  position: relative;
  text-align: left;
  display: block;
  text-decoration: none;
  color: inherit;
}

.program-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.program-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.program-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.program-card-pme .program-card-icon { background: #E0F2FE; color: #0284C7; }
.program-card-pmf .program-card-icon { background: #F3E8FF; color: #9333EA; }

.program-card-code {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 4px;
}
.program-card-pme .program-card-code { color: #0284C7; }
.program-card-pmf .program-card-code { color: #9333EA; }

.program-card-name {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 6px;
}

.program-card-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

.program-card-status {
  position: absolute;
  top: 16px; right: 16px;
}

/* ── Progress / completion ──────────────────── */
.progress-bar-wrap {
  background: #E2E8F0;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width .4s ease;
}

/* ── Alerts & messages ───────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-danger  { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

.alert .bi { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

/* ── Filter bar ──────────────────────────────── */
.filter-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

/* ── Page header ─────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header-left {}
.page-header-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 2px;
}
.page-header-sub {
  font-size: 13px;
  color: var(--muted);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Cheque preview ──────────────────────────── */
.cheque-preview {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  max-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAFAFA;
}
.cheque-preview img { max-height: 220px; width: 100%; object-fit: contain; }

/* ── Empty state ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon { font-size: 40px; color: #CBD5E1; margin-bottom: 12px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.empty-state-sub { font-size: 13px; color: #94A3B8; }

/* ── Utility ─────────────────────────────────── */
.text-muted  { color: var(--muted) !important; }
.text-small  { font-size: 12px; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.mt-1        { margin-top: 4px; }
.mt-3        { margin-top: 12px; }
.mb-0        { margin-bottom: 0; }
.mb-2        { margin-bottom: 8px; }
.mb-3        { margin-bottom: 12px; }
.mb-4        { margin-bottom: 16px; }
.d-flex      { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.flex-wrap   { flex-wrap: wrap; }
.ms-auto     { margin-left: auto; }

/* ── Divider ─────────────────────────────────── */
hr.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Toast/notification placeholder ───────────── */
.messages-container {
  position: fixed;
  top: 16px; right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}

.toast-msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: all;
  animation: slideIn .2s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast-success { background: #166534; color: #F0FDF4; }
.toast-warning { background: #92400E; color: #FFFBEB; }
.toast-error   { background: #991B1B; color: #FEF2F2; }
.toast-info    { background: #1E40AF; color: #EFF6FF; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 32px 24px; }
  .page-body { padding: 16px; }
  .branch-body { padding: 16px; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .branch-info { display: none; }
}

/* ── Masked account number ───────────────────── */
.masked { font-family: monospace; letter-spacing: .05em; }

/* ── Provider output buttons ─────────────────── */
.output-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Sidebar badge count ─────────────────────── */
.sidebar-badge {
  background: rgba(108,69,161,.3);
  color: #C9A8F0;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: auto;
}

/* ── Breadcrumb ──────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb-sep { color: #CBD5E1; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── Step indicator (form) ───────────────────── */
.step-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 72px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--muted);
  font-size: 12.5px;
  transition: background .12s, color .12s;
}
.step-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.step-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }

.step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--muted);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-item.active .step-dot { background: var(--primary); color: #fff; }
.step-item.done .step-dot   { background: #059669; color: #fff; }

/* ── Template status items (template_management.html) ──────── */
.template-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.template-meta-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.template-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 90px;
  flex-shrink: 0;
}

.template-meta-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
}

.template-meta-value.not-set {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
}

/* ── Info tooltip ────────────────────────────── */
.info-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #E2E8F0;
  color: var(--muted);
  font-size: 10px;
  cursor: help;
  vertical-align: middle;
  margin-left: 4px;
}
