/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* App Container */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page {
    display: none;
    flex: 1;
}

.page.active {
    display: block;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.login-form {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-transform: uppercase;
    font-weight: 600;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5a6fd8;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.error-message {
    background-color: #dc3545;
    color: white;
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
}

/* Dashboard Layout */
.app-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content h1 {
    color: #333;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-weight: 500;
    color: #666;
}

.main-nav {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
    display: flex;
    gap: 1rem;
}

.nav-btn {
    background: none;
    border: 1px solid #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn:hover {
    background-color: #f8f9fa;
}

.nav-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-value.pending { color: #ffc107; }
.stat-value.approved { color: #28a745; }
.stat-value.rejected { color: #dc3545; }

/* Forms */
.request-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-end;
}

/* Requests List */
.requests-list {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.request-item {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.3s;
}

.request-item:hover {
    background-color: #f8f9fa;
}

.request-item:last-child {
    border-bottom: none;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.request-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.request-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

.request-status {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending { background-color: #fff3cd; color: #856404; }
.status-director_approved { background-color: #d4edda; color: #155724; }
.status-director_rejected { background-color: #f8d7da; color: #721c24; }
.status-ict_approved { background-color: #d4edda; color: #155724; }
.status-ict_rejected { background-color: #f8d7da; color: #721c24; }
.status-cancelled { background-color: #e2e3e5; color: #383d41; }

.request-description {
    color: #666;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.request-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 3px;
}

/* Search and Filters */
.search-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-filters input, .search-filters select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* Approvals Tabs */
.approvals-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tab-btn {
    background: none;
    border: 1px solid #e9ecef;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background-color: #f8f9fa;
}

.tab-btn.active {
    background-color: #667eea;
    color: white;
    border-color: #667eea;
}

.approvals-tab {
    display: none;
}

.approvals-tab.active {
    display: block;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

/* File Upload */
.file-preview {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-item {
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-form {
        padding: 2rem 1rem;
        margin: 0 1rem;
    }
    
    .main-nav {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .approvals-tabs {
        flex-direction: column;
    }
    
    .request-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .request-actions {
        justify-content: flex-end;
    }
}