/* OfferHub — DMS Partner Platform look:
   dark icon rail + white flyout menu + navy/blue content on white. */

:root {
    --rail: #0b1f2a;          /* dark teal-navy icon rail */
    --rail-ink: #c8d4dc;
    --navy: #12283c;          /* dark buttons, logout card bg */
    --ink: #29425e;           /* headings */
    --text: #33475b;
    --muted: #7d8da0;
    --link: #4a6ee0;
    --lime: #b5e942;
    --bg: #fbfcfe;
    --panel: #ffffff;
    --panel-h: #eef1f6;       /* panel header band */
    --line: #dfe5ec;
    --line-soft: #ecf0f5;
    --ok: #21a453; --ok-bg: #e2f5e9;
    --warn: #a3720a; --warn-bg: #fbf0d3;
    --bad: #c22f2f; --bad-bg: #fbe3e3;
}

* { box-sizing: border-box; margin: 0; }
body { font: 14px/1.5 "Nunito Sans", "Segoe UI", -apple-system, Roboto, sans-serif;
       background: var(--bg); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ shell/rail */
.shell { display: flex; min-height: 100vh; }

.rail { width: 62px; flex-shrink: 0; background: var(--rail); color: var(--rail-ink);
        display: flex; flex-direction: column; align-items: center; gap: 8px;
        padding: 12px 0; position: sticky; top: 0; height: 100vh; z-index: 90; }
.rail a, .rail button { width: 42px; height: 42px; display: flex; align-items: center;
        justify-content: center; border-radius: 10px; color: var(--rail-ink);
        background: none; border: 0; cursor: pointer; position: relative; }
.rail a:hover, .rail button:hover { background: rgba(255,255,255,.09); color: #fff; text-decoration: none; }
.rail a.active { background: #1d3d51; color: #fff; }
.rail svg { width: 21px; height: 21px; }
.rail .spacer { flex: 1; }
.rail hr { width: 26px; border: 0; border-top: 1px solid rgba(255,255,255,.16); margin: 4px 0; }

/* Everflow-style lime tooltip callouts */
.rail a::after, .rail button::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translateY(-50%); background: var(--lime); color: var(--rail);
    font: 700 12px/1 "Nunito Sans", sans-serif; letter-spacing: .18em; text-transform: uppercase;
    padding: 12px 18px; white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity .12s ease; z-index: 80; }
.rail a::before, .rail button::before {
    content: ""; position: absolute; left: calc(100% + 2px); top: 50%;
    transform: translateY(-50%); border: 6px solid transparent;
    border-right-color: var(--lime); opacity: 0; transition: opacity .12s ease; z-index: 80; }
.rail a:hover::after, .rail button:hover::after,
.rail a:hover::before, .rail button:hover::before { opacity: 1; }

/* ------------------------- white overlay drawer: Everflow floating card */
.sidebar { background: var(--panel); position: fixed; left: 76px; top: 14px; bottom: 14px;
           z-index: 70; border-radius: 14px; box-shadow: 0 10px 34px rgba(20,40,60,.13);
           border: 1px solid var(--line);
           transform: translateX(-120%); transition: transform .16s ease; visibility: hidden;
           overflow: hidden; }
body.nav-open .sidebar { transform: none; visibility: visible; }
.drawer { display: flex; height: 100%; }
.side-col { width: 252px; overflow-y: auto; padding-bottom: 14px; }
.sub-col { width: 380px; border-left: 1px solid var(--line); overflow-y: auto;
           padding: 22px 20px 20px; display: none; }
.sidebar.sub-open .sub-col { display: block; }
.side-close { position: absolute; top: 16px; right: 18px; background: none; border: 0;
              font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px 8px; z-index: 2; }
.side-close:hover { color: var(--ink); }

/* submenu column (Reporting) */
.sub-h { display: flex; align-items: center; gap: 10px; font-size: 16.5px; font-weight: 700;
         color: var(--ink); margin: 2px 6px 12px; }
.sub-h svg { width: 19px; height: 19px; opacity: .75; }
.sub-item { display: block; padding: 9px 13px; border-radius: 7px; margin-bottom: 1px; }
.sub-item:hover { background: #f4f7fa; text-decoration: none; }
.sub-item .sub-t { font-size: 14px; font-weight: 600; color: var(--ink); }
.sub-item .sub-d { font-size: 12.5px; color: #74849a; margin-top: 1px; font-weight: 400; }

.side-brand { padding: 26px 22px 12px; text-align: center; }
.brand-mark { display: inline-flex; align-items: center; gap: 9px; font-size: 21px;
              font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
.brand-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--lime);
             display: inline-flex; align-items: center; justify-content: center;
             color: var(--navy); font-size: 14px; font-weight: 800; }
.brand-img { max-width: 190px; max-height: 76px; display: inline-block; }
.auth-card .brand-img { max-height: 90px; margin-bottom: 14px; }
.side-sub { display: flex; align-items: center; gap: 10px; color: #9aa6b4;
            font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; margin-top: 10px; font-weight: 600; }
.side-sub::before, .side-sub::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.side-nav { padding: 4px 16px 18px; }
.side-group { font-size: 10.5px; font-weight: 600; color: #97a3b2;
              text-transform: uppercase; letter-spacing: .1em; margin: 15px 12px 3px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 7px 12px;
              border-radius: 7px; color: #3c5872; font-weight: 400; font-size: 14px; }
.side-nav a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .6; }
.side-nav a:hover { background: #f4f7fa; color: var(--ink); text-decoration: none; }
.side-nav a.active { background: #f0f4f9; color: var(--ink); font-weight: 600; }
.side-nav a.active svg { opacity: .9; }
.side-nav a .pin { width: 12px; height: 12px; margin-left: auto; color: #93a3b5; opacity: 1; }

/* ---------------------------------------------------------------- content */
.main { flex: 1; min-width: 0; padding: 20px 28px 48px; }

.pagehead { display: flex; align-items: flex-start; justify-content: space-between;
            gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 2px; display: flex;
         align-items: center; gap: 6px; }
.crumb svg { width: 15px; height: 15px; }
.crumb b { color: var(--ink); font-weight: 600; }
h1 { font-size: 25px; font-weight: 900; color: var(--ink); letter-spacing: 0; }
h2 { font-size: 15px; font-weight: 800; color: var(--ink); margin: 20px 0 10px; }
.panel > h2:first-child, form.panel > h2:first-child { margin-top: 0; }
.headright { display: flex; align-items: center; gap: 14px; color: var(--muted);
             font-size: 13px; margin-top: 6px; white-space: nowrap; }

/* ------------------------------------------------------------- stat cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
         gap: 14px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stat .stat-h { background: var(--panel-h); padding: 8px 14px; font-weight: 700;
                color: var(--ink); font-size: 13.5px; }
.stat .stat-b { padding: 12px 14px 0; }
.stat .cm { display: flex; justify-content: space-between; align-items: baseline; }
.stat .cm .lbl { color: var(--muted); font-size: 12px; }
.stat .delta { font-size: 12px; font-weight: 700; }
.stat .delta.up { color: var(--ok); } .stat .delta.down { color: var(--bad); }
.stat .num { font-size: 24px; font-weight: 800; color: var(--ink); margin: 2px 0 4px; }
.stat svg.spark { width: 100%; height: 54px; display: block; }
.stat .rows { border-top: 1px solid var(--line-soft); }
.stat .rows div { display: flex; justify-content: space-between; padding: 7px 14px;
                  border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.stat .rows div:last-child { border-bottom: 0; }
.stat .rows b { color: var(--ink); }

/* legacy simple cards (still used on some pages) */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card .num { font-size: 23px; font-weight: 800; color: var(--ink); }
.card .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.card.green .num { color: var(--ok); } .card.red .num { color: var(--bad); } .card.blue .num { color: var(--link); }

/* ----------------------------------------------------------------- panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
         padding: 18px; margin-bottom: 18px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-h { background: var(--panel-h); padding: 10px 16px; font-weight: 700; color: var(--ink);
           font-size: 13.5px; display: flex; justify-content: space-between; align-items: center;
           border-bottom: 1px solid var(--line); }
.panel-h .sub { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.panel-b { padding: 16px; }
.twocol { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; align-items: start; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.kv .item { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.kv .item:last-child, .kv .item:nth-last-child(2) { border-bottom: 0; }
.kv .k { font-size: 12px; font-weight: 700; color: var(--ink); }
.kv .v { color: var(--text); margin-top: 1px; word-break: break-word; }
.kv .v.mono { font-size: 12px; }

/* ----------------------------------------------------------------- tables */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel);
        border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.panel.flush table, .panel table { border: 0; border-radius: 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
         font-size: 13.5px; vertical-align: middle; }
th { background: #e9edf3; color: var(--ink); font-size: 13px; font-weight: 700; }
th.right { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: #f6f8fb; }
.tfoot { display: flex; justify-content: flex-end; align-items: center; gap: 14px;
         padding: 10px 4px 0; color: var(--muted); font-size: 13px; }

/* dot status like DMS "● Approved" */
.dot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.ok { color: var(--ok); } .dot.ok::before { background: var(--ok); }
.dot.warn { color: var(--warn); } .dot.warn::before { background: var(--warn); }
.dot.bad { color: var(--bad); } .dot.bad::before { background: var(--bad); }
.vis-title { font-weight: 700; color: var(--ink); font-size: 13px; }

.rule-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; }
.rule-chip .tick { width: 15px; height: 15px; border-radius: 3px; background: var(--ok);
                   color: #fff; display: inline-flex; align-items: center; justify-content: center;
                   font-size: 11px; font-weight: 800; }

.pill, .badge { display: inline-block; padding: 2px 10px; border-radius: 99px;
        font-size: 12px; font-weight: 650; background: var(--line-soft); color: var(--text); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ------------------------------------------------------------------ forms */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 18px; }
label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 8px 11px; border: 1px solid #c7d0dc;
    border-radius: 8px; font: inherit; background: #fff; color: var(--text); }
textarea { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #cfdcff; border-color: var(--link); }
input[disabled] { background: var(--line-soft); color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 3px; }

.btn { display: inline-block; background: var(--navy); color: #fff; border: 0; padding: 9px 18px;
       border-radius: 9px; font: inherit; font-weight: 650; cursor: pointer; }
.btn svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }
.headright .btn { margin-right: 6px; }
td svg { width: 17px; height: 17px; vertical-align: middle; color: var(--link); }
.btn:hover { background: #1d3a52; text-decoration: none; }
.btn.blue { background: var(--link); } .btn.blue:hover { background: #3757c4; }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid #c7d0dc; }
.btn.secondary:hover { background: var(--line-soft); }
.btn.small { padding: 4px 12px; font-size: 12.5px; border-radius: 99px; }
.btn.danger { background: #c22f2f; }
.btn.danger:hover { background: #a52626; }

.searchbox { position: relative; min-width: 240px; }
.searchbox input { padding-left: 34px; border-radius: 9px; }
.searchbox svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
                 width: 16px; height: 16px; color: var(--muted); }

.flash { background: var(--ok-bg); border: 1px solid #b5e6c5; color: #177a3d;
         padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; }
.flash.bad { background: var(--bad-bg); border-color: #f0b9b9; color: var(--bad); }

.toolbar { display: flex; gap: 10px; align-items: end; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar > div { min-width: 120px; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 9px;
           overflow-x: auto; font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.right { text-align: right; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* --------------------------------------------------- reporting menu cards */
.report-menu { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
               max-width: 660px; }
.report-menu a { display: block; padding: 15px 22px; border-bottom: 1px solid var(--line-soft);
                 border-radius: 0; }
.report-menu a:first-child { border-radius: 12px 12px 0 0; }
.report-menu a:last-child { border-bottom: 0; border-radius: 0 0 12px 12px; }
.report-menu a:hover { background: #f0f3f8; text-decoration: none; }
.report-menu .rm-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.report-menu .rm-d { color: var(--text); font-size: 13.5px; margin-top: 1px; }

/* -------------------------------------------------------- login (diagonal) */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
             background: linear-gradient(115deg, #f7f8fa 0 55%, var(--navy) 55.2% 100%); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: 0 18px 60px rgba(10,30,45,.25);
             padding: 44px 48px; width: 100%; max-width: 500px; text-align: center; }
.auth-card .brand-mark { justify-content: center; margin-bottom: 18px; }
.auth-card h1 { font-size: 28px; margin-bottom: 22px; }
.auth-card form { text-align: left; }
.auth-card .btn { display: block; margin: 16px auto 0; min-width: 160px; }
.auth-sep { border: 0; border-top: 1px solid var(--line); margin: 24px 0 18px; }
.auth-foot { color: var(--text); font-size: 13.5px; }
.auth-foot .btn { display: inline-block; margin-top: 10px; }

/* ----------------------------------------------------------------- mobile */
@media (max-width: 900px) {
    .grid2, .grid3, .twocol, .kv { grid-template-columns: 1fr; }
    .sidebar { left: 0; width: min(320px, 88vw); border-radius: 0 14px 14px 0; }
    .main { padding: 14px 12px 40px; }
}
