/* Make dashboard panels fill the screen height */
.dashboard-panel {
    /* min-height: 340px; */
    /* max-height: 420px; */
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease-in-out;
    height: 100%;
}

.gap-2 {
    gap: 0.5rem !important;
}

#widgetSettingsOffcanvas {
    max-width: 223px !important;
    margin-top: 3.05rem;
}

.dashboard-container button iconify-icon {
    font-size: 120% !important;
}

iconify-icon::part(svg) {
    width: 3rem;
    /* Applies to all Iconify icons */
}

.drag-icon {
    font-size: 1.1rem;
    color: #888;
    cursor: grab;
    position: absolute;
    top: 5px;
    left: 5px;
}

/* Hide drag icon on circular progress cards by default */
.grid-stack-item .circle-progress-card .drag-icon {
    opacity: 0;
    /* transition: opacity 0.2s ease-in-out; */
}

/* Show drag icon on circular progress cards when hovering over the card */
.grid-stack-item .circle-progress-card:hover .drag-icon {
    opacity: 1;
}

.grid-stack-item .circle-progress-card {
    background: #fff;
    /* border-radius: 8px; */
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03); */
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.grid-stack-item .circle-progress-card p {
    margin: 2px 0 0 0;
    color: #7c7c7c;
    font-size: 0.65rem;
    font-weight: 500;
    text-align: center;
    padding: 0 2px;
}

.grid-stack-item .appointment-line-chart {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    width: 100%;
    height: 100%;
    padding: 6px;
}

.grid-stack-item .provider-bar-chart {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    width: 100%;
    height: 100%;
    padding: 6px;
}

.grid-stack-item .visit-types-chart {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    width: 100%;
    height: 100%;
    padding: 2px;
}

/* Responsive design for charts */
@media (max-width: 1400px) {

    .grid-stack-item .circle-progress-card,
    .grid-stack-item .appointment-line-chart,
    .grid-stack-item .provider-bar-chart,
    .grid-stack-item .visit-types-chart {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .grid-stack-item .circle-progress-card p {
        font-size: 0.55rem;
    }

    .grid-stack-item .appointment-line-chart,
    .grid-stack-item .provider-bar-chart,
    .grid-stack-item .visit-types-chart {
        padding: 4px;
    }
}

.dashboard-panel .card-body {
    flex: 1 1 auto;
    overflow: auto;
    /* max-height: 260px; */
    /* min-height: 120px; */
    scrollbar-width: thin;
    scrollbar-color: #cecece transparent;
    position: relative;
}

/* Make horizontal scrollbar stick to bottom */
/* .dashboard-panel .card-body {
    scrollbar-gutter: stable both-edges;
} */

.dashboard-panel .table-responsive {
    overflow: visible;
    margin-bottom: 0;
}

.dashboard-panel .card-body::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.dashboard-panel .card-body::-webkit-scrollbar-thumb {
    background: var(--primary-color, #3b5998);
    border-radius: 4px;
}

.dashboard-panel .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* .dashboard-panel .card-body::-webkit-scrollbar-corner {
    background: #f1f1f1;
} */

.dashboard-widgets .col-md-6 {
    padding: 0 0.2rem;
}

.dashboard-panel .expand-icon {
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.1s ease-in-out;
}

.dashboard-panel .expand-icon:hover {
    scale: 1.08;
    color: #373b3f !important;
}

.action-icons {
    display: flex;
    /* justify-content: flex-end; */
    align-items: center;
    gap: 0.5rem;
}

.action-icons a {
    display: flex;
    /* justify-content: center; */
    align-items: center;
    transition: all 0.15s ease-out;
    /* color: #4d6391; */
    color: var(--primary-color, #3b5998);
}

.action-icons a iconify-icon {
    font-size: 1.15rem;
    transition: all 0.15s ease-out;
}

.action-icons a:hover iconify-icon {
    /* scale: 1.1; */
    color: #074289 !important;
}

.action-icons a:hover {
    /* transform: translateY(-1px); */
    scale: 1.1;
}

.action-icons a:active {
    transform: translateY(1px);
}

.action-icons a[disabled] {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.7;
}

hr {
    margin: 0.5rem 0;
    border: none;
    /* border-top: 1px solid #e9ecef; */
}

/* .action-icons a[disabled] iconify-icon {
    cursor: not-allowed;
} */

/* .dashboard-panel .row-select {
    cursor: pointer;
} */

/* Health Education list scroll if needed */
.dashboard-panel .card-body ul.list-unstyled {
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #cecece transparent;
}

.dashboard-panel .card-body ul.list-unstyled::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

.dashboard-panel .card-body ul.list-unstyled::-webkit-scrollbar-thumb {
    background: #cecece;
    border-radius: 4px;
}

.dashboard-panel .card-body ul.list-unstyled::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dashboard-panel a.text-primary:focus,
.dashboard-panel a.text-primary:hover {
    color: #074289 !important;
}

.small-table-header th {
    font-weight: 700;
    font-size: 10px;
}

.table>:not(:first-child) {
    border-top: 0;
}

.dashboard-panel .table tbody tr td {
    padding: 5px 7px 5px;
    font-size: 11px;
}

.dashboard-panel .card-body ul li {
    font-size: 12px;
}

.dashboard-panel .badge {
    font-size: 90%;
}


.dashboard-panel .panel-hdr h2 {
    line-height: normal;
}

.grid-stack>.grid-stack-item>.grid-stack-item-content {
    background-color: #fff;
    /* border: 1px solid #e0e0e0; */
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grid-stack>.grid-stack-item {
    transition: all 0.2s ease-in-out;
}

/* 
.grid-stack.gs-12.grid-stack-animate {
    --gs-item-margin-top: 4px !important;
    --gs-item-margin-bottom: 4px !important;
    --gs-item-margin-right: 4px !important;
    --gs-item-margin-left: 4px !important;
}

.grid-stack.grid-stack-animate.gs-3 {
    --gs-item-margin-top: 4px !important;
    --gs-item-margin-bottom: 4px !important;
    --gs-item-margin-right: 4px !important;
    --gs-item-margin-left: 4px !important;
} */

/* Expand Icon Enhancement */
.expand-icon {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    padding: 0.25rem;
    border-radius: 4px;
}

.expand-icon:hover {
    /* background: rgba(59, 89, 152, 0.1); */
    scale: 1.1;
    /* color: var(--primary-color, #3b5998) !important; */
}

/* Fullscreen Modal Styles */
#dashboardModal .modal-dialog {
    transition: all 0.2s ease-in-out;
}

#dashboardModal.show .modal-dialog {
    animation: modalSlideIn 0.2s ease-out;
}

#dashboardModal .modal-content {
    border: none;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#dashboardModal .modal-header {
    /* background: linear-gradient(135deg, #3b5998, #4465ca); */
    background: #3b5998;
    color: white;
    border-bottom: none;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
}

#dashboardModal .modal-title {
    font-weight: 500;
    font-size: 0.9rem;
}

#dashboardModal .close {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    transition: all 0.2s ease-in-out;
    font-size: 1.3rem;
}

#dashboardModal .close:hover {
    opacity: 1;
    color: white;
}

#dashboardModal .modal-body {
    background: #f8f9fa;
}

#dashboardModal .modal-body .dashboard-panel {
    background: white;
    border: none;
    box-shadow: none;
    height: 100%;
}

#dashboardModal .modal-body .card-header {
    background: white !important;
    border-bottom: 2px solid #3b5998;
}

#dashboardModal .modal-body .action-icons {
    background: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
}

/* Modal Animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
}

#dashboardModal.fade:not(.show) .modal-dialog {
    animation: modalSlideOut 0.2s ease-in;
}

/* Enhanced table styling in modal */
#dashboardModal .table {
    margin-bottom: 0;
}

#dashboardModal .table thead th {
    background: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
    font-size: 0.7rem;
}

/* #dashboardModal .table tbody tr:hover {
    background-color: rgba(59, 89, 152, 0.05);
} */

/* Responsive modal */
@media (max-width: 768px) {
    #dashboardModal .modal-dialog {
        max-width: 98vw;
        margin: 1vh auto;
    }

    #dashboardModal .modal-content {
        height: 98vh;
    }
}

/* Widget Edit Icon */
.widget-edit-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    background: #3b5998;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.widget-edit-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    color: white;
}

.widget-edit-icon iconify-icon {
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

/* Widget Close Icon */
.widget-close-icon {
    position: absolute;
    top: -4px;
    right: -3px;
    cursor: pointer;
    z-index: 3;
    /* background: rgba(255, 255, 255, 0.9); */
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.widget-close-icon:hover {
    /* background: rgba(255, 255, 255, 1); */
    scale: 1.1;
}

/* @media (max-width: 576px) {
  .grid-stack-item[gs-h] {
    height: auto !important;
  }
  .grid-stack-item-content {
    height: auto !important;
  }
} */