/* ============================================================
   PitMap theme — laterite orange on Materio (same shell as DrillCore)
   (#d9622b primary, Inter, muted #8a93a3)
   Lives outside assets/ so copying the Materio assets never
   overwrites it.
   ============================================================ */
:root {
  --bs-primary: #d9622b;
  --bs-primary-rgb: 217, 98, 43;
  --bs-link-color: #d9622b;
  --bs-link-hover-color: #b94f1f;
  --pm-primary: #d9622b;
  --pm-primary-dark: #b94f1f;
  --pm-primary-soft: rgba(217, 98, 43, .12);
  --pm-muted: #8a93a3;
  --pm-danger: #ff3e1d;
  --pm-border: #e6e8ee;
}

body { font-family: "Inter", -apple-system, "Segoe UI", sans-serif; }
a { color: var(--pm-primary); }
a:hover { color: var(--pm-primary-dark); }

.text-primary { color: var(--pm-primary) !important; }
.bg-primary { background-color: var(--pm-primary) !important; }
.bg-label-primary { background-color: var(--pm-primary-soft) !important; color: var(--pm-primary) !important; }
.border-primary { border-color: var(--pm-primary) !important; }

.btn-primary { background: var(--pm-primary) !important; border-color: var(--pm-primary) !important; color: #fff !important; box-shadow: 0 .125rem .25rem rgba(217,98,43,.35); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: var(--pm-primary-dark) !important; border-color: var(--pm-primary-dark) !important; }
.btn-outline-primary { color: var(--pm-primary) !important; border-color: var(--pm-primary) !important; background: transparent; }
.btn-outline-primary:hover, .btn-check:checked + .btn-outline-primary { background: var(--pm-primary) !important; color: #fff !important; }
.btn-label-primary { background: var(--pm-primary-soft) !important; color: var(--pm-primary) !important; border: 0; }
.btn-label-primary:hover { background: var(--pm-primary) !important; color: #fff !important; }

.form-control:focus, .form-select:focus { border-color: var(--pm-primary) !important; box-shadow: 0 0 0 .15rem rgba(217,98,43,.18) !important; }
.form-check-input:checked { background-color: var(--pm-primary) !important; border-color: var(--pm-primary) !important; }
.nav-pills .nav-link.active, .nav-pills .nav-link.active:hover { background-color: var(--pm-primary) !important; }
.page-item.active .page-link, .page-item.active .page-link:hover { background-color: var(--pm-primary) !important; border-color: var(--pm-primary) !important; }
.progress-bar { background-color: var(--pm-primary); }

/* menu */
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link {
  background: linear-gradient(72.47deg, #d9622b 22.16%, rgba(217,98,43,.7) 76.47%) !important;
  color: #fff !important; box-shadow: 0 2px 6px rgba(217,98,43,.48);
}
.bg-menu-theme .menu-inner > .menu-item.active > .menu-link .menu-icon { color: #fff !important; }
.bg-menu-theme .menu-sub > .menu-item.active > .menu-link { color: var(--pm-primary) !important; }
.app-brand-text { color: var(--pm-primary) !important; font-weight: 700 !important; letter-spacing: -.3px; text-transform: none !important; }
.app-brand-logo .pm-logo { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #d9622b, #f08a4b);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 3px 8px rgba(217,98,43,.4); }
.menu-header-text { color: var(--pm-muted) !important; }

/* page header */
.page-title { font-weight: 600; }
.page-title .crumb { color: var(--pm-muted); font-weight: 300; }
.page-sub { color: var(--pm-muted); font-size: .875rem; }

/* stat cards */
.stat-card { border: 0; border-radius: 14px; transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(58,53,65,.10) !important; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-card .value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { font-size: .78rem; color: var(--pm-muted); font-weight: 500; }
.stat-card .hint { font-size: .72rem; color: var(--pm-muted); }

/* tables */
.pm-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pm-muted); font-weight: 600; white-space: nowrap; }
.pm-table tbody td { vertical-align: middle; font-size: .875rem; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.hole-id { font-family: "SFMono-Regular", Consolas, monospace; font-weight: 700; letter-spacing: .3px; color: var(--pm-primary); }
.required-field::after { content: " *"; color: var(--pm-danger); font-weight: bold; }
.au-chip { display: inline-block; min-width: 46px; padding: 1px 7px; border-radius: 10px; font-weight: 700; font-size: .78rem; text-align: center; color: #1f2430; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.flag-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 8px; border-radius: 10px; background: #fff4e5; color: #b26a00; }
.flag-pill.bad { background: #ffe9e5; color: #c62828; }
.flag-pill.ok { background: #e8f5e9; color: #2e7d32; }

/* empty states */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--pm-muted); }
.empty-state i { font-size: 2.6rem; color: #c7cbe0; display: block; margin-bottom: .4rem; }

/* import wizard */
.wizard-steps { display: flex; gap: .5rem; flex-wrap: wrap; }
.wizard-steps .step { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 30px; background: #f4f5fa; color: var(--pm-muted); font-size: .85rem; font-weight: 500; }
.wizard-steps .step.active { background: var(--pm-primary); color: #fff; }
.wizard-steps .step.done { background: var(--pm-primary-soft); color: var(--pm-primary); }
.wizard-steps .step .n { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.35); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.map-box { height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--pm-border); }

/* auth pages */
.auth-tagline { color: var(--pm-muted); font-size: .85rem; }
.auth-ramp { height: 6px; width: 132px; margin: .6rem auto 0; border-radius: 4px;
  background: linear-gradient(90deg, #2c3e91, #2b83ba, #4fbfa5, #a6d96a, #ffffbf, #fdae61, #f46d43, #d7191c); }

/* dataTables tweaks */
div.dataTables_wrapper div.dataTables_filter input { margin-left: .5rem; }
table.dataTable { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.dataTables_info, .dataTables_length { font-size: .8rem; color: var(--pm-muted); }

/* text buttons (not in Materio free) */
.btn-text-secondary { color: #8a8d93; background: transparent; border: 0; }
.btn-text-secondary:hover { color: var(--pm-primary); background: var(--pm-primary-soft); }
.btn-text-danger { color: #ff4c51; background: transparent; border: 0; }
.btn-text-danger:hover { color: #fff; background: #ff4c51; }
.btn-icon.btn-sm { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.pm-table td.text-end, .pm-table th.text-end { white-space: nowrap; }

/* ---------- PitMap: maps ---------- */
.pm-map { height: calc(100vh - 230px); min-height: 460px; border-radius: 12px; overflow: hidden; border: 1px solid var(--pm-border); }
.pm-map-sm { height: 320px; border-radius: 12px; overflow: hidden; border: 1px solid var(--pm-border); }
.pm-legend { background: rgba(255,255,255,.95); padding: 9px 12px; border-radius: 8px; font: 12px Inter, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.pm-legend .bar { width: 220px; height: 12px; border-radius: 3px; margin: 6px 0 2px; }
.pm-legend .ticks { position: relative; height: 14px; width: 220px; }
.pm-legend .ticks span { position: absolute; transform: translateX(-50%); font-size: 10.5px; color: #333; }
.pm-target-icon { background: var(--pm-primary); color: #fff; border: 2px solid #fff; border-radius: 50%;
  display: grid !important; place-items: center; font: 700 13px Inter, sans-serif; box-shadow: 0 1px 5px rgba(0,0,0,.45); }
.pm-target { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--pm-border); font-size: .85rem; }
.pm-target:last-child { border-bottom: 0; }
.pm-target .pin { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--pm-primary); color: #fff; display: grid; place-items: center; font-weight: 700; }
.pm-trend { background: var(--pm-primary-soft); border-radius: 10px; padding: 12px 14px; font-size: .88rem; line-height: 1.45; color: #4b3a30; }
.pm-kv { display: flex; justify-content: space-between; gap: 12px; font-size: .84rem; padding: 4px 0; }
.pm-kv span:first-child { color: var(--pm-muted); }
.pm-kv span:last-child { font-weight: 500; text-align: right; }
.class-strong { background: #ffe9e5; color: #c62828; }
.class-moderate { background: #fff4e5; color: #b26a00; }
.class-weak { background: #fffbe6; color: #8a6d00; }
.pm-hist { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.pm-hist span { flex: 1; background: var(--pm-primary); opacity: .75; border-radius: 2px 2px 0 0; min-height: 1px; }
.pm-hist-axis { display: flex; justify-content: space-between; font-size: .7rem; color: var(--pm-muted); margin-top: 3px; }
.map-busy { position: absolute; inset: 0; background: rgba(255,255,255,.7); display: none; align-items: center; justify-content: center; z-index: 1000; font-weight: 600; }
.map-busy.show { display: flex; }
.col-pick { min-width: 150px; }
.preview-table td, .preview-table th { white-space: nowrap; font-size: .8rem; }
.preview-table th.mapped { background: var(--pm-primary-soft); color: var(--pm-primary); }

/* ---------- map page layout ---------- */
.pm-map-wrap { position: sticky; top: 88px; }
.pm-map-full { height: calc(100vh - 250px); min-height: 520px; border-radius: 14px; overflow: hidden; border: 1px solid var(--pm-border);
  box-shadow: 0 2px 10px rgba(58,53,65,.08); background: #e9ecef; }
.pm-method-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.pm-method-bar .d-contents { display: contents; }
.pm-method { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 128px; padding: .5rem .9rem;
  border-radius: 10px; border: 1px solid var(--pm-border); background: #fff; color: #4b5161; text-decoration: none;
  font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pm-method:hover { border-color: var(--pm-primary); color: #4b5161; box-shadow: 0 2px 6px rgba(217,98,43,.15); }
.pm-method .lbl { font-weight: 600; font-size: .88rem; }
.pm-method .lbl .mdi-star { color: #f5a623; }
.pm-method .sub { font-size: .72rem; color: var(--pm-muted); }
.pm-method.active { background: var(--pm-primary); border-color: var(--pm-primary); color: #fff; box-shadow: 0 3px 8px rgba(217,98,43,.35); }
.pm-method.active .sub { color: rgba(255,255,255,.85); }
.pm-method.active .lbl .mdi-star { color: #ffe08a; }
.pm-method.missing { border-style: dashed; background: transparent; }
.pm-tcard { border: 1px solid var(--pm-border); border-radius: 12px; padding: .75rem .9rem; margin-bottom: .6rem; cursor: pointer; transition: border-color .15s, background .15s; }
.pm-tcard:hover { border-color: var(--pm-primary); background: #fffaf6; }
.pm-tcard .pin { width: 28px; height: 28px; border-radius: 50%; background: var(--pm-primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: 0 0 28px; }
.pm-tcard .val { font-size: 1.25rem; font-weight: 700; color: #2f3440; }
.pm-tcard .val small { font-size: .75rem; font-weight: 500; color: var(--pm-muted); }
.pm-tcard .coords { font-family: "SFMono-Regular", Consolas, monospace; font-size: .95rem; font-weight: 600; color: #2f3440; letter-spacing: .2px; }
.pm-tcard .coords-sub { font-size: .75rem; color: var(--pm-muted); }
.card-header-tabs .nav-link { font-weight: 500; }
@media (max-width: 1199.98px) {
  .pm-map-wrap { position: static; }
  .pm-map-full { height: 62vh; min-height: 380px; }
  .pm-method { min-width: 0; flex: 1 1 30%; }
}
.nav-tabs .nav-link.active, .nav-tabs .nav-link.active:hover, .nav-tabs .nav-link.active:focus { color: var(--pm-primary) !important; box-shadow: 0 -2px 0 var(--pm-primary) inset !important; border-bottom-color: var(--pm-primary) !important; }
.nav-tabs .nav-link:hover { color: var(--pm-primary); }
.table-active, .table-active > td { --bs-table-bg-state: var(--pm-primary-soft) !important; background-color: var(--pm-primary-soft) !important; }

/* ---------- Student Lab ---------- */
.lab-map { height: 380px; border-radius: 12px; overflow: hidden; border: 1px solid var(--pm-border); background: #e9ecef; }
.lab-map-lg { height: 500px; border-radius: 10px; overflow: hidden; background: #e9ecef; }
.lab-map-cmp { height: 330px; border-radius: 10px; overflow: hidden; background: #e9ecef; }
.lab-hist { display: flex; align-items: flex-end; gap: 2px; height: 130px; border-bottom: 1px solid var(--pm-border); }
.lab-hist span { flex: 1; background: var(--pm-primary); opacity: .78; border-radius: 2px 2px 0 0; min-height: 1px; }
.lab-help { font-size: .74rem; color: var(--pm-muted); line-height: 1.35; }
.lab-explain { background: #f6f7fb; border-left: 3px solid var(--pm-primary); border-radius: 6px; padding: .65rem .85rem; font-size: .84rem; line-height: 1.5; color: #4b5161; }
.lab-loading { color: var(--pm-muted); font-size: .85rem; padding: .75rem 0; }
.lab-methods { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.lab-method { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .6rem; border: 1px solid var(--pm-border); border-radius: 9px; cursor: pointer; margin: 0; }
.lab-method input { margin-top: .25rem; accent-color: var(--pm-primary); }
.lab-method b { display: block; font-size: .85rem; color: #2f3440; }
.lab-method small { display: block; font-size: .72rem; color: var(--pm-muted); line-height: 1.3; }
.lab-method.active { border-color: var(--pm-primary); background: #fffaf6; }
.lab-bar { height: 12px; background: #f1f2f6; border-radius: 6px; overflow: hidden; }
.lab-bar span { display: block; height: 100%; background: var(--pm-primary); border-radius: 6px; }
.lab-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 4px; }
.form-range::-webkit-slider-thumb { background: var(--pm-primary); }
.form-range::-moz-range-thumb { background: var(--pm-primary); }

.form-range { accent-color: var(--pm-primary); }
.form-range::-webkit-slider-runnable-track { background: #f3d9cb !important; }
.form-range::-moz-range-track { background: #f3d9cb !important; }
.form-range::-webkit-slider-thumb { background: var(--pm-primary) !important; box-shadow: 0 0 0 4px rgba(217,98,43,.16) !important; }
.form-range::-moz-range-thumb { background: var(--pm-primary) !important; }

/* ---------- map tools ---------- */
.pm-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.pm-tool { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 1px solid var(--pm-border); border-radius: 8px;
  background: #fff; color: #4b5161; font: 500 .82rem Inter, sans-serif; cursor: pointer; }
.pm-tool .mdi { font-size: 1.05rem; color: var(--pm-primary); }
.pm-tool:hover { border-color: var(--pm-primary); }
.pm-tool.active { background: var(--pm-primary); border-color: var(--pm-primary); color: #fff; }
.pm-tool.active .mdi { color: #fff; }
.pm-tool-hint { font-size: .8rem; color: #4b5161; margin-left: 4px; }
.btn-xs { padding: 1px 8px; font-size: .74rem; line-height: 1.5; border-radius: 6px; }
.pm-drawing, .pm-drawing .leaflet-interactive { cursor: crosshair !important; }
.pm-map-wrap.has-panel { position: static; }
.pm-big { font-size: 1.35rem; font-weight: 700; color: #2f3440; line-height: 1.2; }
.pm-stat { border: 1px solid var(--pm-border); border-radius: 10px; padding: .55rem .4rem; }
.pm-val-label { background: rgba(255,255,255,.92); border: 1px solid #555; border-radius: 4px; padding: 0 4px; font: 600 10.5px Inter, sans-serif;
  color: #111; white-space: nowrap; transform: translate(-50%, -150%); width: auto !important; height: auto !important; }
.pm-labels-small .pm-val-label { display: none; }
@media (max-width: 575.98px) { .pm-tool span { display: none; } .pm-tool { padding: 6px 10px; } }

.pm-drawing .leaflet-marker-pane, .pm-drawing .leaflet-overlay-pane .leaflet-interactive, .pm-drawing .leaflet-tooltip-pane { pointer-events: none !important; }
.pm-stat .pm-big { font-size: 1.05rem; }

/* ---------- few samples ---------- */
.pm-few { border-left: 4px solid #f5a623; background: #fffaf0; }
.pm-few .mdi-36px { color: #f5a623; }
.pm-few-stop { border-left-color: var(--pm-primary); background: #fff6f1; }
.pm-few-stop .mdi-36px { color: var(--pm-primary); }
.pm-conf { display: flex; gap: .6rem; align-items: flex-start; border-radius: 10px; padding: .6rem .8rem; font-size: .84rem; margin-bottom: .9rem; }
.pm-conf .mdi { font-size: 1.3rem; line-height: 1; }
.pm-conf-low { background: #fff4e5; color: #8a4b00; }
.pm-conf-medium { background: #eef6ff; color: #1f4f82; }
.pm-conf-good { background: #e8f5e9; color: #1e6b33; }
.pm-infill-icon { background: #fff; border: 2.5px dashed #1565c0; border-radius: 50%; color: #1565c0; display: grid !important; place-items: center;
  font: 700 11px Inter, sans-serif; box-shadow: 0 1px 4px rgba(0,0,0,.35); }

.pm-feat { display: flex; align-items: center; gap: .6rem; padding: .45rem .55rem; border: 1px solid var(--pm-border); border-radius: 10px; margin-bottom: .4rem; font-size: .85rem; }
.pm-feat > .mdi { font-size: 1.2rem; color: #7b2ff7; }
.pm-open { margin-top: .4rem; padding: .35rem .5rem; border-radius: 8px; background: #fff4e5; color: #8a4b00; font-size: .78rem; line-height: 1.35; }

/* ---------- credits: locked targets and pit results ---------- */
.pm-locked { position: relative; background: repeating-linear-gradient(135deg, #fafafa 0 10px, #f3f3f5 10px 20px); }
.pm-blur { filter: blur(4px); user-select: none; pointer-events: none; }
.pm-pit { margin-top: .4rem; padding: .3rem .5rem; border-radius: 8px; font-size: .8rem; }
.pm-pit-gold { background: #fff6d6; color: #7a5a00; }
.pm-pit-little { background: #eef4ff; color: #2b4f8a; }
.pm-pit-nothing { background: #f2f2f2; color: #666; }
.pm-pit-ask { margin-top: .4rem; font-size: .8rem; }
.pm-pit-ask summary { cursor: pointer; color: var(--bs-primary, #666cff); }
.pm-pit-ask form { margin-top: .4rem; }

/* ---------- sign-up ---------- */
.pm-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.pm-terms p { margin-bottom: .8rem; line-height: 1.5; }

/* ---------- credits: unlock everything on a map ---------- */
.pm-bundle { border: 1px solid rgba(217, 98, 43, .35); background: #fff7f2; border-radius: 10px; padding: .8rem .9rem; margin-bottom: 1rem; }
.pm-bundle-txt { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .6rem; font-size: .85rem; }
.pm-bundle-txt b { font-size: .95rem; }
.pm-bundle-price { font-weight: 700; font-size: 1.15rem; color: #b44d1d; }
.pm-bundle-price s { font-weight: 400; font-size: .85rem; color: #8a8f98; margin-left: .3rem; }

/* ---------- map page: header buttons wrap instead of overflowing ---------- */
.pm-map-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; max-width: 100%; }
.pm-map-actions > form, .pm-map-actions > .dropdown { display: flex; }
.pm-map-actions .btn { white-space: nowrap; }
@media (max-width: 575.98px) {
  .pm-map-actions { width: 100%; justify-content: stretch; }
  .pm-map-actions > * { flex: 1 1 auto; }
  .pm-map-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- navbar: search box shrinks on phones so the credit chip and avatar fit ---------- */
.pm-nav-search { flex: 1 1 auto; min-width: 0; }
.pm-nav-search .nav-item { width: 100%; }
.pm-nav-search input { min-width: 220px; }
@media (max-width: 575.98px) {
  .pm-nav-search input { min-width: 0; width: 100%; }
}

/* ---------- Google sign-in button (Google's brand rules: normal case, neutral colours) ---------- */
.pm-google { text-transform: none !important; letter-spacing: normal; font-weight: 500; color: #3c4043 !important; background: #fff; border-color: #dadce0 !important; }
.pm-google:hover { background: #f8f9fa !important; }
