/* v0.8 — one shared visual system; no remote assets or fonts. */
:root {
  --bg: #f5f6f8; --card: #fff; --ink: #20252e; --muted: #68717d;
  --line: #e5e8ed; --blue: #286be8; --navy: #20252e; --soft: #edf3ff;
  --green: #24755f; --greenbg: #edf7f2; --red: #b53f4b; --redbg: #fdf0f1;
  --shadow: 0 5px 24px rgba(30,45,70,.035), 0 1px 3px rgba(30,45,70,.025);
}
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; background: radial-gradient(ellipse at 85% 0%, #eef1f9 0, transparent 44%), var(--bg); color: var(--ink); }
::selection { background: #d5e4ff; }
a { text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
.topbar { min-height: 88px; padding: 18px max(28px, calc((100vw - 1392px) / 2)); background: rgba(255,255,255,.82); color: var(--ink); border-bottom: 1px solid rgba(224,229,236,.8); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); gap: 18px; }
.brand { font-size: 17px; font-weight: 650; letter-spacing: -.035em; display: flex; align-items: center; gap: 12px; }
.brand::before { content: ""; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(145deg,#a9dbc9,#72bca8 48%,#77a7e9); box-shadow: inset 0 1px 1px #ffffffb0, 0 3px 8px #518b9e22; }
.muted-light { color: var(--muted); font-size: 11px; letter-spacing: .03em; margin-left: 44px; }
.top-actions { gap: 8px; }
.ghost-link, .ghost { color: #434d5c; background: #f1f3f6; border: 1px solid transparent; border-radius: 999px; padding: 9px 15px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.ghost-link:hover, .ghost:hover { background: #e7ebf1; color: var(--ink); }
.user-chip { color: #697383; font-size: 11px; background: none; padding: 0 8px; }
.container, .presence-container, .initiatives-container, .discipline-container, .users-container { max-width: 1392px; padding: 44px 36px 72px; }
.page-head { margin-bottom: 30px; gap: 28px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .11em; font-weight: 650; color: #4c78a9; }
h1 { font-size: clamp(26px,2.7vw,38px); letter-spacing: -.045em; font-weight: 650; line-height: 1.16; margin: 10px 0 14px; max-width: 900px; text-wrap: balance; }
h2, h3 { letter-spacing: -.025em; font-weight: 650; }
.muted { line-height: 1.7; max-width: 900px; }
.dashboard-head { position: relative; overflow: hidden; padding: 38px; border-radius: 30px; border: 1px solid #e1e6f0; background: radial-gradient(ellipse at 100% 0%, #e2efeb 0%, transparent 54%), linear-gradient(115deg,#eef0fb,#f7f9fc 75%); align-items: center; min-height: 260px; }
.dashboard-head > div:first-child { flex: 1; min-width: 0; }
.dashboard-head h1 { max-width: 820px; }
.position-switcher { gap: 6px; margin-top: 22px; }
.position-switcher a { border: 1px solid transparent; background: #ffffff85; padding: 7px 12px; font-size: 11px; border-radius: 11px; color: #596579; }
.position-switcher a.active { color: #254f92; background: #fff; border-color: #dce4ef; box-shadow: 0 2px 6px #30487809; }
.score { padding: 22px 26px; min-width: 190px; max-width: 300px; border-radius: 22px; border: 1px solid #e4e9ef; box-shadow: var(--shadow); }
.score strong { font-size: 42px; font-weight: 650; letter-spacing: -.06em; font-variant-numeric: tabular-nums; margin: 5px 0; }
.score span, .score small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.dashboard-head .score { background: #ffffffa8; border-color: #ffffffb0; backdrop-filter: blur(16px); padding: 26px 30px; min-width: 235px; }
.dashboard-head .score strong { font-size: 64px; }
.score-danger { background: #fff5f5; border-color: #efd3d8; }
.grid { gap: 20px; }
.card, .summary-card, .panel-block, .panel, .login-card { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; }
.card { padding: 28px; --accent: #527cdb; }
.card[data-metric=presence] { --accent: #4d9f85; }
.card[data-metric=initiatives] { --accent: #aa82c5; }
.card[data-metric=discipline] { --accent: #c39354; }
.card-link:hover { transform: translateY(-3px); box-shadow: 0 12px 30px #273f5c0b; border-color: #cbd6e4; }
.card-top { align-items: center; }
.card-top h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.card-top h2::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--accent); box-shadow: 0 0 0 5px color-mix(in srgb,var(--accent) 10%,transparent); }
.weight, .badge, .section-badge { padding: 6px 11px; border-radius: 999px; background: #f0f3f7; color: #5a697d; font-size: 11px; font-weight: 650; white-space: nowrap; }
.metric { margin: 30px 0 17px; gap: 10px; }
.metric strong { font-size: 44px; font-weight: 600; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: 12px; }
.progress { height: 6px; background: #f0f2f5; }
.progress div { background: var(--accent,var(--blue)); }
.card-footer { gap: 20px; line-height: 1.5; margin-top: 18px; }
.card-footer span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.open-hint { color: #65768a; font-size: 11px; margin-top: 20px; font-weight: 500; }
.panel-block, .panel { padding: 28px; margin-top: 22px; margin-bottom: 22px; }
.panel h2, .panel-block h2 { font-size: 18px; font-weight: 650; margin-bottom: 9px; }
.panel p, .panel-block p { font-size: 13px; line-height: 1.7; }
.panel { background: #ffffff80; box-shadow: none; }
.section-title { gap: 16px; margin-bottom: 22px; }
.summary-grid { gap: 16px; margin-bottom: 24px; }
.summary-card { padding: 22px 24px; background: #ffffffd9; }
.summary-card > span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.summary-card > strong, .territory-container .summary-card strong { font-size: 30px; letter-spacing: -.045em; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }
button { background: #286be8; border-radius: 12px; padding: 11px 17px; font-size: 13px; font-weight: 600; transition: background .15s,box-shadow .15s; line-height: 1.4; }
button:hover { background: #1d5fd8; box-shadow: 0 4px 10px #286be81c; }
button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.secondary-btn { color: #4e5b6e; background: #eff2f6; }
.secondary-btn:hover { color: #29384b; background: #e3e9f0; }
.small-btn { font-size: 12px; padding: 10px 14px; }
label { font-size: 12px; font-weight: 600; color: #526073; }
input:not([type=checkbox]):not([type=radio]), select, textarea,
.initiative-main input,.initiative-main textarea,.initiative-result input,.initiative-result select,.initiative-result textarea,.initiative-add-form textarea,.presence-table select,.user-create-grid select,.pyrus-map-grid select,.user-access-form select { border: 1px solid #dde3eb; background: #fbfcfe; color: var(--ink); border-radius: 11px; padding: 11px 12px; font-size: 13px; line-height: 1.4; min-width: 0; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--blue); cursor: pointer; padding: 0; }
input[readonly], textarea[readonly] { background: #f3f5f8 !important; color: #667486; }
select:disabled { color: #667486; opacity: .8; }
input:focus-visible,select:focus-visible,textarea:focus-visible { outline: 3px solid #286be827; outline-offset: 1px; border-color: #7da5ee; }
a:focus-visible,button:focus-visible,summary:focus-visible { outline: 3px solid #286be870; outline-offset: 4px; }
textarea { resize: vertical; min-height: 82px; }
.presence-table-wrap, .discipline-table-wrap { border-radius: 16px; border-color: var(--line); }
.quality-table-wrap { overflow-x: auto; }
table { font-variant-numeric: tabular-nums; }
.quality-table { width: 100%; border-collapse: collapse; min-width: 540px; }
.presence-table th,.discipline-table th,.quality-table th { padding: 15px 16px; background: #f7f9fb; color: #718095; font-size: 10px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--line); text-align: left; }
.presence-table td,.discipline-table td,.quality-table td { padding: 15px 16px; border-bottom: 1px solid #edf0f4; font-size: 13px; line-height: 1.5; }
.presence-table tr:hover td,.quality-table tr:hover td { background: #f8faff; }
.quality-table tr:last-child td { border-bottom: 0; }
.info-box,.alert,.stop-box { border-radius: 16px; padding: 17px 20px; font-size: 13px; line-height: 1.6; }
.info-box { background: #eef4fc; border-color: #dce7f5; color: #49678c; flex-wrap: wrap; }
.alert.error,.stop-box { background: #fdf1f2; border-color: #efdadd; color: #a33a49; }
.alert.success { background: #edf7f2; border-color: #d6eadd; color: #287355; }
.empty-state { padding: 38px; border-radius: 18px; border-color: #dbe2eb; background: #fafbfd; }
.scale-grid > div,.rules-grid > div { border-radius: 16px; padding: 20px; background: #f8f9fb; border-color: #e9edf3; }
.rules-grid strong { font-size: 17px; }
.month-chip { border-radius: 13px; padding: 12px 15px; }
.position-checks { gap: 10px; background: #f8fafc; padding: 14px; border-radius: 14px; }
.position-checks label,.position-checks.compact label { font-size: 12px; line-height: 1.5; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.user-row { grid-template-columns: 145px minmax(0,1fr) 165px; padding: 22px; border-radius: 18px; background: #fff; gap: 20px; }
.user-access-form { grid-template-columns: 140px minmax(0,1fr) 130px; gap: 12px; }
.user-main strong { font-size: 15px; letter-spacing: -.02em; }
.user-controls { gap: 9px; }
.pyrus-map-grid { grid-template-columns: minmax(170px,1fr) minmax(220px,1.4fr) 135px 135px auto; gap: 12px; }
.temp-password { border-radius: 18px; padding: 22px; }
.initiative-item { padding: 24px; border-radius: 20px; gap: 20px; }
.initiative-number { background: #f0edf8; color: #8d70ac; border-radius: 12px; }
.expected-result { background: #f7f9fb; border-radius: 14px; padding: 16px; }
.territory-form { gap: 20px; max-width: none; }
.territory-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.territory-form legend { color: #526073; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
.territory-form .position-checks label { display: flex; }
.territory-record { padding: 22px 0; }
.login-wrap { background: radial-gradient(ellipse at 20% 15%,#e8e8fa,transparent 55%),radial-gradient(ellipse at 90% 80%,#deeee8,transparent 55%),#f5f7fa; }
.login-card { padding: 40px; width: min(460px,100%); background: #ffffffc9; backdrop-filter: blur(20px); border-color: #fff; box-shadow: 0 24px 80px #425f7c12; }
.login-card .brand { font-size: 22px; line-height: 1.25; }
.login-card button { width: 100%; margin-top: 18px; }
@media(min-width:1600px) { .container { padding-top: 52px; } }
@media(max-width:1150px) {
 .user-row { grid-template-columns: 125px minmax(0,1fr); }
 .user-access-form { grid-template-columns: 130px minmax(0,1fr); }
 .user-access-form button { grid-column: 2; justify-self: start; }
 .user-controls { grid-column: 2; flex-direction: row; }
 .user-controls form { width: auto; }
 .pyrus-map-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:900px) {
 .container { padding: 30px 22px 48px; }
 .dashboard-head { padding: 28px; align-items: flex-start; }
 .dashboard-head .score { min-width: 190px; }
 .dashboard-head .score strong { font-size: 52px; }
 .user-row,.user-access-form { grid-template-columns: 1fr; }
 .user-access-form button,.user-controls { grid-column: auto; }
 .user-controls { flex-wrap: wrap; }
 .initiative-item { padding: 20px; }
 .rules-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:640px) {
 .topbar { padding: 16px 18px; gap: 14px; }
 .brand { font-size: 15px; line-height: 1.4; }
 .brand::before { width: 28px; height: 28px; border-radius: 9px; }
 .muted-light { margin-left: 40px; }
 .top-actions { width: 100%; gap: 6px; }
 .top-actions .ghost-link { display: inline-flex; }
 .ghost-link,.ghost { padding: 8px 12px; font-size: 11px; }
 .container { padding: 26px 16px 40px; }
 .dashboard-head { border-radius: 24px; padding: 24px; gap: 22px; }
 .page-head { flex-direction: column; align-items: stretch; }
 h1 { font-size: 28px; }
 .dashboard-head .score,.score { width: 100%; max-width: none; min-width: 0; }
 .dashboard-head .score { padding: 20px 24px; }
 .grid { grid-template-columns: 1fr; gap: 16px; }
 .card,.panel-block,.panel { padding: 22px; border-radius: 20px; }
 .summary-grid,.presence-summary,.initiatives-summary,.discipline-summary { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
 .summary-card { padding: 18px; border-radius: 18px; }
 .summary-card > strong,.territory-container .summary-card strong { font-size: 24px; }
 .panel { flex-direction: column; align-items: flex-start; }
 .pyrus-map-grid,.user-create-grid { grid-template-columns: 1fr; }
 .rules-grid,.scale-grid { grid-template-columns: 1fr; }
 .card-footer { flex-wrap: wrap; gap: 8px; }
 .login-card { padding: 28px; }
}
@media(prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } *,*::before,*::after { transition:none!important; animation:none!important; } .card-link:hover { transform:none; } }

/* v0.8.1: compact operational dashboard. */
.dashboard-page .topbar { min-height: 68px; padding-top: 10px; padding-bottom: 10px; }
.dashboard-page .brand { font-size: 16px; }
.dashboard-page .brand::before { width: 28px; height: 28px; border-radius: 9px; }
.dashboard-page .muted-light { margin-left: 40px; font-size: 10px; }
.container.dashboard { max-width: 1680px; display: grid; grid-template-columns: 232px minmax(0,1fr); gap: 24px; align-items: start; padding: 24px 28px 32px; }
.container.dashboard-single { grid-template-columns: minmax(0,1fr); }
.position-sidebar { padding: 16px 10px; background: #ffffff9c; border: 1px solid #e3e8ef; border-radius: 18px; position: sticky; top: 20px; }
.sidebar-heading { padding: 0 12px 12px; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; color: #758094; }
.position-sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.position-nav-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; text-decoration: none; font-size: 12px; line-height: 1.5; color: #5a6577; border-radius: 12px; border: 1px solid transparent; transition: background .15s; }
.position-nav-item:hover { background: #f0f3f8; }
.position-nav-item.active { background: #eaf2ef; color: #275f51; border-color: #dce9e3; font-weight: 600; }
.position-nav-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #bac3ce; margin-top: 6px; }
.position-nav-item.active .position-nav-dot { background: #509b84; box-shadow: 0 0 0 3px #509b8412; }
.sidebar-period { margin: 16px 12px 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 11px; color: #758094; }
.dashboard-workspace { min-width: 0; }
.dashboard .dashboard-head { min-height: 0; padding: 20px 24px; gap: 24px; border-radius: 20px; margin-bottom: 18px; align-items: center; flex-direction: row; }
.dashboard-head .eyebrow { font-size: 10px; letter-spacing: .07em; }
.dashboard .dashboard-head h1 { font-size: clamp(22px,1.9vw,29px); margin: 7px 0 0; line-height: 1.2; letter-spacing: -.035em; }
.dashboard .dashboard-head .score { min-width: 154px; width: auto; max-width: 245px; flex: 0 0 auto; padding: 12px 18px; border-radius: 15px; }
.dashboard .dashboard-head .score strong { font-size: 36px; margin: 2px 0; line-height: 1.15; }
.dashboard .dashboard-head .score span { font-size: 10px; }
.dashboard .dashboard-head .score small { font-size: 10px; max-width: 210px; display: block; }
.dashboard .dashboard-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.dashboard .dashboard-metrics-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
.dashboard .card { padding: 18px 20px; border-radius: 18px; }
.dashboard .card-top { align-items: flex-start; gap: 10px; }
.dashboard .card-top h2 { font-size: 14px; line-height: 1.4; margin: 0; min-height: 39px; align-items: flex-start; }
.dashboard .card-top h2::before { width: 7px; height: 7px; margin-top: 6px; }
.dashboard .weight { font-size: 10px; padding: 4px 8px; }
.dashboard .metric { margin: 10px 0 12px; gap: 8px; flex-wrap: wrap; }
.dashboard .metric strong { font-size: 32px; line-height: 1.1; }
.dashboard .metric span { font-size: 11px; }
.dashboard .progress { height: 5px; }
.dashboard .card-footer { font-size: 10px; margin-top: 10px; gap: 12px; line-height: 1.45; }
.dashboard .open-hint { margin-top: 10px; font-size: 10px; }
.dashboard-footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 2px 0; }
.dashboard-method { font-size: 11px; color: var(--muted); max-width: 850px; }
.dashboard-method summary { cursor: pointer; width: fit-content; }
.dashboard-method p { margin: 10px 0 0; line-height: 1.65; }
.dashboard-version { font-size: 10px; color: #8a95a5; white-space: nowrap; }
.dashboard .alert { padding: 12px 16px; font-size: 12px; }
@media(min-width:1540px) { .dashboard .dashboard-metrics-four { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media(max-width:1050px) {
 .container.dashboard { grid-template-columns: 205px minmax(0,1fr); gap: 18px; padding: 20px; }
 .container.dashboard-single { grid-template-columns: 1fr; }
 .dashboard .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .dashboard .dashboard-head { padding: 18px; gap: 16px; }
 .dashboard .dashboard-head .score { min-width: 132px; padding: 12px; }
 .dashboard .dashboard-head h1 { font-size: 23px; }
}
@media(max-width:700px) {
 .container.dashboard { grid-template-columns: minmax(0,1fr); gap: 16px; padding: 16px; }
 .position-sidebar { position: static; padding: 12px; border-radius: 16px; }
 .sidebar-heading { padding: 0 4px 8px; }
 .position-sidebar nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
 .position-nav-item { flex: 0 0 210px; padding: 10px; font-size: 11px; }
 .sidebar-period { display: none; }
 .dashboard .dashboard-head { gap: 16px; padding: 18px; }
 .dashboard .dashboard-head h1 { font-size: 21px; }
 .dashboard .dashboard-head .score { min-width: 100px; max-width: 140px; }
 .dashboard .dashboard-head .score strong { font-size: 29px; }
 .dashboard .dashboard-head .score small { font-size: 9px; }
 .dashboard .card { padding: 16px; }
 .dashboard .card-top h2 { font-size: 13px; }
 .dashboard .metric strong { font-size: 29px; }
 .dashboard .card-footer { flex-wrap: wrap; }
}
@media(max-width:480px) {
 .dashboard .dashboard-head { flex-direction: column; align-items: stretch; gap: 12px; }
 .dashboard .dashboard-head .score { max-width: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; }
 .dashboard .dashboard-head .score small { max-width: none; }
 .dashboard .dashboard-metrics { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .dashboard .card-top h2 { min-height: 0; }
}

/* Explicit stop state wins over the neutral dashboard styles. */
.dashboard .dashboard-head .score.score-danger,.score.score-danger{background:#fff0f1;border-color:#d87985;box-shadow:0 0 0 1px #d8798522}
.dashboard .dashboard-head .score.score-danger strong,.score.score-danger strong{color:#b42339}
.dashboard .dashboard-head .score.score-danger .stop-explanation,.score.score-danger .stop-explanation{color:#9e1c30;font-weight:700}
.dashboard .card.card-stop{--accent:#c62943;background:#fff4f5;border-color:#d87985}
.dashboard .card.card-stop .metric strong,.dashboard .card.card-stop .card-footer span{color:#b42339}
.dashboard .card.card-stop .progress{background:#f5d6dc}
.stop-badge{display:inline-block;background:#fbe0e5;color:#9e1c30;padding:6px 9px;border-radius:8px;font-size:11px;font-weight:700;line-height:1.4;margin-top:10px}
.dashboard-method[open]{width:100%;max-width:920px;padding:18px 20px;background:#fff;border:1px solid var(--line);border-radius:16px;font-size:13px;color:var(--ink);box-sizing:border-box}
.dashboard-method h3{font-size:15px;margin:22px 0 8px;line-height:1.4}.dashboard-method h3:first-of-type{margin-top:14px}
.dashboard-method p,.dashboard-method li{font-size:13px;line-height:1.7}.dashboard-method ul,.dashboard-method ol{padding-left:21px;margin:8px 0}
.dashboard-method .method-note{padding:10px 12px;background:#f3f6fa;border-radius:9px}.dashboard-method .method-stop{background:#fff0f1;color:#9e1c30}
.quality-state-error{border-color:#d87985!important;background:#fff4f5!important}.quality-state-error>strong{color:#b42339}
