:root {
    --primary: #16213e;
    --secondary: #1a1a2e;
    --accent: #0f3460;
    --highlight: #e94560;
    --text: #ffffff;
    --text-muted: #a0a0a0;
    --success: #00d26a;
    --warning: #ffc107;
    --danger: #dc3545;
    --card-bg: #1f2937;
    --border: #374151;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--secondary);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--primary);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 1.1rem;
    color: var(--highlight);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn {
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

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

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

.main-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: 80px;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo h2 {
    color: var(--highlight);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--secondary);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--highlight);
}

.date-selector {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-selector input[type="date"] {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
}

.collaborator-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.collaborator-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.collaborator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collaborator-name {
    font-weight: 600;
    font-size: 1rem;
}

.collaborator-id {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.status-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.status-btn {
    padding: 0.6rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--secondary);
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
}

.status-btn:hover {
    border-color: var(--highlight);
}

.status-btn.active {
    border-color: var(--highlight);
    background: var(--highlight);
    color: white;
}

.status-btn.A { border-color: var(--success); }
.status-btn.A.active { background: var(--success); }
.status-btn.FI { border-color: var(--danger); }
.status-btn.FI.active { background: var(--danger); }
.status-btn.FJ { border-color: var(--warning); color: #000; }
.status-btn.FJ.active { background: var(--warning); }
.status-btn.V { border-color: #00bcd4; }
.status-btn.V.active { background: #00bcd4; color: white; }

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    display: flex;
    justify-content: space-around;
    padding: 0.8rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item.active {
    color: var(--highlight);
}

.nav-item:hover {
    background: var(--secondary);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.6rem 1.2rem;
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.85rem;
}

.tab.active {
    background: var(--highlight);
    color: white;
}

.notes-container textarea {
    min-height: 120px;
    resize: vertical;
}

.vacation-card {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.8rem;
}

.vacation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.vacation-balance {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.balance-item {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--secondary);
    border-radius: 8px;
}

.balance-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--highlight);
}

.balance-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.vacation-history {
    margin-top: 1rem;
}

.vacation-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    background: var(--secondary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.admin-panel {
    display: none;
}

@media (min-width: 1024px) {
    .app-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .admin-panel {
        display: block;
    }
    
    .mobile-nav {
        display: none;
    }
    
    .main-content {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .sidebar {
        background: var(--card-bg);
        padding: 1.5rem;
        border-radius: 12px;
        height: fit-content;
        position: sticky;
        top: 80px;
    }
    
    .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .stat-card {
        background: var(--card-bg);
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .stat-value {
        font-size: 2.5rem;
        font-weight: 700;
        color: var(--highlight);
    }
    
    .stat-label {
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    table {
        width: 100%;
        border-collapse: collapse;
    }
    
    th, td {
        padding: 1rem;
        text-align: left;
        border-bottom: 1px solid var(--border);
    }
    
    th {
        background: var(--secondary);
        font-weight: 600;
        color: var(--text-muted);
    }
    
    tr:hover {
        background: var(--secondary);
    }
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-content {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.offline-indicator {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--warning);
    color: #000;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    z-index: 150;
    display: none;
}

.offline-indicator.show {
    display: block;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.sync-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.sync-status.synced {
    color: var(--success);
}

.sync-status.pending {
    color: var(--warning);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.A { background: var(--success); }
.status-badge.FI { background: var(--danger); }
.status-badge.FJ { background: var(--warning); color: #000; }
.status-badge.D { background: var(--accent); }
.status-badge.DL { background: #9c27b0; }
.status-badge.FT { background: #ff9800; }
.status-badge.V { background: #00bcd4; }
.status-badge.PSG { background: #607d8b; }
.status-badge.PCG { background: #4caf50; }
