/* public/assets/css/s50-shift-performance-ui.css
   KHMER HRMS — S50 UI refresh: Shift time picker + Performance Voting
   Uses ONLY theme variables (Day/Night + colour-theme safe).
   Loaded after s45 so it can refine earlier rules. */

/* ═══════════════════════════════════════════════════════════════
   1. SHIFT — Working-hours panel (Start / End time)
   ═══════════════════════════════════════════════════════════════ */
.shift-time-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 18px;
    box-shadow: var(--shadow-ambient);
}
.shift-time-head {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
}
.shift-time-title {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 0.95rem; color: var(--text);
}
.shift-time-title svg { width: 18px; height: 18px; color: var(--primary); }

.shift-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.shift-preset {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--border); background: var(--bg); color: var(--text);
    font-size: 0.8rem; font-weight: 600; line-height: 1.2;
    transition: border-color .15s, background .15s, transform .15s;
}
.shift-preset small { color: var(--text-muted); font-weight: 500; font-size: 0.72rem; }
.shift-preset:hover { border-color: var(--primary); transform: translateY(-1px); }
.shift-preset.is-active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
}

.shift-time-row {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: stretch; gap: 12px;
}
.shift-time-tile {
    position: relative;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--bg); padding: 12px 14px 12px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.shift-time-tile:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}
.shift-time-tile label {
    display: flex; align-items: center; gap: 8px;
    margin: 0 0 6px; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.shift-time-tile label .shift-dot {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
}
.shift-time-tile label .shift-dot svg { width: 13px; height: 13px; }
.shift-time-tile.is-end label .shift-dot {
    background: color-mix(in srgb, var(--warning, #F59E0B) 18%, transparent);
    color: var(--warning, #F59E0B);
}
/* The input itself: big, borderless, tabular — the tile is the "field". */
.shift-time-panel .shift-time-tile input[type="time"] {
    width: 100%; box-sizing: border-box;
    border: 0 !important; background: transparent !important; box-shadow: none !important;
    padding: 2px 0 !important; margin: 0;
    font-size: 1.9rem; font-weight: 700; letter-spacing: .02em;
    font-variant-numeric: tabular-nums; color: var(--text);
    min-height: 0; height: auto;
}
.shift-time-panel .shift-time-tile input[type="time"]:focus { outline: none; }
.shift-time-panel input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer; opacity: .7; padding: 6px; border-radius: 6px;
    filter: var(--calendar-icon-filter, none);
}
.shift-time-panel input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1; background: var(--surface-alt);
}
[data-theme="dark"] .shift-time-panel input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); }

.shift-time-arrow {
    align-self: center; display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--surface-alt); color: var(--text-muted);
}
.shift-time-arrow svg { width: 16px; height: 16px; transform: rotate(-90deg); }

.shift-time-summary {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
    margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
    font-size: 0.85rem; color: var(--text-muted);
}
.shift-time-summary b { color: var(--text); font-size: 0.98rem; font-variant-numeric: tabular-nums; }
.shift-time-summary .shift-chip {
    display: none; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
    background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary);
}
.shift-time-summary .shift-chip svg { width: 13px; height: 13px; }
.shift-time-summary .shift-chip.is-on { display: inline-flex; }
.shift-time-help { margin: 10px 0 0; font-size: 0.78rem; color: var(--text-muted); }

@media (max-width: 640px) {
    .shift-time-panel { padding: 14px; }
    .shift-time-row { grid-template-columns: 1fr; gap: 8px; }
    .shift-time-arrow { margin: -2px auto; }
    .shift-time-arrow svg { transform: none; }
    .shift-time-panel .shift-time-tile input[type="time"] { font-size: 1.6rem; }
}

/* ═══════════════════════════════════════════════════════════════
   2. PERFORMANCE VOTING — shared pieces
   ═══════════════════════════════════════════════════════════════ */
.pv-hero {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
    padding: 22px 24px; margin-bottom: var(--space-3);
    border-radius: var(--radius); border: 1px solid var(--border);
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 55%),
        var(--surface);
    box-shadow: var(--shadow-ambient);
}
.pv-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pv-hero-icon {
    flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff;
}
.pv-hero-icon svg { width: 24px; height: 24px; }
.pv-hero-title { margin: 0; font-size: 1.05rem; font-weight: 700; }
.pv-hero-sub { margin: 2px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.pv-status {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 12px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
    background: var(--surface-alt); color: var(--text-muted);
}
.pv-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pv-status.is-open { color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent); }
.pv-status.is-open::before { animation: pvPulse 1.8s ease-in-out infinite; }
@keyframes pvPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.pv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: var(--space-3); }
.pv-stat {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow-ambient);
}
.pv-stat-icon {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary);
}
.pv-stat-icon svg { width: 19px; height: 19px; }
.pv-stat-val { display: block; font-size: 1.35rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pv-stat-lbl { display: block; font-size: 0.74rem; color: var(--text-muted); margin-top: 2px; }

.pv-progress { flex: 1 1 260px; min-width: 220px; max-width: 420px; }
.pv-progress-top { display: flex; justify-content: space-between; font-size: 0.82rem; margin-bottom: 6px; color: var(--text-muted); }
.pv-progress-top b { color: var(--text); }
.pv-bar { height: 10px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.pv-bar > span {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width .5s cubic-bezier(.2,.8,.2,1);
}

.pv-empty {
    text-align: center; padding: 48px 20px; border: 1px dashed var(--border);
    border-radius: var(--radius); background: var(--surface); color: var(--text-muted);
}
.pv-empty svg { width: 42px; height: 42px; color: var(--primary); opacity: .7; margin-bottom: 8px; }
.pv-empty p { margin: 0; max-width: 460px; margin-inline: auto; }

/* ═══════════════════════════════════════════════════════════════
   3. Voting home — toolbar + colleague cards
   ═══════════════════════════════════════════════════════════════ */
.pv-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: var(--space-2); }
.pv-search { position: relative; flex: 1 1 240px; max-width: 360px; }
.pv-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.pv-search input {
    width: 100%; box-sizing: border-box; padding: 10px 14px 10px 38px !important; border-radius: 999px !important;
    border: 1px solid var(--border) !important; background: var(--surface) !important; color: var(--text);
    -webkit-appearance: none; appearance: none;
}
.pv-search input:focus { outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.pv-tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-alt); }
.pv-tab {
    border: 0; cursor: pointer; padding: 6px 14px; border-radius: 999px;
    background: transparent; color: var(--text-muted); font-size: 0.8rem; font-weight: 600;
}
.pv-tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-ambient); }
.pv-tab .pv-count { margin-left: 4px; opacity: .75; font-variant-numeric: tabular-nums; }

.pv-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 576px)  { .pv-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px)  { .pv-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .pv-grid { grid-template-columns: repeat(4, 1fr); } }

.pv-person {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 22px 16px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); box-shadow: var(--shadow-ambient);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.pv-person:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 14%, transparent); }
.pv-person .avatar-photo, .pv-person .avatar-initial { width: 68px; height: 68px; font-size: 1.5rem; }
.pv-person-name { margin: 12px 0 2px; font-weight: 700; font-size: 0.98rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-person-dept { font-size: 0.78rem; color: var(--text-muted); min-height: 1.2em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-person .btn { margin-top: 14px; width: 100%; justify-content: center; }
.pv-person-badge {
    position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
    color: var(--success); background: color-mix(in srgb, var(--success) 13%, transparent);
}
.pv-person-badge svg { width: 12px; height: 12px; }
.pv-person.is-voted .avatar-photo, .pv-person.is-voted .avatar-initial { box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 55%, transparent); }
.pv-person[hidden] { display: none; }

/* ═══════════════════════════════════════════════════════════════
   4. Vote form
   ═══════════════════════════════════════════════════════════════ */
.pv-vote-wrap { max-width: 760px; margin: 0 auto; }
.pv-nominee {
    display: flex; align-items: center; gap: 16px; padding: 20px 22px; margin-bottom: var(--space-2);
    border: 1px solid var(--border); border-radius: var(--radius);
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%),
        var(--surface);
}
.pv-nominee .avatar-photo, .pv-nominee .avatar-initial { width: 72px; height: 72px; font-size: 1.7rem; flex: 0 0 auto; }
.pv-nominee-name { margin: 0; font-size: 1.2rem; font-weight: 800; }
.pv-nominee-sub { margin: 2px 0 0; font-size: 0.85rem; color: var(--text-muted); }
.pv-nominee-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pv-chip {
    display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
    font-size: 0.74rem; font-weight: 600; background: var(--surface-alt); color: var(--text-muted);
}
.pv-chip svg { width: 13px; height: 13px; }
.pv-chip.is-primary { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); }

.pv-criterion {
    --pct: 50%;
    padding: 18px 20px; margin-bottom: 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    transition: border-color .15s, box-shadow .15s;
}
.pv-criterion:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.pv-criterion-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.pv-criterion-index {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; margin-top: 1px;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800;
    background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary);
}
.pv-criterion-text { flex: 1 1 auto; min-width: 0; }
.pv-criterion-name { display: block; margin: 0; font-weight: 700; font-size: 0.98rem; }
.pv-criterion-desc { margin: 2px 0 0; font-size: 0.8rem; color: var(--text-muted); }
.pv-score {
    flex: 0 0 auto; text-align: center; min-width: 68px; padding: 6px 10px; border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
}
.pv-score-num { display: block; font-size: 1.55rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pv-score-word { display: block; margin-top: 3px; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }

.pv-slider {
    -webkit-appearance: none; appearance: none; display: block;
    width: 100%; height: 10px; margin: 18px 0 8px; border-radius: 999px; outline: none; cursor: pointer;
    background: linear-gradient(90deg, var(--primary) 0, var(--accent) var(--pct), var(--surface-alt) var(--pct), var(--surface-alt) 100%);
    border: 0; padding: 0;
}
.pv-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg); border: 4px solid var(--primary); cursor: grab;
    box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 40%, transparent);
    transition: transform .12s ease;
}
.pv-slider:active::-webkit-slider-thumb { transform: scale(1.15); cursor: grabbing; }
.pv-slider::-moz-range-thumb {
    width: 18px; height: 18px; border-radius: 50%; background: var(--bg); border: 4px solid var(--primary); cursor: grab;
}
.pv-slider:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 25%, transparent); }
.pv-ticks { display: grid; grid-template-columns: repeat(10, 1fr); }
.pv-tick {
    border: 0; background: transparent; padding: 4px 0; cursor: pointer; text-align: center;
    font-size: 0.74rem; font-weight: 600; color: var(--text-muted); border-radius: 6px;
}
.pv-tick:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.pv-tick.is-on { color: var(--primary); font-weight: 800; }

.pv-comment { margin-top: var(--space-2); padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pv-comment label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.pv-comment label svg { width: 16px; height: 16px; color: var(--primary); }
.pv-comment textarea { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: var(--radius-sm); resize: vertical; font: inherit; }
.pv-comment textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.pv-anon {
    display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; font-size: 0.82rem;
    border-radius: var(--radius-sm); color: var(--text-muted);
    background: color-mix(in srgb, var(--primary) 7%, transparent);
}
.pv-anon svg { width: 18px; height: 18px; color: var(--primary); flex: 0 0 auto; }

.pv-submitbar {
    position: sticky; bottom: 0; z-index: 5; margin-top: var(--space-2);
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px);
    box-shadow: 0 -6px 20px color-mix(in srgb, var(--text) 6%, transparent);
}
.pv-avg { display: flex; align-items: baseline; gap: 6px; color: var(--text-muted); font-size: 0.82rem; }
.pv-avg b { font-size: 1.5rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.pv-actions { display: flex; gap: 10px; }

@media (max-width: 575px) {
    .pv-hero { padding: 16px; }
    .pv-nominee { padding: 16px; gap: 12px; }
    .pv-nominee .avatar-photo, .pv-nominee .avatar-initial { width: 56px; height: 56px; font-size: 1.3rem; }
    .pv-criterion { padding: 14px; }
    .pv-score { min-width: 58px; }
    .pv-tick { font-size: 0.68rem; }
    .pv-submitbar { position: static; }
    .pv-actions { width: 100%; }
    .pv-actions .btn { flex: 1; justify-content: center; height: 46px; }
}

/* ═══════════════════════════════════════════════════════════════
   5. Leaderboard (podium + table) & employee detail
   ═══════════════════════════════════════════════════════════════ */
.pv-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: end; margin-bottom: var(--space-3); }
.pv-podium-card {
    position: relative; text-align: center; padding: 20px 12px 16px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    box-shadow: var(--shadow-ambient); text-decoration: none; color: inherit;
    transition: transform .18s ease, box-shadow .18s ease;
}
.pv-podium-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px color-mix(in srgb, var(--primary) 14%, transparent); }
.pv-podium-card.rank-1 { order: 2; padding-top: 30px; padding-bottom: 24px; border-color: color-mix(in srgb, var(--warning, #F59E0B) 60%, var(--border)); background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--warning, #F59E0B) 16%, transparent), transparent 65%), var(--surface); }
.pv-podium-card.rank-2 { order: 1; }
.pv-podium-card.rank-3 { order: 3; }
.pv-medal {
    position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 800; color: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.2);
    background: #94A3B8;
}
.rank-1 .pv-medal { background: #F59E0B; width: 36px; height: 36px; top: -18px; }
.rank-1 .pv-medal svg { width: 18px; height: 18px; }
.rank-3 .pv-medal { background: #B7791F; }
.pv-podium-card .avatar-photo, .pv-podium-card .avatar-initial { width: 60px; height: 60px; margin: 0 auto; font-size: 1.3rem; }
.rank-1 .avatar-photo, .rank-1 .avatar-initial { width: 76px; height: 76px; font-size: 1.6rem; }
.pv-podium-name { margin: 10px 0 2px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-podium-dept { font-size: 0.76rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-podium-score { margin-top: 8px; font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.pv-podium-score small { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.pv-podium-voters { font-size: 0.74rem; color: var(--text-muted); }

.pv-rank { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 9px; font-weight: 800; font-size: 0.85rem; background: var(--surface-alt); color: var(--text-muted); }
.pv-rank.r1 { background: color-mix(in srgb, #F59E0B 20%, transparent); color: #B45309; }
.pv-rank.r2 { background: color-mix(in srgb, #94A3B8 25%, transparent); color: #475569; }
.pv-rank.r3 { background: color-mix(in srgb, #B7791F 20%, transparent); color: #92400E; }
.pv-scorecell { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.pv-scorecell .pv-bar { flex: 1; height: 8px; }
.pv-scorecell b { font-variant-numeric: tabular-nums; min-width: 42px; }
.pv-person-cell { display: flex; align-items: center; gap: 10px; }
.pv-person-cell small { color: var(--text-muted); }

.pv-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .pv-detail { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.pv-panel { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-ambient); }
.pv-panel-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 0.95rem; font-weight: 700; }
.pv-panel-title svg { width: 17px; height: 17px; color: var(--primary); }
.pv-breakdown { display: grid; gap: 14px; }
.pv-breakdown-row-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.86rem; margin-bottom: 5px; }
.pv-breakdown-row-top b { font-variant-numeric: tabular-nums; color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════
   6. Settings & criteria management
   ═══════════════════════════════════════════════════════════════ */
.pv-page { max-width: 760px; }
.pv-segment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface-alt); }
.pv-segment label {
    margin: 0; padding: 9px 8px; text-align: center; cursor: pointer; border-radius: 9px;
    font-size: 0.85rem; font-weight: 600; color: var(--text-muted); transition: background .15s, color .15s;
}
.pv-segment input { position: absolute; opacity: 0; pointer-events: none; }
.pv-segment label:has(input:checked) { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-ambient); }
.pv-segment label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }

.pv-switch-row {
    display: flex !important; cursor: pointer; align-items: flex-start; gap: 14px; padding: 14px 16px; margin: 6px 0 4px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
.pv-switch-row .switch { margin-top: 2px; }
.pv-switch-row strong { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.pv-switch-row strong svg { width: 16px; height: 16px; color: var(--primary); flex: 0 0 auto; }
.pv-switch-row small { color: var(--text-muted); }

.pv-unit { position: relative; }
.pv-unit input { padding-right: 38px !important; }
.pv-unit::after { content: attr(data-unit); position: absolute; right: 14px; bottom: 11px; color: var(--text-muted); font-weight: 700; pointer-events: none; }

.pv-weight-meter { padding: 16px 20px; margin-bottom: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pv-weight-meter .pv-bar { height: 12px; }
.pv-weight-meter.is-ok .pv-bar > span { background: var(--success); }
.pv-weight-meter.is-warn .pv-bar > span { background: var(--warning); }
.pv-weight-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 0.85rem; color: var(--text-muted); }
.pv-weight-top b { font-size: 1.3rem; color: var(--text); font-variant-numeric: tabular-nums; }
.pv-weight-chip { padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 0.78rem; background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); font-variant-numeric: tabular-nums; }
.pv-row-muted { opacity: .55; }

/* ═══════════════════════════════════════════════════════════════
   7. Attendance > Add — desktop: Employee, Date, Check In, Check Out
      on ONE row, Notes full width. (Mobile/tablet unchanged.)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 1100px) {
    .main-content .card.att-form-card { max-width: none; margin-right: 0; }
    .main-content .card.att-form-card > form.att-form {
        grid-template-columns: 1.35fr 1.1fr 1fr 1fr !important;
        column-gap: 18px;
        align-items: end;
    }
    /* tiles dissolve into the shared grid and look like plain fields */
    .att-form-card .att-time-grid { display: contents; }
    .att-form-card .att-time-tile {
        padding: 0; border: 0; background: none; box-shadow: none; margin-bottom: 20px;
    }
    .att-form-card .att-time-tile:focus-within { box-shadow: none; }
    .att-form-card .att-time-label { margin: 0 0 8px; font-size: .95rem; font-weight: 600; }
    .att-form-card .att-time-icon { width: 28px; height: 28px; flex-basis: 28px; border-radius: 8px; }
    .att-form-card input.att-time-input { height: 48px; font-size: 1.05rem; text-align: left; padding: 0 14px; }
    /* hint, notes, notice and buttons span the full row */
    .att-form-card .att-hint { grid-column: 1 / -1; margin: -6px 2px 18px; }
    .main-content .card.att-form-card > form.att-form .form-group:has(textarea) { grid-column: 1 / -1; }
    .att-form-card textarea { min-height: 150px; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════
   8. Attendance list — clean employee cell + time pills
   ═══════════════════════════════════════════════════════════════ */
.att-emp { display: flex; align-items: center; gap: 12px; min-width: 0; }
.att-emp .att-emp-avatar { width: 40px; height: 40px; flex: 0 0 40px; font-size: 1rem; box-shadow: 0 0 0 2px var(--surface); }
.att-emp-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.att-emp-name {
    font-weight: 700; font-size: 0.92rem; color: var(--text) !important; text-decoration: none !important;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25;
}
.att-emp-name:hover { color: var(--primary) !important; }
.att-emp-code {
    display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 600;
    letter-spacing: .02em; color: var(--text-muted); background: var(--surface-alt);
    font-variant-numeric: tabular-nums;
}
.att-times { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.att-time {
    padding: 3px 10px; border-radius: 8px; font-size: 0.82rem; font-weight: 700;
    font-variant-numeric: tabular-nums; background: var(--surface-alt); color: var(--text-muted);
}
.att-time-in-pill  { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.att-time-out-pill { color: var(--danger, #dc2626); background: color-mix(in srgb, var(--danger, #dc2626) 11%, transparent); }
.att-time.is-empty { color: var(--text-muted); background: var(--surface-alt); }
.att-time-sep { color: var(--text-muted); font-size: 0.8rem; }

/* ═══════════════════════════════════════════════════════════════
   9. Mobile / QR Check-In Log — one row per employee per day
   ═══════════════════════════════════════════════════════════════ */
.mcp-table td { vertical-align: top; }
.mcp-table .att-emp-name { cursor: default; }
.mcp-date { font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.mcp-worked {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
    padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
    color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent);
    font-variant-numeric: tabular-nums;
}
.mcp-worked svg { width: 12px; height: 12px; }
.mcp-table { width: 100%; }
.mcp-table th.mcp-col-punch, .mcp-table td.mcp-cell { width: 36%; min-width: 260px; }
.mcp-punch { min-height: 116px; box-sizing: border-box; display: flex; flex-direction: column; }
.mcp-none { min-height: 116px; box-sizing: border-box; }
.mcp-top-right { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mcp-view { display: inline-flex; gap: 4px; }
.mcp-view .btn { width: 28px; height: 28px; padding: 0; }
.mcp-view svg { width: 14px; height: 14px; }
.mcp-punch > :nth-last-child(2):not(.mcp-top) { margin-bottom: 10px; }
.mcp-punch {
    position: relative; padding: 10px 12px 10px 16px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
}
.mcp-punch:last-child { margin-bottom: 0; }
.mcp-punch::before {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0;
    background: var(--success);
}
.mcp-punch.is-out::before { background: var(--danger, #dc2626); }
.mcp-punch.st-pending::before { background: var(--warning); }
.mcp-punch.st-rejected { opacity: .8; }
.mcp-punch.st-rejected .mcp-time { text-decoration: line-through; text-decoration-thickness: 1px; }
.mcp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mcp-time { font-size: 1.25rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.mcp-time small { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.mcp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.mcp-dist { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 600; color: var(--text-muted); }
.mcp-dist svg { width: 13px; height: 13px; color: var(--primary); }
/* Coordinates + branch location sit in the top row, between the time and the status badge */
.mcp-geo { flex: 1 1 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 0 6px; font-size: 0.7rem; line-height: 1.35; color: var(--text-muted); }
.mcp-coords { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcp-place { align-items: center; color: var(--primary); cursor: default; }
.mcp-place svg { width: 15px; height: 15px; }
.mcp-map { display: inline-flex; gap: 4px; }
.mcp-map .btn { width: 28px; height: 28px; padding: 0; }
.mcp-map svg { width: 14px; height: 14px; }
.mcp-dist { cursor: default; }
.mcp-reason { margin-top: 6px; display: inline-block; }
.mcp-note { margin-top: 6px; font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; }
.mcp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--border); }
.mcp-actions:empty { display: none; }
.mcp-actions form { display: inline-flex; margin: 0; }
.mcp-none {
    display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 10px;
    border: 1px dashed var(--border); border-radius: 12px; font-size: 0.8rem; color: var(--text-muted); background: var(--surface);
}

/* ═══════════════════════════════════════════════════════════════
   10. Grant Award — sectioned form + live preview sidebar
   ═══════════════════════════════════════════════════════════════ */
.aw-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .aw-layout { grid-template-columns: minmax(0, 1fr); } }
.main-content .card.aw-card { max-width: none !important; width: 100%; padding: 8px 28px 26px; }
.aw-form { display: block !important; }
.aw-section { padding: 22px 0; border-bottom: 1px solid var(--border); }
.aw-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.aw-section-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.aw-step {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.aw-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px 18px; }
.aw-grid > .form-group { margin-bottom: 12px; min-width: 0; }
.aw-grid > .aw-span-3 { grid-column: span 3 !important; } .aw-grid > .aw-span-4 { grid-column: span 4 !important; } .aw-grid > .aw-span-5 { grid-column: span 5 !important; }
.aw-grid > .aw-span-6 { grid-column: span 6 !important; } .aw-grid > .aw-span-7 { grid-column: span 7 !important; } .aw-grid > .aw-span-12 { grid-column: span 12 !important; }
@media (max-width: 900px) { .aw-grid > .form-group { grid-column: span 12 !important; } }
.aw-form .form-group input:not([type="checkbox"]),
.aw-form .form-group select,
.aw-form .form-group textarea { width: 100%; box-sizing: border-box; }
.aw-form textarea { resize: vertical; min-height: 64px; }
.aw-form .form-hint { margin: 6px 0 0; font-size: 0.78rem; }
.aw-form .form-hint a { color: var(--primary); font-weight: 600; text-decoration: none; }
.aw-form .required { color: var(--danger, #dc2626); }
.aw-hint {
    display: flex; align-items: center; gap: 8px; margin: 2px 0 0; padding: 9px 14px; font-size: 0.8rem;
    color: var(--text-muted); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--primary) 7%, transparent);
}
.aw-hint svg { width: 15px; height: 15px; color: var(--primary); flex: 0 0 auto; }

.aw-money { display: flex; }
.aw-money input { flex: 1 1 auto; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.aw-money select {
    flex: 0 0 96px; width: 96px !important; font-weight: 700;
    border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; border-left: 0 !important;
    background-color: var(--surface-alt);
}

.aw-switch {
    display: flex !important; align-items: flex-start; gap: 14px; margin: 6px 0 0; padding: 14px 16px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}
.aw-switch .switch { margin-top: 2px; }
.aw-switch-text strong { display: block; font-size: 0.9rem; }
.aw-switch-text small { color: var(--text-muted); font-size: 0.8rem; line-height: 1.5; }

.aw-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 22px; }
.aw-actions .btn { height: 46px; padding: 0 28px; justify-content: center; border-radius: 12px; font-weight: 600; }

.aw-side { position: sticky; top: 88px; display: grid; gap: 16px; }
@media (max-width: 1100px) { .aw-side { position: static; } }
.aw-preview {
    text-align: center; padding: 26px 20px; border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warning, #F59E0B) 45%, var(--border));
    background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--warning, #F59E0B) 16%, transparent), transparent 70%), var(--surface);
    box-shadow: var(--shadow-ambient);
}
.aw-preview-icon {
    width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, #F59E0B, #D97706); box-shadow: 0 8px 20px rgba(217, 119, 6, .35);
}
.aw-preview-icon svg { width: 30px; height: 30px; }
.aw-preview-type {
    display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
    color: var(--primary); background: color-mix(in srgb, var(--primary) 13%, transparent);
}
.aw-preview-name { margin: 12px 0 14px; font-size: 1.1rem; line-height: 1.35; word-break: break-word; }
.aw-preview-name.is-empty, .aw-preview-emp.is-empty { color: var(--text-muted); font-weight: 500; }
.aw-preview-emp { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.88rem; }
.aw-preview-avatar {
    width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.82rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent));
}
.aw-preview-emp.is-empty .aw-preview-avatar { background: var(--surface-alt); color: var(--text-muted); }
.aw-preview-prize { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.aw-preview-prize > span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; background: var(--surface-alt); }
.aw-preview-prize svg { width: 15px; height: 15px; color: var(--primary); }
.aw-tips { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.aw-tips h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 0.9rem; }
.aw-tips h3 svg { width: 16px; height: 16px; color: var(--warning, #F59E0B); }
.aw-tips p { margin: 0; font-size: 0.82rem; line-height: 1.6; color: var(--text-muted); }


/* ═══════════════════════════════════════════════════════════════
   8. Performance criteria — Add / Edit form
      Two grouped sections (details, scoring), 2-column fields on
      desktop, stacked on mobile. Back arrow + right-aligned actions.
   ═══════════════════════════════════════════════════════════════ */
.pc-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pc-subtitle { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.pc-back svg { width: 14px; height: 14px; transform: rotate(90deg); } /* chevron-down → points left */
.pc-form { width: 100%; max-width: none; }
.pc-section { margin-bottom: var(--space-2, 16px); padding: 22px 24px 8px; }
.pc-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pc-section-head h2 { margin: 0; font-size: 1.05rem; }
.pc-section-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.82rem; line-height: 1.4; }
.pc-section-icon { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.pc-section-icon svg { width: 20px; height: 20px; }
.pc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 20px; }
@media (min-width: 768px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pc-grid .form-group { margin-bottom: 18px; }
.pc-grid input, .pc-grid textarea { width: 100%; box-sizing: border-box; }
.pc-grid textarea { min-height: 88px; resize: vertical; }
.pc-lang { display: inline-block; margin-right: 4px; padding: 1px 7px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: .03em; color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); vertical-align: 1px; }
.pc-req { color: var(--danger, #dc2626); font-weight: 700; }
.pc-count, .pc-hint { display: block; margin-top: 5px; font-size: 0.74rem; color: var(--text-muted); line-height: 1.4; }
.pc-count { text-align: right; font-variant-numeric: tabular-nums; }
.pc-weight { display: flex; align-items: center; gap: 16px; }
.pc-weight .pv-unit { flex: 0 0 140px; }
.pc-weight input[type="range"] { flex: 1 1 auto; width: auto; accent-color: var(--primary); cursor: pointer; }
.pc-actions { display: flex; justify-content: flex-end; gap: 10px; margin: var(--space-2, 16px) 0 var(--space-3, 24px); }
.pc-actions .btn { min-width: 130px; justify-content: center; }
@media (max-width: 767px) {
    .pc-section { padding: 18px 16px 6px; }
    .pc-actions { flex-direction: column-reverse; }
    .pc-actions .btn { width: 100%; }
    .pc-weight .pv-unit { flex-basis: 110px; }
}


/* Minimum Wage — disabled rows are dimmed, but the Actions cell stays fully visible so Enable is easy to find */
.mw-row-off td:not(.actions) { opacity: .6; }
