/* Client Hub — shared styles (extends Bootstrap 5) */
:root { --ch-primary: #0d6efd; }
body { font-size: 0.95rem; }
.navbar-dark .navbar-nav .nav-link { color: rgba(255,255,255,.88) !important; }
.navbar-dark .navbar-nav .nav-link:hover { color: #fff !important; }
.portal-body { background: #f6f8fb; }
.card { border-radius: .6rem; }
.table-sticky thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.client-type-company   { color:#0d6efd; }
.client-type-organization { color:#6f42c1; }
.client-type-individual { color:#198754; }
.badge-foreign { background:#fd7e14; color:#fff; }
/* Softer than Bootstrap's bold (700) — clearer for small CJK labels. */
.badge { font-weight: 500; }
.required-mark::after { content:" *"; color:#dc3545; }
.tab-section { border:1px solid #dee2e6; border-top:none; padding:1rem; border-radius:0 0 .5rem .5rem; }

/* ── Firm-wide themes (admin-selected; one applies to all users) ──
   Each theme sets 3 custom properties; generic rules consume them so a
   new scheme is just one declaration block. .theme-is-light additionally
   flips the navbar to dark text. Applies to staff (bg-dark) + portal
   (bg-primary) navbars alike. */

/* Dark navbar themes */
.theme-slate    { --nav-bg:#212529; --accent:#0d6efd; --accent-hover:#0b5ed7; }
.theme-emerald  { --nav-bg:#14532d; --accent:#198754; --accent-hover:#157347; }
.theme-plum     { --nav-bg:#4c1d95; --accent:#7c3aed; --accent-hover:#6d28d9; }
/* Light / professional themes */
.theme-ivory    { --nav-bg:#f3f1ea; --accent:#1f3a5f; --accent-hover:#16293f; }
.theme-azure    { --nav-bg:#ffffff; --accent:#2563eb; --accent-hover:#1d4ed8; }
.theme-teal     { --nav-bg:#e6f3f2; --accent:#0f766e; --accent-hover:#115e59; }
.theme-graphite { --nav-bg:#eceff3; --accent:#475569; --accent-hover:#334155; }
.theme-bronze   { --nav-bg:#f7f1e8; --accent:#b45309; --accent-hover:#92400e; }

/* Navbar recolor (both the staff dark navbar and the portal primary navbar) */
body[class*="theme-"] .navbar.bg-dark,
body[class*="theme-"] .navbar.bg-primary {
  background-color: var(--nav-bg) !important;
  background-image: none !important;
}

/* Accent: primary buttons, outlines, links, active tabs, accent cards */
body[class*="theme-"] .btn-primary {
  --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent);
}
body[class*="theme-"] .btn-outline-primary {
  --bs-btn-color: var(--accent); --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent); --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-bg: var(--accent); --bs-btn-active-border-color: var(--accent);
}
body[class*="theme-"] .text-primary { color: var(--accent) !important; }
body[class*="theme-"] .bg-primary   { background-color: var(--accent) !important; }
/* Primary badges/cards follow the theme accent, always with light text for contrast. */
body[class*="theme-"] .text-bg-primary { background-color: var(--accent) !important; color: #fff !important; }
body[class*="theme-"] .nav-tabs .nav-link.active { color: var(--accent); border-bottom-color: #fff; }
body[class*="theme-"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.navbar-brand):not(.page-link):not(.list-group-item) {
  color: var(--accent-hover);
}
body[class*="theme-"] .page-item.active .page-link {
  background-color: var(--accent); border-color: var(--accent);
}

/* Light-navbar themes: dark text + subtle separation */
.theme-is-light .navbar { border-bottom: 1px solid rgba(0,0,0,.08); }
.theme-is-light .navbar .navbar-brand,
.theme-is-light .navbar .nav-link,
.theme-is-light .navbar .dropdown-toggle,
.theme-is-light .navbar .navbar-text { color: #1f2937 !important; }
.theme-is-light .navbar .nav-link:hover,
.theme-is-light .navbar .nav-link:focus { color: #000 !important; text-shadow: none; }
.theme-is-light .navbar .navbar-toggler { border-color: rgba(0,0,0,.15); }
.theme-is-light .navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(33,37,41,0.85)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.theme-is-light .navbar .badge.text-bg-secondary { background-color:#6c757d !important; color:#fff !important; }
.theme-is-light .navbar .dropdown-menu { --bs-dropdown-link-active-bg: var(--accent); }
