/* Autoflows look (autoflows.com): charcoal, mint green, periwinkle; Manrope stands in for their licensed font */
:root{--bg:#232323;--card:#2d2d2d;--line:#454545;--text:#f5f5f5;--muted:#a8a8a8;--soft:#d6d6d6;--accent:#37ffaf;--accent-ink:#2d2d2d;--blue:#6e82f0;--up:#f59e0b;--down:#37ffaf}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Manrope',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;background:var(--bg);background-image:radial-gradient(1100px 520px at 85% -10%,rgba(55,255,175,.10),transparent 60%);background-repeat:no-repeat;color:var(--text);padding:28px 32px 48px;font-variant-numeric:tabular-nums}
.container{max-width:1500px;margin:0 auto}

/* Header: title and tabs on one line */
.top{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;flex-wrap:wrap;padding-bottom:18px;border-bottom:1px solid var(--line);margin-bottom:8px}
.top-logo{display:block;width:120px;height:auto;margin-bottom:12px}
.top h1{font-size:28px;font-weight:700;letter-spacing:-0.01em}
.top .meta{color:var(--muted);font-size:13px;margin-top:4px}
.tab-labels{display:flex;gap:4px;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px;flex-wrap:wrap}
.tab-labels a{padding:8px 18px;border-radius:999px;color:var(--muted);text-decoration:none;font-size:14px;font-weight:500}
.tab-labels a:hover{color:var(--text)}
.tab-labels a.on{background:var(--accent);color:var(--accent-ink);font-weight:700}
.tab-labels a:focus-visible{outline:2px solid var(--soft);outline-offset:2px}
.period{color:var(--muted);font-size:13px;margin:14px 0 6px}
.period-bar{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap}
.period-bar .period{margin-bottom:0}

/* Month tab: month switcher, a pill like the tabs */
.month-pick{display:flex;align-items:center;gap:4px;margin-top:14px;background:var(--card);border:1px solid var(--line);border-radius:999px;padding:4px}
.mp-step{display:grid;place-items:center;width:34px;height:34px;border-radius:999px;color:var(--soft);text-decoration:none;font-size:20px;line-height:1}
a.mp-step:hover{background:var(--accent);color:var(--accent-ink)}
.mp-step.off{opacity:.3}
.month-pick select{appearance:none;-webkit-appearance:none;background:transparent;border:none;color:var(--text);font:inherit;font-size:14px;font-weight:700;
  padding:8px 30px 8px 12px;border-radius:999px;cursor:pointer;min-width:150px;text-align:center;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2337ffaf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 12px center}
.month-pick select:hover{background-color:#353535}
.month-pick select option{background:var(--card);color:var(--text)}
.month-pick a:focus-visible,.month-pick select:focus-visible,.mp-go:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.mp-go{background:var(--accent);color:var(--accent-ink);border:none;border-radius:999px;padding:7px 14px;font:inherit;font-weight:700;cursor:pointer}
.mp-now{margin-left:4px;padding:7px 14px;border-radius:999px;background:var(--accent);color:var(--accent-ink);font-size:13px;font-weight:700;text-decoration:none;white-space:nowrap}
.mp-now:hover{background:#6dffc5}
.kpi-value.dim{color:var(--muted)}
.error{background:#7f1d1d;padding:14px;border-radius:8px;margin:16px 0}

/* Sections */
.sec{margin-top:34px}
.sec-head{display:flex;align-items:baseline;gap:12px;margin-bottom:14px}
.sec-head h2{font-size:17px;font-weight:600}
.sec-head p{color:var(--muted);font-size:13px}

/* Flow: four equal boxes */
.flow{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.kpi{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:20px 22px}
.kpi-value{font-size:38px;font-weight:700;line-height:1.1;color:var(--accent)}
.kpi-label{font-size:13px;color:var(--muted);margin-top:6px}
.kpi-note{font-size:12px;margin-top:8px;font-weight:500}
.kpi.net.up .kpi-value,.kpi.net.up .kpi-note{color:var(--up)}
.kpi.net.down .kpi-value,.kpi.net.down .kpi-note{color:var(--down)}

/* Backlog: one card, total on the left, what it's made of on the right */
.backlog{display:grid;grid-template-columns:220px 1fr;background:var(--card);border:1px solid var(--line);border-radius:16px;overflow:hidden}
.bl-total{padding:26px 26px;border-right:1px solid var(--line);display:flex;flex-direction:column;justify-content:center}
.kpi-value.big{font-size:56px}
.bl-detail{padding:22px 26px}
.bl-bar{display:flex;height:10px;border-radius:5px;overflow:hidden;gap:2px;background:var(--bg)}
.bl-bar span{display:block;min-width:3px}
.bl-cells{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:4px 20px;margin-top:18px}
.bl-name{font-size:13px;color:var(--muted);display:flex;align-items:center;gap:8px}
.bl-name i{width:10px;height:10px;border-radius:2px;flex-shrink:0}
.bl-val{font-size:28px;font-weight:600;margin-top:4px}
.bl-pct{font-size:12px;color:var(--muted)}
/* On hold sits beside the Backlog card, outside Open total */
.bl-row{display:grid;grid-template-columns:1fr 220px;gap:16px}
.bl-hold{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px 26px;display:flex;flex-direction:column;justify-content:center;gap:6px}

/* Card grid: 12 columns */
.grid12{display:grid;grid-template-columns:repeat(12,1fr);gap:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:22px;grid-column:span 4;min-width:0}
.card.s3{grid-column:span 3}.card.s4{grid-column:span 4}.card.s5{grid-column:span 5}.card.s6{grid-column:span 6}.card.s7{grid-column:span 7}.card.s12,.card.full{grid-column:span 12}
.card h3{font-size:15px;font-weight:600;margin-bottom:16px}
.card-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-bottom:16px}
.card-head h3{margin-bottom:0}
.card-meta{color:var(--muted);font-size:13px;white-space:nowrap}

.ht-val{font-size:40px;font-weight:700;color:var(--accent);line-height:1.1}
.ht-label{font-size:13px;color:var(--muted);margin-top:8px;line-height:1.4}
.ht-note{color:var(--muted);font-size:12px;margin-top:14px;line-height:1.5}

.bar-row,.view-row,.team-row{display:flex;align-items:center;gap:12px;margin:11px 0}
.bar-label{width:70px;color:var(--soft);font-size:13px}
.view-title{width:130px;color:var(--soft);font-size:14px}
.bar-track{flex:1;background:var(--bg);border-radius:6px;height:18px;overflow:hidden}
.bar{height:100%;border-radius:6px}
.bar-val{width:40px;text-align:right;color:var(--text);font-weight:500}
.view-total{float:right;color:var(--muted);font-size:13px;font-weight:400}
.team-name{width:150px;color:var(--soft);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.team-val{width:70px;text-align:right;color:var(--muted);font-size:12px;white-space:nowrap}
.team-val b{color:var(--text);font-size:15px;font-weight:600}
.team-count{width:72px;text-align:right;color:var(--muted);font-size:12px;white-space:nowrap}
.how{margin-top:16px;border-top:1px solid var(--line);padding-top:12px;font-size:13px;color:var(--muted)}
.how summary{cursor:pointer;color:var(--soft)}
.how p{margin-top:8px;line-height:1.5;max-width:70ch}

.legend{display:flex;gap:18px;color:var(--soft);font-size:13px;margin-bottom:12px}
.legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:middle}
.legend i.dash{width:18px;height:0;border-radius:0;border-top:2px dashed var(--soft)}
.ht-val.calc{font-size:22px;color:var(--muted)}
svg.line{width:100%;height:auto;display:block}

.foot{margin-top:40px;color:var(--muted);font-size:12px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px}
.js-test{font-size:12px}
.js-off{color:#fca5a5}
.js-on{color:var(--accent)}

@media (max-width:1100px){
  .card.s3,.card.s4,.card.s5{grid-column:span 6}
  .card.s6,.card.s7{grid-column:span 12}
}
@media (max-width:760px){
  body{padding:18px 14px 32px}
  .month-pick{width:100%;justify-content:space-between}
  .month-pick select{flex:1}
  .flow{grid-template-columns:repeat(2,1fr)}
  .backlog,.bl-row{grid-template-columns:1fr}
  .bl-total{border-right:none;border-bottom:1px solid var(--line)}
  .card.s3,.card.s4,.card.s5,.card.s6,.card.s7{grid-column:span 12}
}
.banner{background:#422006;border:1px solid #a16207;color:#fde68a;padding:12px 16px;border-radius:10px;margin:16px 0 0;font-size:14px}
.team-esc{width:96px;text-align:right;color:var(--muted);font-size:12px;white-space:nowrap}
.login-wrap{min-height:80vh;display:flex;align-items:center;justify-content:center}
.card.login{width:100%;max-width:380px;display:flex;flex-direction:column;padding:32px}
.login h1{font-size:24px;font-weight:600}
.login-sub{color:var(--muted);font-size:14px;margin:6px 0 18px}
.login-sub a{color:var(--soft)}
.login label{font-size:13px;color:var(--soft);margin:12px 0 6px}
.login input{background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:11px 12px;color:var(--text);font:inherit;font-size:15px}
.login input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent)}
.login button{margin-top:22px;background:var(--accent);color:#fff;border:none;border-radius:8px;padding:12px;font:inherit;font-weight:600;font-size:15px;cursor:pointer}
.login button:hover{filter:brightness(1.1)}
.login button:focus-visible{outline:2px solid var(--soft);outline-offset:2px}
.login-error{background:#7f1d1d;color:#fecaca;border-radius:8px;padding:10px 12px;font-size:14px;margin-bottom:4px}
/* Login page: centred card with the green wordmark */
body.login-page{min-height:100vh;
  background-image:radial-gradient(1100px 520px at 85% -10%,rgba(55,255,175,.16),transparent 60%),
                   radial-gradient(800px 480px at -10% 110%,rgba(55,255,175,.08),transparent 60%)}
.login-page .login-wrap{min-height:calc(100vh - 76px)}
.login-page .card.login{border-radius:18px;padding:36px 32px;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.login-logo{width:150px;height:auto;margin-bottom:26px}
.login-page .login h1{font-size:26px;font-weight:700;letter-spacing:-.01em}
.login-page .login input{background:#232323}
.login-page .login button{color:var(--accent-ink);border-radius:999px;font-weight:700}
.login-page .login button:hover{filter:none;background:#6dffc5}
.login-page .login-sub a{color:var(--accent)}
.meta a{color:var(--accent)}
.kpi-avg{font-size:12px;margin-top:8px;color:var(--muted);line-height:1.4}
.kpi-avg.good{color:var(--down)}
.kpi-avg.bad{color:var(--up)}

/* Info tooltip (templates/_tips.html): opens on hover, keyboard focus and tap (static/tips.js) */
.tip{position:relative;display:inline-block;vertical-align:middle;text-transform:none;letter-spacing:normal}
.tip-btn{width:18px;height:18px;border-radius:999px;border:1px solid var(--line);background:transparent;color:var(--muted);
  font:italic 700 11px/16px Georgia,serif;cursor:help;padding:0;margin-left:4px}
.tip-btn:hover,.tip.open .tip-btn,.tip-btn:focus-visible{border-color:var(--accent);color:var(--accent);outline:none}
.tip-box{position:absolute;z-index:20;left:-12px;top:calc(100% + 8px);width:300px;max-width:calc(100vw - 32px);
  padding:14px 16px;border-radius:12px;background:#1c1c1c;color:var(--text);border:1px solid var(--line);
  box-shadow:0 14px 40px rgba(0,0,0,.28);font-size:13px;font-weight:400;line-height:1.5;text-align:left;
  visibility:hidden;opacity:0;transition:opacity .12s}
.tip:hover .tip-box,.tip-btn:focus-visible + .tip-box,.tip.open .tip-box{visibility:visible;opacity:1}
.tip-box strong{display:block;font-size:14px;margin-bottom:4px}
.tip-list{display:flex;flex-direction:column;gap:4px;margin:10px 0}
.tip-list span{padding-left:20px;position:relative}
.tip-yes::before,.tip-no::before{position:absolute;left:0;font-weight:700}
.tip-yes::before{content:"✓";color:var(--accent)}
.tip-no::before{content:"✕";color:var(--up)}
.tip-foot{display:block;color:var(--muted);font-size:12px}

/* Ticket map: map left, ranked list right */
.geo{display:grid;grid-template-columns:2fr 1fr;gap:16px}
.geo-map{padding:0;overflow:hidden;grid-column:auto}
#ticket-map{height:400px;background:#1a1a1a}
.geo-list{grid-column:auto;display:flex;flex-direction:column;gap:2px}
.geo-row{display:flex;align-items:center;gap:10px;margin:7px 0}
.geo-name{width:110px;color:var(--soft);font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.geo-bar{flex:1;height:10px;background:var(--bg);border-radius:5px;overflow:hidden}
.geo-bar i{display:block;height:100%;background:var(--accent);border-radius:5px}
.geo-val{width:78px;text-align:right;color:var(--muted);font-size:12px;white-space:nowrap}
.geo-val b{color:var(--text);font-size:15px;font-weight:700;margin-right:4px}
.leaflet-container{font-family:inherit}
.leaflet-tooltip.geo-tip{background:#1c1c1c;color:var(--text);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.35)}
.leaflet-tooltip.geo-tip::before{border-top-color:var(--line)}
.leaflet-control-attribution{background:rgba(35,35,35,.75)!important;color:var(--muted)!important}
.leaflet-control-attribution a{color:var(--soft)!important}
@media (max-width:900px){.geo{grid-template-columns:1fr} #ticket-map{height:320px}}
