*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body{
    overflow-x: hidden;
}

.container {
    position: relative;
    width: 100%;
}

.sidebar {
    position: fixed;
    width: 300px;
    height: 100%;
    background: rgb(0, 166, 77);
    overflow: hidden;
    overflow-x: hidden;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.sidebar ul li {
    width: 100%;
    list-style: none;
}

.sidebar ul li:hover {
    background: rgb(82, 215, 144);
}

.sidebar ul li:first-child {
    line-height: 60px;
    margin-bottom: 10px;
    font-weight: 600;
    border-bottom: 1px solid #fff;
}

.sidebar ul li:first-child:hover {
    background: none;
}

.sidebar ul li a {
    width: 100%;
    text-decoration: none;
    color: #fff;
    height: 50px;
    display: flex;
    align-items: center;
}

.sidebar ul li a i {
    min-width: 60px;
    font-size: 25px;
    text-align: center;
}

.sidebar .title {
    padding: 0 6px;
    font-size: 20px;
}

.main {
    position: absolute;
    width: calc(100% - 300px);
    min-height: 100vh;
    left: 300px;
    background: #f5f5f5;
}

.top-bar {
    position: fixed;
    height: 70px;
    width: calc(100% - 250px);
    background: #fff;
    display: grid;
    grid-template-columns: 10fr 0.4fr 1fr;
    grid-gap: 5px;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.top-bar .search {
    position: relative;
    max-width: 400px;
}

.search input {
    width: 100%;
    min-width: 128px;
    height: 40px;
    padding: 0 40px;
    font-size: 16px;
    outline: none;
    border: none;
    background: #f5f5f5;
}

.search i {
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
}

.user {
    position: relative;
    width: 50px;
    height: 50px;
}

.profile-text {
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    top: 10px; 
    color: black;
}

.cards {
   margin-top: 60px;
   width: 100%; 
   padding: 35px 20px;
   display: grid;
   grid-template-columns: repeat(5, 1fr);
   grid-gap: 20px;
   cursor: pointer;
}

.cards .card {
    background: rgb(0, 166, 77);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.cards .card:hover {
    background: rgb(195, 255, 0);
}

.number {
   font-size: 35px;
   font-weight: 500%;
   color: #fff; 
}

.card-name {
    color: white;
    font-weight: 600%;
}

.icon-box i {
    font-size: 45px;
    color: #F0F0F0;
}

.tables {
    width: 100%;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-gap: 20px;
    align-items: self-start;
    padding: 0 20px 20px 20px;
}

.last-appointments {
    min-height: 350px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.doctor-available {
    min-height: 350px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #444;
}

.btn {
    padding: 5px 10px;
    background-color: rgb(0, 166, 77);
    color: #fff;
    text-decoration: none;
    text-align: center;
}

table {
    margin-top: 10px;
    width: 100%;
    border-collapse: collapse;
}

thead td {
    font-weight: 600%;
    color: #333;
}

table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

tbody tr:hover {
    background-color: rgb(91, 233, 158);
    color: #ffffff;
}

table tbody tr:last-child {
    border-bottom: none;
}

td {
    padding: 9px 5px;
}

td i {
    padding: 7px;
    color: #fff;
    border-radius: 50px;
}

.last-appointments table tbody td:last-child{
    white-space: nowrap;
}

.fa-eye {
    background: rgb(0, 166, 77);
    cursor: pointer;
}

.fa-edit {
    background: rgb(0, 166, 77);
    cursor: pointer;
}

.fa-trash-alt {
    background: red;
    cursor: pointer;
}

.btn:hover {
    background: red;
}

/* Responsive Styles */
@media(max-width: 1200px){
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width: 1090px){
    .sidebar {
        width: 70px;
        overflow: hidden;
    }
    .sidebar .title {
        opacity: 0;
        pointer-events: none;
    }
    .sidebar ul li a {
        justify-content: center;
    }
    .main {
        width: calc(100% - 70px);
        left: 70px;
    }
    .top-bar {
        width: calc(100% - 70px);
    }
    .menu-toggle {
        display: block;
    }
    .sidebar:hover {
        width: 300px;
    }
    .sidebar:hover .title {
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar:hover ~ .main,
    .sidebar:hover ~ .top-bar {
        width: calc(100% - 300px);
        left: 300px;
    }
}

@media(max-width: 860px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .tables {
        grid-template-columns: 1fr;
    }
    .search input {
        width: 150px;
    }
}

@media(max-width: 768px) {
    .sidebar {
        left: -100%;
    }
    .sidebar.active {
        left: 0;
        width: 300px;
    }
    .sidebar.active .title {
        opacity: 1;
        pointer-events: auto;
    }
    .main, .top-bar {
        width: 100%;
        left: 0;
    }
    .sidebar.active ~ .main,
    .sidebar.active ~ .top-bar {
        width: calc(100% - 300px);
        left: 300px;
    }
    .top-bar {
        grid-template-columns: 1fr 0.4fr 1fr;
    }
}

@media(max-width: 600px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .last-appointments td:nth-child(3){
        display: none;
    }
    .top-bar {
        grid-template-columns: 1fr 0.3fr 0.5fr;
    }
    .search {
        max-width: 120px;
    }
    .search input {
        width: 100%;
        padding: 0 30px 0 10px;
    }
    .search i {
        right: 5px;
    }
}

@media(max-width: 480px) {
    .last-appointments, .doctor-available {
        font-size: 14px;
        padding: 10px;
        min-height: 200px;
    }
    .cards, 
    .tables {
        padding: 10px;
    }
    .user {
        width: 40px;
        height: 40px;
    }
    .profile-text {
        font-size: 16px;
    }
    .menu-toggle {
        font-size: 20px;
    }
}

@media(max-width: 400px) {
    .sidebar.active {
        width: 100%;
    }
    .sidebar.active ~ .main,
    .sidebar.active ~ .top-bar {
        width: 0;
        left: 100%;
    }
    .top-bar {
        padding: 0 10px;
    }
}

/* Dark Mode Styles */
body.dark-mode {
    background: #1a1a1a;
}

body.dark-mode .sidebar {
    background: rgb(0, 166, 77);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode .sidebar ul li:hover {
    background: rgb(0, 166, 77);
}

body.dark-mode .sidebar ul li:first-child {
    border-bottom: 1px solid #aaa;
}

body.dark-mode .sidebar ul li a {
    color: #e0e0e0;
}

body.dark-mode .sidebar ul li a i {
    color: #e0e0e0;
}

body.dark-mode .main {
    background: #1a1a1a;
}

body.dark-mode .top-bar {
    background: #2c2c2c;
    box-shadow: 0 4px 0 rgba(255, 255, 255, 0.1);
}

body.dark-mode .search input {
    background: #444;
    color: #e0e0e0;
}

body.dark-mode .search i {
    color: #aaa;
}

body.dark-mode .profile-text {
    color: #66b0ff;
}

body.dark-mode .cards .card {
    background: rgb(0, 166, 77);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

body.dark-mode .cards .card:hover {
    background: #ff3333;
}

body.dark-mode .number {
    color: #e0e0e0;
}

body.dark-mode .card-name {
    color: #e0e0e0;
}

body.dark-mode .icon-box i {
    color: #d1d1d1;
}

body.dark-mode .last-appointments {
    background: #2c2c2c;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode .doctor-available {
    background: #2c2c2c;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.1);
}

body.dark-mode .heading {
    color: #e0e0e0;
}

body.dark-mode .btn {
    background-color: #007bff;
}

body.dark-mode .btn:hover {
    background: #ff3333;
}

body.dark-mode thead td {
    color: #e0e0e0;
}

body.dark-mode table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode tbody tr:hover {
    background-color: #005bb5;
    color: #e0e0e0;
}

body.dark-mode td {
    color: #e0e0e0;
}

body.dark-mode .fa-eye {
    background: #007bff;
}

body.dark-mode .fa-edit {
    background: #005bb5;
}

body.dark-mode .fa-trash-alt {
    background: #ff3333;
}