/* Admin Control Center, org chart and tenure leaderboard. Uses the tokens from staff.css. */

/* ---------- Control Center ---------- */
.dot-blue { background: var(--accent); }
.tabs-scroll { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: thin; }
.tabs-scroll .tab { white-space: nowrap; }
.tab-count { font-style: normal; font-size: 11px; font-weight: 700; min-width: 18px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
a.kpi:hover { border-color: var(--accent); transform: translateY(-2px); }
.kpi span { color: var(--muted); font-size: 13px; font-weight: 500; }
.kpi strong { font-family: var(--font-display); font-size: 28px; line-height: 1.1; }
.kpi .kpi-name { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { color: var(--faint); font-size: 12px; }
.kpi.hot { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.kpi.hot strong { color: var(--accent); }
.spark { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 150px; }
.spark-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.spark-col span { width: 100%; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent)); min-height: 4px; }
.spark-col small { color: var(--faint); font-size: 11px; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick a { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 600; font-size: 13px; transition: border-color .15s, color .15s; }
.quick a:hover { border-color: var(--accent); color: var(--accent); }
.quick .ico { width: 16px; height: 16px; color: var(--accent); }
.role-row { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.role-row:last-child { border-bottom: 0; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form, .row-actions a { display: inline-block; margin-left: 4px; }
.inline-form select { padding: 5px 8px; font-size: 13px; width: auto; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; font-size: 13px; }
.clamp-cell { max-width: 280px; }

/* ---------- Team: org chart ---------- */
.team-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.find { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--faint); min-width: 260px; }
.find input { border: 0 !important; box-shadow: none !important; background: transparent; padding: 9px 0; }
.org { display: flex; flex-direction: column; align-items: center; }
.org-tier { display: flex; justify-content: center; width: 100%; }
.org-node { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); }
.org-node::before { content: ""; position: absolute; left: 16px; right: 16px; top: -1px; height: 3px; border-radius: 0 0 4px 4px; background: var(--tone, var(--accent)); }
.lead-node { width: min(640px, 100%); }
.tone-owner { --tone: var(--accent); }
.tone-admin { --tone: var(--accent); }
.tone-crimson { --tone: var(--crimson); }
.tone-teal { --tone: var(--teal); }
.tone-brass { --tone: var(--brass); }
.tone-blue { --tone: var(--accent); }
.node-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.node-head .ico { color: var(--tone); }
.node-head h3 { font-size: 17px; }
.dept-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--tone) 16%, transparent); }
.dept-ico .ico { width: 20px; height: 20px; color: var(--tone); }
.org-line { width: 2px; height: 34px; background: var(--line-strong); }
.org-branch { position: relative; width: 100%; height: 40px; display: grid; grid-template-columns: repeat(3, 1fr); }
.org-branch::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 20px; background: var(--line-strong); }
.org-branch::after { content: ""; position: absolute; left: 16.66%; right: 16.66%; top: 20px; height: 2px; background: var(--line-strong); }
.org-branch span { position: relative; }
.org-branch span::after { content: ""; position: absolute; left: 50%; top: 20px; width: 2px; height: 20px; background: var(--line-strong); }
.org-depts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; width: 100%; align-items: start; }
.dept-node .sub { margin: -4px 0 12px; }
.dept-block { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 12px; margin-top: 12px; }
.lead-block { border-left-color: var(--tone); }
.block-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; transition: border-color .15s, transform .15s, opacity .15s; max-width: 100%; }
.person-chip:hover { border-color: var(--tone, var(--accent)); transform: translateY(-1px); }
.person-chip strong { white-space: nowrap; }
.person-chip .faint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-chip.is-away { opacity: .7; }
.away-tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); }
.is-hidden { display: none !important; }
.is-match { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-glow); }

/* ---------- Team: tenure ---------- */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: end; max-width: 820px; margin-left: auto; margin-right: auto; }
.podium-spot { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 14px 0; border-radius: 16px 16px 0 0; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; overflow: hidden; transition: transform .2s; }
.podium-spot:hover { transform: translateY(-3px); }
.podium-spot .avatar { width: 72px; height: 72px; margin-bottom: 6px; }
.place-1 .avatar { width: 92px; height: 92px; border-color: var(--accent); }
.place-2 .avatar { border-color: #b9c3d3; }
.place-3 .avatar { border-color: #5a7fae; }
.podium-spot .place { position: absolute; top: 10px; left: 12px; font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--faint); }
.place-1 .place { color: var(--accent); }
.podium-days { font-family: var(--font-display); font-weight: 700; font-size: 16px; margin-top: 4px; }
.podium-base { display: block; width: calc(100% + 28px); margin-top: 14px; border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--accent-soft), transparent); }
.place-1 .podium-base { height: 90px; }
.place-2 .podium-base { height: 56px; }
.place-3 .podium-base { height: 34px; }
.is-me { box-shadow: inset 0 0 0 2px var(--accent); }
.tier-pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.tier-crown { background: linear-gradient(90deg, #3d8bff, #9cc8ff); color: #03101f; }
.tier-gold { background: #0f2a55; color: #8fc1ff; }
.tier-brass { background: #0f2238; color: #6ab0e8; }
.tier-ember { background: #121c2a; color: #9fb6d4; }
.tier-none { background: var(--surface-2); color: var(--faint); }
[data-theme="light"] .tier-gold { background: #dbe8fd; color: #1a4fa8; }
[data-theme="light"] .tier-brass { background: #e0f0fb; color: #0e5b8c; }
[data-theme="light"] .tier-ember { background: #eef2f7; color: #475b78; }
.board .rank { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--faint); width: 40px; }
.board tbody tr:first-child .rank { color: var(--accent); }
.board .who { display: flex; align-items: center; gap: 10px; }
.board tr.is-me td { background: var(--accent-soft); }
.tier-bars { display: grid; gap: 10px; }
.tier-bar { display: grid; grid-template-columns: 76px 1fr 28px; align-items: center; gap: 10px; }
.tier-bar strong { text-align: right; }

@media (max-width: 1000px) {
  .org-depts { grid-template-columns: 1fr; }
  .org-branch { display: none; }
}
@media (max-width: 700px) {
  .podium { grid-template-columns: 1fr; }
  .podium-base { display: none; }
  .podium-spot { border-radius: 16px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
  .quick { grid-template-columns: 1fr; }
}
