:root {
    --primary: #5a8092;
    --primary-light: #f6f8fc;
    --primary-soft: #d9e0e4;
    --danger: #D32F2F;
    --secondary: #c59483;
    --secondary-light: #d9bab0;
    --secondary-soft: #ccb0a7;
    --gray: #ccc;
    --gray-light: #f1f1f1;
    --gray-soft: #eaeaea;
    --black: #000;
    --white: #fff;
    
}

::-webkit-scrollbar {
    /* width of the scrollbar */
    width: 10px; 
    /* height of the scrollbar */
    height: 10px; 
}

::-webkit-scrollbar-thumb {
    /* color of the scrollbar handle */
    background-color: #ccc; 
    /* rounded corners */
    border-radius: 10px; 
}

::-webkit-scrollbar-track {
    /* color of the scrollbar track */
    background-color: #f0f0f0; 
}
  

* {
    margin: 0;
    padding: 0;
    list-style: none;
    text-decoration: none;
    font-family: "Open Sans", sans-serif;
    box-sizing: border-box;
    font-size: 13px;
    outline: none;
    color: var(--black);
}

a:hover {
    text-decoration: underline;
}

/* Hide the icon menu from some apex charts */
.apexcharts-toolbar {
    opacity: 0 !important;
    pointer-events: none !important;
}

.breadcromb {
    display: flex;
    align-items: center;
    user-select: none;

    span {
        font-size: 1.5rem;
        font-weight: lighter;
    }

    a {
        color: var(--primary);
        font-size: 0.9rem;
    }

    a:hover {
        text-decoration: underline;
    }
}


.dropdown-menu {
    border: 1px solid var(--primary-soft);
    border-radius: 0;
    position: relative;
    min-width: 200px;
    

    .selected-tem {
        padding: 10px;
        background-color: var(--primary-light);
        display: flex;
        justify-content: space-between;
        align-items: center;
        user-select: none;
        position: relative;
        transition: all 0.3s ease;

        input[type=checkbox] {
            display: block;
            position: absolute;
            border: 5px solid;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            z-index: 2;
        }

        .icon {
            rotate: 90deg;
            font-weight: 100;
            z-index: 1;
        }
    }

    .selected-tem:hover {
        background-color: var(--primary-soft);
    }

    .items {
        overflow: hidden;
        height: 0;
        max-height: 200px;
        opacity: 0;
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 42px;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 0 2px 1px  #f1f1f1;
        z-index: 2;
        border: 1px solid var(--primary-soft);
        transition: all 0.3s ease;
    
        .group {
            padding: 10px 10px;
        }
    
        .group h3 {
            color: var(--secondary-light);
            font-weight: 400;
            margin-bottom: 4px;
        }
    
        .group ul {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
    
        .group ul li {
            display: block;
            width: 100%;
            padding: 10px;
            color: var(--black);
            background-color: var(--primary-light);
            border-radius: 0;
            transition: all 0.5s ease;
            user-select: none;
            cursor: pointer;
            position: relative;
        }
    
        .group ul li:hover {
            background-color: var(--primary-soft);
        }
    
        .group ul li input[type=radio] {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            opacity: 0;
            cursor: pointer;
        }
    
        .group ul li:has(input[type=radio]:checked) {
            background-color: var(--secondary-light);
        }
    }

    
    
}


.dropdown-menu:has(input[type=checkbox]:checked) .selected-tem {
    background-color: var(--primary-soft);
}

.dropdown-menu:has(input[type=checkbox]:checked) > .items {
    overflow-y: auto;
    height: auto;
    opacity: 1;
}

.input {
    display: flex;
    flex-direction: column;

    label {
        font-size: 0.9rem;
        font-weight: 400;
        color: var(--primary);
    }

    input, textarea, select {
        padding: 10px;
        border-radius: 0;
        border: 1px solid var(--primary-soft);
        background-color: var(--primary-light);
    }

    input:focus, textarea:focus, select:focus {
        background-color: var(--primary-soft);
    }

    .input-error {
        display: none;
    }

    .input-error.visible {
        display: block;
    }
}

.input-error {
    display: flex;
    align-items: center;
    padding: 2px 0;

    span {
        font-size: 0.8rem;
        font-weight: 400;
        color: var(--danger);
    }

}

.btn {
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--gray);
    background-color: var(--gray-light);
    user-select: none;
    transition: all 0.3s ease;

    i {
        font-style: normal;
    }

    span {
        font-weight: 100;
    }
}

.btn.danger {
    background-color: #FF8A80 !important;
    border: 1px solid #fc7e72 !important;

    i {
        color: var(--white);
        font-weight: 500;
    }

    span {
        color: var(--white);
        font-weight: 200;
    }
}

.btn.danger:hover {
    background-color: #fc7e72 !important;
}

.btn.expand {
    width: 100%;
}

.btn:hover {
    background-color: var(--gray-soft);
}

.btn.secondary {
    background-color: var(--secondary-light);
    border: 1px solid var(--secondary);
}

.btn.secondary:hover {
    background-color: var(--secondary-soft);
}

.btn.primary {
    background-color: var(--primary-light);
    border: 1px solid var(--primary-soft);
}

.btn.primary:hover {
    background-color: var(--primary-soft);
}

.btn.table-btn {
    padding: 3px 8px;
    flex-direction: row-reverse;
    justify-content: center;
    gap: 0;

    i {
        font-size: 0.9rem;
    }

    span {
        font-size: 1.7rem;
    }
}

.btn.table-btn.delete {
    background-color: #FF8A80;
    border: 1px solid #fc7e72;

    i {
        color: var(--white);
        font-weight: 500;
    }

    span {
        color: var(--white);
        font-weight: 200;
    }
}

.btn.table-btn.delete:hover {
    background-color: #fc7e72;
}

.btn.table-btn.edit {
    background-color: #a881af;
    border: 1px solid #a16fa9;

    i {
        color: var(--white);
        font-weight: 500;
    }

    span {
        color: var(--white);
        font-weight: 200;
    }
}

.btn.table-btn.edit:hover {
    background-color: #a16fa9;
}



.dropdown-select {
    position: relative;
    border-radius: 20px;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-soft);
    cursor: pointer;
    user-select: none;

    div:first-child {
        display: flex;
        align-items: center;
        gap: 5px;
        position: relative;
        padding: 3px;
        padding-right: 25px;
        border-radius: 20px;
        transition: all 0.5s ease;
    }

    div:first-child img {
        width: 25px;
        border-radius: 50%;
    }

    div:first-child p {
        font-size: 0.9rem;
        font-weight: 100;
        max-width: 200px;
    }

    .items {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        border: 1px solid var(--primary-soft);
        opacity: 0;
        pointer-events: none;
        z-index: 3;
        transition: all 0.3s ease;
        

        ul a {
            display: flex;
            align-items: center;
            padding: 5px;
            transition: all 0.5s ease;
            text-decoration: none !important;

            span {
                font-weight: lighter;
                font-size: 1.7rem;
            }

            i {
                font-style: normal;
                font-weight: 300;
                font-size: 0.9rem;
            }
        }

        ul a:hover {
            background-color: var(--primary-light);
        }
    }

    .items.with-separators {
        ul a {
            border-bottom: 1px solid var(--primary-light);
        }
    }

    input[type=checkbox] {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        cursor: pointer;
        opacity: 0;
        
    }

    div:first-child:has(input[type=checkbox]:hover), div:first-child:has(input[type=checkbox]:checked) {
        background-color: var(--primary-soft);
    }
   
    div:first-child:has(input[type=checkbox]:checked) ~ div.items {
        top: calc(100% + 2px);
        opacity: 1;
        pointer-events: all;
    }   
}

.dropdown-select.btn {
    position: relative;
    border-radius: 0;
    background-color: var(--primary-light);
    border: 1px solid var(--primary-soft);
    user-select: none;
    padding: 0;

    div:first-child {
        display: flex;
        align-items: center;
        gap: 5px;
        position: relative;
        padding: 10px;
        padding-right: 25px;
        border-radius: 0;
        transition: all 0.5s ease;

        #dropdown-select-checkbox {
            cursor: default;
        }
    }

    div:first-child p {
        font-size: 0.9rem;
        font-weight: 100;
        max-width: 200px;
    }

    .items {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        border: 1px solid var(--primary-soft);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        z-index: 3;
        

        ul a {
            display: flex;
            align-items: center;
            padding: 10px;
            transition: all 0.5s ease;
            text-decoration: none !important;

            span {
                font-weight: lighter;
                font-size: 1.5rem;
            }

            i {
                font-style: normal;
                font-weight: 300;
                font-size: 0.9rem;
            }
        }


        ul a:hover {
            background-color: var(--primary-light);
        }
    }

    input[type=checkbox] {
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        cursor: pointer;
        opacity: 0;
        
    }

    div:first-child:has(input[type=checkbox]:hover), div:first-child:has(input[type=checkbox]:checked) {
        background-color: var(--primary-soft);
    }
   
    div:first-child:has(input[type=checkbox]:checked) ~ div.items {
        top: calc(100% + 2px);
        opacity: 1;
        pointer-events: all;
    }   
}

.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    width: 100%;
    box-shadow: 0 0 0 1px var(--secondary-light);
    background-color: var(--primary-light);
    user-select: none;
    overflow: hidden;

    p {
        font-weight: 700;
        color: var(--secondary);
    }

    > div {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;

        span {
            font-weight: lighter;
            font-size: 50px;
            border-radius: 50%;
            color: #888;
        }

        h1 {
            font-weight: 800;
            font-size: 30px;
            color: 	var(--primary);
        }
    }

}

.btn-hide-or-show-sidebar {
    position: absolute;
    top: 20px;
    border-radius: 50%;
    padding: 5px;
    font-weight: 500;
    font-size: 1.5rem;
    background-color: var(--primary-light);
    color: var(--secondary);
    cursor: pointer;
    border: 1px solid var(--primary-soft);
    user-select: none;
    transition: all 0.3s ease;
}

.btn-hide-or-show-sidebar:hover {
    background-color: var(--primary-soft);
}

table {
    width: 100%;
    border-collapse: collapse;

    th, td {
        padding: 5px;
        text-align: left;
    }

    thead th {
        border-bottom: 1px solid var(--gray);
        border-top: 1px solid var(--gray);
        background-color: var(--primary-light);
        font-weight: 600;
        color: var(--black);
    }

    tbody td {

        b {
            font-weight: 500;
            color: var(--secondary);
        }
    }

    
    tbody tr:nth-child(even) td {
        background-color: var(--primary-light);
    }

    tfoot th {
        font-weight: 600;
        color: var(--black);
    }

    tfoot td, tfoot th {
        border-top: 1px solid var(--gray);
        border-bottom: 1px solid var(--gray);

        b {
            font-weight: 500;
            color: var(--secondary);
        }
    }
}

table.crud-table {
    th, td {
        padding: 9px;
        
    }

    td.actions {
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 5px;
    }
}


body {
    background-color: var(--white);
    height: 100vh;
    width: 100vw;
}

main#login {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    height: 100%;
}

main#login section {
    width: 100%;
    overflow: hidden;
}

main#login section:first-child {
    background-image: url(./../images/capa-gestao-hospitalar-4.webp);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    position: relative;
}


main#login section:last-child {
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 40px;
}

main#login section:last-child header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 20px;

    p {
        font-size: 0.8rem;
        font-weight: 400;
    }

}

main#login section:last-child form {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

main#login section:last-child footer {
    text-align: center;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    border-top: 1px solid var(--primary-soft);

    div {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 20px;

        span, a {
            font-size: 0.8rem;
            font-weight: 400;
        }

        a {
            text-decoration: underline;
        }

        a:hover {
            text-decoration: none;
        }
    }

}

nav {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
    width: 320px;
    background-color: var(--white);
    user-select: none;
    position: absolute;
    left: -500px;
    top: 0;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 1px 0 5px 0 var(--secondary-light);

    header {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        padding: 20px 40px 20px 20px;
        box-shadow: 0 -2px 5px 1px var(--primary);
        height: 72px;

        .btn-hide-or-show-sidebar {
            right: 10px;
        }
    

        h3 {
            text-transform: uppercase;
            font-size: 1rem;
            font-weight: 600;
            color: var(--primary);
        }
    
        span {
            display: block;
            font-weight: lighter;
            
        }
    }

   

    > ul {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        
    }

    ul li {
        position: relative;

        .line {
            height: calc(100% + 2px);
            width: 8px;
            border-left: 1px solid;
            border-bottom: 1px solid;
            position: absolute;
            left: 0;
            top: -25px;
            border-color: var(--gray);
            border-radius: 0 0 0 5px;
        }

        a {
            display: flex;
            align-items: center;
            gap: 3px;
            padding: 10px;
            transition: all 0.3s ease;
            text-decoration: none !important;
    
            span {
                font-weight: lighter !important;
                color: var(--primary);
            }
        
            i {
                font-style: normal;
                color: var(--primary);
            }
        }

        > div {
            position: relative;

            > span {
                position: absolute;
                top: 10px;
                right: 3px;
                rotate: 90deg;
                font-weight: lighter !important;
                color: var(--primary);
                z-index: 1;
            }

            input[type=radio] {
                display: block;
                position: absolute;
                width: 100%;
                height: 100%;
                cursor: pointer;
                opacity: 0;
                background-color: var(--primary-soft);
                z-index: 2;
            }
            
            input[type=radio]:hover ~ a {
                background-color: var(--primary-soft);
            }
            
            input[type=radio]:checked ~ a {
                background-color: var(--primary-soft);
            }
            

        }

        > div:has(input[type=radio]:checked) ~ ul {
            height: auto;
        }
    

        > ul {
            padding: 0 20px;
            overflow: hidden;
            height: 0;
            
            li a:hover i {
                text-decoration: underline;
            }

        
            li a span, li a i {
                color: #666;
            }
        
        }

    
    }

   

}

nav.visible {
    opacity: 1;
    left: 0;
}

#sidebar-background.visible {
    opacity: 0.5;
    left: 0;
}

#sidebar-background {
    position: absolute;
    top: 0;
    left: -5000px;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0;
    z-index: 2;
    transition: all 0.3s ease-in-out
}

#admin {
    display: flex;
    justify-content: space-between;
    height: 100%;
    position: relative;

   main {
        display: flex;
        flex-direction: column;
        width: 100%;
        background-color: var(--white);
    
        > header {
            box-shadow: 0 -2px 5px 1px var(--primary);
            background-color: var(--white);
            padding: 0 20px 0 60px;
            height: 72px;
            display: flex;
            flex-direction: column;
            gap: 5px;
            position: relative;
    
            .btn-hide-or-show-sidebar {
                left: 20px;
                rotate: 180deg;
            }
            
        }

        #content.zoom-in {
            transform: scale(0.95);
        }
    
        #content {
            height: 100%;
            overflow: hidden auto;
            transition: all 0.5s ease-in-out;
            transition-delay: 0.3s;
        
            > div:first-child#content-header {
                padding: 20px 20px 0 20px;
                display: flex;
                justify-content: flex-end;
                align-items: center;
                gap: 10px;
            }
        
            > div:last-child {
                display: flex;
                flex-direction: column;
                gap: 10px;
                padding: 20px;
        
                section.hospital-dashboard {
                    display: flex;
                    justify-content: space-between;
                    gap: 10px;
        
                    > div:not(.card) {
                        width: 100%;
                        box-shadow: 0 0 0 1px var(--secondary-light);
                        overflow: hidden auto;
                        padding: 10px;
                        overflow: hidden auto;
        
                        h1 {
                            color: var(--primary);
                            font-weight: 700;
                            padding: 10px 0;
                        }
                    }
                }

                section#dashboard-comuna {
                    display: grid;
                    grid-template-columns: repeat(4, 1fr);
                    gap: 20px;
                    padding: 0 10%;

                    article {
                        width: 100%;
                        cursor: pointer;
                        overflow: hidden;
                        background-color: var(--primary-light);
                        box-shadow: 0 0 5px 0 var(--secondary-soft);
                        position: relative;
                        user-select: none;

                        img {
                            width: 100%;
                            transition: all 0.3s ease;
                        }

                        h1 {
                            font-weight: lighter;
                            font-size: 1.3rem;
                            padding: 5px 10px;
                            padding-left: 15px;
                            text-wrap: nowrap;
                            overflow: hidden;
                            text-overflow: ellipsis;
                        }

                        p {
                            display: flex;
                            align-items: center;
                            padding: 5px 10px 10px 10px;

                            span {
                                font-weight: 200;
                                color: var(--secondary);
                            }

                            i {
                                font-style: normal;
                                color: var(--secondary);
                                font-weight: 500;
                            }
                        }

                       > div:not(.effect) {
                            border-top: 1px solid var(--gray);
                            padding-bottom: 20px;
                            z-index: 2;

                            div {
                                padding: 20px 20px 0 20px;

                                h3 {
                                    font-weight: 500;
                                }

                                span {
                                    font-weight: lighter;
                                    font-size: 0.9rem;
                                }


                            }
                       }

                       div.effect {
                            position: absolute;
                            width: 100%;
                            height: 100%;
                            top: 0;
                            left: 0;
                            background-color: #000;
                            opacity: 0;
                            transition: all 0.3s ease;
                            z-index: 2;
                       }

                      

                    }

                    article:hover  {
                        div.effect {
                            opacity: 0.3;
                       }

                       img {
                            transform: scale(1.1);
                        }
                    }

                }

                section#dashboard-home {
                    display: flex;
                    justify-content: space-between;
                    gap: 20px;
                    height: calc(100vh - 120px);

                    article {
                        width: 100%;

                        h1 {
                            font-weight: lighter;
                            font-size: 3rem;
                        }

                        > div {
                            border-bottom: 1px solid var(--gray-soft);
                            padding: 20px 0;

                            h3 {
                                font-weight: 400;
                                font-size: 1.2rem;
                            }

                            span {
                                font-weight: 100;
                            }

                            div:not(:last-child) {
                                margin-bottom: 20px ;
                            }
                        }
                    }
                }


                section.crud-list {
                    height: calc(100vh - 180px);
                    overflow-y: auto;
                    display: flex;
                    flex-direction: column;
                }

            }
        
        }
    
    }
    
    
}

.modal.visible {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;

    .modal-body {
        background-color: var(--white);
        box-shadow: 0 0 1px 0 var(--secondary);
        border-radius: 2px;
        display: flex;
        flex-direction: column;
        overflow: hidden;

        .modal-header {
            padding: 10px 20px;
            position: relative;
            border-bottom: 1px solid var(--gray);
            background-color: var(--gray-light);
    
            h1 {
                font-weight: 300;
                font-size: 1.7rem;
                user-select: none;
                color: #333;
            }

        }

        .modal-content {
            padding: 20px 20px;
            min-width: 400px;
    
            form {
                display: flex;
                flex-direction: column;
                gap: 10px;
            }

    
        }
    }
 

}

.confirmation-modal.visible {
    opacity: 1;
    pointer-events: all;
}

.confirmation-modal {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease-in-out;

    .modal-body {
        background-color: var(--white);
        box-shadow: 0 0 1px 0 var(--secondary);
        border-radius: 2px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 10px;
        position: relative;
        width: 400px;

        h1 {
            font-size: 1.5rem;
            font-weight: 400;
        }

        p {
            text-align: center;
            font-size: 1rem;
            font-weight: 100;
        }
       
        span {
            position: absolute;
            top: 10px;
            right: 10px;
            border-radius: 3px;
            padding: 2px;
            background-color: var(--gray-light);
            font-weight: 100;
            cursor: default;
            font-size: 1.7rem;
            transition: all 0.3s ease;
        }
        
        span:hover {
            background-color: var(--gray);
        }
    }
}



.notification-modal {
    position: absolute;
    bottom: 10px;
    right: 10px;
    overflow: hidden auto;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 5px;
    

    ul {
        max-width: 450px;
        display: flex;
        flex-direction: column;
        gap: 5px;

        li {
            background-color: var(--gray-light);
            padding: 10px 20px; 
            box-shadow: 0 0 2px 0 var(--secondary);
            border-radius: 2px;
            min-width: 300px;
            user-select: none;
            position: relative;
            position: relative;

            animation-name: notification-slide-in;
            animation-duration: 0.5s;
            animation-timing-function: linear
;
            h1 {
                font-size: 1.1rem;
                font-weight: 600;
            }

            p {
                font-size: 1rem;
                font-weight: 100;
                color: #000
            }
            
            span {
                position: absolute;
                top: 6px;
                right: 6px;
                border-radius: 3px;
                background-color: var(--gray-light);
                font-weight: 100;
                cursor: default;
                font-size: 1.5rem;
                transition: all 0.3s ease;
                border: 1px solid #dbdbdb;
                border-radius: 50%;
            }
            
            span:hover {
                color: #fc7e72;
            }
        }

        li.visible {
            right: 0;
        }

        li.success {
            box-shadow: 0 0 2px 0 rgb(21, 148, 87) !important;

            h1 {
                color: rgb(21, 148, 87);
            }
        }
       
        li.error {
            box-shadow: 0 0 2px 0 #fc7e72 !important;

            h1 {
                color: #fc7e72;
            }
        }
        
        li.info {
            box-shadow: 0 0 2px 0 var(--primary);;

            h1 {
                color: var(--primary);
            }
        }
    }
    

}


@keyframes notification-slide-in {
    from {
        right: -1000px;
        opacity: 0;
    }

    to {
        right: 6px;
        opacity: 1;
    }
}