/* Base Styles */
body {
    background-color: #F8F7FA;
    color: #6f6b7d;
    transition: background-color 0.3s, color 0.3s;
}

/* Animations */
#sidebar {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 260px;
    white-space: nowrap;
}

body.collapsed #sidebar {
    width: 80px;
}

body.collapsed .menu-label,
body.collapsed .menu-arrow,
body.collapsed .brand-text,
body.collapsed .user-info {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    visibility: hidden;
}

body.collapsed .nav-item {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

/* Scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

html.dark .custom-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Navigation */
.nav-item.active {
    background: linear-gradient(72.47deg, #852221 22.16%, #a02b2a 76.47%);
    box-shadow: 0px 2px 6px 0px rgba(133, 34, 33, 0.48);
    color: white !important;
}

.nav-item.active i {
    color: white !important;
}

html.dark .nav-item.active {
    background: rgba(133, 34, 33, 0.2);
    box-shadow: none;
    color: #ff8f8f !important;
}

html.dark .nav-item.active i {
    color: #ff8f8f !important;
}

.nav-item,
.sub-item,
.smooth-slide-hover,
.table-row-hover {
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:hover,
.sub-item:hover,
.smooth-slide-hover:hover {
    transform: translateX(6px);
}

.sub-item .menu-label {
    color: #6b7280;
}

.sub-item.active .menu-label {
    color: #852221 !important;
    font-weight: 600;
}

html.dark .sub-item.active .menu-label {
    color: #ff8f8f !important;
}

.sub-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #dbdbdb;
    margin-right: 12px;
}

.sub-item.active .sub-dot {
    background-color: #852221;
    box-shadow: 0 0 6px rgba(133, 34, 33, 0.6);
}

html.dark .sub-item.active .sub-dot {
    background-color: #ff8f8f;
}

/* Components */
.view-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.view-section.active-view {
    display: block;
    opacity: 1;
}

.dropdown-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Table Row Specific Polish */
.table-row-hover {
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent;
}

.table-row-hover:hover {
    transform: translateX(4px);
    background-color: rgba(133, 34, 33, 0.03) !important;
    box-shadow: inset 4px 0 0 0 #852221 !important;
}

html.dark .table-row-hover:hover {
    background-color: rgba(255, 255, 255, 0.03) !important;
    box-shadow: inset 4px 0 0 0 #ff8f8f !important;
}

/* Prevent table text from wrapping */
td,
th {
    white-space: nowrap;
}

.header-tab.active-tab {
    color: #852221;
    font-weight: 500;
}

.header-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #852221;
    transition: width 0.3s ease;
}

html.dark .header-tab.active-tab {
    color: #852221 !important;
}

html.dark .header-tab:not(.active-tab) {
    color: #ffffff !important;
}

.page-tab-active {
    color: #852221 !important;
    border-bottom-color: #852221 !important;
}

.page-tab-inactive {
    color: #6b7280;
    border-bottom-color: transparent;
}

html.dark .page-tab-inactive {
    color: #9ca3af;
}

.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

html.dark .card-hover-lift:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* Chart Fixes */
.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: #EBE9F1;
    stroke-width: 2.5;
}

.circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    stroke: #852221;
}

@keyframes progress {
    0% {
        stroke-dasharray: 0 100;
    }
}

html.dark .circle-bg {
    stroke: #444;
}

.percentage {
    fill: #5E5873;
    font-family: 'Public Sans', sans-serif;
    font-weight: bold;
    font-size: 0.5em;
    text-anchor: middle;
}

html.dark .percentage {
    fill: #fff;
}

/* Mini Bars */
.bar-chart-mini {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 40px;
}

.bar-chart-mini .bar {
    width: 6px;
    border-radius: 4px 4px 0 0;
    opacity: 0.85;
    transition: height 0.3s ease;
}

.bar-chart-mini .bar:hover {
    opacity: 1;
    transform: scaleY(1.1);
    transform-origin: bottom;
}

/* Chat UI Styles */
.chat-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-sent {
    background-color: #852221;
    color: white;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

.chat-received {
    background-color: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 2px;
}

html.dark .chat-received {
    background-color: #2b2b2b;
    color: #e5e7eb;
}

/* --- NEW: Login Screen Styles --- */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #F8F7FA;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#dashboard-container {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.my-toast-icon {
    font-size: 10px;
    width: 25px;
    height: 25px;
}

.my-toast-title {
    font-size: 8px;
    text-align: center;
}


.my-toast-popup {
    width: 400px;
    padding-top: 0;
    padding-bottom: 0;

}

.option:hover {
    background-color: #007bff;
    color: white;
    cursor: pointer;
}


.avatar-image {
    width: 80px;
    height: 80px;
    border-radius: 10%;
    object-fit: cover;
    border: 3px solid #ddd;
    justify-content: center;
    align-items: center;
    position: relative;
    display: inline-block;
}
.logo-image {
    width: 125px;
    height: 125px;
    border-radius: 10%;
    object-fit: cover;
    border: 3px solid #ddd;
    justify-content: center;
    align-items: center;
    position: relative;
    display: inline-block;
}

#btn-avatar:hover {
    position: absolute;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.2);
    color: gray;
    width: 100%;
    height: 20px;
    cursor: pointer;
    font-size: smaller;
}
#btn-img-admin:hover {
    position: absolute;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.2);
    color: gray;
    width: 100%;
    height: 20px;
    cursor: pointer;
    font-size: smaller;
}
#btn-img-profile:hover {
    position: absolute;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.2);
    color: gray;
    width: 100%;
    height: 20px;
    cursor: pointer;
    font-size: smaller;
}
#btn-input-logo:hover {
    position: absolute;
    bottom: 0px;
    background: rgba(0, 0, 0, 0.2);
    color: gray;
    width: 100%;
    height: 20px;
    cursor: pointer;
    font-size: smaller;
    border-bottom-left-radius: 10%;
    border-bottom-right-radius: 10%;
}