:root {
    --oppo-green: #00BD56;
    --oppo-bg: #F0F3F6;
    --oppo-card: #FFFFFF;
    --text-main: #121212;
    --text-sub: #86868B;
    --warning-red: #FF4D4F;
    --leave-bg: #F5F5F5;
    --leave-text: #A0A0A0;
    --full-bg: #E6F7FF;
    --full-text: #007AFF;
    --part-bg: #FFF0E6;
    --part-text: #FA8C16;
}

body {
    margin: 0;
    height: 100vh;
    font-family: "OPPO Sans", sans-serif;
    background-color: var(--oppo-bg);
    color: var(--text-main);
    overflow: hidden;
}

.layout {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--oppo-bg);
    z-index: 5;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.layout.hidden {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

svg.icon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vertical-align: middle;
    flex-shrink: 0;
}

svg.spin {
    animation: spin 1s linear infinite;
}

/* 首頁桌面 (Dashboard) 樣式 */
.dashboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--oppo-bg);
    display: flex;
    flex-direction: column;
    z-index: 10;
    align-items: center;
    justify-content: center;
    transition: filter 0.4s, opacity 0.3s, transform 0.3s;
}

.dashboard-overlay.blurred {
    filter: blur(12px) brightness(0.95);
    pointer-events: none;
    user-select: none;
}

.dashboard-overlay.hidden {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.dash-header {
    position: absolute;
    top: 0;
    width: 100%;
    padding: 25px 40px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 50px;
    color: var(--text-main);
    letter-spacing: 1px;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 45px;
    max-width: 800px;
    width: 100%;
    justify-content: center;
    justify-items: center;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: 0.3s;
    width: 120px;
}

.app-item:hover {
    transform: translateY(-6px);
}

.app-icon {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: white;
    box-shadow: 0 12px 35px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.3s;
    position: relative;
}

.app-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 22px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}

.app-item:hover .app-icon {
    box-shadow: 0 20px 45px rgba(0,0,0,0.12);
}

.app-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
}

.app-staff .app-icon { background: linear-gradient(135deg, #00D26A, #009A44); }
.app-shop .app-icon { background: linear-gradient(135deg, #FF7043, #D84315); }
.app-schedule .app-icon { background: linear-gradient(135deg, #4A90E2, #0056B3); }
.app-payroll .app-icon { background: linear-gradient(135deg, #FA8C16, #D46B08); }
.app-report .app-icon { background: linear-gradient(135deg, #9C27B0, #5E35B1); }

.back-btn {
    background: #F0F3F6;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
    flex-shrink: 0;
}

.back-btn:hover {
    background: #E5E5E5;
    transform: translateX(-3px);
}

/* 登入視窗 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 243, 246, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    transition: opacity 0.4s;
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    width: 340px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    padding: 40px;
    border-radius: 28px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.1);
    text-align: center;
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.5);
}

.login-icon {
    width: 60px;
    height: 60px;
    background: #E9F8F0;
    color: var(--oppo-green);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.login-icon svg {
    width: 28px;
    height: 28px;
}

.login-card h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: var(--text-main);
}

.login-card p {
    color: var(--text-sub);
    font-size: 13px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.login-input {
    margin-bottom: 12px;
}

.login-input input {
    padding: 14px 16px;
    font-size: 14px;
    background: rgba(247, 248, 250, 0.8);
    border-radius: 12px;
    border: 1.5px solid transparent;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: 0.2s;
}

.login-input input:focus {
    background: white;
    border-color: var(--oppo-green);
}

.login-btn {
    margin-top: 10px;
    background: var(--text-main);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.login-btn:hover {
    background: var(--oppo-green);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,189,86,0.25);
}

.login-btn:disabled {
    background: #A0A0A0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.login-error {
    color: var(--warning-red);
    font-size: 13px;
    font-weight: 600;
    margin-top: 15px;
    display: none;
}

/* 側邊欄 */
.sidebar {
    width: 380px;
    min-width: 380px;
    background: var(--oppo-card);
    border-right: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0,0,0,0.02);
    z-index: 10;
    height: 100vh;
}

.sidebar-header {
    padding: 25px 30px 10px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.sidebar-content {
    padding: 10px 30px 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.user-profile-box {
    padding: 20px 30px;
    border-top: 1px solid #F0F3F6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAFAFB;
}

.user-profile-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: var(--text-main);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-small svg {
    width: 22px;
    height: 22px;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.u-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
}

.u-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--oppo-green);
    background: #E9F8F0;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    width: max-content;
}

.btn-perm {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    background: white;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-perm:hover {
    background: #F0F3F6;
    border-color: #D5D5D5;
}

.btn-logout {
    color: var(--warning-red);
    background: white;
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.center-toast {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translate(-50%, -20px) scale(0.95);
    background: rgba(25, 25, 25, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.center-toast.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.center-toast svg {
    color: var(--oppo-green);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* 狀態框 (右上角) */
.status-container {
    position: fixed;
    top: 30px;
    right: 30px;
    display: flex;
    flex-direction: row;
    gap: 15px;
    z-index: 1000;
    align-items: center;
}

.status-box {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: 0.3s;
    border: 1px solid transparent;
}

.server-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.status-box.connecting { color: var(--part-text); border-color: #FFF0E6; }
.status-box.connecting .server-dot { animation: pulse-orange 1.5s infinite; }

.status-box.connected { color: var(--oppo-green); border-color: #E9F8F0; }
.status-box.connected .server-dot { animation: pulse-green 2s infinite; }

.status-box.error { color: var(--warning-red); border-color: #FFEEEE; }
.status-box.error .server-dot { animation: pulse-red 1s infinite; }

.status-box.idle { color: var(--text-sub); }
.status-box.saving { background: #121212; color: white; }

.status-box.success { background: #E9F8F0; color: var(--oppo-green); }
.status-box.success #save-icon svg { animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

.status-box.save-error { background: #FFEEEE; color: var(--warning-red); }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes pop {
    0% { transform: scale(0.3); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 189, 86, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 189, 86, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 189, 86, 0); }
}

@keyframes pulse-orange {
    0% { box-shadow: 0 0 0 0 rgba(250, 140, 22, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(250, 140, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(250, 140, 22, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}

.perm-table-wrapper {
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.perm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.perm-table th {
    padding: 14px 10px;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 1px solid #E5E5E5;
    background: #FAFAFB;
}

.perm-table td {
    padding: 14px 10px;
    border-bottom: 1px solid #F0F3F6;
    color: var(--text-main);
    font-weight: 600;
}

.perm-table tr:last-child td {
    border-bottom: none;
}

.perm-table .text-left {
    text-align: left;
    padding-left: 15px;
}

.perm-table th.active-role {
    color: var(--oppo-green);
    background: #E9F8F0;
    border-bottom: 1px solid #C4EBD4;
}

.perm-table td.active-role {
    background: #E9F8F0;
}

.icon-tick {
    stroke: var(--oppo-green);
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

.icon-x {
    stroke: #D2D2D2;
    width: 18px;
    height: 18px;
    stroke-width: 3;
}

/* 表單與列表樣式 */
.avatar-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-upload {
    width: 75px;
    height: 75px;
    border-radius: 22px;
    background: #F7F8FA;
    border: 2px dashed #D2D2D2;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: .3s;
    color: #86868B;
    font-size: 28px;
    font-weight: 300;
}

.avatar-upload:hover {
    border-color: var(--oppo-green);
    color: var(--oppo-green);
}

.avatar-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.avatar-clear-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--warning-red);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,.15);
    transition: .2s;
}

.avatar-clear-btn:hover {
    transform: scale(1.1);
}

.avatar-hint {
    font-size: 11px;
    color: var(--text-sub);
    margin-top: 8px;
    font-weight: 600;
}

.crop-container {
    width: 100%;
    height: 320px;
    background: #E9E9E9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}

.cropper-view-box, .cropper-face {
    border-radius: 22px;
}

.input-group {
    margin-bottom: 12px;
}

.input-group label {
    display: block;
    font-size: 11px;
    color: var(--text-sub);
    margin-bottom: 4px;
    font-weight: 600;
}

.flex-group {
    display: flex;
    gap: 10px;
}

.flex-group .input-group {
    flex: 1;
    margin-bottom: 12px;
}

.id-group {
    display: flex;
    gap: 8px;
}

.id-group input {
    width: 65%;
}

input, textarea {
    width: 100%;
    box-sizing: border-box;
    background: #F7F8FA;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    transition: .25s;
    font-family: inherit;
    color: var(--text-main);
}

input:focus, textarea:focus {
    background: #fff;
    border-color: var(--oppo-green);
    outline: 0;
}

input:disabled {
    background: #EAEAEA;
    color: #A0A0A0;
    cursor: not-allowed;
    border-color: transparent;
}

textarea {
    resize: none;
    height: 80px;
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper select {
    display: none;
}

.select-selected {
    background: #F7F8FA;
    border: 1.5px solid transparent;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: .25s;
}

.select-selected:after {
    content: "";
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #86868B;
    transition: .3s transform;
}

.select-selected.select-arrow-active {
    background: #fff;
    border-color: var(--oppo-green);
}

.select-selected.select-arrow-active:after {
    transform: rotate(180deg);
    border-top-color: var(--oppo-green);
}

.select-items {
    position: absolute;
    background-color: #ffffff;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 999;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    overflow: hidden;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #eee;
}

.select-items div {
    color: var(--text-main);
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: .2s;
}

.select-items div:hover {
    background-color: #F7F8FA;
}

.same-as-selected {
    background-color: #E9F8F0 !important;
    color: var(--oppo-green) !important;
    font-weight: 600;
}

.select-hide {
    display: none;
}

.btn-stack {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
}

.btn-save {
    background: var(--oppo-green);
    color: white;
}

.btn-export {
    background: #121212;
    color: white;
}

.btn-import {
    background: #E9F8F0;
    color: var(--oppo-green);
}

.btn-danger {
    background: var(--warning-red);
    color: white;
    margin-top: 15px;
}

.btn-cancel {
    background: #F0F3F6;
    color: var(--text-sub);
    margin-top: 8px;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-row .btn {
    margin-top: 0;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
    gap: 25px;
}

.search-pill {
    background: white;
    border-radius: 50px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    width: 320px;
    box-shadow: 0 4px 15px rgba(0,0,0,.03);
    color: var(--text-sub);
}

.search-pill input {
    background: transparent;
    border: none;
    padding: 5px;
    width: 100%;
    font-size: 14px;
}

.stats-overview-box {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 6px 6px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0,0,0,.03);
    gap: 20px;
    border: 1px solid #F0F3F6;
}

.current-shop-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
}

.stats-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: none;
    transition: 0.3s;
}

.stat-item.active {
    background: #E9F8F0;
    color: #009A44;
}

.stat-item.active span {
    color: var(--oppo-green);
    font-size: 18px;
    font-weight: 700;
}

.stat-item.leave {
    background: #FFF0E6;
    color: #E68A00;
}

.stat-item.leave span {
    color: #FF9800;
    font-size: 18px;
    font-weight: 700;
}

.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap; /* 自動換行，隱藏滑動條 */
}

.tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: .2s;
    box-shadow: 0 2px 5px rgba(0,0,0,.02);
}

.tab.active {
    background: var(--oppo-green);
    color: white;
    box-shadow: none;
}

.sub-tabs .tab {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 15px;
}

.sub-tabs .tab.active {
    background: #121212;
    color: white;
}

.staff-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.02);
    margin-bottom: 10px;
    transition: .3s cubic-bezier(.4,0,.2,1);
    width: 100%;
    box-sizing: border-box;
}

.tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    font-weight: 600;
}

.shop-tag {
    background: #E9F8F0;
    color: var(--oppo-green);
}

.type-tag.full {
    background: var(--full-bg);
    color: var(--full-text);
}

.type-tag.part {
    background: var(--part-bg);
    color: var(--part-text);
}

.pos-tag {
    background: #F0F3F6;
    color: #555;
    font-weight: 500;
}

.id-type-tag {
    font-size: 10px;
    background: #F0F3F6;
    color: #555;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    border: 1px solid #ddd;
}

.date-tag {
    font-size: 11px;
    background: #F0F3F6;
    color: var(--text-sub);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--oppo-green);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.leave-item-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    width: 100%;
}

.leave-item-wrapper .staff-card.leave {
    margin-bottom: 0;
    background: var(--leave-bg);
    box-shadow: none;
    border: 1px dashed #ddd;
}

.staff-card.leave .avatar {
    background: #CCC;
}

.staff-card.leave b {
    color: var(--leave-text);
    text-decoration: line-through;
}

.staff-card.leave .shop-tag {
    background: #E0E0E0;
    color: #666;
}

.leave-badge {
    font-size: 11px;
    background: #FFEEEE;
    color: var(--warning-red);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: bold;
}

.checkbox-container {
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.batch-mode .checkbox-container {
    width: 38px;
    opacity: 1;
    margin-right: 5px;
}

.card-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--warning-red);
    margin: 0;
    pointer-events: none;
}

.batch-mode .staff-card.leave {
    cursor: pointer;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,.03);
}

.batch-mode .staff-card.leave:hover {
    background: #EFEFEF;
}

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    transition: .3s cubic-bezier(.4,0,.2,1);
    max-width: 260px;
    opacity: 1;
    overflow: hidden;
}

.batch-mode .leave-item-wrapper .actions {
    max-width: 0;
    opacity: 0;
    gap: 0;
}

.action-btn {
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: .2s;
    white-space: nowrap;
    border: none;
    background: transparent;
}

.action-btn:hover {
    background: rgba(0,0,0,.05);
}

.btn-view { color: #007AFF; }
.btn-edit { color: var(--oppo-green); }
.btn-leave { color: #FF9800; }
.btn-del { color: var(--warning-red); }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0 10px 5px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-sub);
    margin: 0;
}

.batch-btn {
    font-size: 12px;
    color: var(--warning-red);
    background: #FFEEEE;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: .3s;
    border: 1px solid transparent;
}

.batch-btn:hover {
    background: #FFDDDD;
}

.batch-btn.active {
    background: var(--warning-red);
    color: white;
    box-shadow: 0 4px 12px rgba(255,77,79,.3);
}

.batch-toolbar {
    display: flex;
    background: white;
    padding: 0 15px;
    border-radius: 12px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
    border: 0px solid var(--warning-red);
    margin-bottom: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: .3s cubic-bezier(.4,0,.2,1);
    margin-top: 0;
}

.batch-toolbar.show {
    max-height: 60px;
    opacity: 1;
    padding: 10px 15px;
    border-width: 1px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.batch-toolbar .left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.batch-toolbar .right {
    display: flex;
    gap: 8px;
}

.batch-toolbar button {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-weight: 600;
}

.batch-btn-cancel { background: #F0F3F6; color: var(--text-sub); }
.batch-btn-confirm { background: var(--warning-red); color: white; }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal-card {
    background: white;
    width: 450px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 40px rgba(0,0,0,.1);
    position: relative;
    max-height: 90vh;
    overflow-y: visible;
}

.modal-card.small { width: 320px; text-align: center; padding: 35px 25px; z-index: 101; }
.modal-card.medium { width: 420px; text-align: center; padding: 35px 25px; z-index: 101; }

.modal-card.small h3, .modal-card.medium h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.modal-card.small p, .modal-card.medium p {
    font-size: 15px;
    color: var(--text-sub);
    margin: 0;
    line-height: 1.5;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-sub);
    font-weight: bold;
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.modal-header .avatar {
    width: 60px;
    height: 60px;
    font-size: 24px;
    border-radius: 18px;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.modal-name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 11px;
    color: var(--text-sub);
    font-weight: 600;
    margin-bottom: 4px;
}

.info-value {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
    word-break: break-all;
}

.info-full {
    grid-column: span 2;
}

.check-group-container {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.check-item input[type="radio"], .check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--oppo-green);
    margin: 0;
}

.radio-pill-group {
    display: flex;
    background: #F0F3F6;
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    margin-top: 6px;
}

.radio-pill {
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.radio-pill input[type="radio"] {
    display: none;
}

.radio-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
    border-radius: 8px;
    transition: .2s cubic-bezier(.4,0,.2,1);
}

.radio-pill input[type="radio"]:checked + span {
    background: white;
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.timeline-container {
    margin-top: 15px;
    padding: 15px;
    background: #FAFAFB;
    border-radius: 12px;
    border: 1px solid #F0F3F6;
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 8px;
    height: 8px;
    background: var(--oppo-green);
    border-radius: 50%;
    box-shadow: 0 0 0 3px #E9F8F0;
}

.timeline-date {
    font-size: 10px;
    color: var(--text-sub);
    margin-bottom: 2px;
}

.timeline-event {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.timeline-note {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 2px;
}

.doc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    margin-right: 8px;
    margin-bottom: 8px;
    transition: 0.2s;
    font-weight: 500;
}

.doc-badge:hover {
    border-color: var(--oppo-green);
    color: var(--oppo-green);
    background: #E9F8F0;
}

/* 店鋪管理專屬 UI */
.shop-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 16px 22px;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: 0.3s;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.shop-item-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-item-name::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--oppo-green);
}

.shop-item-actions {
    display: flex;
    gap: 5px;
}

/* 編輯員工資料彈窗：寬版橫向 & 緊湊設計 (消除捲動條) */
.modal-card.wide-modal {
    width: 820px;
    max-width: 95vw;
    max-height: 95vh;
    overflow-y: auto;
    padding: 24px 30px;
}
.edit-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    text-align: left;
}
.edit-side.compact-side {
    width: 110px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.edit-main {
    flex: 1;
    min-width: 0;
}

/* 緊湊網格佈局 (3欄) */
.compact-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px 15px;
}
.compact-form .span-2 { grid-column: span 2; }
.compact-form .span-3 { grid-column: span 3; }

.compact-form .input-group { margin-bottom: 0; }
.compact-form .input-group label { margin-bottom: 3px; font-size: 11px; }

/* 縮小輸入框高度與內距 */
.compact-form input,
.compact-form select,
.compact-form .select-selected {
    padding: 5px 10px !important;
    font-size: 12px !important;
    height: 32px !important;
    border-radius: 8px !important;
}

.compact-form .radio-pill-group {
    margin-top: 0;
    padding: 3px;
    height: 32px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
}
.compact-form .radio-pill span {
    padding: 5px 0;
    font-size: 11px;
    border-radius: 6px;
}

@media (max-width: 760px) {
    .edit-layout { flex-direction: column; align-items: center; }
    .compact-form { grid-template-columns: 1fr 1fr; }
    .compact-form .span-2, .compact-form .span-3 { grid-column: span 2; }
    .edit-side.compact-side { width: 100%; flex-direction: row; justify-content: center; gap: 20px; }
}

/* ----------------------------------- */
/* Role Info Button & Modal Styles     */
/* ----------------------------------- */
.btn-role-info {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid var(--oppo-green);
    background: rgba(0, 189, 86, 0.05);
    color: var(--oppo-green);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-role-info:hover {
    background: var(--oppo-green);
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 189, 86, 0.2);
}

#roleModal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(240, 243, 246, 0.6); 
    backdrop-filter: blur(8px);
}

#roleModal .modal-content { 
    background-color: var(--oppo-card); 
    margin: 8% auto; 
    border-radius: 20px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.12); 
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.8);
    position: relative;
}

#roleModal .modal-header {
    background: #20232A; 
    color: #fff; 
    padding: 18px 24px; 
    border-radius: 20px 20px 0 0; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    border-bottom: none;
}

#roleModal .modal-header h2 {
    margin: 0; 
    font-size: 18px; 
    font-weight: 600;
    letter-spacing: 0.5px;
}

#roleModal .close {
    color: rgba(255,255,255,0.6); 
    cursor: pointer; 
    font-size: 24px;
    line-height: 1;
    transition: 0.2s;
}

#roleModal .close:hover {
    color: #fff;
    transform: scale(1.1);
}

@keyframes slideDown {
    0% { transform: translateY(-30px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
