/* Report Desk - branch portal and customer pages (corporate theme)
   Navy side panel, white surfaces on a cool grey canvas, one blue accent. */

:root {
  --navy-950: #08132a;
  --navy-900: #0c1b38;
  --navy-800: #142a52;
  --navy-700: #1f3a6b;
  --navy-300: #9fb1d1;
  --navy-200: #c9d5ea;

  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #e8efff;

  --canvas: #f3f5f9;
  --surface: #ffffff;
  --border: #e1e6ef;
  --border-strong: #cdd5e1;
  --text: #111a2e;
  --text-muted: #5a6478;
  --text-faint: #8a93a6;

  --success: #127a4a;
  --success-soft: #e5f5ec;
  --warning: #9a5b00;
  --warning-soft: #fff4e0;
  --danger: #b42318;
  --danger-soft: #fdecea;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 12px 32px rgba(8, 19, 42, 0.18);

  --sidebar-w: 256px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--canvas);
}

a { color: var(--primary); }

.icon { width: 18px; height: 18px; flex: none; }

.mono { font-family: var(--mono); letter-spacing: 0.02em; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn .icon { width: 16px; height: 16px; }

.btn-primary { color: #fff; background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--canvas); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-block { width: 100%; }

.btn:focus-visible,
.form-input:focus-visible,
.nav-link:focus-visible,
.report-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ Forms */

.form { display: flex; flex-direction: column; gap: 8px; }

.form-label { font-size: 13px; font-weight: 600; color: var(--text); }

.form-input {
  font: inherit;
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.form-input:focus { border-color: var(--primary); }

.form-input--code {
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: lowercase;
}

.form-input--code::placeholder { letter-spacing: 0.05em; font-size: 15px; color: var(--text-faint); }

.alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f6c9c4; }

/* ------------------------------------------------- Auth (landing / login) */

.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--navy-700) 0%, transparent 60%),
    linear-gradient(160deg, var(--navy-900) 0%, var(--navy-950) 100%);
}

.auth-panel { width: 100%; max-width: 400px; }

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #fff;
}

.auth-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}

.auth-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }

.auth-subtitle { margin: 0 0 22px; color: var(--text-muted); font-size: 14px; }

.auth-link { display: block; margin-top: 18px; text-align: center; font-size: 13px; color: var(--text-muted); }
.auth-link:hover { color: var(--primary); }

.auth-foot { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--navy-300); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary);
}

.brand-mark .icon { width: 20px; height: 20px; }

/* The Sookth logo carries its own colours, so no blue tile behind it. */
.brand-mark--logo { background: none; border-radius: 8px; overflow: hidden; }
.brand-logo { display: block; width: 100%; height: 100%; object-fit: contain; }

.brand-text { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
/* The full name is long for the side panel: smaller, on up to two lines. */
.sidebar-brand .brand-text { font-size: 14.5px; line-height: 1.2; }

/* -------------------------------------------------------------- App shell */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  color: var(--navy-200);
  background: var(--navy-900);
  border-right: 1px solid var(--navy-950);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }

.nav-group {
  margin: 18px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-300);
  opacity: 0.75;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 2px;
  font: inherit;
  font-size: 14px;
  color: var(--navy-200);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }

.nav-link.is-active { color: #fff; background: var(--navy-700); box-shadow: inset 3px 0 0 var(--primary); }

.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Switched-off items (e.g. Customers for now): visible, not clickable. */
.nav-link.is-disabled { opacity: 0.4; cursor: not-allowed; }
.nav-link.is-disabled:hover { color: var(--navy-200); background: none; }

/* Reports not built yet stay reachable but read as secondary. */
.nav-link.is-pending:not(.is-active) { color: var(--navy-300); opacity: 0.7; }

.sidebar-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); }

.nav-logout:hover { color: #fff; background: rgba(180, 35, 24, 0.35); }

.app-body {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-menu {
  display: none;
  padding: 8px;
  color: var(--text);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.topbar-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }

.topbar-branch { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-key { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }

.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
  border-radius: 999px;
  white-space: nowrap;
}

.sync-chip .icon { width: 15px; height: 15px; }

.sync-chip--none { color: var(--warning); background: var(--warning-soft); }

.content { flex: 1; width: 100%; max-width: 1240px; padding: 28px; }

/* Footer: product and version on the left, Sookth Solutions' contact on the right. */
.app-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 28px; padding: 14px 0 22px; font-size: 12.5px; color: var(--text-muted); border-top: 1px solid var(--border); }
.foot-brand, .foot-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.foot-brand .brand-logo { width: 22px; height: 22px; }
.foot-brand strong { color: var(--text); font-weight: 700; }
.foot-version { padding: 1px 8px; font-family: var(--mono); font-size: 11.5px; color: var(--success); background: var(--success-soft); border: 1px solid #b7e2c8; border-radius: 999px; }
.foot-note { color: var(--text-faint); }
.foot-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; }
.foot-chip .icon { width: 14px; height: 14px; color: var(--primary); }
a.foot-chip:hover { border-color: var(--primary); color: var(--primary); }

.sidebar-scrim { display: none; }

/* Collapsed (desktop): a 72px icon rail; names show as tooltips (title). */
.sidebar, .app-body { transition: width 0.18s ease, margin-left 0.18s ease; }
.topbar-menu { display: inline-flex; }

.sidebar-collapsed { --sidebar-w: 72px; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .nav-group span { display: none; }
.sidebar-collapsed .sidebar-nav { padding: 14px 10px; }
.sidebar-collapsed .nav-group { height: 1px; margin: 14px 8px; background: rgba(255, 255, 255, 0.1); }
.sidebar-collapsed .nav-link { justify-content: center; padding: 11px 0; }
.sidebar-collapsed .nav-link.is-active { box-shadow: inset 0 -3px 0 var(--primary); }
.sidebar-collapsed .sidebar-foot { padding: 12px 10px; }

/* ------------------------------------------------------------- Page parts */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-title { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }

.page-sub { margin: 4px 0 0; color: var(--text-muted); }

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.crumb a { color: var(--text-muted); text-decoration: none; }
.crumb a:hover { color: var(--primary); }
.crumb .icon { width: 13px; height: 13px; }

.section-title {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

.stat-value { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

.stat-of { font-size: 14px; font-weight: 500; color: var(--text-muted); }

.stat-note { font-size: 12px; color: var(--text-faint); }

/* Small cards, as many to a row as fit: the list of reports keeps growing. */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }

.report-group-title { margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-faint); }
.report-group-title:first-of-type { margin-top: 0; }

.report-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.report-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }

.report-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
}

.report-card-icon .icon { width: 18px; height: 18px; }

.report-card-body { display: flex; flex-direction: column; min-width: 0; }

.report-card-title { font-size: 14.5px; font-weight: 700; }

.report-card-summary { font-size: 12.5px; line-height: 1.35; color: var(--text-muted); }

.report-card-go { margin-left: auto; color: var(--text-faint); }

.report-card.is-pending .report-card-icon { color: var(--text-muted); background: var(--canvas); }

.badge {
  margin-left: auto;
  flex: none;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.empty { padding: 56px 24px; text-align: center; }

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 14px;
}

.empty-icon .icon { width: 26px; height: 26px; }

.empty h2 { margin: 0 0 6px; font-size: 18px; }

.empty p { max-width: 460px; margin: 0 auto; color: var(--text-muted); }

/* ------------------------------------------------------ Shared extras */

.muted { color: var(--text-faint); }
.muted-text { color: var(--text-muted); margin: 0 0 16px; }
.hint { margin: 4px 0 16px; font-size: 13px; color: var(--text-muted); }

.btn-danger { color: var(--danger); background: var(--surface); border-color: #f1b8b2; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { color: var(--text-muted); background: transparent; padding: 8px 10px; }
.btn-ghost:hover { color: var(--text); background: var(--canvas); }

.alert-success { color: var(--success); background: var(--success-soft); border: 1px solid #b7e2c8; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.pill-success { color: var(--success); background: var(--success-soft); border-color: #b7e2c8; }

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
}

.panel-title .icon { color: var(--primary); }

/* -------------------------------------------------------------- Reports */

.alert-warn { color: var(--warning); background: var(--warning-soft); border: 1px solid #f3d9a8; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.date-nav { display: flex; align-items: center; gap: 6px; }
.date-input { width: auto; margin: 0; padding: 9px 10px; }
.btn-icon { padding: 9px 13px; font-size: 18px; line-height: 1; }

.seg {
  display: inline-flex;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.seg-item { position: relative; display: inline-flex; cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span, a.seg-item {
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}
.seg-item:hover span { color: var(--text); background: var(--canvas); }
.seg-item input:checked + span, a.seg-item.is-active { color: #fff; background: var(--navy-800); }
.seg-item input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Report generation form (desktop-first) */
.gen-form { max-width: 1100px; }
/* One compact card: the dates on one row, the options on the next (each with its note), then Generate. */
.gen-card { margin-bottom: 16px; }
.gen-body { padding: 18px 20px; }
.gen-grid { display: flex; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; }
.gen-field { display: flex; flex-direction: column; gap: 6px; width: 170px; }
.gen-field .form-input { margin: 0; height: 40px; }
.gen-option { margin: 0; padding: 0; border: 0; min-width: 0; }
.gen-option legend { margin-bottom: 6px; padding: 0; }
.gen-grid--options { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.gen-note { margin: 8px 0 0; font-size: 12.5px; }
.gen-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.gen-actions .hint { margin: 0; }
/* Balancing: Product + Proceed, then the head and dates (and Generate) in the next row. */
.gen-field--wide { width: 220px; }
.gen-step.gen-grid { gap: 16px 18px; }
.gen-step .gen-field:not(.gen-field--wide):not(.gen-field--agent) { width: 150px; }
.gen-field--agent { width: 260px; }
/* Pigmy, RD: head + agent on one row, the dates, tick and Generate on the next. */
.gen-break { flex-basis: 100%; height: 0; }
/* A drop-down in a 40px field: the input padding would clip its text. */
.gen-field select.form-input { padding-top: 0; padding-bottom: 0; line-height: 38px; }
.gen-step { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
p.gen-step { display: flex; align-items: center; gap: 10px; }
p.gen-step .badge { margin-left: 0; }

.stat-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-accent { border-color: #c8d6f5; background: linear-gradient(180deg, #f7f9ff, var(--surface)); }

.muted-text-sm { font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------------ Customers */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-bar > .icon { color: var(--text-faint); }

.search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 8px 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.result-note { margin: 0 0 10px; font-size: 13px; color: var(--text-muted); }

.table-wrap { overflow-x: auto; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.data-table th {
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--text-muted);
  background: #f8f9fc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; width: 1%; white-space: nowrap; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #f6f8ff; }
.cell-title { font-weight: 600; color: var(--text); text-decoration: none; }
.cell-title:hover { color: var(--primary); }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 18px; }
.pager-info { font-size: 13px; color: var(--text-muted); }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }

.facts { margin: 0; padding: 4px 20px 12px; }
.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-size: 13px; color: var(--text-muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.facts-compact { padding: 0; margin: 4px 0 16px; }
.facts-compact > div { padding: 7px 0; grid-template-columns: 110px minmax(0, 1fr); font-size: 14px; }

.link-panel { padding-bottom: 20px; }
.link-panel > :not(.panel-title) { margin-left: 20px; margin-right: 20px; }
.link-panel > .panel-title { margin-bottom: 16px; }

.copy-field { display: flex; gap: 8px; margin: 6px 20px 12px; }
.copy-field .form-input { margin: 0; min-width: 0; font-size: 13px; }
.pin-field { letter-spacing: 0.3em; font-size: 16px !important; }

.link-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.empty-compact { padding: 32px 24px; }

/* ----------------------------------------------------- Customer pages */

.cust { min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); }

.cust-bar { color: #fff; background: linear-gradient(160deg, var(--navy-900), var(--navy-800)); }

.cust-bar-inner { display: flex; align-items: center; gap: 12px; max-width: 880px; margin: 0 auto; padding: 14px 16px; }

.cust-bank { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cust-bank-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-branch { font-size: 12px; color: var(--navy-300); }

.cust-logout { margin-left: auto; }
.cust-logout .btn-ghost { color: var(--navy-200); }
.cust-logout .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.cust-main { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 28px 16px; }
.cust-main > .panel { margin-bottom: 16px; }

.cust-pin-card { max-width: 400px; margin: 24px auto; text-align: center; }
.cust-pin-card .form { text-align: left; }

.cust-hello { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }

.cust-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  flex: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 50%;
}

.cust-note { font-size: 13px; color: var(--text-muted); text-align: center; }

.cust-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 16px 24px;
  font-size: 12px;
  color: var(--text-faint);
}

.cust-foot .icon { width: 14px; height: 14px; }

/* ------------------------------------------------------------- Responsive */

@media (max-width: 960px) {
  .stat-row { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }
  .stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .hide-sm { display: none; }
  .data-table th, .data-table td { padding: 10px 12px; }
  .facts > div { grid-template-columns: 1fr; gap: 2px; }
  /* The customer list's ID, name, mobile and link fit a phone without scrolling. */
  .data-table { font-size: 13px; }
  .data-table th, .data-table td { padding: 9px 7px; }
  .data-table th { font-size: 11px; letter-spacing: 0.02em; }
  .copy-field { flex-wrap: wrap; }
  .copy-field .form-input { flex-basis: 100%; }
  .search-bar { flex-wrap: wrap; padding: 8px; }
  .search-bar > .icon { display: none; }
  .search-input { flex-basis: 100%; padding: 8px; }
  .cust-logout span { display: none; }
}

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(8, 19, 42, 0.45); }
  .app-body { margin-left: 0; }
  .topbar { padding: 0 16px; }
  .topbar-menu { display: inline-flex; }
  /* On phones the sidebar is a full-width drawer; the desktop collapse does not apply. */
  .sidebar-collapsed { --sidebar-w: 256px; }
  .sidebar-collapsed .sidebar-brand { justify-content: flex-start; padding: 0 20px; }
  .sidebar-collapsed .brand-text, .sidebar-collapsed .nav-link span, .sidebar-collapsed .nav-group span { display: inline; }
  .sidebar-collapsed .nav-group { height: auto; margin: 18px 10px 6px; background: none; }
  .sidebar-collapsed .nav-link { justify-content: flex-start; padding: 9px 10px; }
  .content { padding: 20px 16px; }
  .app-footer { margin: 0 16px; padding: 12px 0 20px; }
}

@media (max-width: 520px) {
  .sync-chip span { display: none; }
  .sync-chip { padding: 8px; }
  .page-title { font-size: 22px; }
  .auth-card { padding: 26px 20px; }
}

@media print {
  .sidebar, .sidebar-scrim, .topbar, .page-actions, .app-footer, .toolbar, .crumb, .hide-sm { display: none !important; }
  .panel { box-shadow: none; border: 0; }
  .app-body { margin: 0; }
  body { background: #fff; }
  .content { padding: 0; max-width: none; }
}

/* Change password */
.password-panel { max-width: 440px; padding: 22px 24px; }
.password-panel .alert { margin-bottom: 14px; }
.password-panel .form-input + .form-label { margin-top: 6px; }
.password-panel .btn { align-self: flex-start; }

.copy-inline { display: inline-flex; align-items: center; gap: 4px; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 6px; }
.btn-xs .icon { width: 14px; height: 14px; }
.pill-danger { color: var(--danger); background: var(--danger-soft); border-color: #f1b8b2; }
.link-button { width: 100%; padding: 0; border: 0; background: none; font: inherit; cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Customer profile + passbook (Report Desk layout, corporate theme) ----- */
.cust-main, .cust-bar-inner { max-width: 1120px; }
.cp-nil { color: var(--text-faint); }
.cp-muted { color: var(--text-muted); }
.cp-cr { color: var(--success); }
.cp-dr { color: var(--danger); }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }

.cp-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; line-height: 1.6; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; white-space: nowrap; }
.cp-pill .icon { width: 12px; height: 12px; }
.cp-pill.is-id { color: #fff; background: var(--navy-800); border-color: var(--navy-800); }
.cp-pill.is-open { color: var(--success); background: var(--success-soft); border-color: #b7e2c8; }
.cp-pill.is-warn { color: var(--warning); background: var(--warning-soft); border-color: #f3d9a8; }
.cp-pill.is-info { color: var(--primary); background: var(--primary-soft); border-color: #c7d7fb; }

/* Header: bar, who, facts strip */
.cp-hero { overflow: hidden; margin-bottom: 16px; }
.cp-hero-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px; font-size: 12.5px; font-weight: 600; color: #fff; background: linear-gradient(120deg, var(--navy-900), var(--navy-700)); }
.cp-hero-bar .icon { width: 14px; height: 14px; vertical-align: -2px; }
.cp-hero-main { display: flex; align-items: center; gap: 16px; padding: 18px 16px; }
.cp-avatar { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; font-size: 26px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border: 1px solid #c7d7fb; border-radius: var(--radius); }
.cp-who { min-width: 0; }
.cp-name { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.01em; text-transform: uppercase; overflow-wrap: anywhere; }
.cp-kn { margin-top: 2px; font-size: 15px; color: var(--text-muted); }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--border); background: #fafbfd; }
.cp-facts > div { padding: 10px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.cp-facts dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.cp-facts dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 760px) {
  .cp-facts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cp-facts > div { border-bottom: 0; }
  .cp-facts > div:last-child { border-right: 0; }
}

/* Tiles */
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 14px; }
.cp-tile { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.cp-tile:hover { box-shadow: var(--shadow); }
.cp-tile.is-share { border-left-color: var(--navy-800); }
.cp-tile.is-deposit { border-left-color: var(--success); }
.cp-tile-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; color: var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); }
.cp-tile.is-deposit .cp-tile-icon { color: var(--success); background: var(--success-soft); }
.cp-tile.is-loan { border-left-color: var(--warning); }
.cp-tile.is-loan .cp-tile-icon { color: var(--warning); background: var(--warning-soft); }
.cp-tile-icon .icon { width: 20px; height: 20px; }
.cp-tile-body { display: flex; flex-direction: column; min-width: 0; }
.cp-tile-body > span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.cp-tile-body strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.cp-tile-body small { font-size: 12px; color: var(--text-muted); }

/* Section tabs */
.cp-nav { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; margin-bottom: 14px; padding: 6px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); scrollbar-width: none; }
.cp-nav a { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; padding: 7px 12px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; border-radius: var(--radius-sm); }
.cp-nav a:hover { background: var(--canvas); }
.cp-nav .icon { width: 15px; height: 15px; color: var(--primary); }
.cp-count { padding: 0 7px; font-size: 11px; line-height: 18px; color: var(--text-muted); background: var(--canvas); border-radius: 999px; }

/* Sections */
.cp-section { margin-bottom: 16px; padding: 14px 16px 16px; scroll-margin-top: 70px; }
.cp-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 16px; font-weight: 700; }
.cp-title .icon { width: 18px; height: 18px; color: var(--primary); }
.cp-title-note { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.cp-title-sum { margin-left: auto; font-variant-numeric: tabular-nums; }
.cp-sub { display: flex; justify-content: space-between; align-items: center; margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.cp-sub span { display: inline-flex; align-items: center; gap: 6px; }
.cp-sub .icon { width: 15px; height: 15px; }
.cp-sub--gap { margin-top: 16px; }
.cp-none { margin: 0; padding: 16px; font-size: 14px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }

/* Tables: navy header; stacked label/value rows on phones */
.cp-table-wrap { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cp-table th { padding: 9px 10px; text-align: left; font-size: 12px; font-weight: 700; color: #fff; background: var(--navy-800); white-space: nowrap; }
.cp-table td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.cp-table tbody tr:hover td { background: #f6f8ff; }
.cp-table .num { text-align: right; }
.cp-act .btn { white-space: nowrap; }
.cp-none-cell { padding: 18px !important; text-align: center; color: var(--text-muted); }
@media (max-width: 759px) {
  .cp-table, .cp-table tbody, .cp-table tfoot { display: block; }
  .cp-table thead { display: none; }
  .cp-table tbody tr, .cp-table tfoot tr { display: block; padding: 8px 12px; border-top: 1px solid var(--border); }
  .cp-table tbody tr:first-child { border-top: 0; }
  .cp-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .cp-table td::before { content: attr(data-label); flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: left; }
  .cp-table td:empty { display: none; }
  .cp-table td.cp-act { justify-content: flex-end; padding-top: 6px; }
}

/* Personal details groups */
.cp-groups { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .cp-groups { grid-template-columns: 1fr 1fr; } }
.cp-group { padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.cp-group h3 { margin: 0 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.cp-group dl { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.cp-group dt { color: var(--text-muted); }
.cp-group dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.acct-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; font-size: 14px; font-weight: 600; text-decoration: none; }
.acct-back .icon { width: 14px; height: 14px; transform: rotate(180deg); }
.acct-staff { margin-top: 4px; }

/* Passbook */
.pb-head { padding: 14px 16px 4px; }
.pb-head .cp-name { font-size: 18px; }
.pb-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 16px 16px; }
@media (min-width: 760px) { .pb-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pb-strip > div { padding: 10px 12px; background: #fafbfd; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pb-strip span { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.pb-strip strong { display: block; margin-top: 2px; font-size: 17px; font-variant-numeric: tabular-nums; }
.pb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.pb-toolbar .cp-title { margin: 0 auto 0 0; }
.pb-search { width: 240px; max-width: 100%; height: 36px; margin: 0; font-size: 13px; }
.cp-mode { display: inline-block; padding: 1px 8px; font-size: 11.5px; font-weight: 700; border-radius: 999px; }
.cp-mode.is-cash { color: var(--success); background: var(--success-soft); }
.cp-mode.is-cheque { color: var(--warning); background: var(--warning-soft); }
.cp-mode.is-transfer { color: #6d28d9; background: #f1ebff; }
.pb-table tr.pb-year td { padding: 6px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--navy-700); background: var(--primary-soft); }
.pb-table tr.pb-bf td { font-style: italic; color: var(--text-muted); background: #fafbfd; }
.pb-table tfoot td { padding: 10px; font-weight: 700; background: var(--canvas); border-top: 2px solid var(--border-strong); }
.pb-nomatch { margin: 10px; }
/* Phones: date, particulars and mode / credit, debit, balance */
@media (max-width: 759px) {
  .pb-toolbar .cp-title { width: 100%; }
  .pb-search { width: 100%; }
  .pb-table tr.pb-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 8px; }
  .pb-table tr.pb-row td { display: block; padding: 0; text-align: left; }
  .pb-table tr.pb-row td::before { content: none; }
  .pb-table .pb-n { display: none !important; }
  .pb-table .pb-date { grid-column: 1; grid-row: 1; font-size: 12.5px; color: var(--text-muted); }
  .pb-table .pb-what { grid-column: 2; grid-row: 1; font-weight: 600; }
  .pb-table tr.pb-row td.pb-mode { grid-column: 3; grid-row: 1; text-align: right; }
  .pb-table tr.pb-row td.pb-cr, .pb-table tr.pb-row td.pb-dr, .pb-table tr.pb-row td.pb-bal { grid-row: 2; margin-top: 3px; text-align: right; }
  .pb-table .pb-cr { grid-column: 1; }
  .pb-table .pb-dr { grid-column: 2; }
  .pb-table .pb-bal { grid-column: 3; }
  .pb-table .pb-cr:not(:empty)::before, .pb-table .pb-dr:not(:empty)::before, .pb-table .pb-bal::before { display: inline; margin-right: 4px; font-size: 11px; font-weight: 600; color: var(--text-muted); }
  .pb-table .pb-cr:not(:empty)::before { content: "Cr"; }
  .pb-table .pb-dr:not(:empty)::before { content: "Dr"; }
  .pb-table .pb-bal::before { content: "Bal"; }
  .pb-table tr.pb-row td:empty { display: block; }
  .pb-table tr.pb-year td { display: block; text-align: left; }
  .pb-table tr.pb-bf { display: flex; align-items: baseline; gap: 10px; }
  .pb-table tr.pb-bf td { display: block; padding: 0; text-align: left; }
  .pb-table tr.pb-bf td:empty { display: none; }
  .pb-table tr.pb-bf td::before { content: none; }
  .pb-table tr.pb-bf td.num { margin-left: auto; }
  .pb-table tfoot td { display: flex; padding: 3px 0; background: none; border: 0; }
  .pb-table tfoot td:first-child::before { content: none; }
  .pb-table tfoot tr { background: var(--canvas); border-top: 2px solid var(--border-strong); }
}
