/* ==========================================================================
   Landmeco brand overrides on top of Tabler Core
   Palette: yellow #FDC41D (primary), near-black #1A1A1A (text), white surfaces
   ========================================================================== */

:root,
[data-bs-theme="light"] {
  --tblr-primary: #FDC41D;
  --tblr-primary-rgb: 253, 196, 29;
  --tblr-primary-fg: #1A1A1A;
  --tblr-link-color: #1A1A1A;
  --tblr-link-color-rgb: 26, 26, 26;
  --tblr-body-color: #1A1A1A;
  --tblr-body-color-rgb: 26, 26, 26;
  --tblr-font-sans-serif: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --landmeco-yellow: #FDC41D;
  --landmeco-yellow-soft: #FFF1B8;
  --landmeco-ink: #1A1A1A;
  --landmeco-ink-soft: #4a4a4a;
}

html, body {
  background: #f7f8fa;
}

body {
  font-feature-settings: "ss01", "cv02";
  letter-spacing: -0.005em;
}

h1, h2, h3, .h1, .h2, .h3, .navbar-brand {
  letter-spacing: -0.018em;
  font-weight: 700;
}

/* --- Buttons: yellow primary with black text --- */
.btn-primary,
.btn-primary:focus {
  background-color: var(--landmeco-yellow);
  border-color: var(--landmeco-yellow);
  color: var(--landmeco-ink);
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:active,
.btn-primary.active,
.btn-primary:focus-visible {
  background-color: #ffd34a;
  border-color: #ffd34a;
  color: var(--landmeco-ink);
  box-shadow: 0 6px 18px -8px rgba(253, 196, 29, .8);
}
.btn-outline-primary {
  color: var(--landmeco-ink);
  border-color: var(--landmeco-yellow);
}
.btn-outline-primary:hover {
  background-color: var(--landmeco-yellow);
  border-color: var(--landmeco-yellow);
  color: var(--landmeco-ink);
}

/* --- Brand bar --- */
.navbar-brand-image { height: 3rem; width: auto; }
.navbar.navbar-light {
  border-bottom: 1px solid #e9ebef;
  background: #fff;
  padding-top: 0rem;
  padding-bottom: 0rem;
  /* Pin the header height: never let it grow/shrink to fill leftover
     vertical space on short pages or tall windows. Keeps it identical on
     every page (no jump) at the roomier size. The content area below
     (.page-wrapper) absorbs the slack instead. */
  flex: 0 0 auto;
}
.page-wrapper { flex: 1 1 auto; }

/* --- Hero / welcome card --- */
.landmeco-hero {
  border: 0;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, #FDC41D 0%, #fff7d6 55%, #ffffff 100%);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .15);
}
.landmeco-hero .card-body { padding: 3rem 3rem; }
.landmeco-hero h1 {
  font-size: clamp(1.75rem, 2.4vw, 2.5rem);
  margin-bottom: .35rem;
}
.landmeco-hero .lead {
  color: var(--landmeco-ink-soft);
  font-size: 1.05rem;
}

/* --- Wizard step indicator --- */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  list-style: none;
  margin: 0 0 2rem 0;
  padding: 0;
}
.wizard-steps.wizard-steps-4 {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 720px) {
  .wizard-steps.wizard-steps-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
.wizard-steps .step {
  position: relative;
  background: #fff;
  border-radius: .75rem;
  padding: .9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
  border: 1px solid #eceef2;
}
.wizard-steps .step .num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f3f6;
  color: #777;
  font-weight: 700;
  flex-shrink: 0;
}
.wizard-steps .step .label { font-weight: 600; color: var(--landmeco-ink-soft); }
.wizard-steps .step.is-active {
  border-color: var(--landmeco-yellow);
  box-shadow: 0 0 0 4px rgba(253,196,29,.18);
}
.wizard-steps .step.is-active .num { background: var(--landmeco-yellow); color: var(--landmeco-ink); }
.wizard-steps .step.is-active .label { color: var(--landmeco-ink); }
.wizard-steps .step.is-done .num { background: var(--landmeco-ink); color: #fff; }
.wizard-steps .step.is-done .label { color: var(--landmeco-ink); }

/* --- Builder stepper (one strip per builder in a combined offer) --- */
.builder-track-wrap {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: .85rem;
  padding: .9rem 1.1rem;
}
.builder-track-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .7rem;
}
.builder-track-title { font-weight: 700; color: var(--landmeco-ink); }
.builder-track-count {
  font-weight: 700;
  color: var(--landmeco-ink);
  background: var(--landmeco-yellow-soft);
  border: 1px solid var(--landmeco-yellow);
  border-radius: 999px;
  padding: .12rem .7rem;
  font-size: .82rem;
  white-space: nowrap;
}
.builder-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.builder-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: .45rem .85rem;
  border-radius: 999px;
  border: 1px solid #e3e6ea;
  background: #f7f8fa;
  color: var(--landmeco-ink-soft);
  font-weight: 600;
  font-size: .9rem;
}
.builder-step .bs-num {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e3e6ea;
  color: #777;
  font-weight: 700;
  font-size: .8rem;
}
.builder-step .bs-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-step.is-current {
  border-color: var(--landmeco-yellow);
  background: var(--landmeco-yellow-soft);
  color: var(--landmeco-ink);
  box-shadow: 0 0 0 3px rgba(253,196,29,.18);
}
.builder-step.is-current .bs-num { background: var(--landmeco-yellow); color: var(--landmeco-ink); }
.builder-step.is-done { border-color: #d6dae0; background: #fff; color: var(--landmeco-ink); }
.builder-step.is-done .bs-num { background: var(--landmeco-ink); color: #fff; }

/* --- Question cards --- */
.q-card {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: .85rem;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1rem;
  transition: box-shadow .15s ease, border-color .15s ease, transform .1s ease;
}
.q-card:focus-within {
  border-color: var(--landmeco-yellow);
  box-shadow: 0 0 0 4px rgba(253,196,29,.18);
}
/* Locked until the questions above it are answered. */
.q-card.is-locked {
  opacity: .45;
  background: #f7f8fa;
}
.q-card.is-locked .q-options,
.q-card.is-locked .input-group {
  pointer-events: none;
}
/* The next row while the server settles which options it allows / whether it unlocks. */
.q-card.is-processing {
  position: relative;
  opacity: .6;
}
.q-card.is-processing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin: -.75rem 0 0 -.75rem;
  border: 3px solid rgba(0, 0, 0, .12);
  border-top-color: var(--landmeco-yellow);
  border-radius: 50%;
  animation: q-spin .7s linear infinite;
}
@keyframes q-spin { to { transform: rotate(360deg); } }
.q-card .q-label {
  font-weight: 600;
  font-size: 1.02rem;
  margin-bottom: .9rem;
  display: block;
}
.q-card .q-options {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}
.q-card .q-options .form-check {
  margin: 0;
  padding: 0;
  position: relative;
  display: inline-block;
}
.q-card .q-options input[type="radio"] {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.q-card .q-options .pill {
  border: 1px solid #d6dae0;
  background: #fff;
  border-radius: 999px;
  padding: .42rem 1rem;
  font-weight: 500;
  color: var(--landmeco-ink);
  cursor: pointer;
  transition: all .12s ease;
  display: inline-block;
}
.q-card .q-options input[type="radio"]:hover + .pill,
.q-card .q-options .form-check:hover .pill {
  border-color: var(--landmeco-yellow);
  background: var(--landmeco-yellow-soft);
}
.q-card .q-options input[type="radio"]:checked + .pill {
  background: var(--landmeco-yellow);
  border-color: var(--landmeco-yellow);
  color: var(--landmeco-ink);
  box-shadow: inset 0 0 0 1px var(--landmeco-ink);
}

/* --- Category / builder cards --- */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.choice-card {
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: .85rem;
  padding: 1.25rem;
  cursor: pointer;
  transition: all .12s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  text-decoration: none;
  color: inherit;
}
.choice-card:hover,
.choice-card:focus {
  border-color: var(--landmeco-yellow);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -22px rgba(0, 0, 0, .25);
}
.choice-card:hover,
.choice-card:focus,
.choice-card:hover .title,
.choice-card:hover .meta {
  text-decoration: none;
  color: inherit;
}
.choice-card .title { font-weight: 700; font-size: 1.05rem; }
.choice-card .meta { color: var(--landmeco-ink-soft); font-size: .85rem; }

/* --- Result table --- */
.result-table {
  background: #fff;
  border-radius: .85rem;
  overflow: hidden;
  border: 1px solid #eceef2;
}
.result-table table { margin: 0; }
.result-table th {
  background: #faf9f4;
  border-bottom: 2px solid var(--landmeco-yellow) !important;
  font-weight: 700;
}
.result-table td.qty { font-variant-numeric: tabular-nums; font-weight: 600; }

/* --- Filter chips (Quotations / Customers list pages) --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-chips {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  padding: .25rem;
  background: #fff;
  border: 1px solid #eceef2;
  border-radius: 999px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .9rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--landmeco-ink-soft);
  font-weight: 600;
  font-size: .9rem;
  line-height: 1;
  white-space: nowrap;
  transition: all .12s ease;
}
.filter-chip:hover {
  background: #f7f8fa;
  color: var(--landmeco-ink);
}
.filter-chip .label { line-height: 1; }
.filter-chip .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 .45rem;
  border-radius: 999px;
  background: #f1f3f6;
  color: var(--landmeco-ink-soft);
  font-size: .75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.filter-chip .dot {
  width: .55rem; height: .55rem; border-radius: 999px;
  display: inline-block; flex-shrink: 0;
}
.filter-chip .dot-yellow { background: var(--landmeco-yellow); }
.filter-chip .dot-green  { background: #2fb344; }
.filter-chip .dot-grey   { background: #adb5bd; }
.filter-chip .dot-orange { background: #f76707; }
.filter-chip.is-active {
  background: var(--landmeco-yellow);
  color: var(--landmeco-ink);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.filter-chip.is-active .count {
  background: rgba(0,0,0,.18);
  color: var(--landmeco-ink);
}
.filter-search { margin-left: auto; max-width: 340px; flex: 1; min-width: 240px; }

/* --- Action cell in tables (Resume + dropdown, etc.) --- */
.action-cell { white-space: nowrap; }
/* Detach buttons inside the action btn-group: small gap, every button keeps
   its own full corner radius (overrides Bootstrap's flush btn-group styling). */
.action-cell .btn-group { gap: .4rem; }
.action-cell .btn-group > .btn { margin-left: 0 !important; border-radius: .4rem !important; }

/* Don't let .table-responsive clip dropdown menus. The horizontal scroll only kicks
   in when content actually overflows — for a vertical-only dropdown we just need it
   to escape upward/downward, which overflow:visible allows. The table-responsive
   wrapper still scrolls horizontally on narrow viewports thanks to min-width on the
   table itself. */
.card .table-responsive { overflow: visible; }

/* Suppress Bootstrap's auto caret on a dropdown-toggle */
.dropdown-toggle-no-caret::after { display: none !important; }
.btn.btn-icon { padding-left: .5rem; padding-right: .5rem; }

/* Override the heavy dark "active" state on outline-secondary when its dropdown is open.
   By default Bootstrap inverts to solid #6c757d which clashes with the yellow primary
   button next to it. Keep it light, with a soft yellow tint to indicate it's the source. */
.btn-outline-secondary.dropdown-toggle-no-caret:hover,
.btn-outline-secondary.dropdown-toggle-no-caret:focus,
.btn-outline-secondary.dropdown-toggle-no-caret:active,
.btn-outline-secondary.dropdown-toggle-no-caret.show,
.btn-outline-secondary.dropdown-toggle-no-caret[aria-expanded="true"] {
  background-color: var(--landmeco-yellow-soft) !important;
  border-color: var(--landmeco-yellow) !important;
  color: var(--landmeco-ink) !important;
  box-shadow: none !important;
}

/* Tidy dropdown menu: subtle border + soft shadow, items align with the action button */
.action-cell .dropdown-menu {
  border-radius: .65rem;
  border-color: #eceef2;
  box-shadow: 0 18px 30px -22px rgba(0,0,0,.25);
  padding: .35rem;
  min-width: 11rem;
}
.action-cell .dropdown-item {
  border-radius: .4rem;
  padding: .45rem .65rem;
  font-weight: 500;
}
.action-cell .dropdown-item:hover { background: var(--landmeco-yellow-soft); }
.action-cell .dropdown-item.text-danger:hover {
  background: #fdecec;
  color: #b30000 !important;
}

/* --- Top navigation active link --- */
.navbar .nav-link.active {
  color: var(--landmeco-ink) !important;
  font-weight: 700;
  position: relative;
}
.navbar .nav-link.active::after {
  content: "";
  position: absolute;
  left: .9rem; right: .9rem; bottom: -.4rem;
  height: 3px;
  border-radius: 2px;
  background: var(--landmeco-yellow);
}

/* --- Dashboard stat cards --- */
.stat-card { border: 1px solid #eceef2; border-radius: .85rem; height: 100%; }
.stat-card .card-body { padding: 1.25rem 1.4rem; }
.stat-card .stat-icon {
  width: 2.4rem; height: 2.4rem; border-radius: .65rem;
  background: #f7f8fa; color: var(--landmeco-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; margin-bottom: .8rem;
}
.stat-card .stat-value {
  font-size: 1.9rem; font-weight: 800; line-height: 1.05;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat-card .stat-label {
  font-size: .85rem; color: var(--landmeco-ink-soft); font-weight: 600;
  margin-top: .15rem; margin-bottom: .65rem;
}
.stat-card .stat-trend { font-size: .8rem; }
.stat-card.stat-card-yellow {
  background: linear-gradient(160deg, #FDC41D 0%, #ffe27a 100%);
  border-color: transparent;
  color: var(--landmeco-ink);
}
.stat-card.stat-card-yellow .stat-icon {
  background: rgba(0,0,0,.08); color: var(--landmeco-ink);
}
.stat-card.stat-card-yellow .stat-label,
.stat-card.stat-card-yellow .stat-trend { color: rgba(0,0,0,.65); }

/* --- Customer banner during wizard + result --- */
.customer-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, #fff7d6 0%, #fff 60%);
  border: 1px solid #f0e3a6;
  border-radius: .85rem;
  padding: .85rem 1.1rem;
}
.customer-banner-icon {
  width: 2.6rem; height: 2.6rem;
  border-radius: .65rem;
  background: var(--landmeco-yellow);
  color: var(--landmeco-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.customer-banner-name { font-size: 1.1rem; font-weight: 700; color: var(--landmeco-ink); }

/* --- Customer pick cards (wizard step 1) --- */
.customer-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1px solid #eceef2;
  background: #fff;
  border-radius: .85rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all .12s ease;
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.customer-pick:hover {
  border-color: var(--landmeco-yellow);
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -22px rgba(0,0,0,.25);
}
.customer-pick.is-selected,
.customer-pick:has(input:checked) {
  border-color: var(--landmeco-yellow);
  background: var(--landmeco-yellow-soft);
  box-shadow: 0 0 0 4px rgba(253,196,29,.18);
}
.customer-pick-body { flex: 1; min-width: 0; }
.customer-pick-body .title { font-weight: 700; font-size: 1.02rem; }
.customer-pick-body .meta { color: var(--landmeco-ink-soft); font-size: .85rem; margin-top: .15rem; }
.customer-pick-tick {
  width: 1.6rem; height: 1.6rem;
  border-radius: 999px;
  background: #f1f3f6;
  color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.customer-pick:has(input:checked) .customer-pick-tick {
  background: var(--landmeco-ink);
  color: #fff;
}
.customer-pick-add {
  border-style: dashed;
  background: transparent;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--landmeco-ink-soft);
}
.customer-pick-add:hover { background: var(--landmeco-yellow-soft); }

/* --- Wizard sidebar (sticky) --- */
.wizard-sidebar {
  position: sticky;
  top: 1.5rem;
}
.q-card .q-num {
  display: inline-block;
  color: var(--landmeco-ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-right: .25rem;
}

/* --- Progress block --- */
.progress-block { margin-bottom: 1rem; }
.progress-block-row {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

/* --- Print stylesheet for the result page --- */
@media print {
  .navbar, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .result-table { border: 0; }
  .result-table th { background: transparent; border-bottom: 2px solid #1A1A1A !important; }
  .landmeco-hero { background: transparent; box-shadow: none; }
  .container, .container-xl { max-width: 100% !important; }
}

/* --- Full-page busy overlay (slow POSTs, e.g. Business Central sync) --- */
.busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    cursor: progress;
}
.busy-overlay[hidden] { display: none; }
.busy-overlay__box { text-align: center; padding: 1.5rem 2rem; }
.busy-overlay__text { margin-top: 1rem; font-weight: 700; font-size: 1.05rem; color: #1A2433; }
.busy-overlay__hint { margin-top: .25rem; font-size: .85rem; }

/* --- Business Central debtor autocomplete --- */
[data-bc-ac] { position: relative; }
.bc-ac-menu {
    position: absolute;
    z-index: 1050;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 2px;
    background: #fff;
    border: 1px solid #d7dbe0;
    border-radius: .6rem;
    box-shadow: 0 18px 30px -22px rgba(0, 0, 0, .35);
    max-height: 280px;
    overflow-y: auto;
    padding: .25rem;
}
.bc-ac-menu[hidden] { display: none; }
.bc-ac-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .1rem;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: .4rem;
    padding: .45rem .6rem;
    cursor: pointer;
}
.bc-ac-item:hover, .bc-ac-item:focus, .bc-ac-item.is-active { background: var(--landmeco-yellow, #ffd400); }
.bc-ac-main { display: flex; align-items: baseline; gap: .55rem; }
.bc-ac-no { font-weight: 700; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.bc-ac-name { flex: 1 1 auto; min-width: 0; }
.bc-ac-loc { color: var(--landmeco-ink-soft, #6b7280); font-size: .8rem; }
.bc-ac-status { margin-top: .35rem; min-height: 1rem; }

/* --- Language switcher --- */
.lang-switch { display: flex; align-items: center; gap: .35rem; }
.lang-flag {
    display: inline-flex;
    border-radius: .3rem;
    overflow: hidden;
    line-height: 0;
    opacity: .45;
    border: 2px solid transparent;
    transition: opacity .15s ease, border-color .15s ease;
}
.lang-flag:hover { opacity: .8; }
.lang-flag--active, .lang-flag--active:hover { opacity: 1; border-color: var(--landmeco-yellow, #FDC41D); }
