/*───────────────────────────────────────────────
  Agricheck ‑ clean, unified stylesheet
────────────────────────────────────────────────*/
:root {
  --primary:   #3db85d;
  --secondary: #98eeaf;
  --light:     #f8f9fa;
  --white:     #ffffff;
  --muted:     #6c757d;
  --border:    #dee2e6;
  --navbar-h:  56px;
}

/*────────────────────────────
  Base layout & typography
────────────────────────────*/
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12pt;
}

main   { flex: 1 0 auto; }
footer { flex-shrink: 0; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: none;
}

strong, b { font-weight: 900; }

/*────────────────────────────
  Helpers
────────────────────────────*/
.hover-opacity:hover { opacity: 0.8; }

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration,
input[type="search"]::-ms-clear {
  display: none;
  width: 0; height: 0;
}

/*────────────────────────────
  Navigation bar
────────────────────────────*/
.navbar-icons .nav-link {
  color: var(--white) !important;
  opacity: 0.9;
}
.navbar-icons .nav-link:hover { opacity: 1; }

/*────────────────────────────
  Cards
────────────────────────────*/
.card-header { font-weight: 600; }

/*────────────────────────────
  Section headings & chips
────────────────────────────*/
.section-number {
  color: var(--muted);
  margin-right: .5rem;
}

/* Chip for the (human readable) identifier */
.id-chip {
  color:            var(--primary);
  border:           2px solid var(--primary);
  border-radius:    0.5rem;
  padding:          0.15rem 0.3rem;
  background-color: var(--white);
}

/*────────────────────────────
  Checklist
────────────────────────────*/
ul.checklist        { list-style: none; margin: 0 0 1rem; padding: 0; }
ul.checklist li     { margin-bottom: 0.75rem; }
ul.checklist input  { margin-right: .5rem; }
ul.checklist label  { cursor: pointer; }

/*────────────────────────────
  jsTree
────────────────────────────*/

/* search highlight */
.jstree-search {
  background: var(--secondary) !important;
  color: inherit !important;
  font-weight: inherit !important;
  font-style:  normal !important;
}

/* custom coloured checkboxes */
#tree li.jstree-checked > .jstree-anchor > .jstree-checkbox,
#tree li.jstree-undetermined > .jstree-anchor > .jstree-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  position: relative;
}
#tree li.jstree-checked > .jstree-anchor > .jstree-checkbox::after {
  content: '';
  position: absolute;
  top: 0.15em; left: 0.26em;
  width: 0.55em; height: 0.3em;
  border: 2px solid var(--white);
  border-top: none; border-right: none;
  transform: rotate(-45deg);
}
#tree li.jstree-undetermined > .jstree-anchor > .jstree-checkbox::after {
  content: '';
  position: absolute;
  top: 0.44em; left: 0.2em;
  width: 0.6em; height: 2px;
  background: var(--white);
}

/* ── jsTree overflow fix ─────────────────────────────────────────────── */

/* 1 · wrap long node labels */
#tree a,                     /* the anchor inside each node                */
#tree .jstree-anchor {        /* selector alias used by some themes         */
  white-space: normal;        /* allow wrapping                             */
  word-break: break-word;     /* break very long identifiers if necessary   */
}

/* 2 · if something is *still* too wide, let the container scroll */
#tree,                             /* the tree itself                      */
#tree .jstree-container-ul,        /* root <ul> that jsTree injects        */
#treeCard .card-body {             /* give your tree card an id first      */
  overflow-x: auto;
  max-width: 100%;
}

/*────────────────────────────
  Buttons & forms
────────────────────────────*/
.btn-primary:disabled { opacity: 0.5; }

.form-check-input {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-top: .25em;
  appearance: none;
  background-color: var(--light);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 2px solid var(--muted);
}

/*────────────────────────────
  Sticky action column (desktop)
────────────────────────────*/
@media (min-width: 992px) {
  #actionsWrapper {
    position: sticky;
    top: calc(var(--navbar-h) + 1rem);
    align-self: flex-start;
    z-index: 1010;
  }
  
}
