
/* === OBR Input Page Enhancements === */
/* Greener, centered hero with intro */
.hero.obr-hero{ 
  background: linear-gradient(180deg, rgba(16,185,129,0.12), rgba(16,185,129,0.05) 60%, transparent);
  border-bottom: 1px solid var(--card-border);
  text-align:center;
}
.hero.obr-hero h1{ margin-bottom:.25rem; }
.hero.obr-hero .hero-intro{ color:#445161; font-size:1.02rem; margin-top:.25rem; }
/* Two-column card layout with breathing space */
.form-grid{ display:grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 980px){
  .form-grid{ grid-template-columns: 1fr 1fr; gap: 22px; }
}
.form-grid .block-half{ grid-column: span 1; }
/* Inner fields responsive grid */
.card-fields{ display:grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 920px){ .card-fields{ grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px){ .card-fields{ grid-template-columns: 1fr 1fr 1fr; } }
/* lr-row look */
.lr-row{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:12px; position:relative; }
.lr-row label{ font-weight:600; color:#1f2a37; display:block; }
.lr-row input, .lr-row select, .lr-row textarea{ width:100%; margin-top:6px; height:42px; border-radius:10px; border:1px solid var(--border); padding:8px 10px; }
.lr-row textarea{ height:auto; min-height:92px; }
/* Valid tick + invalid state */
.lr-auto-enhanced .lr-row.valid::after{
  content:"✓"; position:absolute; right:12px; top:12px;
  width:22px; height:22px; display:grid; place-items:center;
  background:var(--brand); color:#fff; border-radius:999px; font-weight:800; font-size:14px;
}
.lr-auto-enhanced .lr-row.invalid{ border-color:#fca5a5; background:#fff7f7; }
/* Bubble help */
label > details.help { display:inline-block; margin-left:.35rem; position:relative; }
label > details.help > summary{ list-style:none; cursor:pointer; display:inline-flex; align-items:center; }
label > details.help > summary::-webkit-details-marker{ display:none; }
.help-badge{ display:inline-flex; align-items:center; justify-content:center; width:1.1rem; height:1.1rem; border-radius:999px; background:#e8f7ee; color:#0a7f3f; font-weight:700; font-size:.85rem; line-height:1; }
label > details.help[open] .help-panel{
  position:absolute; z-index:30; left:0; top:1.8rem; min-width:260px;
  background:#fff; border:1px solid var(--card-border); border-radius:12px;
  box-shadow: 0 8px 22px rgba(22,163,74,0.12);
  padding:.6rem .75rem; color:#445161; font-size:.92rem; line-height:1.4;
}
label > details.help[open] .help-panel:before{
  content:""; position:absolute; left:14px; top:-8px; width:0; height:0;
  border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:8px solid #fff;
}
label > details.help[open] .help-panel:after{
  content:""; position:absolute; left:14px; top:-9px; width:0; height:0;
  border-left:9px solid transparent; border-right:9px solid transparent; border-bottom:9px solid var(--card-border);
}
/* Sticky calc bar – centered, larger button with green shadow */
.sticky-calc{ position:sticky; bottom:0; background:rgba(255,255,255,.85); backdrop-filter: saturate(1.25) blur(6px); padding:.9rem; border-top:1px solid var(--card-border); text-align:center; }
.sticky-calc .btn{ background:var(--brand); color:#fff; border-radius:999px; font-weight:700; box-shadow: 0 16px 30px rgba(16,185,129,.28), 0 0 0 1px rgba(16,185,129,.10); }
.sticky-calc .btn.btn-large{ padding:1rem 1.8rem; font-size:1.05rem; }
.sticky-calc .btn:hover{ filter:brightness(0.98); }

/* === OBR Input Page – scoped polish === */
.hero.obr-hero{ 
  background: linear-gradient(180deg, rgba(16,185,129,0.12), rgba(16,185,129,0.05) 60%, transparent);
  border-bottom: 1px solid var(--card-border);
  text-align:center;
}
.hero.obr-hero h1{ margin-bottom:.25rem; }
.hero.obr-hero .hero-intro{ color:#445161; font-size:1.02rem; margin-top:.25rem; }

.form-grid{ display:grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 980px){ .form-grid{ grid-template-columns: 1fr 1fr; gap: 22px; } }
.form-grid .block-half{ grid-column: span 1; }

.card-fields{ display:grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 920px){ .card-fields{ grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px){ .card-fields{ grid-template-columns: 1fr 1fr 1fr; } }

.lr-row{ background:#fff; border:1px solid var(--border); border-radius:12px; padding:12px; position:relative; }
.lr-row label{ font-weight:600; color:#1f2a37; display:block; }
.lr-row input, .lr-row select, .lr-row textarea{ width:100%; margin-top:6px; height:42px; border-radius:10px; border:1px solid var(--border); padding:8px 10px; }
.lr-row textarea{ height:auto; min-height:92px; }

/* Valid tick and invalid state (leverages existing JS) */
.lr-auto-enhanced .lr-row.valid::after{
  content:"✓"; position:absolute; right:12px; top:12px;
  width:22px; height:22px; display:grid; place-items:center;
  background:var(--brand); color:#fff; border-radius:999px; font-weight:800; font-size:14px;
}
.lr-auto-enhanced .lr-row.invalid{ border-color:#fca5a5; background:#fff7f7; }

/* Help bubble with arrow & shadow */
label > details.help { display:inline-block; margin-left:.35rem; position:relative; }
label > details.help > summary{ list-style:none; cursor:pointer; display:inline-flex; align-items:center; }
label > details.help > summary::-webkit-details-marker{ display:none; }
.help-badge{ display:inline-flex; align-items:center; justify-content:center; width:1.1rem; height:1.1rem; border-radius:999px; background:#e8f7ee; color:#0a7f3f; font-weight:700; font-size:.85rem; line-height:1; }
label > details.help[open] .help-panel{
  position:absolute; z-index:30; left:0; top:1.8rem; min-width:260px;
  background:#fff; border:1px solid var(--card-border); border-radius:12px;
  box-shadow: 0 8px 22px rgba(22,163,74,0.12);
  padding:.6rem .75rem; color:#445161; font-size:.92rem; line-height:1.4;
}
label > details.help[open] .help-panel:before{
  content:""; position:absolute; left:14px; top:-8px; width:0; height:0;
  border-left:8px solid transparent; border-right:8px solid transparent; border-bottom:8px solid #fff;
}
label > details.help[open] .help-panel:after{
  content:""; position:absolute; left:14px; top:-9px; width:0; height:0;
  border-left:9px solid transparent; border-right:9px solid transparent; border-bottom:9px solid var(--card-border);
}

/* Sticky calculate bar with centered larger button */
.sticky-calc{ position:sticky; bottom:0; background:rgba(255,255,255,.85); backdrop-filter: saturate(1.25) blur(6px); padding:.9rem; border-top:1px solid var(--card-border); text-align:center; }
.sticky-calc .btn{ background:var(--brand); color:#fff; border-radius:999px; font-weight:700; box-shadow: 0 16px 30px rgba(16,185,129,.28), 0 0 0 1px rgba(16,185,129,.10); }
.sticky-calc .btn.btn-large{ padding:1rem 1.8rem; font-size:1.05rem; }
.sticky-calc .btn:hover{ filter:brightness(0.98); }

/* --- Financial Metrics (kv-3) : uniform grid & row height --- */
.kv-3{
  display:grid;
  grid-template-columns: minmax(240px,1fr) 100px 110px; /* label | value | badge */
  column-gap:14px;
  row-gap:8px;                /* consistent vertical rhythm */
  align-items:start;          /* allow 2-line value cells */
}

.kv-3 > div:nth-child(3n-2){  /* label */
  font-weight:500;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.kv-3 > div:nth-child(3n-1){  /* value */
  text-align:right;
  font-variant-numeric: tabular-nums;
  line-height:1.2;
}

.kv-3 > div:nth-child(3n){    /* badge */
  justify-self:start;
  min-width:100px;
}

/* Notes always sit on their own line under the value */
.kv-3 .muted{
  display:block;
  margin-top:2px;
  font-size:12px;
  opacity:.65;
  line-height:1.2;
  height:16px;                /* reserve a fixed note height */
}

/* If a row has NO note, add a transparent spacer so height matches rows that do */
.kv-3 > div:nth-child(3n-1):not(:has(.muted))::after{
  content:"";
  display:block;
  height:16px;                /* exactly the same as .muted height */
}

/* Responsive tweaks */
@media (max-width: 900px){
  .kv-3{
    grid-template-columns: minmax(200px,1fr) 90px 100px;
    column-gap:12px;
  }
}
@media (max-width: 640px){
  .kv-3{
    grid-template-columns: 1fr auto auto; /* keep three columns, allow narrower labels */
    column-gap:10px;
  }
}

/* === Inputs card â€” professional three-column layout === */

/* three equal columns */
.grid-3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:28px;                                   /* space between columns */
}

/* base two-cell row: label | value */
.kv{
  display:grid;
  column-gap:16px;
  row-gap:10px;
  align-items:start;
}
.kv > div:nth-child(2n-1){                    /* labels */
  font-weight:600;
}

/* ----- Columns 1 & 2 (text-heavy): wider labels, left-aligned values ----- */
.grid-3 > div:nth-child(1) .kv,
.grid-3 > div:nth-child(2) .kv{
  grid-template-columns: 260px 1fr;           /* widen label rail to avoid skinny wraps */
}
.grid-3 > div:nth-child(1) .kv > div:nth-child(2n),
.grid-3 > div:nth-child(2) .kv > div:nth-child(2n){
  text-align:left;
  white-space:normal;                         /* allow natural wrapping */
  word-break:normal;                          /* no mid-word breaks */
  overflow-wrap:break-word;                   /* wrap long tokens gracefully */
  hyphens:none;                               /* avoid auto hyphenation */
  line-height:1.25;
}

/* ----- Column 3 (numbers): narrower labels, right-aligned values ----- */
.grid-3 > div:nth-child(3) .kv{
  grid-template-columns: 190px auto;
}
.grid-3 > div:nth-child(3) .kv > div:nth-child(2n){
  text-align:right;
  font-variant-numeric: tabular-nums;         /* align digits vertically */
  white-space:nowrap;                         /* keep figures on one line */
}

/* Responsive: stack columns; keep sensible rails */
@media (max-width: 960px){
  .grid-3{ grid-template-columns:1fr; }
  .grid-3 > div:nth-child(1) .kv,
  .grid-3 > div:nth-child(2) .kv{ grid-template-columns: 220px 1fr; }
  .grid-3 > div:nth-child(3) .kv{ grid-template-columns: 180px auto; }
  .grid-3 > div:nth-child(3) .kv > div:nth-child(2n){ white-space:normal; }
}

/* === Professional Navigation Dropdown Menus === */

/* Ensure nav is flexbox for right-alignment */
.lr-menu {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dropdown container */
.lr-dropdown {
  position: relative;
  display: inline-block;
}

.lr-dropdown-right {
  margin-left: auto; /* Push to right */
}

/* Enhanced navigation links and dropdown toggles */
.lr-link, .lr-dropdown-toggle {
  color: #18528b;
  background: transparent;
  border-radius: 8px;
  padding: 8px 16px;
  transition: background 0.15s ease, color 0.15s ease;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}

.lr-link:hover, .lr-dropdown-toggle:hover,
.lr-link:focus, .lr-dropdown-toggle:focus {
  background: #e8f2fa;
  color: #0a3c6e;
}

/* Focus visible for keyboard accessibility */
.lr-link:focus-visible, .lr-dropdown-toggle:focus-visible {
  outline: 2px solid #18528b;
  outline-offset: 2px;
}

/* Enhanced CTA button styling (Login/Logout) */
.lr-cta {
  background: #10b981;
  color: #fff;
  border-radius: 8px;
  padding: 8px 20px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16,185,129,0.09);
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s ease, transform 0.12s ease;
}

.lr-cta:hover {
  background: #0e9468;
  transform: translateY(-1px);
}

.lr-cta:focus-visible {
  outline: 2px solid #10b981;
  outline-offset: 2px;
}

.lr-caret {
  font-size: 0.75em;
  margin-left: 4px;
  transition: transform 0.2s;
  display: inline-block;
}

.lr-dropdown:hover .lr-caret {
  transform: rotate(180deg);
}

/* Enhanced dropdown menu */
.lr-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 16px rgba(16,185,129,0.10);
  border-radius: 8px;
  padding: 8px 4px;
  z-index: 1000;
  margin-top: 4px;
}

/* Invisible hover bridge to prevent menu from closing when moving mouse from button to menu */
.lr-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.lr-dropdown-menu-right {
  left: auto;
  right: 0;
}

.lr-dropdown:hover .lr-dropdown-menu,
.lr-dropdown-menu:hover {
  display: block;
}

/* Enhanced dropdown items */
.lr-dropdown-item {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  border-radius: 6px;
  margin: 2px 8px;
}

.lr-dropdown-item:hover,
.lr-dropdown-item:focus {
  background: #e8f2fa;
  color: #0a3c6e;
}

.lr-dropdown-item:focus-visible {
  outline: 2px solid #18528b;
  outline-offset: 2px;
}
