:root {
    --bg-dark: #796de7ce;
    --glass-bg: rgba(15, 23, 42, 0.45);
    --glass-border: rgba(255, 255, 255, 0.22);
    --primary: #7c3aed;
    --text-main: #f8fafc;
    --text-muted: rgba(226, 232, 240, 0.82);
    --card-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    position: relative;
    background: linear-gradient(135deg, var(--bg-dark), rgb(141, 250, 129));
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    isolation: isolate;
}

body::before,
body::after {
    content: "";
    position: fixed;
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.28;
    z-index: -1;
    pointer-events: none;
}

body::before {
    top: -5rem;
    right: -4rem;
    background: rgba(168, 85, 247, 0.6);
}

body::after {
    bottom: -6rem;
    left: -3rem;
    background: rgba(34, 211, 238, 0.42);
}

.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.glass-nav {
    width: 90%;
    max-width: 600px;
    height: 50px;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255,255,255,0.08);
}

.nav-btn {
    border: none;
    background: transparent;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.nav-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(109, 74, 255, 0.3);
}

.spacer {
    flex-grow: 1;
}

.icon-only {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-main);
}

.main-container {
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    height: calc(100vh - 80px);
    margin-top: 80px;
    gap: 20px;
    padding: 20px;
}

.sidebar-left {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.42));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.menu-list {
    list-style: none;
}

.menu-list li {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.menu-list li:hover {
    background: #f0f2f5;
    color: var(--primary);
}

.menu-list li.active {
    background: #eeebfc;
    color: var(--primary);
    font-weight: 600;
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
}

.profile-info small {
    color: var(--text-muted);
    display: block;
}

.content-area {
    overflow-y: auto;
    padding-right: 10px;
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding-top: 20px;
}

.card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.44));
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.card:hover {
    transform: translateY(-5px);
    border-color: #ddd;
}

.card-img {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    font-size: 2.5rem;
    color: var(--primary);
}

.card h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--text-main);
}

.card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-right {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.42));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    position: relative;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0.6;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.item-details {
    animation: fadeIn 0.3s ease-in-out;
}

.detail-icon-wrapper {
    font-size: 4rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 15px;
}

#d-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.tag {
    background: #eeebfc;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-badge {
    margin: 15px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    display: inline-block;
}

.description {
    line-height: 1.6;
    color: #4b5563;
    margin-bottom: 25px;
    min-height: 100px;
}

.actions {
    display: flex;
    gap: 10px;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

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

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-primary:hover {
    background: #5830e0;
}

.btn-secondary:hover {
    background: #d1d5db;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

@media screen and (max-width: 1024px) {
    .main-container {
        grid-template-columns: 200px 1fr;
        gap: 15px;
        padding: 15px;
    }

    .sidebar-right {
        display: none;
    }

    .glass-nav {
        width: 95%;
        padding: 0 5px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .grid-cards {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    .card-img {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
}

@media screen and (max-width: 768px) {
    body {
        overflow-y: auto !important;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .top-bar {
        position: sticky;
        height: 70px;
        background: rgba(255, 255, 255, 0.9);
    }

    .glass-nav {
        width: 95%;
        max-width: 100%;
        height: 55px;
        padding: 0 8px;
        border-radius: 12px;
    }

    .nav-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        min-width: fit-content;
    }

    .spacer {
        display: none;
    }

    .main-container {
        display: block;
        margin-top: 70px;
        padding: 10px;
        height: auto;
        overflow-x: hidden;
    }

    .sidebar-left {
        position: fixed;
        left: -240px;
        top: 70px;
        bottom: 0;
        width: 240px;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
        border-radius: 0 16px 16px 0;
        overflow-y: auto;
    }

    .sidebar-left.open {
        left: 0;
    }

    .content-area {
        width: 100% !important;
        padding-right: 0 !important;
        margin-bottom: 20px;
    }

    .sidebar-right {
        display: none;
    }

    .grid-cards {
        grid-template-columns: 1fr;
        gap: 15px;
        padding-top: 10px;
    }

    .card {
        padding: 18px;
        text-align: left;
    }

    .menu-list li {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 14px 16px;
        font-size: 1rem;
        min-height: 48px;
    }

    #d-title {
        font-size: 1.3rem;
    }

    .detail-icon-wrapper {
        font-size: 3rem;
    }

    .menu-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .menu-overlay.active {
        display: block;
    }
}

@media screen and (max-width: 480px) {
    :root {
        --card-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.08);
    }

    .top-bar {
        height: 60px;
    }

    .glass-nav {
        height: 50px;
        border-radius: 10px;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .card {
        padding: 16px;
    }

    .actions {
        flex-direction: column;
    }

    .avatar {
        width: 32px;
        height: 32px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --glass-bg: rgba(30, 30, 40, 0.85);
        --text-muted: #a0aec0;
    }

    .sidebar-left,
    .sidebar-right,
    .card {
        background: #1a1a2e !important;
        color: #f0f0f0;
    }

    .menu-list li:hover {
        background: #252542 !important;
    }

    .menu-list li.active {
        background: #2d2d44 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    .top-bar,
    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .content-area {
        width: 100% !important;
        padding: 0;
        margin: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}