/* Shared form language: quiet graphite surfaces, mint focus and consistent spacing. */
:root { --control-bg:#111c20; --control-hover:#213238; --control-radius:9px; --control-height:40px; --muted:var(--text-muted); }
button,input,textarea,select { font-family:var(--font-new); }
:where(.ui-new,.ui-legacy,.reports-page,.earnings-page) :is(.input,.select,.textarea),
:where(.reports-field,.earnings-filters,.earnings-form,.cf,.mrow) > :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),textarea),
.card-bottom textarea {
    background:var(--control-bg); border:1px solid var(--border); border-radius:var(--control-radius);
    color:var(--text); font-size:14px; box-shadow:none; transition:border-color .15s,box-shadow .15s,background-color .15s;
}
:where(.ui-new,.ui-legacy) :is(input.input,select.select) { min-height:var(--control-height); }
:where(input,textarea)::placeholder { color:#81989e; opacity:1; }
:where(input,textarea,select):hover:not(:disabled):not([readonly]) { border-color:#49615f; }
:where(.ui-new,.ui-legacy,.reports-page,.earnings-page) :is(input,textarea,select):focus-visible {
    outline:2px solid var(--green); outline-offset:2px; border-color:var(--green); box-shadow:0 0 0 4px #8ee3bc10;
}
:where(input,textarea,button,select):disabled { cursor:not-allowed; opacity:.5; }
:where(input,textarea)[readonly] { color:var(--text-muted); }
:where(.ui-new,.ui-legacy) .btn { min-height:36px; border-radius:var(--control-radius); transition:background-color .15s,border-color .15s; }
:where(.ui-new,.ui-legacy) .btn:not(.btn-primary):not(:disabled):hover { background:var(--control-hover); border-color:#49615f; }
.dropdown-menu { padding:6px; border-radius:12px; box-shadow:0 16px 45px #0006; }
.dropdown-menu :is(a,button) { border-radius:7px; min-height:36px; }
.dropdown-menu .sep { background:var(--border); margin:6px 0; }
.modal,.drawer { box-shadow:0 24px 80px #0006; }
.modal-head { border-radius:10px 10px 0 0; }
/* Custom drawn checkboxes/radios also cover legacy tables and report filters. */
body input:is([type=checkbox],[type=radio]):not([hidden]) {
    appearance:none; -webkit-appearance:none; position:relative; display:inline-grid; place-content:center;
    width:17px; height:17px; min-height:17px; padding:0; margin:0 5px 0 0; flex:none; vertical-align:-3px;
    background:var(--control-bg); border:1px solid #53696b; border-radius:5px; cursor:pointer; box-shadow:none;
}
body input[type=radio]:not([hidden]) { border-radius:50%; }
body input:is([type=checkbox],[type=radio]):not([hidden])::after { content:none; }
body input[type=checkbox]:not([hidden]):checked { background:var(--green); border-color:var(--green); }
body input[type=checkbox]:not([hidden]):checked::after {
    content:""; position:static; width:5px; height:9px; border:solid #103527; border-width:0 2px 2px 0; transform:translateY(-1px) rotate(45deg);
}
body input[type=checkbox]:not([hidden]):indeterminate { background:var(--green); border-color:var(--green); }
body input[type=checkbox]:not([hidden]):indeterminate::after { content:""; position:static; width:8px; height:2px; background:#103527; border:0; transform:none; }
body input[type=radio]:not([hidden]):checked { border-color:var(--green); background:var(--control-bg); }
body input[type=radio]:not([hidden]):checked::after { content:""; position:static; width:7px; height:7px; border-radius:50%; background:var(--green); }
body input:is([type=checkbox],[type=radio]):not([hidden]):disabled { opacity:.45; cursor:not-allowed; }
input[type=file] { max-width:100%; font-size:13px; color:var(--text-muted); }
input[type=file]::file-selector-button { font:inherit; color:var(--green); background:#253c35; border:1px solid #385b4a; border-radius:8px; padding:9px 13px; margin-right:12px; cursor:pointer; }
input[type=range] { accent-color:var(--green); }
/* Original select stays available to FormData and browser constraint validation. */
.tk-select { position:relative; display:inline-flex; vertical-align:middle; width:100%; max-width:100%; min-width:0; }
body select.tk-select-source { position:absolute!important; inset:0!important; width:100%!important; height:100%!important; min-width:0!important; opacity:0!important; pointer-events:none!important; margin:0!important; }
.tk-select-trigger {
    display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-width:0; min-height:var(--control-height);
    padding:9px 12px; background:var(--control-bg); border:1px solid var(--border); border-radius:var(--control-radius);
    color:var(--text); font:400 14px/1.4 var(--font-new); text-align:left; cursor:pointer; transition:border-color .15s,background .15s;
}
.tk-select-trigger:hover:not(:disabled) { background:#16252a; border-color:#49615f; }
.tk-select-trigger[aria-expanded=true] { border-color:var(--green); box-shadow:0 0 0 3px #8ee3bc12; }
.tk-select-trigger[aria-invalid=true] { border-color:var(--danger); }
.tk-select-caption { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; min-width:0; }
.tk-select-chevron { width:7px; height:7px; border:solid #93b6ab; border-width:0 1.5px 1.5px 0; transform:translateY(-2px) rotate(45deg); flex:none; transition:transform .15s; }
[aria-expanded=true] > .tk-select-chevron { transform:translateY(2px) rotate(225deg); }
.tk-select-popup {
    position:fixed; z-index:1200; display:flex; flex-direction:column; padding:6px; overflow:hidden;
    background:#1a292d; border:1px solid #3b5553; border-radius:12px; box-shadow:0 18px 55px #0008;
    color:var(--text); font:14px/1.4 var(--font-new);
}
.tk-select-search { flex:none; width:100%; min-height:38px; margin:0 0 6px; padding:8px 11px; border:1px solid var(--border); border-radius:7px; color:var(--text); background:var(--control-bg); outline:none; }
.tk-select-search:focus { border-color:#81c7aa; }
.tk-select-options { overflow:auto; overscroll-behavior:contain; min-height:0; scrollbar-width:thin; scrollbar-color:#47665c transparent; }
.tk-select-option { position:relative; padding:10px 34px 10px 11px; border-radius:7px; cursor:pointer; overflow-wrap:anywhere; }
.tk-select-option.is-highlighted { background:#2a423b; color:#c0f8dc; }
.tk-select-option[aria-selected=true] { color:var(--green); font-weight:500; }
.tk-select-option[aria-selected=true]::after { content:"✓"; position:absolute; right:12px; top:10px; }
.tk-select-option[aria-disabled=true] { opacity:.4; cursor:not-allowed; }
.tk-select-empty,.tk-select-group { padding:10px 11px; color:var(--text-muted); }
.tk-select-group { font-size:11px; letter-spacing:.04em; font-weight:600; }
.tk-select-hint { flex:none; padding:9px 10px 3px; margin-top:5px; border-top:1px solid var(--border); color:var(--text-muted); font-size:11px; }
.tk-select-validation { position:absolute; top:100%; left:0; z-index:1; color:var(--danger); background:var(--panel); font-size:12px; padding:3px 6px; border-radius:4px; }
.pager .tk-select,.pager-right .tk-select { width:auto; min-width:76px; }
.pager .tk-select-trigger { min-height:34px; padding:6px 10px; }
.team-bulk > .tk-select,.team-actions > .tk-select,.filter-box > .tk-select { width:200px; flex:0 1 200px; }
.sched-row > .tk-select { width:172px; }
.card-bottom .result-row > .tk-select { width:260px; }
.fcontrol.w-300 > .tk-select { width:300px; }
@media(max-width:600px) {
    .tk-select-trigger { min-height:42px; }
    .tk-select-option { padding-top:12px; padding-bottom:12px; }
    .tk-select-hint { display:none; }
    .card-bottom .result-row { flex-wrap:wrap; }
    .card-bottom .result-row > .tk-select { width:100%; }
    .team-bulk > .tk-select,.team-actions > .tk-select,.filter-box > .tk-select { flex:1 1 160px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }
@media(forced-colors:active) {
    body input:is([type=checkbox],[type=radio]):not([hidden]) { appearance:auto; }
    body input:is([type=checkbox],[type=radio]):not([hidden])::after { display:none; }
    .tk-select-option.is-highlighted { outline:1px solid Highlight; }
}
.tk-suggestions { overflow:auto; }
.tk-dialog { width:min(440px,calc(100vw - 32px)); padding:26px; background:var(--panel); border:1px solid #3b5553; border-radius:16px; color:var(--text); box-shadow:0 24px 90px #0009; }
.tk-dialog::backdrop { background:#061013b8; backdrop-filter:blur(3px); }
.tk-dialog h2 { font-size:20px; font-weight:600; margin-bottom:14px; }
.tk-dialog p { color:var(--text-label); font-size:14px; line-height:1.65; white-space:pre-line; overflow-wrap:anywhere; }
.tk-dialog-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; margin-top:24px; }
.tk-dialog-actions button { padding:10px 16px; border-radius:8px; font-weight:500; border:1px solid var(--border); cursor:pointer; }
.tk-dialog-cancel { background:var(--wash); color:var(--text); }
.tk-dialog-confirm { background:var(--green); color:#11251c; }

/* Rail labels stay centered and compact; each section has a legible icon. */
.control-rail nav a { text-align:center; line-height:1.35; }
.control-rail nav a > .icon { width:20px; height:20px; }
.control-rail nav a[href="/earnings"] > span { white-space:nowrap; font-size:10px; letter-spacing:-.15px; }

/* Persistent attendance controls live outside .ui-new/.ui-legacy. */
.work-clock { gap:10px; align-items:center; }
.work-clock [data-work-toggle] {
    display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:36px; padding:8px 13px;
    border:1px solid #426c59; border-radius:9px; background:#243d32; color:#a6efca;
    font:600 13px/1.3 var(--font-new); white-space:nowrap; cursor:pointer; transition:background .15s,border-color .15s;
}
.work-clock [data-work-toggle]::before { content:""; width:0; height:0; border-left:6px solid currentColor; border-top:4px solid transparent; border-bottom:4px solid transparent; }
.work-clock [data-work-toggle]:hover:not(:disabled) { background:#30503f; border-color:var(--green); }
.work-clock [data-work-toggle]:disabled { background:#1b292b; border-color:#344549; color:#8caaa4; opacity:1; cursor:not-allowed; }
.work-clock[data-working=true] [data-work-toggle] { background:var(--wash); border-color:#46565b; color:var(--text); }
.work-clock[data-working=true] [data-work-toggle]::before { width:7px; height:10px; border:solid currentColor; border-width:0 2px; }
.work-clock [data-work-state] { display:flex; align-items:center; gap:6px; font-size:11px; line-height:1.35; color:var(--text-muted); }
.work-clock [data-work-state]:empty { display:none; }
.work-clock [data-work-state]::before { content:""; width:6px; height:6px; flex:none; border-radius:50%; background:#b9a778; }
.work-clock[data-working=true] [data-work-state]::before { background:var(--green); box-shadow:0 0 0 3px #8ee3bc12; }
@media(max-width:1000px) { .work-clock [data-work-state] { display:none; } }

.recording-player { display:flex; align-items:center; flex-wrap:wrap; gap:10px; width:340px; max-width:100%; padding:11px 12px; border:1px solid #32474a; border-radius:12px; background:#132126; color:var(--text); }
.recording-player.is-playing { border-color:#4c8169; }
.recording-player button,.recording-player a { appearance:none; display:inline-flex; align-items:center; justify-content:center; flex:none; padding:0; text-decoration:none; cursor:pointer; }
.recording-player svg { width:17px; height:17px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.recording-player .recording-play { width:34px; height:34px; border:1px solid #45765b; border-radius:10px; background:#284937; color:#a4f1c9; }
.recording-play:hover { background:#355f47; }
.recording-timeline { flex:1; min-width:72px; }
.recording-times { display:flex; justify-content:space-between; gap:8px; margin-top:1px; color:var(--text-muted); font:11px/1.2 var(--font-new); font-variant-numeric:tabular-nums; }
.recording-player .recording-action,.recording-player .recording-speed { width:24px; height:28px; border:0; border-radius:6px; background:transparent; color:#9dbbb0; }
.recording-player .recording-action:hover,.recording-player .recording-speed:hover { background:#2a3d36; color:var(--green); }
.recording-player .recording-speed { width:30px; font:600 11px var(--font-new); }
.recording-player .recording-range { display:block; appearance:none; -webkit-appearance:none; width:100%; height:16px; padding:0; margin:0; background:transparent; border:0; cursor:pointer; }
.recording-range::-webkit-slider-runnable-track { height:3px; background:linear-gradient(to right,#8ee3bc var(--played,0%),#3d5355 var(--played,0%)); border-radius:3px; }
.recording-range::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; height:10px; width:10px; margin-top:-3.5px; border:0; border-radius:50%; background:var(--green); }
.recording-range::-moz-range-track { height:3px; background:#3d5355; border-radius:3px; }
.recording-range::-moz-range-progress { background:var(--green); height:3px; }
.recording-range::-moz-range-thumb { height:10px; width:10px; border:0; border-radius:50%; background:var(--green); }
.recording-player .recording-volume { width:38px; flex:none; }
.recording-player .recording-status { flex-basis:100%; color:var(--text-muted); font-size:11px; line-height:1.4; }
@media(max-width:600px) { .recording-player { gap:8px; padding:10px; } .recording-player .recording-volume { display:none; } }

/* Call history: one aligned record, without nested cards or distant metadata. */
.call-history { container-type:inline-size; max-width:1100px; margin:0; padding:0 8px; }
.call-history .call-history-item { display:grid; grid-template-columns:100px minmax(0,420px) minmax(140px,1fr); gap:10px 22px; align-items:start; padding:16px 0; margin:0; border-bottom:1px solid var(--border); }
.call-history .when { grid-column:1; grid-row:1 / span 2; display:flex; flex-direction:column; gap:5px; font-variant-numeric:tabular-nums; }
.call-history .history-date { color:var(--text-muted); font-size:12px; }
.call-history time { font-size:14px; color:var(--text); }
.history-identity { grid-column:2; min-width:0; }
.history-number { display:flex; align-items:center; gap:8px; line-height:1.5; }
.history-number .icon { width:14px; height:14px; color:var(--text-muted); }
.call-history .history-number a { color:var(--text); font-size:14px; text-decoration:none; font-variant-numeric:tabular-nums; }
.call-history .history-number a:hover { text-decoration:underline; }
.history-meta { display:flex; flex-wrap:wrap; gap:4px 12px; margin:5px 0 0 22px; color:var(--text-muted); font-size:12px; overflow-wrap:anywhere; }
.history-meta span + span { border-left:1px solid #415054; padding-left:12px; }
.history-result { grid-column:3; display:flex; flex-direction:column; gap:5px; text-align:left; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.history-duration { color:var(--text-muted); font-size:12px; font-variant-numeric:tabular-nums; }
.call-history .history-recording { grid-column:2 / -1; min-width:0; }
.history-comment { grid-column:2 / -1; font-size:13px; line-height:1.5; color:var(--text-label); white-space:pre-wrap; overflow-wrap:anywhere; }
.history-no-recording { font-size:12px; color:var(--text-muted); }
.call-history .recording-player { width:440px; padding:0; gap:10px; border:0; border-radius:0; background:transparent; }
.call-history .recording-play { width:30px; height:30px; border:1px solid #3c4e51; border-radius:6px; background:transparent; color:var(--text-label); }
.call-history .recording-play:hover,.call-history .is-playing .recording-play { color:var(--green); border-color:#699884; background:#8ee3bc08; }
.call-history .recording-action,.call-history .recording-speed { color:var(--text-muted); }
.call-history .recording-times { font-size:10px; }
.call-history .recording-range::-webkit-slider-thumb { width:8px; height:8px; margin-top:-2.5px; background:#a6bab2; }
.call-history .recording-range::-moz-range-thumb { width:8px; height:8px; background:#a6bab2; }
.call-history .hitem-sys { padding:16px 0; margin:0; text-align:left; background:transparent; color:var(--text-muted); font-size:12px; }
@container (max-width:620px) {
    .call-history .call-history-item { grid-template-columns:76px minmax(0,1fr); column-gap:14px; padding:16px 0; }
    .call-history .history-result { grid-column:2; flex-direction:row; justify-content:space-between; text-align:left; gap:12px; }
    .call-history .history-recording,.call-history .history-comment { grid-column:2; }
    .call-history .history-meta { margin-left:0; }
    .call-history .recording-volume { display:none; }
}
