:root {
    --primary-green: #166647;
    --light-green: #f0f7f4;
    --background-gray: #f8f9fa;
    --border-gray: #e9ecef;
    --text-dark: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --status-pending: #ffc107; 
    --status-approved: #198754; 
    --status-rejected: #dc3545; 
    --status-secondary: #0dcaf0;
    --primary: #4361ee;
    --success: #06d6a0;
    --danger: #ef476f;
    --dark: #2b2d42;
    --gray: #8d99ae;
    --light-bg: #f8f9fa;
    --border: #e9ecef; 
}

body {
    display: flex;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-gray);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden; 
}

* {
    box-sizing: border-box;
}

.sidebar {
    width: 260px;
    background-color: var(--primary-green);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 24px;
    height: 100vh;
    position: sticky;
    top: 0;
    flex-shrink: 0;
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
}
.sidebar-header {
    margin-bottom: 30px;
    padding-left: 10px;
}
.sidebar-header h3 {
    margin: 0;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}
.sidebar-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--white);
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.sidebar-nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.sidebar-nav a.active {
    background-color: var(--white);
    color: var(--primary-green);
    font-weight: 600;
}
.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.main-content {
    flex-grow: 1;
    padding: 30px;
    height: 100vh; 
    overflow-y: auto; 
    overflow-x: hidden;
    padding-bottom: 120px; 
    width: 100%;
}

.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.main-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.main-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
    margin-right: auto;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.menu-overlay.active {
    display: block;
    opacity: 1;
}

.logout-btn {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    transition: background-color 0.2s;
    font-size: 0;
    font-family: 'Poppins', sans-serif;
}
.logout-btn:hover {
    background-color: var(--border-gray);
}
.logout-btn i {
    margin-right: 8px;
    font-size: 16px;
}
.logout-btn::after {
    content: 'uColab';
    font-size: 16px;
    font-weight: 600;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-gray);
    gap: 20px;
    flex-wrap: wrap;
}

.header-left h1 {
    font-size: 28px;
    margin: 0;
    font-weight: 600;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

.header-left .subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin: 5px 0 0 0;
}

.header-right {
    flex-grow: 1;
    max-width: 600px;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    background-color: var(--white);
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pending-color { color: var(--status-pending); }
.approved-color { color: var(--status-approved); }
.rejected-color { color: var(--status-rejected); }

.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 14px;
}

#search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s ease;
}

#search-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.filters {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.status-filters {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 15px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: var(--light-green);
    border-color: var(--primary-green);
}

.filter-btn.active {
    background-color: var(--primary-green);
    color: var(--white);
    border-color: var(--primary-green);
}

.sort-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 35px 10px 15px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    background-color: var(--white);
    font-family: 'Poppins', sans-serif; 
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236c757d'%3E%3Cpath d='M8 11L2 5h12L8 11z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.sort-dropdown:hover {
    border-color: #adb5bd;
}

.sort-dropdown:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(24, 99, 75, 0.1);
}

.applications-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 40px; 
}

.application-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 160px; 
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 20px;
    align-items: center;
    gap: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.application-row:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateX(4px);
    border-color: #dee2e6;
}

.row-section {
    display: flex;
    align-items: center;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.startup-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(67, 97, 238, 0.2));
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.row-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0 0 4px 0;
    line-height: 1.2;
}

.row-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.dot-separator {
    font-size: 1.2rem;
    line-height: 0;
    color: #cbd5e0;
}

.application-row .details-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 0 24px;
    margin: 0;
    background: transparent;
}

.application-row .detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    font-weight: 500;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    display: inline-block;
    width: fit-content;
    white-space: nowrap;
}

.status-badge.approved { background: rgba(6, 214, 160, 0.15); color: #059c75; }
.status-badge.rejected { background: rgba(239, 71, 111, 0.15); color: #d62851; }
.status-badge.pending { background: rgba(255, 209, 102, 0.2); color: #b8860b; }

.action-section {
    display: flex;
    gap: 8px;
    justify-content: flex-end; 
    min-width: 160px; 
}

.action-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    background: transparent;
    color: var(--gray);
}

.action-btn-icon:hover {
    background: var(--light-bg);
    color: var(--dark);
    transform: translateY(-2px);
}

.action-btn-icon.view:hover { color: var(--primary); background: rgba(67, 97, 238, 0.1); }
.action-btn-icon.approve:hover { color: #059c75; background: rgba(6, 214, 160, 0.1); }
.action-btn-icon.reject:hover { color: #d62851; background: rgba(239, 71, 111, 0.1); }
.action-btn-icon.delete:hover { color: #dc3545; background: rgba(220, 53, 69, 0.1); }

.loading-state {
    text-align: center;
    padding: 50px 0;
    font-size: 18px;
    color: var(--text-light);
}

.loading-state i {
    font-size: 40px;
    color: var(--primary-green);
    margin-bottom: 10px;
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 1100;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.details-modal {
    max-width: 800px;
}

.confirm-modal {
    max-width: 450px;
    text-align: center;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal-body {
    padding: 25px;
    flex-grow: 1;
}

.details-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--background-gray);
    border-radius: 8px;
}

.details-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--primary-green);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
}

.details-section h3 i {
    font-size: 16px;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

.detail-item span,
.long-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.5;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.support-tag {
    padding: 5px 10px;
    background-color: var(--light-green);
    color: var(--primary-green);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.action-group-right {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    color: white;
    justify-content: center;
}

.btn i {
    font-size: 1.1em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    opacity: 0.95;
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--status-approved, #28a745), #218838);
}

.btn-warning {
    background: linear-gradient(135deg, var(--status-pending, #ffc107), #e0a800);
    color: #333;
}

.btn-danger {
    background: linear-gradient(135deg, var(--status-rejected, #dc3545), #c82333);
}

.btn-secondary {
    background: #6c757d;
}

.btn-primary{
    background: linear-gradient(135deg, var(--primary-green, #166647), #14543f);
}
.btn-delete {
    background-color: transparent;
    border: 2px solid #ff4d4d;
    color: #ff4d4d;
    box-shadow: none;
}

.btn-delete:hover {
    background-color: #ff4d4d;
    color: white;
    box-shadow: 0 5px 15px rgba(255, 77, 77, 0.3);
}

@media (max-width: 1200px) {
    .application-row {
        grid-template-columns: 1.2fr 1.5fr auto;
        padding: 16px;
    }
    .application-row .details-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }
}

@media (max-width: 992px) {
    .content-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-right {
        max-width: 100%;
    }

    .controls-section {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .filters {
        justify-content: space-between;
    }

    .application-row {
        grid-template-columns: 1fr;
        gap: 16px;
        position: relative;
        padding-bottom: 60px; 
    }
    
    .application-row .details-section {
        border: none;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        padding: 16px 0;
        grid-template-columns: repeat(2, 1fr);
        margin-top: 5px;
        margin-bottom: 5px;
    }
    
    .action-section {
        position: absolute;
        bottom: 15px;
        right: 15px;
        justify-content: flex-end;
        width: auto;
    }

    .application-row:hover {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        position: relative;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        width: 260px;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        padding: 15px;
        padding-bottom: 150px; 
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-header {
        justify-content: space-between;
        margin-bottom: 20px;
    }
    
    .application-row .details-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }
    
    .action-group-right, 
    .action-group-left {
        width: 100%;
    }

    .btn {
        width: 100%;
    }
    
    .action-group-right {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .status-filters {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .filter-btn {
        flex-shrink: 0;
    }
    
    .header-stats {
        grid-template-columns: 1fr 1fr;
    }

    .row-subtitle {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .dot-separator {
        display: none;
    }
}

/* Modal overlay & content - centered design */
.modal-overlay {
    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: 2000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.25s, opacity 0.25s;
    padding: 16px;
}
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.modal-content {
    background-color: var(--white);
    padding: 22px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-10px);
    transition: transform 0.25s ease-out;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-dark);
}
.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
}
.confirm-modal .modal-footer { display:flex; justify-content:flex-end; gap:10px; }
.confirm-modal .btn { min-width: 96px; }
