body {
    margin: 0;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    background: #f5f7fb;
    color: #333;
}

.nav {
    background: linear-gradient(90deg, #1d4ed8, #2563eb);
    padding: 16px 30px;
    box-shadow: 0 4px 12px rgba(37,99,235,.2);
}

.nav a, .nav-user {
    color: white;
    text-decoration: none;
    margin-right: 22px;
    font-weight: bold;
}

.container {
    padding: 28px;
}

h1 {
    margin-top: 0;
}

.alert {
    background: #fff7ed;
    color: #c2410c;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-left: 5px solid #fb923c;
    border-radius: 8px;
}

.card {
    background: white;
    padding: 22px;
    margin-bottom: 20px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.login-page {
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 420px;
    background: white;
    border-radius: 22px;
    padding: 38px;
    box-shadow: 0 18px 50px rgba(0,0,0,.15);
    text-align: center;
}

.login-card h1 {
    color: #2563eb;
}

.login-card input {
    width: 100%;
    box-sizing: border-box;
}

.hint {
    margin-top: 16px;
    color: #888;
    font-size: 14px;
}

input, select {
    padding: 12px;
    margin: 6px;
    width: 220px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: white;
    font-size: 15px;
}

button {
    padding: 12px 22px;
    background: #2563eb;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    font-weight: bold;
}

button:hover {
    background: #1d4ed8;
}

button:disabled,
.disabled-btn {
    background: #cbd5e1 !important;
    color: #64748b !important;
    cursor: not-allowed !important;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

th, td {
    padding: 14px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
}

th {
    background: #e0f2fe;
    color: #475569;
}

.grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-card {
    width: 180px;
    text-align: center;
    text-decoration: none;
    color: #111827;
    font-size: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
}

.form-grid button {
    width: 220px;
    margin: 6px;
}

.hidden {
    display: none;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-bar {
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.filter-bar a {
    display: inline-block;
    padding: 10px 14px;
    margin-right: 8px;
    text-decoration: none;
    color: #374151;
    border-radius: 8px;
    background: #f3f4f6;
}

.filter-bar a.active {
    background: #2563eb;
    color: white;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
}

.stat-card b {
    font-size: 34px;
    display: block;
    color: #2563eb;
}

.stat-card span {
    color: #64748b;
}

.employee-info {
    background: white;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.notice {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: bold;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.action-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.action-card {
    background: white;
    border: none;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    text-align: center;
}

.action-card .icon {
    font-size: 34px;
}

.action-card h2 {
    color: #2563eb;
    margin-bottom: 8px;
}

.action-card p {
    color: #16a34a;
    font-size: 20px;
    font-weight: bold;
}

.action-card button {
    width: 100%;
}

.back-card h2 {
    color: #16a34a;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.green { background: #16a34a; }
.orange { background: #f97316; }
.blue { background: #0ea5e9; }
.purple { background: #8b5cf6; }
.gray { background: #64748b; }
.red { background: #dc2626; }

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

@media (max-width: 900px) {
    .stats, .action-cards, .form-grid, .settings-grid {
        grid-template-columns: 1fr;
    }

    input, select, .form-grid button {
        width: 100%;
        box-sizing: border-box;
    }

    .container {
        padding: 14px;
    }

    table {
        font-size: 13px;
    }
}


.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 18px 0;
}

.checkbox-item {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.checkbox-item input {
    width: auto;
    margin: 0;
}

.position-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.form-grid label {
    display: block;
    font-weight: bold;
    margin-left: 8px;
    color: #475569;
}


.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.search-form input {
    margin: 0;
}

.form-tip {
    color: #64748b;
    font-weight: bold;
}

.reset-link {
    display: inline-block;
    padding: 10px 14px;
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
    border-radius: 10px;
    font-weight: bold;
}

.hint {
    margin-top: 10px;
    color: #64748b;
    font-size: 14px;
}


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

.white-card {
    background: #fff;
    color: #0f172a;
    text-align: left;
    position: relative;
    min-height: 130px;
}

.white-card b {
    color: #0f172a;
    font-size: 34px;
}

.white-card small {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-weight: bold;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    margin-bottom: 8px;
}

.blue-icon { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.green-icon { background: linear-gradient(135deg, #16a34a, #86efac); }
.purple-icon { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.orange-icon { background: linear-gradient(135deg, #f97316, #fdba74); }
.red-icon { background: linear-gradient(135deg, #dc2626, #fca5a5); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

.mini-progress {
    width: 120px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    display: inline-block;
    margin-right: 8px;
    overflow: hidden;
    vertical-align: middle;
}

.mini-progress span {
    height: 100%;
    background: #2563eb;
    display: block;
    border-radius: 999px;
}

.red-progress span {
    background: #ef4444;
}

.center-link {
    display: block;
    text-align: center;
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
    margin-top: 14px;
}

.stat-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-side b {
    font-size: 42px;
    color: #7c3aed;
}

.stat-side span {
    color: #64748b;
    font-weight: bold;
}

.resign-side b {
    color: #dc2626;
}

.danger-btn {
    background: #ef4444;
}

.danger-btn:hover {
    background: #dc2626;
}

@media (max-width: 900px) {
    .dashboard-stats,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== v3.9 Sidebar UI Upgrade ===== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, "Microsoft YaHei", sans-serif;
    background: #f4f7fb;
    color: #172033;
}

.app-layout {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 260px;
    min-height: 100vh;
    background: linear-gradient(180deg, #0f5bff 0%, #185adb 100%);
    color: #fff;
    padding: 18px 14px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    box-shadow: 12px 0 30px rgba(37, 99, 235, .18);
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px 22px;
    border-bottom: 1px solid rgba(255,255,255,.18);
    margin-bottom: 18px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: rgba(255,255,255,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.brand-title {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: .5px;
}

.brand-sub {
    font-size: 10px;
    opacity: .75;
    margin-top: 4px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-link {
    color: rgba(255,255,255,.92);
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    transition: .18s;
}

.side-link:hover {
    background: rgba(255,255,255,.18);
    transform: translateX(3px);
}

.side-user {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 18px;
    background: rgba(255,255,255,.16);
    border-radius: 18px;
    padding: 12px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.username {
    font-weight: 900;
}

.user-role {
    font-size: 12px;
    opacity: .75;
    margin-top: 3px;
}

.logout {
    color: white;
    text-decoration: none;
    font-weight: 900;
    font-size: 13px;
}

.main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.login-main {
    width: 100%;
    min-height: 100vh;
}

.topbar {
    height: 76px;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e8eef7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.page-welcome {
    font-size: 18px;
    font-weight: 900;
}

.page-subtitle {
    font-size: 13px;
    color: #64748b;
    margin-top: 4px;
}

.topbar-right {
    display: flex;
    gap: 16px;
    color: #475569;
    font-weight: 800;
}

.container {
    padding: 30px 34px;
}

.page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 22px;
}

.page-title-row h1,
.container > h1 {
    margin: 0 0 8px;
    font-size: 34px;
    letter-spacing: -1px;
    color: #111827;
}

.page-title-row p {
    color: #64748b;
    margin: 0;
    font-weight: 700;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    margin-bottom: 22px;
}

.kpi-card {
    background: #fff;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 134px;
    border: 1px solid #eef2f7;
}

.kpi-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    flex: none;
}

.kpi-label {
    font-weight: 900;
    color: #334155;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 34px;
    font-weight: 950;
    color: #0f172a;
}

.kpi-value span {
    font-size: 16px;
    color: #64748b;
}

.kpi-small {
    margin-top: 6px;
    font-size: 13px;
    color: #64748b;
    font-weight: 800;
}

.blue-icon { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.green-icon { background: linear-gradient(135deg, #16a34a, #86efac); }
.purple-icon { background: linear-gradient(135deg, #7c3aed, #c084fc); }
.orange-icon { background: linear-gradient(135deg, #f97316, #fdba74); }
.red-icon { background: linear-gradient(135deg, #dc2626, #fca5a5); }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 22px;
}

.card,
.modern-card {
    background: #fff;
    border-radius: 22px;
    padding: 22px;
    border: 1px solid #eef2f7;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-head h2,
.card h2 {
    margin: 0;
    font-size: 20px;
    color: #111827;
}

.card-head span,
.card-head small {
    color: #64748b;
    font-weight: 800;
}

.card-head a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 900;
}

table,
.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

th {
    background: #f3f7fb;
    color: #64748b;
    font-weight: 900;
    padding: 13px 12px;
    border: 0;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #edf2f7;
    color: #1f2937;
    font-weight: 700;
}

tr:hover td {
    background: #fafcff;
}

.dept-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #2563eb;
    display: inline-block;
    margin-right: 8px;
}

.rate-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-progress {
    width: 110px;
    height: 7px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.mini-progress span {
    display: block;
    height: 100%;
    background: #2563eb;
    border-radius: 999px;
}

.red-progress span {
    background: #ef4444;
}

.rank-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.soft-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 12px;
}

.purple-soft {
    background: #ede9fe;
    color: #7c3aed;
}

.quick-grid,
.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.quick-grid a,
.btn-card {
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 20px;
    text-decoration: none;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    padding: 26px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .06);
    transition: .18s;
}

.quick-grid a:hover,
.btn-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .1);
}

input,
select,
textarea {
    border: 1px solid #d9e2ef;
    border-radius: 13px;
    padding: 12px 14px;
    background: #fff;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

button {
    border-radius: 13px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

.alert {
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(249, 115, 22, .08);
}

.login-page {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #dbeafe, transparent 34%),
                linear-gradient(135deg, #f8fbff, #eef5ff);
}

.login-card {
    border-radius: 26px;
    border: 1px solid #e8eef7;
}

.login-card h1 {
    font-size: 28px;
}

@media (max-width: 1100px) {
    .kpi-grid,
    .dashboard-grid,
    .quick-grid,
    .grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }

    .side-user {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: 18px;
    }

    .app-layout {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        position: relative;
    }
}


.danger-link {
    color: #dc2626 !important;
    font-weight: 900;
}

.shift-tag {
    display: inline-block;
    padding: 5px 10px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 999px;
    font-weight: 900;
}
