:root {
  color-scheme: light;

  /* Brand palette */
  --navy: #0b2545;
  --navy-ink: #ffffff;
  --slate: #1b4965;
  --slate-ink: #ffffff;
  --sky: #5fa8d3;
  /* Sky at text size fails WCAG contrast on white/off-white, so hyperlinks
     use this deepened variant; raw --sky is reserved for large fills
     (active pills, focus glow, chart accents) where the ratio isn't an issue. */
  --sky-text: #2c6d95;
  --gold: #c9942b;
  --gold-text: #a97918;
  --success: #2e7d53;
  --due: #b3423b;

  /* Surfaces */
  --page-plane: #f7f5f1;
  --surface-1: #ffffff;
  --surface-sunken: #f1ede4;

  /* Text */
  --text-primary: #0f2540;
  --text-secondary: #3d5871;
  --text-muted: #74889a;

  /* Lines */
  --border-hairline: rgba(11, 37, 69, 0.13);
  --gridline: #e6e1d4;

  /* Legacy aliases kept so existing component rules stay in sync */
  --accent: var(--sky-text);
  --accent-ink: #ffffff;
  --status-good: var(--success);
  --status-warning: var(--gold-text);
  --status-critical: var(--due);
  --danger: var(--due);

  /* Type */
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Elevation */
  --shadow-card: 0 1px 2px rgba(11, 37, 69, 0.06), 0 6px 16px rgba(11, 37, 69, 0.05);
  --shadow-topbar: 0 2px 10px rgba(11, 37, 69, 0.16);
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
}

main {
  max-width: 840px;
  padding: 2rem 1.5rem 4rem;
  /* Bug fix 2026-08-08: no auto margins meant main sat flush at the
     viewport's left edge on every public page wider than 840/1180px
     instead of centering -- the root cause of the visitor-site
     "content not centered" report. Scoped to these two bare rules only;
     the .sidebar ~ main override below intentionally stays left-offset. */
  margin-left: auto;
  margin-right: auto;
}

main.main--wide {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

/* Offset content past the fixed sidebar. Scoped to ".sidebar ~ main" (not a
   bare "main" rule) so pages that render without a sidebar — login, the
   printable receipt — are unaffected. */
.sidebar ~ main {
  margin-left: 230px;
  transition: margin-left 0.15s ease;
}

a {
  color: var(--sky-text);
  text-decoration-color: color-mix(in srgb, var(--sky-text) 40%, transparent);
}

a:hover {
  color: var(--navy);
}

.muted {
  color: var(--text-secondary);
}

/* Visible keyboard focus everywhere. Components on dark surfaces (sidebar)
   override the color further down so the ring stays visible on navy. */
:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Financial figures, IDs and dates read as a ledger, not prose. */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* Sidebar navigation */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 230px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-topbar);
  z-index: 40;
}

.sidebar__brand-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.sidebar__brand-text {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
}

.sidebar__brand-mark {
  display: none;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-family: var(--font-mono);
}

.sidebar__close {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}

.sidebar__nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.25rem 0.6rem 1rem;
}

.sidebar__link,
.sidebar__group-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.65rem;
  margin: 1px 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  border-radius: 7px;
  text-align: left;
}

.sidebar__link:hover,
.sidebar__group-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar__link.is-active {
  color: #ffffff;
  background: rgba(95, 168, 211, 0.25);
  box-shadow: inset 3px 0 0 var(--sky);
}

.sidebar__group.is-open > .sidebar__group-toggle {
  color: #ffffff;
}

.sidebar__icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.sidebar__label {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__chevron {
  flex: 0 0 auto;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.4);
  transition: transform 0.15s ease;
}

.sidebar__group.is-open > .sidebar__group-toggle .sidebar__chevron {
  transform: rotate(90deg);
  color: var(--sky);
}

.sidebar__submenu {
  display: none;
  flex-direction: column;
  padding-left: 0.2rem;
}

.sidebar__group.is-open .sidebar__submenu {
  display: flex;
}

.sidebar__submenu a {
  display: block;
  padding: 0.45rem 0.6rem 0.45rem 2.55rem;
  margin: 1px 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  border-radius: 6px;
}

.sidebar__submenu a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.sidebar__submenu a.is-active {
  color: #ffffff;
  font-weight: 600;
  background: rgba(95, 168, 211, 0.22);
  box-shadow: inset 3px 0 0 var(--sky);
}

.sidebar__user {
  flex: 0 0 auto;
  padding: 0.9rem 1.1rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.sidebar__username {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.sidebar__user .btn-secondary {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.sidebar__user .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #ffffff;
}

.btn-block {
  width: 100%;
}

.sidebar :focus-visible,
.mobile-topbar :focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 1px;
  box-shadow: 0 0 0 5px rgba(95, 168, 211, 0.4);
}

/* Mobile top strip + drawer trigger. Hidden on desktop/tablet, where the
   sidebar itself is always on screen (full or icon-only). */
.mobile-topbar {
  display: none;
}

.sidebar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.sidebar-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.45);
  z-index: 30;
}

/* Card */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h1,
.card h2 {
  margin-top: 0;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  background: var(--navy);
  background-image: linear-gradient(160deg, var(--navy) 0%, var(--slate) 100%);
}

.auth-card {
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 50px rgba(11, 37, 69, 0.35);
}

.auth-card h1 {
  color: var(--navy);
  font-size: 1.6rem;
}

/* Forms */
.stacked-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1rem 0 0.35rem;
}

.stacked-form label:first-of-type {
  margin-top: 0;
}

.stacked-form input[type="text"],
.stacked-form input[type="email"],
.stacked-form input[type="password"],
.stacked-form input[type="tel"],
.stacked-form input[type="number"],
.stacked-form input[type="date"],
.stacked-form textarea,
.stacked-form select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--page-plane);
  border: 1px solid var(--gridline);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stacked-form input:focus,
.stacked-form select:focus,
.stacked-form textarea:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.28);
}

.stacked-form input:disabled {
  color: var(--text-muted);
  background: var(--surface-sunken);
  font-family: var(--font-mono);
}

.stacked-form textarea {
  resize: vertical;
  min-height: 5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  margin-top: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--navy);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--slate);
}

.btn-secondary {
  background: transparent;
  border-color: var(--gridline);
  color: var(--navy);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--navy) 6%, transparent);
  border-color: var(--navy);
}

.btn-danger {
  background: var(--due);
  color: #ffffff;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--due) 85%, black);
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: color-mix(in srgb, var(--success) 85%, black);
}

/* "Blue" per the Wasooli reference (New Amount / Recharge / More) — Sky,
   the app's link/active-state color, used here as a solid button fill. */
.btn-info {
  background: var(--sky);
  color: var(--navy);
}

.btn-info:hover {
  background: color-mix(in srgb, var(--sky) 80%, var(--navy));
  color: #ffffff;
}

.btn-icon {
  margin-right: 0.35rem;
}

/* Per-row action dropdown (Users screen) */
.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu__toggle {
  white-space: nowrap;
}

/* position:fixed (set via JS on open, using the toggle button's
   getBoundingClientRect) rather than position:absolute, so the panel isn't
   clipped by .table-scroll's overflow-x — the same clipping bug the sidebar
   flyout hit at the tablet breakpoint. */
.action-menu__list {
  display: none;
  position: fixed;
  min-width: 190px;
  padding: 0.4rem;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(11, 37, 69, 0.22);
  z-index: 50;
}

.action-menu__list.is-open {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.action-menu__list form {
  margin: 0;
}

.action-menu__item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: none;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.action-menu__item:hover {
  background: color-mix(in srgb, var(--sky) 14%, transparent);
}

.action-menu__item--danger {
  color: var(--due);
}

.action-menu__item--danger:hover {
  background: color-mix(in srgb, var(--due) 10%, transparent);
}

/* Modals (Edit / Detailed / Remarks) */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.45);
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem;
  overflow-y: auto;
  z-index: 60;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 720px;
  background: var(--surface-1);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(11, 37, 69, 0.35);
}

.modal--narrow {
  max-width: 460px;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--gridline);
}

.modal__header h2 {
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
}

.modal__close:hover {
  color: var(--navy);
}

.modal__body {
  padding: 1.4rem;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.4rem 1.4rem;
}

/* Groups the Edit modal's fields into the rows the field spec calls for —
   a flexible grid (not a fixed 2-column .form-row) since some rows hold up
   to five fields. */
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-form-grid label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

.modal-form-grid input,
.modal-form-grid select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--page-plane);
  border: 1px solid var(--gridline);
  border-radius: 8px;
}

.modal-form-grid input:disabled {
  color: var(--text-muted);
  background: var(--surface-sunken);
  font-family: var(--font-mono);
}

.modal-form-grid input:focus,
.modal-form-grid select:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.28);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem 1.5rem;
}

.detail-grid dt {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  margin: 0 0 0.15rem;
}

.detail-grid dd {
  margin: 0;
  font-size: 0.92rem;
}

/* Alerts */
.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.alert-error {
  background: color-mix(in srgb, var(--due) 10%, var(--surface-1));
  border-color: color-mix(in srgb, var(--due) 30%, transparent);
  color: var(--due);
}

.alert-success {
  background: color-mix(in srgb, var(--success) 10%, var(--surface-1));
  border-color: color-mix(in srgb, var(--success) 30%, transparent);
  color: var(--success);
}

/* Logo */
.logo-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.logo-preview {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px solid var(--gridline);
  background: var(--page-plane);
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-muted);
  overflow: hidden;
}

.logo-upload-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Meter */
.meter {
  --meter-color: var(--sky);
}

.meter--good {
  --meter-color: var(--success);
}

.meter--warning {
  --meter-color: var(--gold);
}

.meter--critical {
  --meter-color: var(--due);
}

.meter__track {
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--meter-color) 18%, var(--surface-1));
  overflow: hidden;
}

.meter__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--meter-color);
  transition: width 0.2s ease;
}

.meter__caption {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.meter__icon {
  font-size: 0.95rem;
}

/* Area nav */
.area-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.area-nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--gridline);
}

.area-nav a:hover {
  border-color: var(--sky);
  color: var(--navy);
}

.area-nav a.active {
  background: var(--sky);
  border-color: var(--sky);
  color: var(--navy);
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--gridline);
}

.data-table thead th {
  color: rgba(255, 255, 255, 0.82);
  background: var(--navy);
  font-weight: 600;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: none;
  position: sticky;
  top: 0;
}

.data-table thead tr:first-child th:first-child {
  border-top-left-radius: 6px;
}

.data-table thead tr:first-child th:last-child {
  border-top-right-radius: 6px;
}

.data-table tbody tr:nth-child(even) {
  background: var(--surface-sunken);
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--sky) 12%, transparent);
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}

.row-actions form {
  margin: 0;
  display: inline;
}

.link-danger {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--due);
  cursor: pointer;
  text-decoration: underline;
}

/* Same shape as .link-danger, for a POST-only row action that isn't
   destructive (e.g. Restore) so it doesn't read as a delete-style warning. */
.link-action {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--sky-text);
  cursor: pointer;
  text-decoration: underline;
}

/* Wide tables that may not fit narrow viewports scroll in their own box,
   never the page. */
.table-scroll {
  overflow-x: auto;
  border-radius: 8px;
}

/* Search */
.search-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-form input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--page-plane);
  border: 1px solid var(--gridline);
  border-radius: 8px;
}

.search-form input[type="text"]:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.28);
}

.search-form select,
.search-form input[type="date"] {
  padding: 0.5rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--page-plane);
  border: 1px solid var(--gridline);
  border-radius: 8px;
}

/* Group header row in a grouped report table (e.g. Package Wise List) */
.group-row td {
  background: color-mix(in srgb, var(--slate) 10%, var(--surface-1)) !important;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Status badge: color always paired with a label, never alone */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge--good {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, transparent);
}

.status-badge--critical {
  color: var(--due);
  background: color-mix(in srgb, var(--due) 12%, transparent);
}

.status-badge--neutral {
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
}

/* Partial bill status (item 4 fix, 2026-07-22) -- distinct from Unpaid's
   neutral treatment so a bill with some payment already collected toward
   it is visually distinguishable from one with none at a glance. */
.status-badge--warning {
  color: var(--gold-text);
  background: color-mix(in srgb, var(--gold) 15%, transparent);
}

/* Checkbox list (e.g. multi-select sublocalities) */
.checkbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.4rem 1rem;
  max-height: 260px;
  overflow-y: auto;
  padding: 0.75rem;
  margin-top: 0.35rem;
  border: 1px solid var(--gridline);
  border-radius: 8px;
  background: var(--page-plane);
}

.checkbox-list__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 400;
}

.data-table select {
  padding: 0.35rem 0.5rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--gridline);
  border-radius: 6px;
}

/* Stat tile (e.g. customer balance) */
.stat-tile {
  display: inline-flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--page-plane);
  border: 1px solid var(--gridline);
  border-top: 3px solid var(--gridline);
}

.stat-tile__label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat-tile__value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.stat-tile--critical {
  border-top-color: var(--due);
}
.stat-tile--critical .stat-tile__value {
  color: var(--due);
}

.stat-tile--good {
  border-top-color: var(--success);
}
.stat-tile--good .stat-tile__value {
  color: var(--success);
}

.stat-tile--neutral {
  border-top-color: var(--slate);
}
.stat-tile--neutral .stat-tile__value {
  color: var(--text-primary);
}

.stat-tile--warning {
  border-top-color: var(--gold);
}
.stat-tile--warning .stat-tile__value {
  color: var(--gold-text);
}

.customer-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}

.customer-card__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem 1.5rem;
  flex: 1;
  min-width: 240px;
}

.customer-card__field {
  font-size: 0.88rem;
}

.customer-card__field .label {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.summary-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Elements/regions marked .no-print are hidden when the page is printed
   (e.g. via a Print button's window.print()) — nav chrome, filter controls,
   action buttons never belong in a printout. */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Token chips (message template placeholders) */
.token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.token-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  background: color-mix(in srgb, var(--sky) 16%, var(--surface-1));
  color: var(--sky-text);
  border: 1px solid color-mix(in srgb, var(--sky) 35%, transparent);
}

code {
  font-family: var(--font-mono);
  background: var(--page-plane);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.receipt-preview {
  white-space: pre-wrap;
  padding: 0.9rem 1rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  border: 1px dashed var(--gridline);
  background: var(--page-plane);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Dashboard charts grid */
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dashboard-charts .card {
  margin-bottom: 0;
}

/* Tabs (dashboard "Overview" widget) */
.tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--gridline);
  padding-bottom: 0.75rem;
}

.tabs__button {
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--gridline);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
}

.tabs__button:hover {
  border-color: var(--sky);
  color: var(--navy);
}

.tabs__button.is-active {
  background: color-mix(in srgb, var(--sky) 20%, var(--surface-1));
  border-color: var(--sky);
  color: var(--navy);
}

.tabs__panel {
  display: none;
}

.tabs__panel.is-active {
  display: block;
}

/* Collections screen — find/select bar, bill action bar */
.collection-find-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.collection-find-bar .choices {
  flex: 1 1 320px;
  min-width: 240px;
  margin-bottom: 0;
}

.collection-find-bar.has-error .choices__inner {
  border-color: var(--due) !important;
  box-shadow: 0 0 0 3px rgba(179, 66, 59, 0.2);
}

.collection-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--surface-sunken);
  border: 1px solid var(--gridline);
  border-radius: var(--radius);
}

.collection-action-bar__amount {
  width: 160px;
  padding: 0.6rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface-1);
  border: 1px solid var(--gridline);
  border-radius: 8px;
}

.collection-action-bar__amount:focus {
  outline: none;
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.28);
}

.collection-action-bar__meta {
  margin-right: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.collection-action-bar__meta .mono {
  color: var(--text-primary);
  font-weight: 600;
}

/* Choices.js theme override — matches the app's Inter/navy/sky look instead
   of the library's default styling. Loaded via CDN (see note in
   collections.ejs): there's no existing select2/choices.js pattern
   elsewhere in this app to match, despite the reference implying one. */
.choices__inner {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  background: var(--page-plane) !important;
  border: 1px solid var(--gridline) !important;
  border-radius: 8px !important;
  min-height: unset !important;
  padding: 0.5rem 0.7rem !important;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: var(--sky) !important;
  box-shadow: 0 0 0 3px rgba(95, 168, 211, 0.28);
}

.choices__list--dropdown {
  border-color: var(--gridline) !important;
  border-radius: 8px !important;
  font-family: var(--font-ui);
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: color-mix(in srgb, var(--sky) 16%, var(--surface-1)) !important;
}

.choices__list--single .choices__item {
  color: var(--text-primary);
}

/* Responsive */

/* Tablet / small desktop: sidebar collapses to an icon-only rail. Labels and
   chevrons hide; an open group flies out beside its icon instead of pushing
   the list down, since there's no vertical room for indented text. */
@media (max-width: 1024px) and (min-width: 641px) {
  .sidebar {
    width: 64px;
  }

  .sidebar__label,
  .sidebar__chevron,
  .sidebar__brand-text {
    display: none;
  }

  .sidebar__brand-mark {
    display: flex;
  }

  .sidebar__brand-row {
    padding: 1.1rem 0.7rem;
    justify-content: center;
  }

  .sidebar__link,
  .sidebar__group-toggle {
    justify-content: center;
    padding: 0.6rem;
  }

  .sidebar__username {
    display: none;
  }

  .sidebar__user {
    align-items: center;
  }

  .sidebar__user .btn-block {
    width: 34px;
    height: 34px;
    padding: 0;
    font-size: 0;
    position: relative;
  }

  .sidebar__user .btn-block::after {
    content: "\21B2";
    font-size: 1rem;
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar__group {
    position: relative;
  }

  /* overflow-x:hidden on .sidebar__nav (set for the expanded desktop rail)
     would otherwise clip this flyout, since an absolutely positioned
     descendant is still clipped by an overflow-hidden ancestor even though
     it escapes normal flow. */
  .sidebar__nav {
    overflow: visible;
  }

  .sidebar__group.is-open .sidebar__submenu {
    display: flex;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 210px;
    padding: 0.4rem;
    background: var(--navy);
    border-radius: 0 10px 10px 0;
    box-shadow: 6px 0 20px rgba(11, 37, 69, 0.35);
  }

  .sidebar__submenu a {
    padding-left: 0.75rem;
  }

  .sidebar ~ main {
    margin-left: 64px;
  }
}

/* Mobile: sidebar becomes an off-canvas drawer opened from a slim top strip,
   preserving the page's existing narrow-viewport behavior underneath it. */
@media (max-width: 640px) {
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    padding: 0 1rem;
    background: var(--navy);
    box-shadow: var(--shadow-topbar);
    z-index: 20;
  }

  .sidebar-toggle {
    display: flex;
  }

  .mobile-topbar__brand {
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 1px;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar__close {
    display: inline-block;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar ~ main {
    margin-left: 0;
    padding-top: calc(52px + 1.25rem);
  }

  main {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
  }

  .card {
    padding: 1.1rem;
  }

  h1 {
    font-size: 1.3rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .stat-tile {
    flex: 1 1 45%;
    min-width: 140px;
    padding: 0.8rem 1rem;
  }

  .stat-tile__value {
    font-size: 1.4rem;
  }

  .data-table {
    font-size: 0.82rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.5rem 0.4rem;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }
}

/* Persistent impersonation banner (Phase B task 7) -- deliberately loud
   (gold, not the tenant navy/sky palette) so it's never mistaken for
   normal tenant chrome while a master admin is viewing as this tenant. */
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: #3a2a04;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

/* ---- Landing page hero + features ---- */
.hero {
  background: var(--navy);
  background-image: linear-gradient(160deg, var(--navy) 0%, var(--slate) 100%);
  color: #ffffff;
  padding: 3rem 1.5rem;
}
.hero__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero__content {
  flex: 1 1 360px;
  min-width: 280px;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  margin: 0 0 0.75rem;
}
.hero__title {
  font-size: 2.5rem;
  margin: 0 0 1rem;
  color: #ffffff;
}
.hero__tagline {
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.82);
  margin: 0 0 1.75rem;
  max-width: 480px;
}
.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn-ghost {
  background: transparent;
  border-color: rgba(255,255,255,0.45);
  color: #ffffff;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: #ffffff;
}
.hero__art {
  flex: 1 1 320px;
  min-width: 260px;
  display: flex;
  justify-content: center;
}
.hero__art svg {
  width: 100%;
  max-width: 380px;
  height: auto;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}
.feature-card {
  margin-bottom: 0;
}
.feature-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  color: var(--navy);
}
.feature-card__icon svg {
  width: 22px;
  height: 22px;
}
.feature-card h2 {
  font-size: 1.02rem;
}
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--surface-sunken);
}
.cta-banner h2 {
  margin: 0 0 0.35rem;
}
.cta-banner p {
  margin: 0;
}
@media (max-width: 640px) {
  .hero__inner { flex-direction: column; text-align: center; }
  .hero__actions { justify-content: center; }
  .hero__tagline { max-width: none; margin-left: auto; margin-right: auto; }
  .cta-banner { flex-direction: column; text-align: center; }
}

/* ---- Login logo mark ---- */
.auth-card__brand {
  text-align: center;
  margin-bottom: 0.25rem;
}
.brand-mark {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.6rem;
  display: block;
}
.auth-card__brand h1 {
  margin-bottom: 0;
}

/* ---- Login logo badge (matches mobile app drawer) ---- */
.brand-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  box-shadow: 0 6px 16px rgba(11,37,69,0.18);
}
.brand-badge svg {
  width: 40px;
  height: 40px;
}

/* ---- Public marketing nav ---- */
.public-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-hairline);
}
.public-nav__inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  gap: 1rem;
}
.public-nav__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--navy);
  text-decoration: none;
}
.public-nav__links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.public-nav__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.public-nav__link:hover {
  color: var(--sky-text);
}
.public-nav__link.is-active {
  color: var(--navy);
  font-weight: 700;
}
.public-nav__cta {
  padding: 0.5rem 1.1rem;
}
.public-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.public-nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--navy);
  display: block;
}
@media (max-width: 760px) {
  .public-nav__toggle { display: flex; }
  .public-nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-hairline);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 1.5rem 1.5rem;
    display: none;
  }
  .public-nav__links.is-open { display: flex; }
  .public-nav__cta { margin-top: 0.4rem; }
}

/* ---- Public page hero (Features / Pricing / About / Contact) ---- */
.page-hero {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  text-align: center;
  padding: 3rem 1.5rem 0;
}
.page-hero h1 {
  font-size: 2.1rem;
  margin: 0.4rem 0 0.75rem;
}
.hero-eyebrow {
  display: inline-block;
  color: var(--sky-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  margin: 0;
}

/* ---- Pricing cards ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.pricing-card {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2rem 1.75rem;
  display: flex;
  flex-direction: column;
}
.pricing-card--highlight {
  border-color: var(--sky);
  box-shadow: 0 6px 20px rgba(11,37,69,0.12);
  transform: translateY(-6px);
}
.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 1.75rem;
  background: var(--sky-text);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.pricing-card__name {
  margin: 0.25rem 0 0.5rem;
}
.pricing-card__price {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 1rem;
}
.pricing-card__price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}
.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex: 1;
}
.pricing-card__features li {
  padding-left: 1.4rem;
  position: relative;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.pricing-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.pricing-card__cta {
  text-align: center;
}

/* ---- Hero enhancements ---- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -100px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--sky) 0%, transparent 70%);
  opacity: 0.25;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.4;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; }
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero__headline {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.85rem;
  line-height: 1.4;
}
.hero__accent { color: var(--gold); }
.hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.hero__proof-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
}
.hero__proof-item::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}
.hero__art { position: relative; }
.hero__chip {
  position: absolute;
  background: var(--surface-1);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(11,37,69,0.25);
  z-index: 2;
}
.hero__chip--1 { top: 6%; left: -6%; }
.hero__chip--2 { bottom: 10%; right: -4%; }
@media (max-width: 900px) {
  .hero__chip { display: none; }
}

/* ---- Capability strip ---- */
.capability-strip {
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-hairline);
  padding: 1.5rem;
}
.capability-strip__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
}
.capability-strip__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
}
.capability-strip__item::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky-text);
  flex-shrink: 0;
}

/* ---- Section head (eyebrow + heading) ---- */
.section-head {
  max-width: 640px;
  margin: 0 auto 2rem;
  text-align: center;
}
.section-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.7rem;
}

/* ---- Feature card hover polish ---- */
.feature-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(11,37,69,0.12);
}
.feature-card__icon {
  background: color-mix(in srgb, var(--sky) 16%, var(--surface-1));
  color: var(--sky-text);
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 0.75rem;
}
.feature-card__icon svg { width: 22px; height: 22px; }

/* ---- CTA banner brand variant ---- */
.cta-banner--brand {
  background: linear-gradient(135deg, var(--navy) 0%, var(--slate) 100%);
  border: none;
}
.cta-banner--brand h2, .cta-banner--brand p { color: #ffffff; }
.cta-banner--brand p.muted { color: rgba(255,255,255,0.75); }

/* ---- Light-background ghost button (dark text variant) ---- */
.btn-ghost-dark {
  background: transparent;
  border-color: var(--border-hairline);
  color: var(--navy);
}
.btn-ghost-dark:hover {
  background: var(--surface-sunken);
  border-color: var(--navy);
}

/* ---- Public footer ---- */
.public-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  margin-top: 3rem;
}
.public-footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
}
.public-footer__brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.3rem;
  color: #ffffff;
  margin: 0 0 0.5rem;
}
.public-footer__tagline {
  font-size: 0.9rem;
  max-width: 320px;
  margin: 0;
}
.public-footer h3 {
  color: #ffffff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.9rem;
}
.public-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.public-footer a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
}
.public-footer a:hover { color: #ffffff; }
.public-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.82rem;
}
@media (max-width: 760px) {
  .public-footer__inner { grid-template-columns: 1fr; }
}


/* ==========================================================================
   Theme toggle + dark theme overrides.
   Scoped to the public marketing site via [data-theme] on <html>, set by
   an inline no-flash script in header.ejs (only on public paths) and
   flipped by the toggle button in public-nav.ejs. Everything else already
   reads CSS variables, so most components adapt automatically; the rules
   below only patch spots that use a fixed brand color instead of a
   variable (nav brand/active link, stat values, price text) plus a few
   visual flourishes to match the dark aesthetic.
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --page-plane: #0a1526;
  --surface-1: #101d33;
  --surface-sunken: #16233b;
  --text-primary: #eef3f9;
  --text-secondary: #b7c4d6;
  --text-muted: #7e8fa5;
  --border-hairline: rgba(255, 255, 255, 0.1);
  --gridline: rgba(255, 255, 255, 0.09);
  --sky-text: #7cc0ea;
}

[data-theme="dark"] .public-nav {
  background: rgba(10, 21, 38, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
}

[data-theme="dark"] .public-nav__brand,
[data-theme="dark"] .public-nav__link.is-active {
  color: #ffffff;
}

[data-theme="dark"] .public-nav__toggle span {
  background: #ffffff;
}

[data-theme="dark"] .stats-bar__value,
[data-theme="dark"] .pricing-card__price {
  color: #ffffff;
}

[data-theme="dark"] .feature-card__icon {
  background: linear-gradient(135deg, var(--sky) 0%, var(--slate) 100%);
  color: #ffffff;
}

[data-theme="dark"] .step__number {
  background: linear-gradient(135deg, var(--sky) 0%, var(--slate) 100%);
}

/* ---- Theme toggle button ---- */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
}
.theme-toggle:hover {
  color: var(--sky-text);
  border-color: var(--sky);
}
.theme-toggle__icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.theme-toggle__icon--moon { opacity: 0; transform: scale(0.6) rotate(-40deg); }
.theme-toggle__icon--sun { opacity: 1; transform: scale(1) rotate(0); }
[data-theme="dark"] .theme-toggle__icon--sun { opacity: 0; transform: scale(0.6) rotate(40deg); }
[data-theme="dark"] .theme-toggle__icon--moon { opacity: 1; transform: scale(1) rotate(0); color: var(--gold); }

/* ==========================================================================
   Landing page redesign round 2 -- bigger hero, proof pills, stats bar,
   how-it-works steps, layered mockup, scroll-reveal.
   ========================================================================== */

.section-eyebrow {
  color: var(--sky-text);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  margin: 0;
}

.hero__headline-main {
  display: block;
  font-size: clamp(2.1rem, 4.4vw, 3.1rem);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -0.015em;
  color: #ffffff;
  margin: 0 0 1.1rem;
}
.hero__headline-main .hero__accent {
  background: linear-gradient(100deg, var(--sky) 10%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.proof-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.proof-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 600;
}
.proof-pill__icon {
  width: 16px;
  height: 16px;
  color: var(--sky);
  flex-shrink: 0;
}

.hero__mock {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.hero__mock-back {
  position: absolute;
  top: 6%;
  right: 4%;
  width: 78%;
  transform: rotate(6deg);
  opacity: 0.55;
}
.hero__mock-front {
  position: relative;
  transform: rotate(-2deg);
}
.hero__mock-back svg,
.hero__mock-front svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 22px 40px rgba(2, 8, 20, 0.45));
}

@keyframes rabtFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.hero__chip {
  animation: rabtFloat 5s ease-in-out infinite;
}
.hero__chip--2 {
  animation-delay: 1.4s;
}

/* Stats bar -- floats over the hero/body boundary */
.stats-bar {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  max-width: 1180px;
  margin: -2.75rem auto 0;
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 1.5rem 1rem;
}
.stats-bar__item {
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-right: 1px solid var(--gridline);
}
.stats-bar__item:last-child { border-right: none; }
.stats-bar__value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}
.stats-bar__label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

@media (max-width: 760px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); margin-top: -1.5rem; }
  .stats-bar__item:nth-child(2) { border-right: none; }
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin: 2.5rem 0;
}
.step {
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 1.5rem;
}
.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--navy);
  color: #ffffff;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.step h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.step p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
}

/* Scroll reveal (see public-footer.ejs for the IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__chip { animation: none; }
}

/* ---- Fix: hero chips are a fixed floating label on the (always-dark)
   hero art, independent of the light/dark toggle -- they must not use
   --surface-1 (which flips dark) or they go dark-text-on-dark-bg. ---- */
.hero__chip {
  background: #ffffff;
  color: var(--navy);
}


/* ==========================================================================
   Light-theme visual polish round 2 -- gradient icon badges in both themes
   (not just dark), decorative background glows behind page-hero and the
   feature/steps sections, colorful pricing-card accent bar, subtle nav
   shadow. Appended last so these override the earlier plain-color versions
   of the same selectors (same specificity, source order wins).
   ========================================================================== */
.feature-card__icon {
  background: linear-gradient(135deg, var(--sky) 0%, var(--slate) 100%);
  color: #ffffff;
}
.step__number {
  background: linear-gradient(135deg, var(--sky) 0%, var(--slate) 100%);
}

.public-nav {
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.06);
}

.page-hero {
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  max-width: 140vw;
  height: 320px;
  background: radial-gradient(ellipse at center, var(--sky) 0%, transparent 70%);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.page-hero > * {
  position: relative;
  z-index: 1;
}

main.main--wide {
  position: relative;
}
main.main--wide::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: 90vw;
  height: 480px;
  background: radial-gradient(ellipse at center, var(--gold) 0%, transparent 72%);
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}
main.main--wide > * {
  position: relative;
  z-index: 1;
}

.pricing-card {
  overflow: hidden;
}
.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--sky) 0%, var(--gold) 100%);
}


/* Contact page redesign (2026-08-08): icon-badged boxes for Call/Email/Login,
   plus a Karachi map card. Reuses the same gradient-badge language as
   .feature-card__icon/.step__number elsewhere on the public site. */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.contact-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 8px 24px -18px rgba(11, 37, 69, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.contact-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -16px rgba(11, 37, 69, 0.4);
}

.contact-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--sky), var(--slate));
  margin-bottom: 1rem;
}

.contact-map-card h2 {
  margin-bottom: 0.4rem;
}

.contact-map-frame {
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-hairline);
  box-shadow: 0 8px 24px -18px rgba(11, 37, 69, 0.35);
}

.contact-map-frame iframe {
  width: 100%;
  height: 380px;
  border: 0;
  display: block;
}


/* Tenant login split layout (session 13) -- see login.ejs's own comment.
   Keeps the exact single-column mobile behavior below 900px; above that,
   adds a left brand panel so the page doesn't read as a narrow mobile card
   floating on a big blank desktop screen. */
.auth-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.auth-split__visual {
  flex: 1.1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  flex-direction: column;
  background: linear-gradient(160deg, var(--slate) 0%, var(--navy) 100%);
  color: #fff;
}

.auth-split__visual-inner {
  max-width: 400px;
  text-align: center;
  position: relative;
  z-index: 2;
}

.auth-split__visual-inner .brand-badge--lg {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
}

.auth-split__form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: linear-gradient(160deg, var(--slate) 0%, var(--navy) 100%);
}

.auth-split .auth-card {
  max-width: 380px;
  
}

/* Animated hub graphic, ported from master.css's master-login-page graphic
   so the tenant login page gets the same connectivity animation instead of
   static text (session 15, rabt.md). Scoped under .auth-split__visual so it
   never collides with master.css's own bare .hub-graphic rules on pages
   that load both stylesheets. */
.auth-split__visual .hub-graphic { width: 100%; max-width: 560px; position: relative; z-index: 2; }
.auth-split__visual .hub-graphic__label { fill: #ffffff; font-size: 13px; font-weight: 600; opacity: 0.85; }
.auth-split__visual .hub-graphic__orbit { animation: hubOrbitSpin 60s linear infinite; transform-origin: 250px 250px; }
.auth-split__visual .hub-graphic__line {
  stroke: #C9942B; stroke-width: 2; stroke-dasharray: 200; stroke-dashoffset: 200; opacity: 0;
  animation-name: hubDrawLine; animation-duration: 9s; animation-timing-function: linear; animation-iteration-count: infinite;
}
.auth-split__visual .hub-graphic__line:nth-of-type(1) { animation-delay: 0s; }
.auth-split__visual .hub-graphic__line:nth-of-type(2) { animation-delay: 0.9s; }
.auth-split__visual .hub-graphic__line:nth-of-type(3) { animation-delay: 1.8s; }
.auth-split__visual .hub-graphic__line:nth-of-type(4) { animation-delay: 2.7s; }
.auth-split__visual .hub-graphic__line:nth-of-type(5) { animation-delay: 3.6s; }
.auth-split__visual .hub-graphic__line:nth-of-type(6) { animation-delay: 4.5s; }
.auth-split__visual .hub-graphic__line:nth-of-type(7) { animation-delay: 5.4s; }
.auth-split__visual .hub-graphic__line:nth-of-type(8) { animation-delay: 6.3s; }
.auth-split__visual .hub-graphic__halo { transform-origin: 250px 250px; animation: hubHaloPulse 4.5s ease-in-out infinite; }
.auth-split__visual .hub-graphic__center { animation: hubCenterPulse 9s ease-in-out infinite; }
.auth-split__visual .hub-graphic__node {
  opacity: 0; transform-box: fill-box; transform-origin: center;
  animation-name: hubPopNode; animation-duration: 1s; animation-timing-function: ease-out; animation-iteration-count: 1; animation-fill-mode: forwards;
}
.auth-split__visual .hub-graphic__node--1 { animation-delay: 0.35s; }
.auth-split__visual .hub-graphic__node--2 { animation-delay: 1.25s; }
.auth-split__visual .hub-graphic__node--3 { animation-delay: 2.15s; }
.auth-split__visual .hub-graphic__node--4 { animation-delay: 3.05s; }
.auth-split__visual .hub-graphic__node--5 { animation-delay: 3.95s; }
.auth-split__visual .hub-graphic__node--6 { animation-delay: 4.85s; }
.auth-split__visual .hub-graphic__node--7 { animation-delay: 5.75s; }
.auth-split__visual .hub-graphic__node--8 { animation-delay: 6.65s; }
.auth-split__visual .hub-graphic__glow {
  position: absolute; top: 50%; left: 50%; width: 560px; height: 560px; transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201,148,43,0.22) 0%, rgba(201,148,43,0.08) 40%, transparent 70%);
  border-radius: 50%; animation: hubGlowPulse 5s ease-in-out infinite; z-index: 0; pointer-events: none;
}
.auth-split__visual .hub-graphic__particle {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #C9942B; opacity: 0.5; z-index: 1; pointer-events: none;
  animation: hubParticleFloat 6s ease-in-out infinite;
}
.auth-split__visual .hub-graphic__particle--1 { top: 8%; left: 12%; animation-delay: 0s; }
.auth-split__visual .hub-graphic__particle--2 { top: 18%; left: 82%; animation-delay: 1s; }
.auth-split__visual .hub-graphic__particle--3 { top: 45%; left: 6%; animation-delay: 2s; }
.auth-split__visual .hub-graphic__particle--4 { top: 78%; left: 90%; animation-delay: 0.5s; }
.auth-split__visual .hub-graphic__particle--5 { top: 88%; left: 18%; animation-delay: 1.5s; }
.auth-split__visual .hub-graphic__particle--6 { top: 55%; left: 94%; animation-delay: 2.5s; }
.auth-split__visual .hub-graphic__caption { color: #ffffff; opacity: 0.9; font-size: 0.95rem; text-align: center; max-width: 320px; margin: 1.25rem auto 0; position: relative; z-index: 2; }

@keyframes hubOrbitSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes hubDrawLine { 0% { stroke-dashoffset: 200; opacity: 0; } 3% { opacity: 1; } 9% { stroke-dashoffset: 0; opacity: 1; } 88% { stroke-dashoffset: 0; opacity: 1; } 96% { opacity: 0; } 100% { stroke-dashoffset: 200; opacity: 0; } }
@keyframes hubHaloPulse { 0%, 100% { r: 54; opacity: 0.5; } 50% { r: 68; opacity: 0.1; } }
@keyframes hubCenterPulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(201, 148, 43, 0)); } 50% { filter: drop-shadow(0 0 20px rgba(201, 148, 43, 0.9)); } }
@keyframes hubPopNode { 0% { opacity: 0; transform: scale(0.3); } 60% { opacity: 1; transform: scale(1.18); } 100% { opacity: 1; transform: scale(1); } }
@keyframes hubGlowPulse { 0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } }
@keyframes hubParticleFloat { 0%, 100% { transform: translateY(0) scale(1); opacity: 0.35; } 50% { transform: translateY(-16px) scale(1.4); opacity: 0.8; } }

@media (prefers-reduced-motion: reduce) {
  .auth-split__visual .hub-graphic__line, .auth-split__visual .hub-graphic__node, .auth-split__visual .hub-graphic__center { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

.auth-page--split {
  padding: 0;
  align-items: stretch;
  max-width: none;
  width: 100%;
  margin: 0;
}

@media (max-width: 900px) {
  .auth-split {
    flex-direction: column;
    min-height: auto;
  }

  .auth-split__visual {
    display: none;
  }

  .auth-split__form {
    padding: 2rem 1.5rem;
  }
}

/* Login-page image/message slider, left visual panel (task 14, rabt.md) --
   compact rotating slide deck above the hub graphic, cycled by
   public/js/auth-slider.js. Absolutely-positioned slides cross-fade via
   opacity so no layout shift happens on rotation. */
.auth-split__slider {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0 auto;
  z-index: 2;
}
.auth-split__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.auth-split__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.auth-split__slide-icon {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}
.auth-split__slide p {
  color: #ffffff;
  opacity: 0.92;
  font-size: 0.92rem;
  text-align: center;
  max-width: 270px;
  margin: 0;
}
.auth-split__slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.auth-split__slider-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s ease;
}
.auth-split__slider-dots span.is-active {
  background: #C9942B;
}
@media (prefers-reduced-motion: reduce) {
  .auth-split__slide { transition: none; }
}

/* Login page stage sequencing (task 98, rabt.md) -- the hub graphic
   animation plays first; after one loop, the panel cross-fades to the
   slider instead. Both live in the same box so switching is a plain
   opacity fade with no layout jump. Kept separate from the .is-active
   class the individual slides use, so the two concerns don't collide. */
.auth-split__stage {
  position: relative;
  width: 100%;
  min-height: 600px;
}
.auth-split__intro,
.auth-split__slider-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.auth-split__intro.is-stage-active,
.auth-split__slider-stage.is-stage-active {
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .auth-split__intro, .auth-split__slider-stage { transition: none; }
}

/* Slider slide media -- real uploaded photos take over automatically;
   until then (or if a file is missing/broken), each slide falls back
   to its built-in icon card. See rabt.md for the exact upload path. */
.auth-split__slide-media {
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  margin-bottom: 0.85rem;
}
.auth-split__slide-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-split__slide-photo.is-broken {
  display: none;
}
.auth-split__slide-media .auth-split__slide-icon {
  display: none;
  width: 88px;
  height: 88px;
}
.auth-split__slide-media.has-fallback .auth-split__slide-icon {
  display: block;
}
