/* 3Dtracking brand (as KPI, the sales planner and the dashboard): dark teal #00444E, logo blue #00A0BE,
   logo orange #F49600, ink #171B25, light grey #F4F6FA, Inter. */
:root {
  --brand-teal: #00444E; --brand-blue: #00A0BE; --brand-orange: #F49600;
  --bg: #F4F6FA; --surface: #FFFFFF; --sunken: #EBEFF4; --ink: #171B25; --muted: #5A6472; --line: #DCE2EA;
  --field: #FFFFFF; --field-line: #D3DBE4;
  --accent: #00444E; --accent-ink: #FFFFFF; --accent-soft: #DCEFF2; --accent-text: #00707F;
  --bar: #00A0BE; --bonus: #F49600; --bonus-soft: #FCEBD0; --bonus-text: #8A5300;
  --red: #C8372D; --red-soft: #F9E0DD; --amber: #C77700; --amber-soft: #FCEBD0; --green: #1D8A55; --green-soft: #DDF1E6;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D1518; --surface: #15222A; --sunken: #101B21; --ink: #E6EDF2; --muted: #93A3AE; --line: #263842;
  --field: #1C2B34; --field-line: #3A5062;
  --accent: #2FB8D1; --accent-ink: #0D1518; --accent-soft: #10343D; --accent-text: #5CCDE2;
  --bar: #2FB8D1; --bonus: #F5A938; --bonus-soft: #33281A; --bonus-text: #F5C27A;
  --red: #F0766E; --red-soft: #3A1E1F; --amber: #F5A938; --amber-soft: #33281A; --green: #4FC38C; --green-soft: #15302A;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0D1518; --surface: #15222A; --sunken: #101B21; --ink: #E6EDF2; --muted: #93A3AE; --line: #263842;
  --field: #1C2B34; --field-line: #3A5062;
  --accent: #2FB8D1; --accent-ink: #0D1518; --accent-soft: #10343D; --accent-text: #5CCDE2;
  --bar: #2FB8D1; --bonus: #F5A938; --bonus-soft: #33281A; --bonus-text: #F5C27A;
  --red: #F0766E; --red-soft: #3A1E1F; --amber: #F5A938; --amber-soft: #33281A; --green: #4FC38C; --green-soft: #15302A;
  color-scheme: dark }

* { box-sizing: border-box }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font) }
:root { --page-w: 1180px }
.app { max-width: var(--page-w); margin: 0 auto; padding: 16px 16px 64px }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; margin: 0 }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px }
.num { font-variant-numeric: tabular-nums }
a { color: var(--accent-text) }
[hidden] { display: none !important }

/* The title bar, period bar, tabs and page footer are in chrome.css (shared by every app). */
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--accent-text) }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-weight: 600; text-decoration: none; color: var(--ink) }
.btn:hover { border-color: var(--muted) }
.btn.sm { padding: 4px 10px; font-size: 13px }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent) }
.btn:disabled { opacity: .6; cursor: default }
.field { border: 1px solid var(--field-line); background: var(--field); border-radius: 8px; padding: 7px 10px; min-width: 0; width: 100% }
.hint { color: var(--muted); font-size: 13px; margin: 0 }
.err { color: var(--red) }
.loading { color: var(--muted) }
.notice { background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 16px; font-size: 14px }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center }
.empty b { color: var(--ink); font-size: 16px }

.signin { max-width: 420px; margin: 48px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 12px }
.btn.ms { justify-content: center; padding: 10px 14px }
.mslogo { display: grid; grid-template-columns: 8px 8px; gap: 2px }
.mslogo i { width: 8px; height: 8px; display: block }

.periodbar-what small { color: var(--muted); font-size: 14px }
.teamchip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap }
.bonuschip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--bonus-soft); color: var(--bonus-text); white-space: nowrap; vertical-align: 1px }

/* Headline figures */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px 14px; display: grid; gap: 4px; align-content: start }
.stat.lead { border-top: 4px solid var(--accent-text) }
.label { font-size: 12.5px; font-weight: 600; color: var(--muted) }
.big { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums }
.sub { color: var(--muted); font-size: 12.5px }
.rules { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin: 0 0 16px }
.rules b { color: var(--ink) }

/* Commission by month: bar chart */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px }
.panel > h3 { font-size: 16px; margin-bottom: 12px }
.chartwrap { position: relative }
.bars { width: 100%; height: auto; display: block; overflow: visible; font-family: var(--font) }
.bars .grid { stroke: var(--line); stroke-width: 1 }
.bars .ylab { fill: var(--muted); font-size: 12px; text-anchor: end; font-variant-numeric: tabular-nums }
.bars .xlab { fill: var(--muted); font-size: 12px; text-anchor: middle }
.bars .xlab.on { fill: var(--ink); font-weight: 700 }
.bars .bar { fill: var(--bar) }
.bars .bar.bonus { fill: var(--bonus) }
.bars .bar.now { opacity: .55 }
.bars .vlab { fill: var(--ink); font-size: 11.5px; font-weight: 600; text-anchor: middle; font-variant-numeric: tabular-nums }
.bars .hit { fill: transparent; cursor: pointer }
.bars .hit:hover, .bars .hit.on { fill: var(--accent-soft); opacity: .6 }
.charttip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: #171B25; color: #FFFFFF; border: 1px solid #3A4656; border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; display: grid; gap: 2px; white-space: nowrap; pointer-events: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .25) }
.charttip .tipval { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px }
.legend span { display: inline-flex; align-items: center; gap: 6px }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--bar) }
.legend i.bonus { background: var(--bonus) }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) }
table { width: 100%; border-collapse: collapse; font-size: 14px }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle }
thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600 }
tbody th { font-weight: 600 }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums }
tfoot th, tfoot td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 700 }
td.muted, .muted { color: var(--muted) }
tr.month { cursor: pointer }
tr.month:hover, tr.month.on { background: var(--accent-soft) }
tr.month .caret { display: inline-block; width: 1em; color: var(--muted); transition: transform .15s }
tr.month.on .caret { transform: rotate(90deg) }
tr.deals > td { background: var(--sunken); padding: 8px 12px 10px 40px; white-space: normal }
.deallist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13.5px }
.deallist li { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap }
.deallist time { color: var(--muted); font-variant-numeric: tabular-nums }
table.everyone td.r small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 500 }
table.everyone td.bonus { color: var(--bonus-text); font-weight: 700 }
table.everyone tbody th small { display: block; color: var(--muted); font-weight: 500; font-size: 12px }
.teamhead th { background: var(--sunken); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted) }

/* People (super-administrators) */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted) }
.form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink) }
.form .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; grid-column: 1 / -1 }
.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 999px; background: var(--sunken); color: var(--muted) }
tr.off td, tr.off th { opacity: .55 }

@media (max-width: 640px) {
  .who .me { display: none }
  .big { font-size: 24px }
  tr.deals > td { padding-left: 12px }
}
