/* Explain: Styles for the dashboard layout, sidebar, top navigation, and interactive elements. */
.dash-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.dash-sidebar {
    width: 16rem;
    flex: 0 0 auto;
}

.dash-nav {
    display: grid;
    gap: 0.375rem;
}

.dash-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    min-height: 2.75rem;
    border: 1px solid transparent;
    border-radius: 0.75rem;
    background: transparent;
    padding: 0 0.9rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.dash-nav-item i {
    width: 1.1rem;
    text-align: center;
    font-size: 0.9rem;
}

.dash-nav-item:hover {
    background: #ffffff;
    color: var(--primary-color);
}

.dash-nav-item.is-active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.dash-upcoming {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
}

.dash-upcoming-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.dash-upcoming-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dash-upcoming-list li i {
    width: 1rem;
    text-align: center;
    color: var(--primary-color);
}

.dash-loading {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 999px;
    animation: f5spin 0.8s linear infinite;
}

@keyframes f5spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 1023px) {
    .dash-layout {
        flex-direction: column;
    }

    .dash-sidebar {
        width: 100%;
    }

    .dash-nav {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .dash-nav-item {
        width: auto;
        white-space: nowrap;
    }

    .dash-upcoming {
        display: none;
    }
}

.dash-sidebar {
    transition: width 0.25s ease;
}

.dash-group-title {
    margin: 1.1rem 0.45rem 0.4rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.dash-nav .dash-group-title:first-child {
    margin-top: 0;
}

.dash-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: #ffffff;
    color: var(--primary-color);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dash-icon-btn:hover {
    background: var(--surface-color);
    border-color: var(--primary-color);
}

.progress-track {
    height: 0.6rem;
    width: 100%;
    border-radius: 999px;
    background: var(--surface-strong);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary-color);
    transition: width 0.4s ease;
}

.task-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 1.1rem;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.task-item > i {
    width: 1.25rem;
    text-align: center;
    color: var(--border-strong);
    font-size: 1rem;
}

.task-item.is-done {
    color: var(--text-color);
}

.task-item.is-done > i {
    color: var(--success-color);
}

.mini-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.mini-empty i {
    font-size: 1.15rem;
    color: var(--primary-color);
}

.mini-empty p {
    max-width: 22rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

@media (min-width: 1024px) {
    .dash-layout.is-collapsed .dash-sidebar {
        width: 4.75rem;
    }

    .dash-layout.is-collapsed .dash-group-title,
    .dash-layout.is-collapsed .dash-nav-label {
        display: none;
    }

    .dash-layout.is-collapsed .dash-nav-item {
        justify-content: center;
        padding: 0 0.5rem;
    }
}

@media (max-width: 1023px) {
    .dash-group-title {
        display: none;
    }
}