[hidden] { display: none !important; }
:root {
  --ink: #1b2430;
  --muted: #667085;
  --line: #e4e7ec;
  --bg: #f5f6f8;
  --card: #ffffff;
  --navy: #14213d;
  --accent: #7b1e2e;
  --sub-bg: #eef2f7;
  --neg: #b42318;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; display: flex; min-height: 100vh; background: var(--bg); }

/* ---------- navigation ---------- */
.nav { width: 232px; flex: none; background: var(--navy); color: #cbd5e1; padding: 20px 0; }
.brand { font-weight: 700; font-size: 20px; color: #fff; padding: 0 22px 22px; letter-spacing: .5px; }
.brand span { font-weight: 400; color: #e3929f; margin-left: 6px; }
.nav a { display: block; padding: 9px 22px; font-size: 14px; color: #cbd5e1; cursor: pointer; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left: 3px solid #e3929f; padding-left: 19px; }
.nav a.soon { opacity: .45; cursor: default; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #7c8aa5; padding: 18px 22px 6px; }

/* ---------- header + filters ---------- */
main { flex: 1; min-width: 0; padding: 22px 28px 40px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; }
.client { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); font-weight: 600; }
h1 { margin: 4px 0 0; font-size: 24px; font-weight: 600; }
.user { font-size: 13px; color: var(--muted); text-align: right; }

.filters { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
  margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.filter-row.loc { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.filter-row.loc select { min-width: 190px; max-width: 260px; }
.filter-row.loc select.set { border-color: var(--accent); background: #faf0f2; font-weight: 600; }
.clear { height: 34px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; padding: 0 6px; }
.clear:hover { text-decoration: underline; }
.match { margin-left: auto; font-size: 13px; color: var(--muted); padding-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
select { height: 34px; border: 1px solid #cfd4dc; border-radius: 6px; padding: 0 8px; font: inherit; font-size: 14px;
  background: #fff; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid #cfd4dc; border-radius: 6px; overflow: hidden; height: 34px; }
.seg button { border: 0; background: #fff; padding: 0 14px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.seg button + button { border-left: 1px solid #cfd4dc; }
.seg button.on { background: var(--navy); color: #fff; }
.range { margin-left: auto; font-size: 13px; color: var(--muted); padding-bottom: 8px; }

/* ---------- LOS table ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.table-wrap { overflow: auto; max-height: calc(100vh - 230px); }
table.los { border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.los th, .los td { padding: 6px 12px; white-space: nowrap; text-align: right; border-bottom: 1px solid #f0f2f5; }
.los thead th { position: sticky; top: 0; z-index: 2; background: var(--navy); color: #fff; font-weight: 600; font-size: 12px; }
.los th:first-child, .los td:first-child { position: sticky; left: 0; z-index: 1; text-align: left; background: var(--card);
  min-width: 270px; border-right: 1px solid var(--line); }
.los thead th:first-child { z-index: 3; background: var(--navy); }
.los .sum-col { background: #f9f6f7; }
.los thead th.sum-col { background: #22325a; }
.los td.first-sum, .los th.first-sum { border-left: 2px solid var(--line); }

.los tr.header td { font-weight: 700; font-size: 11px; letter-spacing: 1px; color: var(--accent); padding-top: 10px;
  border-bottom: 0; }
.los tr.spacer td { height: 10px; padding: 0; border-bottom: 0; }
.los tr.line td:first-child { padding-left: 24px; }
.los tr.subtotal td { font-weight: 700; background: var(--sub-bg); border-top: 1px solid #cdd5e0; }
.los tr.subtotal td:first-child { background: var(--sub-bg); }
.los tr.key td { background: #e3e9f2; border-top: 2px solid var(--navy); }
.los tr.key td:first-child { background: #e3e9f2; }
.los td.neg { color: var(--neg); }
.los td.zero { color: #b0b7c3; }
.los tbody tr:not(.header):not(.spacer):hover td { background: #f8edef; }

.empty, .error { padding: 40px; text-align: center; color: var(--muted); }
.error { color: var(--neg); }

/* ---------- uploads page ---------- */
.card.pad { padding: 18px 20px; margin-bottom: 16px; overflow: visible; }
.card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 22px 0 8px; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.tile.need { border-style: dashed; background: #fcfcfd; }
.tile.done { border-color: #b7dfc6; background: #f6fbf8; }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-name { font-weight: 600; }
.tile dl { display: grid; grid-template-columns: 56px 1fr; gap: 4px 10px; margin: 0; font-size: 13px; }
.tile dt { color: var(--muted); }
.tile dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .btn { align-self: flex-start; margin-top: auto; }
.tie { color: #027a48; font-size: 12px; margin-left: 4px; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.badge.ok { background: #dcfae6; color: #067647; }
.badge.need { background: #fef0c7; color: #93370d; }
.pill { font-size: 11px; background: #eef2f7; color: var(--muted); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
.grid th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.grid td { padding: 9px 10px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.grid .r { text-align: right; } .grid .c { text-align: center; }
#history tr[data-month] { cursor: pointer; }
#history tr[data-month]:hover td, #history tr.sel td { background: #f8edef; }
.ck { color: #067647; font-weight: 700; } .x { color: #c0c6cf; }

.btn { height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid #cfd4dc; background: #fff; font: inherit;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--ink); }
.btn.small { height: 30px; font-size: 13px; padding: 0 12px; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:disabled { background: #98a2b3; border-color: #98a2b3; cursor: not-allowed; }
.btn.ghost { background: none; }
.btn.danger-ghost { color: var(--neg); border-color: #f4c7c3; background: #fff; }
.btn.danger-ghost.confirm { background: var(--neg); color: #fff; border-color: var(--neg); }

/* review dialog */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: flex; align-items: center;
  justify-content: center; z-index: 50; padding: 30px; }
.modal { background: #fff; border-radius: 12px; width: min(920px, 100%); max-height: 100%; display: flex;
  flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 22px; overflow: auto; }
.modal-foot { padding: 12px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.banner { padding: 10px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.banner.ok { background: #ecfdf3; color: #067647; } .banner.bad { background: #fef3f2; color: var(--neg); }
.tieout { display: flex; gap: 12px; margin: 14px 0 4px; }
.tieout div { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.tieout span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.tieout strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.tieout .neg { color: var(--neg); }
h4 { font-size: 13px; margin: 16px 0 6px; } h4.bad { color: var(--neg); } h4.warn { color: #93370d; }
.msgs { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.msgs.bad li { color: var(--neg); } .msgs.warn li { color: #7a4a0d; }
.prev-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.grid.prev td, .grid.prev th { white-space: nowrap; font-size: 12px; padding: 6px 10px; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%;
  margin: 30px auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 22px; right: 22px; background: var(--navy); color: #fff; padding: 12px 16px;
  border-radius: 8px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); z-index: 60; max-width: 420px; }
.toast.bad { background: var(--neg); }

/* ---------- users page ---------- */
.invite { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.invite .grow { flex: 1; min-width: 260px; }
.invite input { height: 34px; border: 1px solid #cfd4dc; border-radius: 6px; padding: 0 10px; font: inherit; font-size: 14px; }
.invite input:focus, select:focus { outline: 2px solid #e3929f; outline-offset: 0; }
.roles-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
#users select { min-width: 110px; height: 30px; font-size: 13px; }
#users .you { font-size: 11px; background: #eef2f7; color: var(--muted); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.badge.off { background: #f2f4f7; color: #667085; }
.badge.inv { background: #e0eaff; color: #3538cd; }
.acts { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- sign-in page ---------- */
body.welcome { background: linear-gradient(160deg, #14213d 0%, #1f3160 55%, #2a3f73 100%); align-items: center; justify-content: center; }
.welcome-wrap { width: min(460px, 92vw); padding: 40px 0; }
.welcome-card { background: #fff; border-radius: 14px; padding: 34px 34px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.brand.dark { color: var(--navy); padding: 0 0 18px; }
.brand.dark span { color: var(--accent); }
.welcome h1 { font-size: 26px; margin: 0; }
.lead { color: var(--muted); font-size: 14px; margin: 6px 0 22px; }
.btn.big { height: 46px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 15px; text-decoration: none; }
.fine { font-size: 12px; color: var(--muted); margin: 10px 0 0; text-align: center; }
.notice { background: #f8edef; border: 1px solid #e6bfc6; color: #7b1e2e; border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 16px; }
.help { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 16px; }
.help h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; }
.help details { border-bottom: 1px solid #f0f2f5; padding: 10px 0; font-size: 14px; }
.help summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.help summary::marker { color: var(--accent); }
.help p, .help li { color: #475467; line-height: 1.5; font-size: 13px; }
.help ul { padding-left: 18px; margin: 6px 0 0; }
.welcome-foot { text-align: center; color: #b8c2d9; font-size: 12px; margin-top: 16px; }
.signout { color: var(--muted); font-size: 12px; text-decoration: none; display: block; margin-top: 4px; }
.signout:hover { color: var(--accent); }

/* ---------- company logo ---------- */
.top-left { display: flex; align-items: center; gap: 16px; }
.client-logo { height: 54px; max-width: 280px; object-fit: contain; padding-right: 16px; border-right: 1px solid var(--line); }
.logo-row { display: flex; align-items: center; gap: 24px; }
.logo-preview { width: 320px; height: 120px; border: 1px dashed #cfd4dc; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; background:
  repeating-conic-gradient(#f2f4f7 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.logo-preview img { max-width: 90%; max-height: 90%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* while a report refreshes, its old numbers stay on screen, dimmed */
#page-los.loading .card { opacity: .55; transition: opacity .15s; }

/* ---------- volumes page ---------- */
#page-volumes.loading .kpis, #page-volumes.loading .card { opacity: .55; transition: opacity .15s; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; }
.kpi-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 24px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-unit { font-size: 12px; color: var(--muted); }
.kpi.hero { border-top: 3px solid var(--accent); }
.vol-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.vol-grid .card { margin-bottom: 14px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.chart-head .unit { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; font-size: 12px; color: #475467; }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart .grid { stroke: #eef0f3; stroke-width: 1; }
.chart .axis { stroke: #cfd4dc; stroke-width: 1; }
.chart .tick { font-size: 11px; fill: #667085; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; cursor: default; }
/* hover highlight: everything except the pointed-at column / well fades back */
.chart svg.hovering .col:not(.on) path, .chart svg.hovering .col:not(.on) rect:not(.hit) { opacity: .3; transition: opacity .12s; }
.chart svg.hovering .bar-row:not(.on) path, .chart svg.hovering .bar-row:not(.on) text { opacity: .35; transition: opacity .12s; }
.chart .bar-row.on path { fill: var(--accent); }
.chart .bar-row.on .bar-label, .chart .bar-row.on .bar-value { font-weight: 700; fill: var(--ink); }
.chart .col:focus, .chart .bar-row:focus { outline: none; }
.chart .bar-row { cursor: pointer; }
.chart .bar-row .hit { cursor: pointer; }
.chart .bar-label { font-size: 12px; fill: #344054; }
.chart .bar-value { font-size: 12px; fill: #475467; font-variant-numeric: tabular-nums; }
.chart-tip { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,24,40,.14); padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 150px; }
.chart-tip .tip-title { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; line-height: 1.6; }
.chart-tip .tip-row i { width: 12px; height: 2px; display: inline-block; }
.chart-tip .tip-row strong { font-variant-numeric: tabular-nums; }
.chart-tip .tip-row span { color: var(--muted); }
.vol-table th.sortable { cursor: pointer; user-select: none; }
.vol-table th.sortable:hover { color: var(--accent); }
.vol-table td { font-variant-numeric: tabular-nums; }
.vol-table tr.total td { font-weight: 700; background: var(--sub-bg); }
/* Volumes by well: the table scrolls inside its own box, with the column headers frozen at the
   top and the Total row frozen at the bottom. */
.vol-scroll { max-height: 520px; overflow: auto; }
.vol-scroll .vol-table th { position: sticky; top: 0; z-index: 2; background: var(--card); box-shadow: inset 0 -1px 0 var(--line); }
.vol-scroll .vol-table tr.total td { position: sticky; bottom: 0; z-index: 1; box-shadow: inset 0 1px 0 var(--line); }

/* ---------- collapsible left menu ---------- */
.menu-btn { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; color: var(--navy); flex: none; }
.menu-btn:hover { border-color: var(--accent); color: var(--accent); }
body.nav-collapsed .nav { display: none; }

.welcome-foot a { color: #e3929f; }
