/* =========================================================================
   OMARAIN WELL LOGGERS — shared stylesheet
   Two scopes: body.marketing (public site, light corporate) and
   body.console (authenticated app, dark operations theme).
   System font stack throughout — no external font/CDN dependency.
   ========================================================================= */
:root{
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --navy-900:#0a2436; --navy-800:#0c3049; --navy-700:#143f5c; --navy-600:#1c5478;
  --rust-700:#8f4f16; --rust-600:#b5651d; --rust-500:#c97a30; --rust-100:#fbeee1;
  --good:#0ca30c; --warning:#c98500; --critical:#c1272d;
  --white:#ffffff;
}
*,*::before,*::after{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--sans); -webkit-font-smoothing:antialiased}
img,svg{max-width:100%}
a{color:inherit; text-decoration:none}
button{font-family:inherit}
.mono{font-family:var(--mono)}
[hidden]{display:none!important}
.container{max-width:1200px; margin:0 auto; padding:0 32px}
@media (max-width:720px){ .container{padding:0 18px} }

/* ============================= MARKETING ============================= */
body.marketing{
  --bg:#ffffff; --bg-alt:#f3f6f7; --ink:#0d1b24; --ink-2:#4a5a66; --ink-muted:#7c8a94; --line:#e3e8ea;
  background:var(--bg); color:var(--ink); line-height:1.5; color-scheme:light;
}
body.marketing h1,body.marketing h2,body.marketing h3{
  font-weight:800; line-height:1.12; letter-spacing:-0.01em; margin:0; text-wrap:balance;
}
.site-header{
  position:sticky; top:0; z-index:20; background:rgba(255,255,255,.94); backdrop-filter:blur(6px);
  border-bottom:1px solid var(--line);
}
.site-header .container{display:flex; align-items:center; gap:28px; height:76px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; font-size:16.5px; color:var(--navy-800); flex:none}
.brand .mark{width:32px; height:32px; border-radius:7px; background:linear-gradient(155deg,var(--rust-500),var(--rust-700)); display:flex; align-items:center; justify-content:center; flex:none}
.brand .mark svg{width:18px; height:18px}
.brand small{display:block; font-weight:600; font-size:9.5px; letter-spacing:.14em; color:var(--ink-muted); text-transform:uppercase; margin-top:1px}
.site-nav{display:flex; gap:26px; flex:1}
.site-nav a{font-size:14px; font-weight:600; color:var(--ink-2)}
.site-nav a:hover{color:var(--navy-800)}
.header-actions{display:flex; align-items:center; gap:10px}
@media (max-width:860px){ .site-nav{display:none} }

.btn{display:inline-flex; align-items:center; justify-content:center; gap:8px; border-radius:7px; font-weight:700; font-size:14px; padding:11px 20px; border:1.5px solid transparent; cursor:pointer; transition:filter .15s, background .15s, color .15s, border-color .15s}
.btn-ghost{color:var(--navy-800); border-color:var(--line); background:transparent}
.btn-ghost:hover{border-color:var(--navy-700)}
.btn-primary{background:var(--rust-600); color:#fff}
.btn-primary:hover{background:var(--rust-700)}
.btn-outline-light{color:#fff; border-color:rgba(255,255,255,.55)}
.btn-outline-light:hover{border-color:#fff; background:rgba(255,255,255,.08)}
.btn-solid-light{background:#fff; color:var(--navy-800)}
.btn-solid-light:hover{background:#eef2f4}
.btn-sm{padding:7px 13px; font-size:12.5px; border-radius:6px}
.btn svg{width:15px; height:15px}

.hero{position:relative; overflow:hidden; background:var(--navy-900)}
.hero-art{position:absolute; inset:0}
.hero-art svg{width:100%; height:100%; display:block}
.hero-scrim{position:absolute; inset:0; background:linear-gradient(180deg, rgba(10,36,54,.25) 0%, rgba(10,36,54,.55) 55%, rgba(10,36,54,.94) 100%)}
.hero-inner{position:relative; padding:96px 0 72px; max-width:680px}
.hero-eyebrow{display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:#f0c9a3; margin-bottom:18px}
.hero-inner h1{font-size:clamp(32px,4.6vw,50px); color:#fff}
.hero-inner p{font-size:17px; color:#cfdde6; max-width:52ch; margin:18px 0 0}
.hero-cta{display:flex; gap:12px; margin-top:32px; flex-wrap:wrap}

.stats-strip{background:var(--bg-alt); border-bottom:1px solid var(--line)}
.stats-strip .container{display:grid; grid-template-columns:repeat(4,1fr); gap:0; padding:0}
.stat-cell{padding:28px 32px; border-right:1px solid var(--line)}
.stat-cell:last-child{border-right:none}
.stat-cell .n{font-size:30px; font-weight:800; color:var(--navy-800); font-variant-numeric:tabular-nums}
.stat-cell .l{font-size:12.5px; color:var(--ink-muted); margin-top:4px}
@media (max-width:860px){ .stats-strip .container{grid-template-columns:repeat(2,1fr)} .stat-cell{border-bottom:1px solid var(--line)} }

.section{padding:76px 0}
.section-head{max-width:640px; margin:0 auto 44px; text-align:center}
.section-head .kicker{font-size:12.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--rust-600)}
.section-head h2{font-size:clamp(24px,3vw,32px); margin-top:10px; color:var(--navy-900)}
.section-head p{color:var(--ink-2); margin-top:12px; font-size:15.5px}

.cap-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:20px}
@media (max-width:900px){ .cap-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:600px){ .cap-grid{grid-template-columns:1fr} }
.cap-card{border:1px solid var(--line); border-radius:12px; padding:24px; background:#fff; transition:box-shadow .15s, transform .15s}
.cap-card:hover{box-shadow:0 12px 28px -16px rgba(12,48,73,.25); transform:translateY(-2px)}
.cap-card .ic{width:38px; height:38px; border-radius:9px; background:var(--rust-100); color:var(--rust-700); display:flex; align-items:center; justify-content:center; margin-bottom:14px}
.cap-card .ic svg{width:20px; height:20px}
.cap-card h3{font-size:16px; font-weight:700; color:var(--navy-900)}
.cap-card p{font-size:13.8px; color:var(--ink-2); margin:8px 0 14px; line-height:1.55}
.cap-card .go{font-size:13px; font-weight:700; color:var(--rust-600); display:inline-flex; align-items:center; gap:5px}

.footprint-row{display:grid; grid-template-columns:repeat(4,1fr); gap:16px}
@media (max-width:760px){ .footprint-row{grid-template-columns:1fr 1fr} }
.fp-card{border:1px solid var(--line); border-radius:10px; padding:18px; background:var(--bg-alt)}
.fp-flag{width:34px; height:22px; border-radius:3px; margin-bottom:12px; box-shadow:0 0 0 1px rgba(0,0,0,.08)}
.fp-card h4{font-size:14.5px; font-weight:700; color:var(--navy-900); margin:0}
.fp-card p{font-size:12.5px; color:var(--ink-muted); margin:4px 0 0}

.cta-banner{background:linear-gradient(120deg,var(--navy-900),var(--navy-700)); color:#fff; padding:56px 0; text-align:center}
.cta-banner h2{font-size:26px; margin-bottom:10px}
.cta-banner p{color:#cfdde6; margin-bottom:26px}

.site-footer{background:var(--navy-900); color:#c6d3db; padding:56px 0 26px; font-size:13.5px}
.footer-grid{display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr; gap:32px; padding-bottom:36px; border-bottom:1px solid rgba(255,255,255,.12)}
@media (max-width:760px){ .footer-grid{grid-template-columns:1fr 1fr} }
.footer-grid h5{color:#fff; font-size:12px; letter-spacing:.1em; text-transform:uppercase; margin:0 0 14px}
.footer-grid ul{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:9px}
.footer-grid a:hover{color:#fff}
.footer-bottom{display:flex; justify-content:space-between; padding-top:20px; flex-wrap:wrap; gap:8px; color:#8fa2ae}

/* ============================= CONSOLE (app) ============================= */
body.console{
  --bg-deep:#0a0e13; --bg-panel:#121922; --bg-panel-raised:#161f2a; --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.14); --text-primary:#edf1f4; --text-secondary:#9aabb8; --text-muted:#69788a;
  --accent:#c97a30; --accent-dim:#7a4a1f;
  --s1:#3987e5; --s2:#d9772e; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#3fae3f; --s7:#9085e9; --s8:#e66767;
  --good:#0ca30c; --warning:#fab219; --critical:#d03b3b;
  background:var(--bg-deep); color:var(--text-primary); min-height:100vh; color-scheme:dark;
}
body.console table{font-variant-numeric:tabular-nums}
.app-shell{display:flex; min-height:100vh}
.sidebar{width:236px; flex:none; background:#0d1218; border-right:1px solid var(--line); display:flex; flex-direction:column; height:100vh; position:sticky; top:0}
.sidebar-head{display:flex; align-items:center; gap:10px; padding:18px 16px; border-bottom:1px solid var(--line)}
.sidebar-head .mark{width:32px; height:32px; border-radius:8px; background:linear-gradient(155deg,var(--s2),var(--accent-dim)); display:flex; align-items:center; justify-content:center; flex:none}
.sidebar-head .mark svg{width:18px; height:18px; color:#1a1204}
.sidebar-head b{font-size:14.5px; display:block}
.sidebar-head small{font-size:9.5px; color:var(--text-muted); letter-spacing:.1em; text-transform:uppercase}
.navlist{flex:1; overflow-y:auto; padding:10px}
.nav-item{display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:8px; color:var(--text-secondary); font-size:13.5px; margin-bottom:2px}
.nav-item svg{width:17px; height:17px; flex:none; opacity:.85}
.nav-item:hover{background:var(--bg-panel-raised); color:var(--text-primary)}
.nav-item.active{background:linear-gradient(90deg, rgba(201,122,48,.16), rgba(201,122,48,.02)); color:#fff; box-shadow:inset 2px 0 0 var(--accent)}
.nav-item.active svg{color:var(--accent); opacity:1}
.sidebar-foot{border-top:1px solid var(--line); padding:12px 14px; display:flex; align-items:center; gap:10px}
.avatar{width:28px; height:28px; border-radius:50%; background:linear-gradient(155deg,var(--s1),#1c5cab); display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; flex:none}
.sidebar-foot .who{flex:1; min-width:0}
.sidebar-foot .who .name{font-size:12.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.sidebar-foot .who .role{font-size:10.5px; color:var(--text-muted)}
.icon-btn{width:26px; height:26px; border-radius:6px; border:1px solid var(--line-strong); background:transparent; color:var(--text-muted); display:flex; align-items:center; justify-content:center; flex:none}
.icon-btn svg{width:14px; height:14px}
.icon-btn:hover{color:var(--critical); border-color:var(--critical)}

.main-wrap{flex:1; min-width:0; display:flex; flex-direction:column}
.topbar{display:flex; align-items:center; gap:16px; padding:14px 26px; border-bottom:1px solid var(--line); position:sticky; top:0; background:rgba(10,14,19,.85); backdrop-filter:blur(6px); z-index:5}
.topbar h1{font-size:19px; margin:0; color:#fff}
.crumb{font-size:11.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.1em; margin:0 0 2px}
.top-spacer{flex:1}
.live-chip{display:flex; align-items:center; gap:7px; font-family:var(--mono); font-size:11px; color:var(--good); border:1px solid rgba(12,163,12,.35); background:rgba(12,163,12,.08); padding:6px 10px; border-radius:999px}
.live-chip .dot{width:6px;height:6px;border-radius:50%;background:var(--good); animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
.content{flex:1; padding:24px 26px 60px; max-width:1360px; width:100%; margin:0 auto}
.intro{color:var(--text-secondary); font-size:14.5px; line-height:1.6; max-width:75ch; margin:0 0 20px}

.banner{display:flex; gap:10px; align-items:flex-start; background:rgba(201,122,48,.08); border:1px solid var(--accent-dim); color:var(--text-secondary); font-size:12.8px; line-height:1.55; padding:11px 14px; border-radius:9px; margin-bottom:18px}
.banner svg{width:16px; height:16px; flex:none; color:var(--accent); margin-top:1px}
.flash{padding:11px 14px; border-radius:9px; font-size:13px; margin-bottom:18px}
.flash.ok{background:rgba(12,163,12,.1); border:1px solid rgba(12,163,12,.35); color:#9be89b}
.flash.err{background:rgba(208,59,59,.1); border:1px solid rgba(208,59,59,.35); color:#ffb4b0}

.kpi-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:14px; margin-bottom:20px}
.kpi{background:var(--bg-panel); border:1px solid var(--line); border-radius:12px; padding:16px 17px}
.kpi .kl{font-size:11px; text-transform:uppercase; letter-spacing:.1em; color:var(--text-muted); display:flex; justify-content:space-between; align-items:center}
.kpi .kv{font-size:27px; font-weight:700; color:#fff; margin-top:6px}
.kpi .ks{font-size:11.5px; color:var(--text-secondary); margin-top:4px}
.chip{display:inline-flex; align-items:center; gap:5px; padding:2px 8px; border-radius:999px; font-size:10.5px; font-weight:600}
.chip.good{background:rgba(12,163,12,.14); color:#7be07b}
.chip.warning{background:rgba(250,178,25,.16); color:#ffcf6b}
.chip.critical{background:rgba(208,59,59,.16); color:#ff9d9d}

.grid-2{display:grid; grid-template-columns:1.3fr 1fr; gap:16px; margin-bottom:16px}
.grid-3{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:16px}
@media (max-width:960px){ .grid-2,.grid-3{grid-template-columns:1fr} }
.panel{background:var(--bg-panel); border:1px solid var(--line); border-radius:12px; padding:18px 20px}
.panel-head{display:flex; align-items:baseline; justify-content:space-between; margin-bottom:14px; gap:10px}
.panel-head h2{font-size:14.5px; margin:0; font-weight:600; color:var(--text-primary)}
.panel-head .hint{font-size:11px; color:var(--text-muted)}
.chart-wrap{position:relative; height:260px}
.chart-wrap.tall{height:320px}

table{width:100%; border-collapse:collapse; font-size:12.8px}
thead th{text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); padding:8px 10px; border-bottom:1px solid var(--line-strong); font-weight:600}
tbody td{padding:9px 10px; border-bottom:1px solid var(--line); color:var(--text-secondary); vertical-align:middle}
tbody tr:hover td{background:rgba(255,255,255,.02); color:var(--text-primary)}
td.num,th.num{text-align:right; font-family:var(--mono)}
.table-scroll{overflow-x:auto}

.tab-row{display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap}
.tab-btn{padding:8px 15px; border-radius:8px; border:1px solid var(--line); background:var(--bg-panel); color:var(--text-secondary); font-size:12.8px; font-weight:600; display:flex; align-items:center; gap:8px}
.tab-btn .flag{width:16px; height:11px; border-radius:2px; flex:none; opacity:.85}
.tab-btn.active{background:rgba(201,122,48,.14); border-color:var(--accent-dim); color:#fff}
.tab-btn:hover{color:#fff}

.form-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; align-items:end}
.field label{display:block; font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); margin-bottom:5px}
.field input,.field select,.field textarea{width:100%; padding:9px 10px; border-radius:7px; border:1px solid var(--line-strong); background:rgba(5,7,9,.5); color:var(--text-primary); font-size:13px; font-family:inherit}
.field input:focus,.field select:focus,.field textarea:focus{outline:none; border-color:var(--accent)}
.btn-app{appearance:none; border:1px solid var(--line-strong); border-radius:7px; padding:9px 14px; font-size:12.8px; font-weight:600; cursor:pointer; background:var(--bg-panel-raised); color:var(--text-primary); display:inline-flex; align-items:center; gap:7px}
.btn-app:hover{border-color:var(--accent-dim)}
.btn-app.primary{background:linear-gradient(155deg,#e0a05c,var(--accent) 65%); color:#1a1204; border:none}
.btn-app.danger:hover{border-color:var(--critical); color:#ff9d9d}
.btn-app svg{width:14px; height:14px}
.row-actions{display:flex; gap:6px; justify-content:flex-end}
.add-panel{background:var(--bg-panel); border:1px dashed var(--line-strong); border-radius:12px; padding:16px 18px; margin-bottom:18px}
.add-panel h2{font-size:13px; margin:0 0 12px; color:var(--text-secondary); text-transform:uppercase; letter-spacing:.08em}

.search-box{display:flex; align-items:center; gap:8px; background:var(--bg-panel); border:1px solid var(--line); border-radius:8px; padding:7px 11px; width:220px; color:var(--text-muted)}
.search-box svg{width:14px; height:14px; flex:none}
.search-box input{background:none; border:none; outline:none; color:var(--text-primary); font-size:12.5px; width:100%}

.zoom-toolbar{display:flex; align-items:center; gap:8px; margin-bottom:14px; flex-wrap:wrap}
.zoom-btn{width:32px; height:32px; border-radius:8px; border:1px solid var(--line-strong); background:var(--bg-panel); color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; justify-content:center}
.zoom-btn:hover{color:#fff; border-color:var(--accent-dim)}
.zoom-level{font-family:var(--mono); font-size:12px; color:var(--text-muted); width:52px; text-align:center}
.layout-stage{position:relative; height:520px; overflow:hidden; border-radius:12px; border:1px solid var(--line); background:var(--bg-panel); cursor:grab; user-select:none}
.layout-stage.grabbing{cursor:grabbing}
.layout-stage *{user-select:none}
.layout-inner{position:absolute; top:50%; left:50%; transform-origin:0 0; will-change:transform}
.layout-hint{position:absolute; bottom:10px; left:12px; font-size:11px; color:var(--text-muted); background:rgba(0,0,0,.35); padding:5px 9px; border-radius:6px}
.legend-row{display:flex; flex-wrap:wrap; gap:10px 16px; margin-top:14px; font-size:11.5px; color:var(--text-secondary)}
.legend-row .sw{display:inline-block; width:9px; height:9px; border-radius:2px; margin-right:6px; vertical-align:middle}
