:root {
    /* Color Palette - Modern Indigo & Slate */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #818cf8;
    --primary-soft: rgba(99, 102, 241, 0.15);

    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-sidebar: #0f172a;
    /* Slate 900 */

    --text-primary: #f1f5f9;
    /* Slate 100 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --text-muted: #64748b;
    /* Slate 500 */

    --border: #334155;
    /* Slate 700 */
    --border-hover: #475569;
    /* Slate 600 */

    --sidebar-width: 260px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    /* Custom focus styles */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: white;
    background: linear-gradient(135deg, #a5b4fc 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.nav-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.875rem 1rem;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Main Content */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    position: relative;
    background: #0b1121;
    /* Slightly darker than sidebar for contrast */
}

/* Scrollbar Styling */
.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.main-scroll-area {
    flex: 1;
    padding: 3rem 2rem;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.header {
    margin-bottom: 3rem;
    text-align: center;
}

.header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
    color: white;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Form Elements */
.input-group {
    margin-bottom: 1.75rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.875rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
    transform: translateY(1px);
}

.mt-4 {
    margin-top: 1.5rem;
}

/* Result Box */
.result-box {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    /* Subtler border */
    border-left: 4px solid var(--primary);
    color: var(--text-primary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 2rem;
}

.result-header-large {
    font-size: 2rem;
    color: var(--success);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

/* Tabs Sub */
.tabs-sub {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding-bottom: 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

/* Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);

    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

td input {
    width: 100px;
    padding: 0.25rem;
    font-size: 0.875rem;
}

/* Mobile */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        overflow-x: auto;
    }

    .nav-item {
        margin: 0 0.5rem;
        white-space: nowrap;
    }

    .content {
        padding: 1rem;
    }
}

/* =============================================== */
/* Workday Calculator Results - Premium Card Style */
/* =============================================== */

.results {
    display: none;
    animation: fadeIn 0.3s ease;
}

.results.show {
    display: block;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(99, 102, 241, 0.1));
    border-radius: 1rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-main {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--success);
    line-height: 1;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.result-label {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.result-item {
    background: var(--bg-dark);
    padding: 1.5rem 1rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.result-item:hover::before {
    opacity: 1;
}

.result-item .value {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.result-item .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Card color variants */
.result-item.total::before {
    background: var(--primary);
}

.result-item.total .value {
    color: var(--primary-light);
}

.result-item.holidays::before {
    background: var(--danger);
}

.result-item.holidays .value {
    color: var(--danger);
}

.result-item.weekends::before {
    background: var(--warning);
}

.result-item.weekends .value {
    color: var(--warning);
}

.result-item.makeup::before {
    background: var(--success);
}

.result-item.makeup .value {
    color: var(--success);
}

/* Always show color bars for card style */
.result-item::before {
    opacity: 1;
}

/* Special Days Section */
.special-days {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-dark);
    border-radius: 1rem;
    border: 1px solid var(--border);
}

.special-days h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.day-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--primary);
    border-radius: 2rem;
    font-size: 0.875rem;
    color: var(--primary-light);
}

/* 法定假期 - 红色 */
.day-tag.statutory {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* 调休假期 (非法定) - 橙色 */
.day-tag.inlieu {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

/* 旧的 holiday 类 - 保持兼容 */
.day-tag.holiday {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: var(--danger);
}

/* 调休上班日 - 绿色 */
.day-tag.makeup {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

/* Loading & Error States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

/* Responsive: 4 columns -> 2 columns on smaller screens */
@media (max-width: 600px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-main {
        font-size: 3rem;
    }

    .result-item .value {
        font-size: 1.75rem;
    }
}

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.app-footer p {
    margin: 0;
}

.app-footer span {
    color: var(--primary-light);
    font-weight: 600;
}