/*
 * Project theme on top of Tabler: brand color, Arabic font, pillar colors.
 * Tabler's own look comes from vendor/tabler/tabler.rtl.min.css; only overrides go here.
 */
:root {
  --tblr-primary: #0e5a4a;
  --tblr-primary-rgb: 14, 90, 74;
  --tblr-font-sans-serif: "NYS Sakkal", "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;

  /* Pillar identity colors (same defaults as strategy.models.DEFAULT_PILLAR_COLORS) */
  --pillar-1: #527F3A;
  --pillar-2: #3A587F;
  --pillar-3: #7F7E3A;
  --pillar-4: #7F3A7A;
  --pillar-5: #563A7F;
}

/* English pages: a Latin font first; Arabic text in them (e.g. strategy names not yet translated)
   still falls back to the Arabic fonts */
:root[lang="en"] {
  --tblr-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
                          "NYS Sakkal", "Noto Naskh Arabic", Tahoma, sans-serif;
}

/* Top bar: the ministry's green instead of Tabler's white bar */
.navbar-brand-bar { background: #093f34; color: #fff; }
.navbar-brand-bar .navbar-brand, .navbar-brand-bar .nav-link { color: #fff; }
.navbar-brand-bar .nav-link:hover { color: #fff; opacity: .85; }

.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.na, .table td.na { color: var(--tblr-secondary-color, #9aa4aa); }

/* A small colored square marking a pillar */
.pillar-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; flex: none; }

/* Stat cards */
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }

/* Ministry of Youth logo in the menu bar */
.moy-logo-nav { height: 52px; width: auto; display: block; }

/* Disabled actions: show the "not allowed" cursor over the whole button */
.add-disabled { cursor: not-allowed; }
.add-disabled .btn { pointer-events: none; }

/* Breadcrumbs: an arrow pointing in the reading direction (a plain "/" turns into "\" in right-to-left) */
.breadcrumb { --tblr-breadcrumb-divider: "‹"; }

/* Invalid fields: red border and message only. Tabler's warning icon overlaps the text in
   left-to-right fields (email, phone, website) on right-to-left pages. */
.form-control.is-invalid { background-image: none; padding-inline-end: .75rem; }

/* Multi-step forms (static/js/stepper.js): only the current step is shown once the script runs */
.js-stepper .form-step:not(.active) { display: none; }
.steps a.step-item { cursor: pointer; text-decoration: none; }
.step-intro { background: #eef6f3; border-inline-start: 4px solid var(--tblr-primary); padding: .75rem 1rem; margin-bottom: 1rem; }
.review-item { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--tblr-border-color); }
.review-item:last-child { border-bottom: 0; }
.review-item .icon { flex: none; margin-top: .15rem; }
.review-ok .icon { color: #2fb344; }
.review-warn .icon { color: #c77c00; }
.review-error .icon { color: #d63939; }

/* Colour-coded analytical notes (projects and funding pages) */
.note { display: flex; gap: .6rem; align-items: flex-start; padding: .6rem .75rem; border-radius: 6px;
        border-inline-start: 4px solid var(--note-color); background: color-mix(in srgb, var(--note-color) 9%, white); }
.note + .note { margin-top: .5rem; }
.note > .icon { color: var(--note-color); flex: none; margin-top: .1rem; }
.note-kind { font-size: .78rem; font-weight: 700; color: var(--note-color); display: block; }
.note-danger { --note-color: #d63939; }
.note-warning { --note-color: #c77c00; }
.note-info { --note-color: #206bc4; }
.note-success { --note-color: #2fb344; }

/* ---- Forms (static/js/forms.js) ------------------------------------------------------------
   One column; short inputs (dates, numbers, years) don't stretch across the page. */
.form-narrow { max-width: 46rem; }
.field-short .form-control, .field-short .form-select { max-width: 14rem; }
.field-medium .form-control, .field-medium .form-select { max-width: 24rem; }
.color-field .form-control:not(.form-control-color) { max-width: 10rem; }

/* A row inside a field list: "2026 [ input ]", label and input on one line, still one column */
.field-inline { display: grid; grid-template-columns: minmax(4rem, max-content) minmax(0, 14rem) 1fr; gap: .25rem .75rem; align-items: center; }
.field-inline > .form-label { margin: 0; }
.field-inline > small { grid-column: 3; grid-row: 1; margin: 0; }
.field-inline > .invalid-feedback { grid-column: 2 / -1; grid-row: 2; }

/* Correctly filled: green border and a tick after the label (replaces the red * of required fields) */
.field-ok .form-control, .field-ok .form-select { border-color: #2fb344; }
.field.field-ok > .form-label::after, .field.field-ok > label.form-label::after {
  content: ""; display: inline-block; width: 1rem; height: 1rem; margin-inline-start: .35rem; vertical-align: -.15rem;
  background-color: #2fb344;
  -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0'/%3e%3cpath d='M9 12l2 2l4 -4'/%3e%3c/svg%3e") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0'/%3e%3cpath d='M9 12l2 2l4 -4'/%3e%3c/svg%3e") center / contain no-repeat;
}
/* Selects keep their arrow when marked invalid (the border and message are enough) */
.form-select.is-invalid { --tblr-form-select-bg-icon: none; padding-inline-end: 2.25rem; }

/* The "N fields need attention" link next to disabled buttons */
.form-gate-hint { color: #d63939; padding-inline: .25rem; text-decoration: underline; }
button.btn:disabled { cursor: not-allowed; pointer-events: auto; }
