:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

/* 登录页 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

.login-content-wrapper {
    display: flex;
    align-items: center;
    gap: 4rem;
    /* Spacing between text and box */
    max-width: 900px;
    width: 90%;
}

.login-left-section {
    text-align: center;
}

.login-box {
    flex: 1;
    max-width: 380px;
    background: rgba(30, 41, 59, 0.7);
    /* Glassy feeling */
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Updated Header Styles */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
    /* Increased spacing */
}

.login-h1 {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 2.2rem;
    /* Larger font */
    font-weight: 800;
    line-height: 1.25;
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    letter-spacing: -1px;
}

.login-subtitle {
    font-family: 'Inter', sans-serif;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Dashboard Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    color: #fff;
    letter-spacing: 1px;
}

.nav {
    list-style: none;
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.user-info {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: #0b1120;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Cards & Forms */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s;
}

/* Fix Date/Time icons to be white */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: auto;
}

.btn-danger {
    background: var(--danger);
}

.btn-secondary {
    background: #475569;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: #64748b;
}

.btn-success {
    background: var(--success);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.btn-warning:hover {
    background: #d97706;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.data-table th {
    background: #1e293b;
    padding: 1rem;
    text-align: left;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #2d3748;
    color: var(--text-main);
}

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

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* Status Badges */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-draft {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.badge-submitted {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-approved {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge-returned {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    background: var(--card-bg);
    width: 90%;
    /* max-width removed to allow inline override */
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    /* Restrict height */
    display: flex;
    flex-direction: column;
    /* For proper child scrolling */
    animation: scaleIn 0.2s ease;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent);
    flex-shrink: 0;
}

.modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    /* Enable scrolling */
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: right;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Batch Layout */
.batch-container {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 200px);
}

.member-selection {
    width: 250px;
    background: #162032;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.workload-form-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.member-item input {
    margin-right: 0.8rem;
    accent-color: var(--primary-color);
    width: 16px;
    height: 16px;
}

/* Announcement Styles */
.sidebar-announcement {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 12px;
    margin: 0;
    /* Margin handled by container padding */
    color: #cbd5e1;
    font-size: 0.85rem;
    line-height: 1.5;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.sidebar-announcement h4 {
    margin: 0 0 8px 0;
    color: #fbbf24;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed #475569;
    padding-bottom: 6px;
}

/* New Grouping Styles */
.member-group-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid #334155;
}

/* 2-Column Grid Layout */
.member-group-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Two equal columns */
    gap: 0.5rem;
}

.member-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.02);
    /* Slight bg for visibility */
    border: 1px solid transparent;
}

.member-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Admin Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    background: #111827;
    padding: 0.5rem;
    border-radius: 8px;
    display: inline-flex;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1.2rem;
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: 0.2s;
}

.tab-btn.active {
    background: var(--bg-card);
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab-btn:hover:not(.active) {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}