:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --bg-secondary: #f1f5f9;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Language Selector - Login Page (absolute positioned) */
.login-page .language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Language Selector - Base Styles */
.language-selector {
    display: flex;
    gap: 8px;
}

.language-selector button,
.language-selector .lang-btn {
    padding: 8px 16px;
    border: 2px solid white;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.language-selector button:hover,
.language-selector .lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.language-selector button.active,
.language-selector .lang-btn.active {
    background: white;
    color: #667eea;
}

/* Language Selector - Inside Header (different colors for visibility) */
.app-header .language-selector {
    position: relative;
    top: auto;
    right: auto;
}

.app-header .language-selector button,
.app-header .language-selector .lang-btn {
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
}

.app-header .language-selector button:hover,
.app-header .language-selector .lang-btn:hover {
    background: rgba(59, 130, 246, 0.1);
}

.app-header .language-selector button.active,
.app-header .language-selector .lang-btn.active {
    background: var(--primary-color);
    color: white;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.login-box h1 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
    color: #667eea;
}

.login-box h2 {
    font-size: 20px;
    text-align: center;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

/* Header */
.app-header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
}

.app-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.admin-badge {
    display: inline-block;
    background: var(--danger-color);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 5px;
}

.nav-link {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: var(--radius);
    transition: all 0.2s;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.nav-link.active {
    background: var(--primary-color);
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.user-name {
    font-weight: 600;
    color: var(--text-color);
}

.btn-logout {
    padding: 8px 16px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

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

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - var(--header-height) - 60px);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input {
    margin-right: 8px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

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

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

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-color);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-color);
}

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

.data-table-container {
    overflow-x: auto;
}

/* Cards */
.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

/* Sections */
.dashboard-header {
    margin-bottom: 30px;
}

.dashboard-header h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.quick-entry-section,
.recent-entries-section,
.recent-activity {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.quick-entry-section h2,
.recent-entries-section h2,
.recent-activity h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Admin Stats */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 90px;
    right: 20px;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: var(--success-color);
    color: white;
}

.notification-error {
    background: var(--danger-color);
    color: white;
}

/* Footer */
.app-footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-content form {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

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

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

.status-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.role-employee {
    background: #dbeafe;
    color: #1e40af;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-secondary);
    color: var(--text-muted);
    margin-left: 8px;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
}

/* Filters */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.filters-section {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.filters-form .form-row {
    align-items: flex-end;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Manage Pages */
.manage-page {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Summary Section */
.summary-section {
    margin-bottom: 24px;
}

.summary-card {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.summary-label {
    font-weight: 500;
    color: var(--text-muted);
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.summary-count {
    color: var(--text-muted);
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
}

/* Reports Page */
.reports-page {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.report-section {
    margin-top: 30px;
}

.report-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    height: 8px;
    background: var(--primary-color);
    border-radius: 4px;
    min-width: 4px;
}

/* Time Entry Page */
.time-entry-page {
    max-width: 800px;
}

.entry-form-section {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.recent-section {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.recent-section h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

/* My Entries Page */
.my-entries-page {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.error-message {
    margin-top: 15px;
    padding: 12px;
    background: #fee2e2;
    color: var(--danger-color);
    border-radius: var(--radius);
    font-size: 14px;
}

.error-text {
    color: var(--danger-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .header-nav {
        gap: 2px;
    }
    
    .nav-link {
        padding: 8px 10px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 20px;
    }
    
    .header-nav {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .header-right {
        gap: 10px;
    }
    
    .app-header .language-selector button,
    .app-header .language-selector .lang-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .summary-cards {
        flex-direction: column;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .filters-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}