/* ================================================================
   STT LOGISTICS GROUP — site.css
   ================================================================ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base ───────────────────────────────────────────────────── */
html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f0f2f7;
    color: #1a1a2e;
}

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
    --red: #CC0000;
    --red-dark: #A30000;
    --red-light: #E60000;
    --navy: #0d1b3e;
    --white: #ffffff;
    --black: #1a1a1a;
}


/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-wrapper {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.left-panel {
    flex: 1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
    animation: floatUp 0.8s ease-out both;
}

    .left-panel::before {
        content: '';
        position: absolute;
        bottom: -60px;
        left: -60px;
        width: 300px;
        height: 300px;
        background: radial-gradient(circle,rgba(204,0,0,0.04) 0%,transparent 70%);
        border-radius: 50%;
        pointer-events: none;
    }

.left-content {
    width: 100%;
    max-width: 500px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px 0;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding-top: 80px;
}

.stt-logo {
    width: 220px;
    height: auto;
    display: block;
    object-fit: contain;
}

.illustration {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-bg-img {
    width: 70%;
    max-width: 440px;
    max-height: 420px;
    object-fit: contain;
    display: block;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    animation: floatUp 1s ease 0.2s both;
}

.right-panel {
    width: 48%;
    min-width: 420px;
    background: #CC0000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

    .right-panel::before {
        content: '';
        position: absolute;
        top: -90px;
        right: -90px;
        width: 300px;
        height: 300px;
        border: 45px solid rgba(255,255,255,0.07);
        border-radius: 50%;
        pointer-events: none;
    }

    .right-panel::after {
        content: '';
        position: absolute;
        bottom: -70px;
        left: -70px;
        width: 240px;
        height: 240px;
        border: 35px solid rgba(255,255,255,0.05);
        border-radius: 50%;
        pointer-events: none;
    }

.form-container {
    width: 100%;
    max-width: 380px;
    position: relative;
    z-index: 1;
    animation: slideIn 0.6s ease-out both;
}

.form-title {
    color: #ffffff;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -0.5px;
}

.alert-error {
    background: rgba(0,0,0,0.22);
    border-left: 3px solid rgba(255,255,255,0.7);
    color: white;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 0.88rem;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 32px;
    position: relative;
}

.form-label {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.4px;
}

.form-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255,255,255,0.4);
    color: #ffffff;
    font-size: 1rem;
    padding: 10px 0;
    outline: none;
    transition: border-color 0.25s ease;
    caret-color: white;
}

    .form-input::placeholder {
        color: rgba(255,255,255,0.38);
        font-size: 0.92rem;
    }

    .form-input:focus {
        border-bottom-color: #ffffff;
    }

    .form-input:-webkit-autofill,
    .form-input:-webkit-autofill:hover,
    .form-input:-webkit-autofill:focus {
        -webkit-text-fill-color: white;
        -webkit-box-shadow: 0 0 0px 1000px #CC0000 inset;
        transition: background-color 5000s ease-in-out 0s;
        caret-color: white;
    }

.password-wrapper {
    position: relative;
}

.toggle-pwd {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity 0.2s;
}

    .toggle-pwd:hover {
        opacity: 1;
    }

.field-error {
    display: block;
    color: rgba(255,220,220,0.95);
    font-size: 0.78rem;
    margin-top: 5px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    margin-top: -12px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: rgba(255,255,255,0.88);
    font-size: 0.9rem;
    user-select: none;
}

    .remember-label .checkbox {
        appearance: none;
        -webkit-appearance: none;
        width: 18px;
        height: 18px;
        border: 2px solid rgba(255,255,255,0.6);
        border-radius: 3px;
        background: transparent;
        cursor: pointer;
        flex-shrink: 0;
        transition: all 0.2s;
        position: relative;
    }

        .remember-label .checkbox:checked {
            background: rgba(255,255,255,0.2);
            border-color: white;
        }

            .remember-label .checkbox:checked::after {
                content: '✓';
                position: absolute;
                top: -2px;
                left: 2px;
                color: white;
                font-size: 13px;
                font-weight: 700;
            }

.forgot-link {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

    .forgot-link:hover {
        color: white;
        text-decoration: underline;
    }

.login-btn {
    width: 100%;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.25s,transform 0.15s,box-shadow 0.25s;
}

    .login-btn:hover {
        background: #1f2937;
        transform: translateY(-1px);
        box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    }

    .login-btn:active {
        transform: translateY(0);
        box-shadow: none;
    }

#spinner svg, .btn-spinner svg {
    animation: spin 0.8s linear infinite;
}

@keyframes floatUp {
    from {
        opacity: 0;
        transform: translateY(22px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(28px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg)
    }

    to {
        transform: rotate(360deg)
    }
}

@media (max-width: 900px) {
    .login-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .left-panel {
        flex: none;
        padding: 32px 24px;
        min-height: 300px;
    }

    .login-bg-img {
        max-height: 280px;
    }

    .right-panel {
        width: 100%;
        min-width: unset;
        padding: 40px 28px 60px;
    }

    .form-title {
        font-size: 2.2rem;
    }

    .stt-logo {
        width: 160px;
    }
}


/* ================================================================
   APP SHELL — FIXED SIDEBAR + SCROLLING CONTENT
   ================================================================ */

/* ── The entire app fills the viewport exactly — no page scroll ── */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh; /* ← exact viewport height */
    overflow: hidden; /* ← nothing overflows the shell */
}

/* ── Top bar is fixed, never scrolls ─────────────────────────── */
.top-bar {
    background: #0d1b3e;
    color: #fff;
    padding: 0 28px;
    height: 60px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* ← never shrinks */
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #b0bcd4;
}

    .user-chip strong {
        color: #fff;
    }

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2b5eb7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #CC0000;
    color: #fff;
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

    .btn-logout:hover {
        background: #aa0000;
    }

/* ── Body layout — sidebar + main, fills remaining height ─────── */
.body-layout {
    display: flex;
    flex: 1;
    overflow: hidden; /* ← key: prevents body-layout from scrolling */
    min-height: 0; /* ← required for flex children to shrink correctly */
}

/* ── Sidebar — full height, scrolls internally ────────────────── */
.sidebar {
    width: 220px;
    min-width: 220px;
    background: #0d1b3e;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* ← sidebar scrolls if nav is too tall */
    overflow-x: hidden;
    flex-shrink: 0;
    height: 100%;
}

/* ── Main content — only this scrolls ────────────────────────── */
.main-content {
    flex: 1;
    padding: 28px 32px;
    overflow-y: auto; /* ← ONLY the content scrolls */
    overflow-x: hidden;
    height: 100%;
}

/* ── Nav styles ───────────────────────────────────────────────── */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #4e6f9b;
    padding: 0 10px;
    margin-bottom: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #a0b8d8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s,color 0.15s;
}

    .nav-item:hover {
        background: rgba(255,255,255,0.06);
        color: #fff;
    }

    .nav-item.active {
        background: #1e4fa3;
        color: #fff;
    }

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.nav-badge {
    margin-left: auto;
    background: #e67e00;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
}


/* ================================================================
   PAGE HEADER
   ================================================================ */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #0d1b3e;
}

.page-sub, .page-subtitle {
    font-size: 13px;
    color: #7a89a8;
    margin-top: 3px;
}

.page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #CC0000;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-primary:hover {
        background: #aa0000;
    }

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #374060;
    border: 1px solid #d1d9eb;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

    .btn-secondary:hover {
        background: #f4f6fb;
    }


/* ================================================================
   STAT CARDS
   ================================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    border: 1px solid #e4eaf5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.stat-green {
    background: #d1fae5;
    color: #065f46;
}

.stat-amber {
    background: #fef3c7;
    color: #92400e;
}

.stat-red {
    background: #fee2e2;
    color: #991b1b;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 12px;
    color: #7a89a8;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #0d1b3e;
    line-height: 1;
}

.stat-trend {
    font-size: 12px;
    font-weight: 500;
}

    .stat-trend.up {
        color: #16a34a;
    }

    .stat-trend.neutral {
        color: #d97706;
    }

    .stat-trend.down {
        color: #dc2626;
    }


/* ================================================================
   SEARCH & FILTER BAR
   ================================================================ */
.search-bar-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}

.search-input-wrap {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aaac5;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1px solid #d1d9eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
}

    .search-input:focus {
        border-color: #1e4fa3;
    }

.filter-select {
    padding: 9px 12px;
    border: 1px solid #d1d9eb;
    border-radius: 8px;
    font-size: 13.5px;
    color: #374060;
    background: #fff;
    cursor: pointer;
    outline: none;
}


/* ================================================================
   TABLE CARD + EMPLOYEE TABLE
   ================================================================ */
.table-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e4eaf5;
    overflow: hidden;
}

.emp-table {
    width: 100%;
    border-collapse: collapse;
}

    .emp-table thead th {
        background: #f8f9fd;
        text-align: left;
        padding: 12px 16px;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: #7a89a8;
        border-bottom: 1px solid #e4eaf5;
        white-space: nowrap;
    }

    .emp-table tbody tr {
        border-bottom: 1px solid #f0f3fa;
        transition: background 0.15s;
    }

        .emp-table tbody tr:last-child {
            border-bottom: none;
        }

        .emp-table tbody tr:hover {
            background: #f8f9fd;
        }

    .emp-table tbody td {
        padding: 13px 16px;
        vertical-align: middle;
    }

.emp-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.emp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.emp-name {
    font-size: 14px;
    font-weight: 600;
    color: #0d1b3e;
}

.emp-email {
    font-size: 12px;
    color: #7a89a8;
    margin-top: 1px;
}

.emp-role {
    font-size: 13.5px;
    color: #374060;
}

.emp-date {
    font-size: 13px;
    color: #7a89a8;
}

/* Department badges */
.dept-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

.dept-ops {
    background: #dbeafe;
    color: #1e40af;
}

.dept-hr {
    background: #fce7f3;
    color: #9d174d;
}

.dept-fin {
    background: #d1fae5;
    color: #065f46;
}

.dept-log {
    background: #ede9fe;
    color: #5b21b6;
}

.dept-adm {
    background: #FBEAF0;
    color: #72243E;
}

.dept-it {
    background: #fef3c7;
    color: #92400e;
}

/* Status badges */
.status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-leave {
    background: #fef3c7;
    color: #92400e;
}

.status-inactive {
    background: #f1f5f9;
    color: #64748b;
}

/* Action buttons */
.emp-actions {
    display: flex;
    gap: 6px;
}

.icon-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e4eaf5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7a89a8;
    transition: border-color 0.15s,color 0.15s,background 0.15s;
}

    .icon-btn:hover {
        border-color: #1e4fa3;
        color: #1e4fa3;
        background: #eff4ff;
    }


/* ================================================================
   PAGINATION
   ================================================================ */
.pagination, .emp-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid #f0f3fa;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.page-info {
    font-size: 13px;
    color: #7a89a8;
}

.page-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    border: 1px solid #e4eaf5;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #374060;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

    .page-btn:hover:not(:disabled) {
        border-color: #1e4fa3;
        color: #1e4fa3;
    }

    .page-btn.active {
        background: #1e4fa3;
        color: #fff;
        border-color: #1e4fa3;
    }

    .page-btn:disabled {
        opacity: 0.35;
        cursor: default;
    }


/* ================================================================
   MODALS
   ================================================================ */
.emp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 20px;
}

.emp-modal {
    background: #fff;
    border-radius: 14px;
    padding: 22px;
    width: 100%;
    max-width: 490px;
    max-height: 90vh;
    overflow-y: auto;
}

.emp-modal-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.emp-modal-title {
    font-size: 16px;
    font-weight: 500;
}

.emp-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #888;
}

    .emp-modal-close:hover {
        color: #333;
    }

.emp-modal-ftr {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}

.emp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.emp-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .emp-form-group.full {
        grid-column: span 2;
    }

    .emp-form-group label {
        font-size: 12px;
        color: #555;
        font-weight: 500;
    }

    .emp-form-group input,
    .emp-form-group select {
        padding: 8px 10px;
        border: 1px solid #e0e0e0;
        border-radius: 7px;
        font-size: 13px;
    }

        .emp-form-group input:focus,
        .emp-form-group select:focus {
            outline: none;
            border-color: #aaa;
        }

/* View modal */
.view-block {
    margin-bottom: 16px;
}

.view-section-title {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.view-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

    .view-row:last-child {
        border-bottom: none;
    }

.view-lbl {
    color: #888;
}


/* ================================================================
   TOAST
   ================================================================ */
.emp-toast {
    position: fixed;
    bottom: 22px;
    right: 22px;
    background: #222;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

    .emp-toast.show {
        opacity: 1;
    }


/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .emp-form-grid {
        grid-template-columns: 1fr;
    }

    .emp-form-group.full {
        grid-column: span 1;
    }
}


/* ================================================================
   PERFORMANCE PAGE
   ================================================================ */

.perf-tab-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.perf-tab {
    padding: 7px 16px;
    border: 1px solid #d1d9eb;
    border-radius: 7px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #7a89a8;
    cursor: pointer;
    transition: all .15s;
}

    .perf-tab:hover {
        background: #f4f6fb;
        color: #1a2b5e;
    }

    .perf-tab.active {
        background: #1e4fa3;
        border-color: #1e4fa3;
        color: #fff;
    }

/* ── Progress bar ── */
.prog-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

.prog-bg {
    flex: 1;
    height: 6px;
    background: #e8ecf4;
    border-radius: 4px;
    overflow: hidden;
}

.prog-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .4s;
}

.prog-pct {
    font-size: 12px;
    font-weight: 600;
    color: #374060;
    min-width: 34px;
    text-align: right;
}

/* ── Goal status dots ── */
.perf-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

    .perf-status::before {
        content: '';
        width: 7px;
        height: 7px;
        border-radius: 50%;
        display: inline-block;
    }

.ps-ontrack::before {
    background: #16a34a;
}

.ps-ontrack {
    color: #16a34a;
}

.ps-atrisk::before {
    background: #d97706;
}

.ps-atrisk {
    color: #d97706;
}

.ps-behind::before {
    background: #dc2626;
}

.ps-behind {
    color: #dc2626;
}

.ps-achieved::before {
    background: #2563eb;
}

.ps-achieved {
    color: #2563eb;
}

/* ── Appraisal badges ── */
.ap-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.ap-completed {
    background: #dcfce7;
    color: #166534;
}

.ap-progress {
    background: #fef3c7;
    color: #92400e;
}

.ap-pending {
    background: #f1f5f9;
    color: #64748b;
}

/* ── Appraisal cycle cards ── */
.ap-cycle-card {
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: 12px;
    padding: 18px 20px;
}

.ap-cycle-label {
    font-size: 12px;
    color: #7a89a8;
    font-weight: 500;
    margin-bottom: 6px;
}

.ap-cycle-val {
    font-size: 26px;
    font-weight: 700;
    color: #0d1b3e;
    line-height: 1;
}

    .ap-cycle-val span {
        font-size: 14px;
        color: #7a89a8;
        font-weight: 400;
    }

.ap-cycle-bar {
    height: 5px;
    background: #e8ecf4;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.ap-cycle-fill {
    height: 100%;
    border-radius: 4px;
}

/* ── Analytics layout ── */
.analytics-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.analytics-trend-card,
.analytics-donut-card,
.analytics-dept-card {
    background: #fff;
    border: 1px solid #e4eaf5;
    border-radius: 12px;
    padding: 20px;
}

.donut-container {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* ── Analytics bar rows ── */
.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.chart-bar-label {
    width: 100px;
    color: #374060;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.chart-bar-bg {
    flex: 1;
    height: 10px;
    background: #e8ecf4;
    border-radius: 5px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 5px;
}

.chart-bar-val {
    width: 36px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #374060;
    flex-shrink: 0;
}

/* ── Rating legend ── */
.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374060;
    margin-bottom: 10px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-count {
    font-weight: 700;
    color: #0d1b3e;
    margin-left: auto;
}

/* ── Star rating in modal ── */
.modal-rating-star {
    font-size: 22px;
    cursor: pointer;
    color: #d1d9eb;
    transition: color .15s;
}

    .modal-rating-star.active,
    .modal-rating-star:hover {
        color: #f59e0b;
    }
