:root {
  --uv-primary: #0d47a1;
  --uv-primary-light: #1565c0;
  --uv-accent: #00bcd4;
  --uv-success: #2e7d32;
  --uv-warning: #f57c00;
  --uv-danger: #c62828;
  --uv-sidebar-width: 260px;
  --uv-radius: 12px;
  --uv-shadow: 0 4px 24px rgba(13, 71, 161, 0.08);
  --uv-bg: #f4f7fb;
  --uv-card: #ffffff;
  --uv-text: #1a237e;
  --uv-text-muted: #5c6bc0;
  --uv-border: #e8eaf6;
}

[data-theme="dark"] {
  --uv-bg: #0f1419;
  --uv-card: #1a2332;
  --uv-text: #e3f2fd;
  --uv-text-muted: #90a4ae;
  --uv-border: #2d3a4f;
  --uv-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Transparent brand logos — no background box anywhere */
.brand-logo,
img.uv-sidebar-icon,
img.uv-sidebar-logo {
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  object-fit: contain;
}
img.auth-logo.brand-logo {
  object-fit: unset;
}

* { box-sizing: border-box; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--uv-bg);
  color: var(--uv-text);
  margin: 0;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

.uv-sidebar {
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--uv-sidebar-width);
  background: linear-gradient(180deg, var(--uv-primary) 0%, #0a2d6e 100%);
  color: #fff;
  z-index: 1000;
  overflow-y: auto;
  transition: transform 0.3s;
}
.uv-sidebar-brand {
  padding: 1.25rem 1.5rem;
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.uv-sidebar-brand small { display: block; font-size: 0.7rem; opacity: 0.7; font-weight: 400; }
.uv-sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.25rem;
}
.uv-sidebar-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.uv-sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.uv-sidebar-logo {
  max-width: 100%;
  height: auto;
  max-height: 52px;
  margin-bottom: 0.35rem;
  display: block;
}
.uv-nav { list-style: none; padding: 1rem 0; margin: 0; }
.uv-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: all 0.2s;
}
.uv-nav a:hover, .uv-nav a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.uv-nav-section {
  padding: 0.85rem 1.5rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  list-style: none;
}
.uv-nav li:first-child.uv-nav-section { padding-top: 0.25rem; }
.uv-main {
  margin-left: var(--uv-sidebar-width);
  min-height: 100vh;
  transition: margin 0.3s;
}
.uv-topbar {
  background: var(--uv-card);
  border-bottom: 1px solid var(--uv-border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--uv-shadow);
}
.uv-content { padding: 1.5rem; }

.uv-card {
  background: var(--uv-card);
  border-radius: var(--uv-radius);
  border: 1px solid var(--uv-border);
  box-shadow: var(--uv-shadow);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.uv-stat-card {
  background: var(--uv-card);
  border-radius: var(--uv-radius);
  padding: 1.25rem;
  border: 1px solid var(--uv-border);
  box-shadow: var(--uv-shadow);
  transition: transform 0.2s;
}
.uv-stat-card:hover { transform: translateY(-2px); }
.uv-stat-card .stat-value { font-size: 1.75rem; font-weight: 700; color: var(--uv-primary); }
.uv-stat-card .stat-label { color: var(--uv-text-muted); font-size: 0.875rem; }
.uv-stat-card .stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

.btn-uv-primary {
  background: linear-gradient(135deg, var(--uv-primary-light), var(--uv-primary));
  border: none; color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
}
.btn-uv-primary:hover { color: #fff; opacity: 0.9; }

.uv-table { width: 100%; }
.uv-table th {
  background: var(--uv-bg);
  color: var(--uv-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--uv-border);
}
.uv-table td { padding: 0.875rem 1rem; border-bottom: 1px solid var(--uv-border); vertical-align: middle; }

.badge-uv { padding: 0.35em 0.75em; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: #e8f5e9; color: var(--uv-success); }
.badge-expired { background: #ffebee; color: var(--uv-danger); }
.badge-trial { background: #fff3e0; color: var(--uv-warning); }
[data-theme="dark"] .badge-active { background: rgba(46,125,50,0.2); }
[data-theme="dark"] .badge-expired { background: rgba(198,40,40,0.2); }

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 50%, #00bcd4 100%);
}
.auth-logo-wrap {
  width: 100%;
  text-align: center;
}
.auth-logo-box {
  display: inline-block;
  line-height: 0;
  margin-bottom: 0.75rem;
}
.auth-logo {
  display: block;
  height: 64px;
  width: auto;
  max-width: 100%;
  margin: 0;
}
.auth-card {
  background: var(--uv-card);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.auth-card:has(.billing-portal),
.auth-card:has(.client-dashboard) {
  max-width: 920px;
}
.billing-portal .billing-status {
  border: 1px solid var(--uv-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--uv-bg);
}

.website-hero {
  background: linear-gradient(135deg, #0d47a1 0%, #1976d2 60%, #00acc1 100%);
  color: #fff;
  padding: 5rem 0;
}
.module-picker-card {
  border: 2px solid var(--uv-border);
  border-radius: var(--uv-radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.module-picker-card:hover {
  border-color: var(--uv-primary-light);
  transform: translateY(-4px);
  box-shadow: var(--uv-shadow);
}
.module-picker-card.is-locked {
  cursor: not-allowed;
  opacity: 0.85;
  background: #f8fafc;
  border-color: #fecaca;
  pointer-events: none;
}
.module-picker-card.is-locked:hover {
  transform: none;
  box-shadow: none;
  border-color: #fecaca;
}
.client-dashboard .billing-status {
  border: 1px solid var(--uv-border);
  border-radius: 8px;
  padding: 1rem;
  background: var(--uv-bg);
}

/* Invoice — A4 single page preview & print */
.invoice-print-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem 0.5rem;
  background: #cbd5e1;
  border-radius: 10px;
}
.invoice-print-area {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.invoice-a4-page {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 0 auto;
  padding: 10mm 12mm 8mm;
  box-sizing: border-box;
  background: #fff;
  color: #111827;
  font-size: 9pt;
  line-height: 1.35;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.18);
}

body.invoice-print-body {
  margin: 0;
  padding: 16px 0;
  background: #94a3b8;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
body.invoice-print-body .invoice-a4-page {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.25);
}

.invoice-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 2px solid var(--uv-primary);
  padding-bottom: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.invoice-doc-brand { flex: 1; min-width: 0; }
.invoice-doc-logo {
  display: block;
  height: 42px;
  width: auto;
  max-width: 220px;
  margin-bottom: 4px;
  object-fit: contain;
}
.invoice-doc-shop { margin: 0; color: var(--uv-primary); font-size: 13pt; font-weight: 700; line-height: 1.2; }
.invoice-doc-tag { margin: 2px 0 0; color: #64748b; font-size: 8pt; }
.invoice-doc-meta { text-align: right; flex-shrink: 0; min-width: 130px; }
.invoice-doc-no { font-size: 11pt; font-weight: 700; color: #0f172a; }
.invoice-doc-meta-line { font-size: 8pt; color: #64748b; margin-top: 2px; }
.invoice-doc-status {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eff6ff;
  color: var(--uv-primary);
}

.invoice-doc-main {
  display: block;
  max-height: 175mm;
  overflow: hidden;
}
.invoice-doc-main > * + * { margin-top: 8px; }

.invoice-doc-items-wrap {
  overflow: hidden;
}

.invoice-doc-amounts {
  position: absolute;
  left: 12mm;
  right: 12mm;
  bottom: 30mm;
  z-index: 2;
}

.invoice-doc-totals {
  width: 50%;
  max-width: 280px;
  margin-left: auto;
  margin-bottom: 6px;
  border-collapse: collapse;
  font-size: 8.5pt;
}
.invoice-doc-totals td {
  padding: 4px 8px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.invoice-doc-totals td:first-child { width: 58%; }
.invoice-doc-totals td:last-child { width: 42%; white-space: nowrap; }
.invoice-doc-totals .invoice-doc-total td {
  border-top: 2px solid #334155;
  border-bottom: 1px solid #334155;
  font-size: 9.5pt;
  font-weight: 700;
  padding-top: 6px;
  padding-bottom: 6px;
}
.invoice-doc-totals .invoice-doc-due td { color: #b91c1c; font-weight: 600; }

.invoice-doc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex-shrink: 0;
}
.invoice-doc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 7px 9px;
  min-height: 72px;
}
.invoice-doc-box-label {
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 3px;
}
.invoice-doc-box-name { font-size: 9.5pt; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.invoice-doc-box-line { font-size: 8pt; color: #334155; line-height: 1.35; }
.invoice-doc-gst { font-weight: 600; margin-top: 3px; }

.invoice-doc-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  flex-shrink: 0;
}
.invoice-doc-summary-3 { grid-template-columns: repeat(3, 1fr); }
.invoice-doc-pill {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: center;
}
.invoice-doc-pill span { font-size: 6.5pt; text-transform: uppercase; color: #64748b; letter-spacing: 0.04em; }
.invoice-doc-pill strong { font-size: 8pt; color: #0f172a; font-weight: 700; }
.invoice-doc-pill-due { background: #fef2f2; border-color: #fecaca; }
.invoice-doc-pill-due strong { color: #b91c1c; }

.invoice-doc-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 8pt;
  flex-shrink: 0;
}
.invoice-doc-table th,
.invoice-doc-table td {
  padding: 4px 5px;
  vertical-align: middle;
  border-bottom: 1px solid #e2e8f0;
  word-wrap: break-word;
}
.invoice-doc-table th {
  background: #eff6ff;
  font-size: 7.5pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #334155;
  border-bottom: 2px solid #bfdbfe;
}
.invoice-doc-table .col-num { width: 5%; text-align: center; }
.invoice-doc-table .col-item { width: 34%; }
.invoice-doc-table .col-sku { width: 10%; color: #64748b; font-size: 7.5pt; }
.invoice-doc-table .col-qty { width: 8%; }
.invoice-doc-table .col-unit { width: 8%; }
.invoice-doc-table .col-rate { width: 17%; }
.invoice-doc-table .col-amt { width: 18%; }
.invoice-doc-note-inline { font-size: 7.5pt; color: #64748b; }

/* Override bootstrap table inside invoice */
.invoice-a4-page .table {
  --bs-table-bg: transparent;
  --bs-table-color: inherit;
  margin-bottom: 0;
}
.invoice-a4-page .table > :not(caption) > * > * {
  padding: 4px 5px;
  box-shadow: none;
  border-color: #e2e8f0;
}

.invoice-doc-words {
  background: #eff6ff;
  border-left: 3px solid var(--uv-primary);
  padding: 5px 8px;
  border-radius: 0 4px 4px 0;
  font-size: 8pt;
  flex-shrink: 0;
}
.invoice-doc-notes,
.invoice-doc-terms {
  font-size: 7.5pt;
  color: #475569;
  flex-shrink: 0;
}
.invoice-doc-terms {
  border-top: 1px dashed #cbd5e1;
  padding-top: 6px;
}
.invoice-doc-terms p { margin: 2px 0 0; line-height: 1.35; }

.invoice-doc-footer {
  position: absolute;
  left: 12mm;
  right: 12mm;
  bottom: 8mm;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  z-index: 2;
}
.invoice-doc-footer-left { flex: 1; }
.invoice-doc-footer-left p { margin: 0; font-size: 7.5pt; color: #64748b; line-height: 1.4; }
.invoice-doc-powered { margin-top: 2px !important; }
.invoice-doc-footer-right { text-align: right; min-width: 160px; }
.invoice-doc-sign {
  border-top: 1px solid #334155;
  display: inline-block;
  min-width: 150px;
  padding-top: 3px;
  font-size: 7.5pt;
  color: #64748b;
  text-align: center;
}
.invoice-doc-sign-name { font-size: 8.5pt; font-weight: 700; margin-top: 28px; color: #0f172a; }

.invoice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Admin client profile */
.client-profile-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: var(--uv-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.client-profile-plan-box {
  background: #f8fafc;
  border: 1px solid var(--uv-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

/* Subscription billing banner (client modules) */
.uv-billing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid #ffc107;
  background: linear-gradient(90deg, #fff8e1 0%, #fff3cd 100%);
  color: #7c4a00;
}
.uv-billing-banner-urgent {
  border-color: #dc3545;
  background: linear-gradient(90deg, #fff5f5 0%, #fde8e8 100%);
  color: #991b1b;
}
.uv-billing-banner-text {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.uv-billing-banner-text i {
  flex-shrink: 0;
  margin-top: 0.15rem;
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .invoice-a4-page {
    width: 100%;
    min-height: auto;
    max-height: none;
    padding: 12px;
    font-size: 8.5pt;
  }
  .invoice-print-wrap { padding: 0; background: #e2e8f0; }
  .invoice-doc-parties { grid-template-columns: 1fr; }
  .invoice-doc-summary { grid-template-columns: repeat(2, 1fr); }
}
.quick-action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; }
.quick-action-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 1rem 0.75rem; border-radius: 12px; border: 1px solid var(--uv-border);
  background: var(--uv-card); text-decoration: none; color: var(--uv-text); transition: .15s;
  text-align: center; font-size: 0.9rem; font-weight: 600;
}
.quick-action-btn:hover { border-color: var(--uv-primary-light); color: var(--uv-primary); transform: translateY(-2px); }
.quick-action-btn i { font-size: 1.4rem; }
.workflow-steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.workflow-steps li {
  counter-increment: step; padding: 0.65rem 0 0.65rem 2.5rem; position: relative;
  border-bottom: 1px dashed var(--uv-border);
}
.workflow-steps li:last-child { border-bottom: none; }
.workflow-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0.55rem;
  width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--uv-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700;
}
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body.invoice-print-body {
    display: block !important;
    min-height: 0 !important;
  }
  body.invoice-print-body .invoice-a4-page {
    margin: 0 auto !important;
    box-shadow: none !important;
  }

  /* Module/admin page: hide chrome, show invoice only */
  body:not(.invoice-print-body) * {
    visibility: hidden;
  }
  body:not(.invoice-print-body) .invoice-a4-page,
  body:not(.invoice-print-body) .invoice-a4-page * {
    visibility: visible;
  }
  body:not(.invoice-print-body) .invoice-a4-page {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0 !important;
    box-shadow: none !important;
  }
  body:not(.invoice-print-body) .invoice-print-wrap {
    position: fixed;
    left: 0;
    top: 0;
    visibility: visible;
    background: none !important;
    padding: 0 !important;
  }
  body:not(.invoice-print-body) .invoice-print-area {
    visibility: visible;
  }

  .uv-sidebar,
  .uv-topbar,
  .invoice-actions,
  .no-print,
  details,
  .alert { display: none !important; }

  .invoice-a4-page {
    width: 210mm !important;
    height: 297mm !important;
    padding: 10mm 12mm 8mm !important;
    overflow: hidden !important;
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  .invoice-doc-main { max-height: 175mm !important; }
  .invoice-doc-amounts {
    position: absolute !important;
    left: 12mm !important;
    right: 12mm !important;
    bottom: 30mm !important;
  }
  .invoice-doc-footer {
    position: absolute !important;
    left: 12mm !important;
    right: 12mm !important;
    bottom: 8mm !important;
  }
  .invoice-doc-table thead { display: table-header-group; }
}

@media (max-width: 991px) {
  .uv-sidebar { transform: translateX(-100%); }
  .uv-sidebar.show { transform: translateX(0); }
  .uv-main { margin-left: 0; }
}

/* Software modules admin */
.software-module-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--uv-card);
  border: 1px solid var(--uv-border);
  border-radius: var(--uv-radius);
  padding: 1.1rem 1.2rem;
  color: var(--uv-text);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  height: 100%;
}
.software-module-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--uv-shadow);
  transform: translateY(-2px);
  color: var(--uv-text);
}
.software-module-card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.software-module-card-body { flex: 1; min-width: 0; }
.software-module-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  color: var(--uv-text-muted);
}
.software-module-card-arrow {
  color: var(--uv-primary);
  font-weight: 600;
}
.software-module-icon-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
}
.software-icon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .45rem;
}
.software-icon-grid-readonly { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.software-icon-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .55rem .35rem;
  border: 1px solid var(--uv-border);
  border-radius: 10px;
  background: #f8fafc;
  font-size: .72rem;
  color: var(--uv-text);
  text-align: center;
  cursor: pointer;
  transition: .12s;
}
.software-icon-pick i { font-size: 1.15rem; color: var(--uv-primary); }
.software-icon-pick:hover,
.software-icon-pick.is-selected {
  border-color: var(--uv-primary);
  background: #eff6ff;
}
.software-icon-pick.readonly { cursor: default; }
.invoice-print-page {
  max-width: 210mm;
  margin: 0 auto;
  padding: 0;
}

.sub-invoice-summary-no {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--uv-primary);
  letter-spacing: 0.02em;
}

.sub-invoice-summary-table td {
  padding: 0.35rem 0;
  vertical-align: top;
}

.sub-invoice-summary-table td:first-child {
  width: 42%;
}

@media (max-width: 991px) {
  .sub-invoice-summary.sticky-lg-top { position: static !important; }
}

/* Help documentation */
.help-doc h5, .help-doc h6 { margin-top: 0; }
.help-doc .uv-card + .uv-card { margin-top: 1rem; }
.help-doc-compact { max-width: 520px; margin: 0 auto; }
.auth-page .auth-card:has(.help-doc-compact) { max-width: 560px; }
.help-doc ol, .help-doc ul { padding-left: 1.25rem; }
.help-doc li + li { margin-top: 0.35rem; }

/* Calculator & Calendar utilities */
body.uv-utility-open { overflow: hidden; }
.uv-utility-backdrop[hidden],
.uv-utility-panel[hidden] {
  display: none !important;
}
.uv-utility-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 30, 0.35);
  z-index: 1040;
}
.uv-utility-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 320px);
  height: 100%;
  background: var(--uv-card);
  border-left: 1px solid var(--uv-border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  z-index: 1050;
  display: flex;
  flex-direction: column;
}
.uv-utility-panel-wide { width: min(100%, 340px); }
.uv-utility-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--uv-border);
  font-weight: 600;
  background: var(--uv-bg);
}
.uv-utility-panel-head .uv-utility-close {
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
}
.uv-utility-panel-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
}
.uv-calc-display {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.5rem !important;
  font-weight: 600;
}
.uv-calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}
.uv-calc-key {
  border: 1px solid var(--uv-border);
  background: var(--uv-bg);
  color: var(--uv-text);
  border-radius: 8px;
  padding: 0.65rem 0.25rem;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.uv-calc-key:hover { background: var(--uv-border); }
.uv-calc-key:active { transform: scale(0.97); }
.uv-calc-op { background: rgba(13, 71, 161, 0.1); color: var(--uv-primary); font-weight: 600; }
.uv-calc-fn { background: rgba(245, 124, 0, 0.12); color: var(--uv-warning); }
.uv-calc-eq { background: var(--uv-primary); color: #fff; font-weight: 700; }
.uv-calc-eq:hover { background: var(--uv-primary-light); }
.uv-calc-wide { grid-column: span 2; }
.uv-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}
.uv-cal-weekdays span {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--uv-text-muted);
  padding: 0.25rem 0;
}
.uv-cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--uv-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.uv-cal-day:hover:not(:disabled) { background: var(--uv-border); }
.uv-cal-day-today {
  background: rgba(13, 71, 161, 0.15);
  color: var(--uv-primary);
  font-weight: 700;
}
.uv-cal-day-selected {
  background: var(--uv-primary) !important;
  color: #fff !important;
  font-weight: 700;
}
.uv-cal-day-muted { visibility: hidden; }
@media (max-width: 575px) {
  .uv-utility-panel, .uv-utility-panel-wide {
    width: 100%;
    max-width: 100%;
  }
}

.uv-password-field {
  position: relative;
}
.uv-password-field .form-control {
  padding-right: 2.75rem;
}
.uv-password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2.75rem;
  border: none;
  background: transparent;
  color: var(--uv-muted, #6c757d);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 0 var(--bs-border-radius, 0.375rem) var(--bs-border-radius, 0.375rem) 0;
}
.uv-password-toggle:hover {
  color: var(--uv-text, #212529);
}
.uv-password-toggle:focus-visible {
  outline: 2px solid var(--uv-primary, #0d47a1);
  outline-offset: -2px;
}

/* Admin payment mode toggles — visible ON/OFF switches */
.uv-toggle-panel {
  border: 2px solid var(--uv-primary-light);
  border-radius: var(--uv-radius);
  background: linear-gradient(180deg, rgba(13, 71, 161, 0.06) 0%, var(--uv-card) 100%);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.uv-toggle-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--uv-primary);
  margin-bottom: 0.75rem;
}
.uv-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--uv-border);
}
.uv-toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.uv-toggle-row-text {
  flex: 1;
  min-width: 0;
}
.uv-toggle-row-label {
  font-weight: 600;
  color: var(--uv-text);
  margin-bottom: 0.15rem;
}
.uv-toggle-row-desc {
  font-size: 0.82rem;
  color: var(--uv-text-muted);
  line-height: 1.4;
}
.uv-toggle-switch {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 32px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.uv-toggle-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}
.uv-toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: background 0.2s ease;
  pointer-events: none;
}
.uv-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease;
}
.uv-toggle-switch .uv-toggle-track {
  position: absolute;
}
.uv-toggle-input:checked + .uv-toggle-track {
  background: var(--uv-success);
}
.uv-toggle-input:checked + .uv-toggle-track::after {
  transform: translateX(32px);
}
.uv-toggle-badge {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.uv-toggle-badge-off {
  right: 8px;
  color: #64748b;
}
.uv-toggle-badge-on {
  left: 10px;
  color: #fff;
  opacity: 0;
}
.uv-toggle-input:checked ~ .uv-toggle-badge-off {
  opacity: 0;
}
.uv-toggle-input:checked ~ .uv-toggle-badge-on {
  opacity: 1;
}
.uv-toggle-input:focus-visible + .uv-toggle-track {
  outline: 2px solid var(--uv-primary);
  outline-offset: 2px;
}
.uv-toggle-row.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* Admin settings page — view/edit lock + tabs */
.uv-settings-shell .nav-tabs {
  border-bottom: 1px solid var(--uv-border);
  gap: 0.25rem;
}
.uv-settings-shell .nav-tabs .nav-link {
  border: none;
  color: var(--uv-text-muted);
  font-weight: 500;
  padding: 0.65rem 1rem;
  border-radius: 8px 8px 0 0;
}
.uv-settings-shell .nav-tabs .nav-link.active {
  color: var(--uv-primary);
  background: rgba(13, 71, 161, 0.08);
  border-bottom: 2px solid var(--uv-primary);
}
.uv-client-pay-status {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}
.uv-client-pay-status.is-gateway { background: #e3f2fd; color: #0d47a1; border: 1px solid #90caf9; }
.uv-client-pay-status.is-upi { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.uv-client-pay-status.is-none { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
#upiOptionsWrap.is-off { opacity: 0.55; }
.uv-form-locked .uv-field-control,
.uv-form-locked .uv-password-field.uv-field-control,
.uv-form-locked .form-check.form-switch { display: none !important; }
.uv-form-locked .uv-view-value {
  display: block;
  padding: 0.35rem 0 0.65rem;
  font-weight: 600;
  color: #212529;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0.5rem;
  min-height: 1.5rem;
}
.uv-form-locked .uv-view-value.is-empty { color: #6c757d; font-weight: 400; font-style: italic; }
.uv-view-value { display: none; }
.uv-form-locked button[type=submit] { display: none !important; }
.uv-form-locked .uv-pay-switch-row .uv-view-value {
  display: block;
  font-weight: 700;
  min-height: auto;
  padding: 0;
  border: none;
}
.uv-settings-locked-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #664d03;
}
.uv-pay-switch-row { background: var(--uv-card) !important; }
