/* App shell + screens. Layout uses the Bootstrap grid; this file only adds shell chrome and small components. */
:root { --sidebar-w: 232px; }

.sidebar { width: var(--sidebar-w); background: var(--rcg-green); color: #fff; --bs-offcanvas-bg: #124922; --bs-offcanvas-color: #fff; --bs-offcanvas-width: var(--sidebar-w); }
@media (min-width: 992px) { .sidebar.offcanvas-lg { background-color: var(--rcg-green) !important; color: #fff; } .sidebar .offcanvas-body { overflow-y: auto; } }
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; }
.sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.14); }
/* Logo exclusion zone is 2x the width of the G: keep generous space around it. */
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; }
.sidebar-brand img { display: block; width: 100%; height: auto; }
.sidebar .nav-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; color: var(--rcg-green-300); padding: .9rem 1.1rem .3rem; }
.sidebar .nav-link { color: #E6EFE8; padding: .42rem 1.1rem; display: flex; align-items: center; gap: .65rem; border-left: 3px solid transparent; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar .nav-link.active { background: rgba(255,255,255,.14); color: #fff; border-left-color: var(--rcg-orange); font-weight: 600; }
.sidebar .nav-link .badge { margin-left: auto; background: var(--rcg-orange); color: var(--rcg-green); }
.sidebar-foot { margin-top: auto; padding: .8rem 1.1rem; font-size: .75rem; color: var(--rcg-green-300); border-top: 1px solid rgba(255,255,255,.14); }

@media (min-width: 992px) {
  .app-main { margin-left: var(--sidebar-w); }
  .sidebar.offcanvas-lg { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1030; transform: none; visibility: visible !important; }
}
.topbar { background: #fff; position: sticky; top: 0; z-index: 1020; }
.topbar::after { content: ''; display: block; height: 7px; background: linear-gradient(to bottom, var(--rcg-green) 0 4px, var(--rcg-orange) 4px 7px); }
.page-title { font-size: 1.35rem; margin: 0; }
.page-sub { color: var(--rcg-slate-500); margin: 0; }

.kpi { border-left: 4px solid var(--rcg-green); }
.kpi.kpi-orange { border-left-color: var(--rcg-orange); }
.kpi.kpi-amber { border-left-color: #D79A22; }
.kpi .kpi-value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; color: var(--rcg-green); }
.kpi .kpi-label { color: var(--rcg-slate-500); font-size: .8rem; }

.table > :not(caption) > * > * { padding: .45rem .65rem; vertical-align: middle; }
.table thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rcg-slate-500); font-weight: 600; background: var(--rcg-paper); white-space: nowrap; }
.table-hover > tbody > tr[data-href] { cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }
.rego { font-weight: 600; letter-spacing: .04em; }
.dim { color: var(--rcg-slate-500); }
.missing { color: var(--rcg-red); font-style: italic; }

.bar-row { display: flex; align-items: center; gap: .65rem; margin-bottom: .5rem; font-size: .85rem; }
.bar-row .bar-name { width: 8.5rem; flex: none; }
.bar-row .bar-track { flex: 1; background: var(--rcg-green-50); border-radius: 1rem; height: .7rem; overflow: hidden; }
.bar-row .bar-fill { height: 100%; background: linear-gradient(90deg, var(--rcg-green), var(--rcg-orange)); border-radius: 1rem; }
.bar-row .bar-val { width: 4.5rem; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

/* Ticket viewer */
.ticket-viewer { background: #2a2f2c; border-radius: var(--rcg-radius); height: 600px; overflow: hidden; position: relative; }
.ticket-viewer img { transition: transform .2s; transform-origin: center center; }
.viewer-tools { position: absolute; top: .6rem; right: .6rem; z-index: 2; display: flex; gap: .35rem; }
.viewer-tools .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .5rem; background: rgba(255,255,255,.92); }

/* Field + confidence */
.field-label { font-size: .75rem; font-weight: 500; color: var(--rcg-slate-700); display: flex; justify-content: space-between; align-items: center; margin-bottom: .2rem; }
.conf { font-size: .68rem; font-weight: 500; display: inline-flex; align-items: center; gap: .25rem; }
.conf-high { color: var(--rcg-green); }
.conf-confirmed { color: var(--rcg-blue); }
.conf-med { color: var(--rcg-amber); }
.conf-low, .conf-missing { color: var(--rcg-red); }
.form-control.f-low, .form-control.f-med { border-color: #D79A22; background: #FFFBF1; }
.form-control.f-missing { border-color: var(--rcg-red); background: #FFF6F5; }
.weights-check { border-radius: var(--rcg-radius); padding: .5rem .75rem; font-size: .85rem; }
.weights-ok { background: var(--rcg-green-50); color: var(--rcg-green); }
.weights-bad { background: var(--rcg-amber-bg); color: var(--rcg-amber); }
.suggest { border: 1px dashed var(--rcg-dk-orange); background: var(--rcg-orange-50); color: var(--rcg-green); border-radius: 2rem; padding: .1rem .6rem; font-size: .75rem; cursor: pointer; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; border-left: 2px solid var(--rcg-line); }
.timeline li { position: relative; padding: 0 0 .7rem .9rem; font-size: .85rem; }
.timeline li::before { content: ''; position: absolute; left: -1.62rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--rcg-green); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--rcg-line); }
.timeline li.sys::before { background: var(--rcg-orange); }
.timeline .when { color: var(--rcg-slate-500); font-size: .72rem; }

.msg-list .list-group-item { cursor: pointer; border-left: 3px solid transparent; }
.msg-list .list-group-item.active { background: var(--rcg-green-50); color: inherit; border-color: var(--rcg-line); border-left-color: var(--rcg-green); }
.msg-thumb { width: 3.2rem; height: 3.2rem; object-fit: cover; border-radius: .35rem; flex: none; background: var(--rcg-line); }
.msg-bubble { background: var(--rcg-green-50); border-radius: 1rem 1rem 1rem .2rem; padding: .5rem .8rem; display: inline-block; max-width: 85%; }

.login-wrap { min-height: 100vh; background: var(--rcg-green); }
.login-logo { display: block; width: 100%; max-width: 22rem; height: auto; margin: 0 auto; }
.login-card { max-width: 26rem; width: 100%; }

.proto-banner { background: var(--rcg-orange-50); border-bottom: 1px solid var(--rcg-orange-100); color: var(--rcg-green); font-size: .75rem; padding: .25rem 1rem; text-align: center; }

/* Billing sheet */
.sheet { background: #fff; max-width: 820px; margin: 0 auto; padding: 2.25rem 2.5rem; border: 1px solid var(--rcg-line); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.sheet-head { margin: -2.25rem -2.5rem 1.5rem; }
.sheet-head img { display: block; width: 100%; height: auto; }
.sheet h2 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: .12em; color: var(--rcg-green); }
.sheet table td, .sheet table th { padding: .45rem .6rem; border-bottom: 1px solid var(--rcg-line); }
.sheet .big { font-size: 1.6rem; font-weight: 600; color: var(--rcg-green); }
.sig-line { border-bottom: 1px solid var(--rcg-slate-700); height: 2.5rem; }

@media print {
  .no-print, .sidebar, .topbar, .proto-banner { display: none !important; }
  .app-main { margin-left: 0 !important; }
  body { background: #fff !important; }
  .sheet { border: 0; box-shadow: none; padding: 0; max-width: none; }
  main { padding: 0 !important; }
}

/* Image strip on a job with several images */
.img-thumb { display: block; width: 100%; padding: 0; border: 2px solid var(--rcg-line); border-radius: .5rem; background: #fff; overflow: hidden; text-align: left; }
.img-thumb img { display: block; width: 100%; height: 5.5rem; object-fit: cover; }
.img-thumb-label { display: block; padding: .2rem .4rem; font-size: .75rem; font-weight: 600; color: var(--rcg-slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-thumb.active { border-color: var(--rcg-green); box-shadow: 0 0 0 2px rgba(18,73,34,.2); }
.img-thumb.active .img-thumb-label { background: var(--rcg-green); color: #fff; }

/* Page padding, a little tighter */
main.p-3 { padding: .9rem !important; }
@media (min-width: 992px) { main.p-lg-4 { padding: 1.1rem 1.25rem !important; } }

/* Job typeahead */
.typeahead-list { position: absolute; z-index: 1056; left: 0; right: 0; top: 100%; margin-top: .2rem; max-height: 17rem; overflow-y: auto; box-shadow: 0 .5rem 1rem rgba(0,0,0,.15); border-radius: var(--rcg-radius); }
.typeahead-list .list-group-item { border-left: 3px solid transparent; }
.typeahead-list .list-group-item.active, .typeahead-list .list-group-item:hover { background: var(--rcg-green-50); color: inherit; border-color: var(--rcg-line); border-left-color: var(--rcg-green); }
.typeahead-picked { font-weight: 600; color: var(--rcg-green); }
