/* dash.vmtads.com — tokens lifted from vmtads.com so the two sites read as one brand. */

:root {
    --amber: #ffbc45;
    --coral: #ff5959;
    --navy: #162f62;
    --muted: #8a919e;
    --line: #e5e5e5;
    --paper: #fff;
    --wash: #f6f8fb;

    --font-heading: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* The house corner: rounded except bottom-left, taken from .thm-btn. */
    --corner: 14px 14px 14px 0;
    --corner-lg: 28px 28px 28px 0;

    --shadow: 0 30px 50px rgba(25, 71, 174, .1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted);
    background: var(--wash);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brandmark {
    font-family: var(--font-heading);
    color: var(--navy);
    margin: 0;
    line-height: 1.25;
}

a { color: var(--navy); }

:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

/* ---------- Shared control language ---------- */

.field { margin-bottom: 20px; }

.field label {
    display: block;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
    margin-bottom: 7px;
}

.field input {
    width: 100%;
    padding: 13px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--navy);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--corner);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 188, 69, .18);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 13px 32px;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background-image: linear-gradient(90deg, var(--amber) 0%, var(--coral) 51%, var(--amber) 100%);
    background-size: 200% auto;
    border-radius: var(--corner-lg);
    box-shadow: var(--shadow);
    transition: background-position .5s ease;
}

.btn:hover { background-position: right center; }

.alert {
    padding: 12px 16px;
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.5;
    color: #8a2b2b;
    background: #fdecec;
    border-left: 3px solid var(--coral);
    border-radius: var(--corner);
}

/* ---------- Login ---------- */

.login-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 32px 20px;
    background:
        radial-gradient(60% 60% at 80% 10%, rgba(255, 188, 69, .16), transparent 70%),
        radial-gradient(50% 50% at 10% 90%, rgba(255, 89, 89, .14), transparent 70%),
        var(--navy);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px 40px;
    background: var(--paper);
    border-radius: var(--corner-lg);
    box-shadow: 0 40px 80px rgba(9, 22, 51, .35);
}

.login-card .logo {
    display: block;
    max-width: 132px;
    margin-bottom: 30px;
}

.login-card h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 6px;
}

.login-card .lede {
    margin: 0 0 30px;
    font-size: 15px;
    line-height: 1.6;
}

.login-foot {
    margin: 26px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--muted);
}

/* ---------- Dashboard shell ---------- */

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

.sidebar {
    flex: 0 0 240px;
    padding: 28px 20px;
    background: var(--navy);
}

.sidebar .logo { max-width: 124px; margin-bottom: 34px; }

.sidebar nav a {
    display: block;
    padding: 11px 16px;
    margin-bottom: 4px;
    font-family: var(--font-heading);
    font-size: 15px;
    color: rgba(255, 255, 255, .72);
    text-decoration: none;
    border-radius: var(--corner);
    transition: background-color .2s ease, color .2s ease;
}

.sidebar nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.sidebar nav a[aria-current="page"] {
    color: var(--navy);
    background: var(--amber);
    font-weight: 500;
}

.main { flex: 1; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 32px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.topbar .who {
    font-family: var(--font-heading);
    font-size: 15px;
    color: var(--navy);
}

.topbar .who span { display: block; font-family: var(--font-body); font-size: 13px; color: var(--muted); }

.signout {
    padding: 8px 20px;
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--navy);
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--corner);
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}

.signout:hover { border-color: var(--coral); color: var(--coral); }

.content { padding: 32px; }

.panel {
    max-width: 640px;
    padding: 34px 32px;
    background: var(--paper);
    border-radius: var(--corner-lg);
    box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
}

.panel h2 { font-size: 21px; font-weight: 600; margin-bottom: 10px; }
.panel p { margin: 0; font-size: 15px; }

.panel code, .footnote code {
    padding: 2px 6px;
    font-size: 13px;
    color: var(--navy);
    background: var(--wash);
    border-radius: 6px;
}

/* ---------- Reports ---------- */

.report-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 24px;
    margin-bottom: 24px;
}

.report-head h1 { font-size: 26px; font-weight: 600; }
.report-head .sub { margin: 4px 0 0; font-size: 15px; }

.period-picker { display: flex; align-items: center; gap: 10px; }

.period-picker label {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--navy);
}

.period-picker select,
.period-picker button,
.link-btn {
    padding: 9px 16px;
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--navy);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--corner);
}

.period-picker button, .link-btn { cursor: pointer; text-decoration: none; transition: border-color .2s ease; }
.period-picker button:hover, .link-btn:hover { border-color: var(--amber); }

.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tile {
    padding: 20px 22px;
    background: var(--paper);
    border-radius: var(--corner-lg);
    box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
}

.tile .label { margin: 0 0 6px; font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }

.tile .value {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--navy);
    font-variant-numeric: tabular-nums;
}

.tile .hint { margin: 4px 0 0; font-size: 13px; font-variant-numeric: tabular-nums; }

.tile-lead { background: var(--navy); }
.tile-lead .label { color: rgba(255, 255, 255, .7); }
.tile-lead .value { color: var(--amber); }

.table-card {
    background: var(--paper);
    border-radius: var(--corner-lg);
    box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
    overflow: hidden;
}

.table-scroll { overflow-x: auto; }

table.report {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

.report th, .report td {
    padding: 13px 18px;
    text-align: left;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.report thead th {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    background: var(--wash);
}

.report thead a { color: var(--navy); text-decoration: none; }
.report thead a:hover { color: var(--coral); }
.report th[aria-sort] a { color: var(--coral); }

.report .num { text-align: right; }
.report td { color: #4a5263; }
.report .strong { font-weight: 500; color: var(--navy); }

.report tbody tr:hover td { background: #fbfcfe; }

/* App bundles arrive as long encoded domains; keep the row height sane and show the rest on hover. */
.report .site span {
    display: block;
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--navy);
    font-weight: 500;
}

.report .site small { display: block; font-size: 12px; color: var(--muted); }

.report tfoot th, .report tfoot td {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--navy);
    background: var(--wash);
    border-bottom: none;
}

.share-col { width: 180px; }

.share {
    display: inline-block;
    width: 100px;
    height: 8px;
    margin-right: 8px;
    vertical-align: middle;
    background: var(--wash);
    border-radius: 4px 4px 4px 0;
    overflow: hidden;
}

.share span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--amber), var(--coral));
}

.share-pct { font-size: 13px; }

.footnote { margin: 16px 4px 0; font-size: 13px; line-height: 1.6; }

.exports { margin-bottom: 24px; }

.illustrative {
    margin: 0 0 12px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #6b4a00;
    background: #fff7e6;
    border-left: 3px solid var(--amber);
    border-radius: var(--corner);
}

.illustrative strong { color: var(--navy); }

/* Keep the label in any screenshot of the table itself. */
.illustrative-caption {
    caption-side: top;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 500;
    text-align: left;
    color: #6b4a00;
    background: #fff7e6;
    border-bottom: 1px solid #f5d79a;
}

.report .country { color: var(--navy); font-weight: 500; }
.report .country small { color: var(--muted); font-weight: 400; }

.block-form { max-width: none; margin-bottom: 8px; }
.block-form form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 16px; margin-top: 16px; }
.block-form .field { flex: 1 1 240px; margin-bottom: 16px; }
/* Same look as .field input: 16px text, house corner, amber focus ring. */
.block-form select {
    width: 100%;
    height: 50px;
    padding: 0 42px 0 16px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--navy);
    background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23162f62' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
    border: 1px solid var(--line);
    border-radius: var(--corner);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.block-form select:hover { border-color: #d3d7de; }
.block-form select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 4px rgba(255, 188, 69, .18);
}
.block-form select:invalid { color: var(--muted); }
.locked {
    display: inline-block;
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--muted);
    background: var(--wash);
    border: 1px dashed var(--line);
    border-radius: var(--corner);
    white-space: nowrap;
    cursor: help;
}
.block-form .btn-inline { height: 50px; padding: 0 28px; line-height: 50px; white-space: nowrap; }
.btn-inline { width: auto; margin-bottom: 16px; }

.flash {
    padding: 12px 16px;
    margin-bottom: 22px;
    font-size: 15px;
    color: #1d5b34;
    background: #e9f7ee;
    border-left: 3px solid #3aa364;
    border-radius: var(--corner);
}
.flag-emoji { margin-right: 8px; }
.exports a.strong { color: var(--navy); font-weight: 500; }


.crumb { margin: 0 0 6px; font-size: 14px; }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--coral); }

.meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px 24px;
    margin: 0 0 20px;
    padding: 20px 24px;
    background: var(--paper);
    border-radius: var(--corner-lg);
    box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
}

.meta dt { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.meta dd { margin: 2px 0 0; color: var(--navy); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }


.section-title { margin: 28px 0 12px; font-size: 18px; font-weight: 600; }
.section-title span { margin-left: 8px; font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--muted); }

.report.daily .group th {
    padding-top: 16px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--navy);
    background: var(--paper);
    border-bottom: 2px solid var(--line);
}

.report.daily .group span { display: block; max-width: 640px; overflow: hidden; text-overflow: ellipsis; }
.report.daily .subtotal td { font-weight: 500; color: var(--navy); background: var(--wash); }

/* ---------- RTB (simulated) ---------- */

.chart-card { padding: 18px 20px 10px; }
.bars rect { fill: var(--amber); }
.bars rect:hover { fill: var(--coral); }
.bars .grid { stroke: var(--line); stroke-width: 1; }
.bars .axis { font-size: 11px; fill: var(--muted); font-family: var(--font-body); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 24px; }

.matrix td { background: rgba(255, 89, 89, calc(var(--heat) * .22)); }
.matrix tbody th { font-family: var(--font-heading); color: var(--navy); font-weight: 500; }

.xc-chain { display: flex; align-items: center; margin: 0 0 22px; overflow-x: auto; }
.xc-node {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    border: 1px solid;
    border-radius: var(--corner);
    background: var(--paper);
}
.xc-node.demand { color: #1f4fae; border-color: #bcd2f8; background: #edf3fe; }
.xc-node.core   { color: var(--paper); border-color: var(--navy); background: var(--navy); }
.xc-node.supply { color: #157a47; border-color: #b8e6cc; background: #edf9f2; }
.xc-link { flex: 1 0 70px; position: relative; height: 40px; }
.xc-link::before { content: ''; position: absolute; left: 0; right: 0; top: 20px; border-top: 1px dashed #cdd5e0; }
.xc-link span {
    position: absolute; left: 50%; top: 20px; transform: translate(-50%, -50%);
    padding: 1px 9px; font-size: 12px; background: var(--wash); border-radius: 20px;
}

.xc-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
    margin-bottom: 22px; padding: 16px 20px;
    background: var(--paper); border-radius: var(--corner-lg); box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
}
.xc-controls label { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-size: 14px; color: var(--navy); }
.xc-controls select { padding: 9px 12px; font-size: 14px; color: var(--navy); border: 1px solid var(--line); border-radius: var(--corner); background: var(--paper); max-width: 260px; }
.xc-controls .btn-inline { margin: 0; padding: 10px 22px; }
.xc-controls .xc-check { font-family: var(--font-body); color: var(--muted); }
.xc-clock { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--navy); font-weight: 500; }

.xc-grid { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 20px; margin-bottom: 22px; }
.xc-col {
    padding: 18px 18px 14px; background: var(--paper);
    border-radius: var(--corner-lg); box-shadow: 0 10px 30px rgba(25, 71, 174, .06);
}
.xc-col h2 { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.xc-col h2 span { margin-left: 6px; font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--muted); }
.xc-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; font-size: 13px; }
.xc-list li { display: flex; justify-content: space-between; padding: 5px 8px; border-radius: 8px 8px 8px 0; color: #4a5263; transition: background-color .2s ease; }
.xc-list li b { font-weight: 500; font-variant-numeric: tabular-nums; }
.xc-list li.bid { background: #edf3fe; color: #1f4fae; }
.xc-list li.win { background: #1f4fae; color: #fff; }
.xc-list li.no_bid, .xc-list li.withheld { color: #b3b9c4; }
.xc-list li.timeout { color: var(--coral); }
.xc-list.supply li.active { background: #edf9f2; color: #157a47; font-weight: 500; }

.xc-stages { list-style: none; margin: 0 0 14px; padding: 0; }
.xc-stages li { padding: 9px 12px; margin-bottom: 6px; border-left: 3px solid var(--line); border-radius: 0 10px 10px 0; background: var(--wash); }
.xc-stages li strong { font-family: var(--font-heading); font-size: 13px; color: var(--navy); font-weight: 500; }
.xc-stages li p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; }
.xc-stages li.done { border-left-color: #3aa364; animation: xcIn .3s ease; }
.xc-stages li.failed { border-left-color: var(--coral); background: #fdecec; animation: xcIn .3s ease; }
@keyframes xcIn { from { opacity: .25; } }

.xc-rules h3 { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.xc-rules ul { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.xc-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.xc-totals div { padding: 8px; text-align: center; background: var(--wash); border-radius: 10px 10px 10px 0; }
.xc-totals b { display: block; font-family: var(--font-heading); font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
.xc-totals span { font-size: 12px; }

.xc-tape { margin-bottom: 22px; padding: 14px 18px; background: var(--navy); border-radius: var(--corner-lg); }
.xc-tape h2 { font-size: 14px; color: var(--amber); margin-bottom: 8px; }
.xc-tape div > div {
    display: grid; grid-template-columns: 70px 1fr 40px 90px 2fr 60px; gap: 10px;
    padding: 3px 0; font-size: 13px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums;
    animation: xcIn .3s ease;
}
.xc-tape div > div.won span:nth-child(5) { color: var(--amber); }
.xc-tape div > div.refused span:nth-child(5) { color: var(--coral); }
.report tr.is-win td { background: #fff7e6; font-weight: 500; }
.report td small { color: var(--muted); font-weight: 400; }

@media (max-width: 1100px) {
    .xc-grid { grid-template-columns: 1fr; }
    .xc-list { max-height: 220px; }
}

@media (max-width: 720px) {
    .split { grid-template-columns: 1fr; }
    .xc-tape div > div { grid-template-columns: 60px 1fr 34px 1.5fr; }
    .block-form .btn-inline { width: 100%; }
    .xc-tape div > div span:nth-child(4), .xc-tape div > div span:nth-child(6) { display: none; }
    .report-head h1 { font-size: 22px; }
    .tiles { grid-template-columns: 1fr 1fr; gap: 12px; }
    .tile { padding: 16px 18px; }
    .tile-lead { grid-column: 1 / -1; }
    .tile .value { font-size: 22px; }
    .report .site span { max-width: 200px; }
    .shell { flex-direction: column; }
    .sidebar { flex: none; padding: 20px; }
    .sidebar .logo { margin-bottom: 18px; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 6px; }
    .sidebar nav a { margin: 0; }
    .topbar, .content { padding: 18px 20px; }
    .login-card { padding: 34px 26px 30px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
