
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: #f4f4f2;
    color: #333;
}

a {
    text-decoration: none;
    color: inherit;
}

/* LAYOUT */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/*SIDEBAR (DESKTOP)*/
.sidebar {
    width: 260px;
    background: #4f7f5a;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 0;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo img {
    width: 90px;
}

/* NAV LINKS */
.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar nav a,
.logout {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: #fff;
    font-size: 15px;
    transition: background 0.3s;
}

.sidebar nav a:hover,
.sidebar nav a.active,
.logout:hover {
    background: rgba(255,255,255,0.15);
}

/* SVG ICONS — fixed for desktop & mobile */
.sidebar svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
}

.logout {
    margin-top: auto;
}

/* MAIN*/
.main {
    flex: 1;
    padding: 30px;
}
.main-wrapper {
    flex: 1;          
    display: flex;     
    flex-direction: column;
    width: 100%;
}

/*TOP BAR*/
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.topbar h2 {
    font-size: 26px;
    font-weight: 600;
    color: #2f5d3a;
}

.admin {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #d9d9d9;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ADD JOB*/
.add-job {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    width: 350px;
}

.input-group input {
    width: 100%;
    padding: 14px;
    border: 1.5px solid #aaa;
    font-size: 14px;
    background: transparent;
    outline: none;
}

.input-group label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #f4f4f2;
    padding: 0 6px;
    font-size: 13px;
    color: #777;
    pointer-events: none;
    transition: 0.3s;
}

.input-group input:focus + label,
.input-group input:valid + label {
    top: -7px;
    font-size: 12px;
    color: #4f7f5a;
}

.add-btn {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 14px 28px;
    font-size: 14px;
    cursor: pointer;
}

.add-btn:hover {
    background: #43a047;
}

/*CARD + TABLE */
.card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f7f7f7;
}

thead th {
    padding: 14px;
    font-size: 14px;
    color: #2f5d3a;
    text-align: left;
}

tbody td {
    padding: 14px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}


.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 0 0 10px 10px;
}

.page-nav-btn {
    background: #f0f2f5;
    border: none;
    padding: 8px;
    border-radius: 5%;
    cursor: pointer;
    transition: 0.3s;
}

.page-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-link {
    border: none;
    background: none;
    width: 35px;
    height: 35px;
    border-radius: 5%;
    cursor: pointer;
    font-weight: 600;
}

.page-link.active {
    background: #667eea;
    color: white;
}

.page-indicator {
    font-size: 14px;
    color: #666;
}


/* ACTION ICONS (RESTORED ORIGINAL)*/
.actions {
    display: flex;
    gap: 24px;
    align-items: center;
}

.actions svg.edit-icon {
    width: 24px;
    height: 24px;
    fill: #4caf50; 
    cursor: pointer;
}

.actions svg.delete-icon {
    width: 24px;
    height: 24px;
    fill: #f44336; 
    cursor: pointer;
}

.actions svg:hover {
    transform: scale(1.1);
}

/* TOGGLE SWITCH (VISIBLE FIXED)*/
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    vertical-align: middle;
}

.switch input {
    display: none;
}

.switch span {
    display: block;          
    position: relative;
    width: 100%;
    height: 100%;
    background: #ccc;
    border-radius: 22px;
    transition: 0.3s;
    cursor: pointer;
}

.switch span::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

.switch input:checked + span {
    background: #4caf50;
}

.switch input:checked + span::before {
    transform: translateX(22px);
}

/* MOBILE SLIDE MENU*/
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 105vh;
    background: #4f7f5a;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: 0.4s ease;
    z-index: 999;
}

.mobile-menu.show {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: right;
    align-items: center;
    color: #fff;
    font-size: 18px;
    margin-bottom: 30px;
}

.mobile-menu-header button {
    background: none;
    border: none;
    color: #fff;
    font-size: 50px;
    cursor: pointer;
}

.mobile-menu nav a,
.mobile-menu .logout {
    color: #fff;
    padding: 14px 0;
    display: block;
    font-size: 15px;
}


/* MOBILE MENU ICONS & ACTIVE LINK */
.mobile-menu nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    color: #fff;
    font-size: 15px;
    transition: background 0.3s;
}

.mobile-menu nav a.active {
    background: rgba(255,255,255,0.15);
}

.mobile-menu nav svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}

.mobile-menu .logout {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 14px 0;
}

.mobile-menu .logout svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    fill: none;
    stroke-width: 2;
}


/*RESPONSIVE */
@media (max-width: 900px) {

    /* REMOVE OUTER NAV COMPLETELY */
    .nav-links,
    .logout.desktop-only {
        display: none !important;
    }

    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
        padding: 12px 20px;
    }

    .sidebar-header {
        flex-direction: row;
        width: 100%;
    }

    .logo {
        margin-right: auto;
        margin-bottom: 0;
    }

    .menu-toggle {
        display: block;
    }

    .main {
        padding: 20px;
    }

    .add-job {
        flex-direction: column;
    }

    .input-group {
        width: 100%;
    }

    .admin {
        display: none;
    }

    .mobile-menu .logout {
        margin-bottom: 4vh;
    }

   
    .table-responsive {
        width: 100%;
        overflow-x: auto;
    }

    .table-responsive table {
        min-width: 600px; 
        border-collapse: collapse;
    }

    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap; 
    }
    /* Blur background when mobile menu is active */
    .main-wrapper.blur {
        filter: blur(6px);
        transition: filter 0.3s ease;
        pointer-events: none; 
    }
}
