/* Importing Google font - Poppins */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto+Flex:opsz,wght@8..144,100..500&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

:root {
    --app-bg-base: #c7d2dc;
    --app-bg-start: #e5ebf0;
    --app-bg-mid: #cfd9e1;
    --app-bg-end: #adbcc8;
    --app-bg-deep: #8c9dab;
    --app-bg-accent-rgb: 120 146 170;
}

body {
    height: 100vh;
    width: 100%;
    background-color: var(--app-bg-base);
    background-image:
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.34) 0, rgba(255, 255, 255, 0.18) 14%, transparent 34%),
        radial-gradient(circle at 82% 16%, rgb(var(--app-bg-accent-rgb) / 0.18) 0, rgb(var(--app-bg-accent-rgb) / 0.08) 16%, transparent 32%),
        radial-gradient(circle at 76% 78%, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.08) 12%, transparent 28%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0, rgba(255, 255, 255, 0.04) 2px, transparent 2px, transparent 26px),
        linear-gradient(135deg, var(--app-bg-start) 0%, var(--app-bg-mid) 32%, var(--app-bg-end) 70%, var(--app-bg-deep) 100%);
    background-position: center;
    background-size: cover;
    background-attachment: fixed;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rotate-image {
    animation: spin 6s linear infinite;
    box-shadow: 0.7px 1.4px 1.4px hsl(0deg 0% 0% / 0.48);
}

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 90px;
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(17px);
    -webkit-backdrop-filter: blur(17px);
    border-right: 1px solid rgba(255, 255, 255, 0.7);
    transition: width 0.3s ease;
    z-index: 1000;
}

.sidebar:hover:not(.force-collapsed) {
    width: 220px;
}

.sidebar .logo {
    color: #000;
    display: flex;
    align-items: center;
    padding: 15px 10px 10px;
}

.logo img {
    width: 43px;
    border-radius: 50%;
}

.logo h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-left: 15px;
    display: none;
}

.sidebar:hover:not(.force-collapsed) .logo h2 {
    display: block;
}

.sidebar .links {
    list-style: none;
    margin-top: 10px;
    overflow-y: auto;
    scrollbar-width: none;
    height: calc(100% - 120px);
}

.sidebar .links::-webkit-scrollbar {
    display: none;
}

.links li {
    display: flex;
    border-radius: 4px;
    align-items: center;
    transition: all 0.2s ease;
    transform: scale(1);
    margin: 0 8px;
    padding: 4px 10px;
    cursor: pointer;
}

.links li:hover {
    /* background: rgba(255, 255, 255, 0.8); */
    background: rgba(95, 5, 5, 0.8);
    transform: scale(1.02);
}

.links li:active {
    transform: scale(0.98);
}

.links li.active {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: scale(1.01);
}

.links li.active span,
.links li.active a {
    color: #2563eb;
    font-weight: 600;
}

.links li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    height: 50px;
    border-radius: 6px;
    color: #000;
    font-size: 1.2rem;
    margin-right: 0;
}

.sidebar:hover:not(.force-collapsed) .links li span {
    margin-right: 10px;
}

.links li a {
    display: none;
    padding: 0 15px 0 0;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.sidebar:hover:not(.force-collapsed) .links li a {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

.links h4 {
    color: #222;
    font-weight: 500;
    font-size: 0.8rem;
    margin: 10px 0;
    display: none;
}

.sidebar:hover:not(.force-collapsed) .links h4 {
    display: block;
}

.links hr {
    margin: 10px 8px;
    border: none;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    display: none;
}

.sidebar:hover:not(.force-collapsed) .links hr {
    display: block;
}

/* ========== MAIN CONTENT ========== */
.user-bar {
    margin-left: 90px;
    width: calc(100% - 90px);
    min-height: 84px;
    padding: 20px 20px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.3s ease;
}

.sidebar:hover:not(.force-collapsed) ~ .user-bar {
    margin-left: 220px;
    width: calc(100% - 220px);
}

.user-bar__identity,
.user-bar__meta {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    color: rgba(59, 57, 57, 0.92);
}

.user-bar__identity {
    flex: 1;
    align-items: center;
}

.user-bar__meta {
    min-width: 250px;
    flex-direction: column;
    align-items: flex-end;
}

.theme-menu-button {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(59, 57, 57, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-menu-button:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.theme-menu-button .material-symbols-outlined {
    font-size: 24px;
}

.page-transition-layer {
    position: fixed;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(229, 235, 240, 0.28) 0%, rgba(207, 217, 225, 0.14) 100%),
        rgba(233, 240, 245, 0.16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: opacity 220ms ease;
    z-index: 1400;
}

.page-transition-layer.is-active {
    opacity: 1;
}

@keyframes pageContentReveal {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.992);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

body.page-has-transitions .user-bar,
body.page-has-transitions .main-content {
    animation: pageContentReveal 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.page-has-transitions .main-content {
    animation-delay: 40ms;
}

body.page-is-leaving .user-bar,
body.page-is-leaving .main-content {
    opacity: 0;
    transform: translateY(-10px) scale(0.994);
    filter: blur(6px);
    transition: opacity 180ms ease, transform 220ms ease, filter 220ms ease;
}

body.page-is-leaving {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(18, 30, 40, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1300;
}

.modal.is-open {
    display: flex;
}

.modal-content {
    width: min(100%, 420px);
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    background: rgba(239, 245, 249, 0.92);
    box-shadow: 0 24px 50px rgba(29, 50, 67, 0.2);
    color: #223644;
}

.modal-content h3 {
    margin: 0 0 18px;
    font-size: 1.1rem;
    font-weight: 700;
}

.color-picker-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.color-picker-container input[type="color"] {
    width: 72px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
}

.apply-button,
.close-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(120, 146, 170, 0.25);
    background: rgba(255, 255, 255, 0.74);
    color: #223644;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.apply-button:hover,
.close-button:hover {
    background: #eef5fa;
    border-color: rgba(120, 146, 170, 0.38);
    transform: translateY(-1px);
}

.close-button {
    width: 100%;
}

.theme-popup {
    max-width: min(860px, calc(100vw - 24px));
}

.theme-popup .dx-overlay-content {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(239, 245, 249, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 18px 45px rgba(29, 50, 67, 0.16);
    overflow: hidden;
}

.theme-popup .dx-popup-title {
    padding: 18px 20px 10px;
}

.theme-popup .dx-toolbar-label {
    font-size: 1.05rem;
    font-weight: 700;
    color: #223644;
}

.theme-popup .dx-toolbar-label > div {
    white-space: nowrap;
}

.theme-popup .dx-popup-content {
    padding: 8px 18px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.theme-popup__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.theme-popup__group {
    padding: 10px 12px 12px;
    border: 1px solid rgba(145, 158, 171, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.4);
}

.theme-popup__group-title {
    margin: 0 0 10px;
    padding: 0 2px;
    color: #607181;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.theme-popup__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.theme-popup__option {
    padding: 8px 12px;
    border: 1px solid rgba(145, 158, 171, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #223644;
    font: inherit;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.theme-popup__option:hover {
    background: #eef5fa;
    transform: translateY(-1px);
}

.theme-popup__option.is-active-theme {
    border-color: #7892aa;
    background: #dbe9f4;
    color: #18324a;
}

@media (max-width: 900px) {
    .theme-popup__grid {
        grid-template-columns: 1fr;
    }

    .theme-popup .dx-toolbar-label > div {
        white-space: normal;
    }
}

.user-bar__label {
    margin: 0 0 4px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.72;
}

.user-bar h3,
.user-bar__meta span {
    margin: 0;
}

.user-bar h3 {
    color: #fff;
    font-size: 1.1rem;
}

.main-content {
    margin-left: 90px;
    width: calc(100% - 90px);
    height: calc(100vh - 94px); /* 104*/ 
    padding: 20px;
    transition: all 0.3s ease;
}

.sidebar:hover:not(.force-collapsed) ~ .main-content {
    margin-left: 220px;
    width: calc(100% - 220px);
}

.module-container {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.module-container h1 {
    font-family: "Roboto Flex", "Poppins", sans-serif;
    font-size: 2.5rem;
    font-weight: 200;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    text-shadow: none;
}

.module-container p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.module-container--orders {
    align-items: stretch;
    justify-content: flex-start;
    text-align: left;
    gap: 24px;
    color: #243746;
}

.orders-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.orders-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.2);
    color: #1f3442;
    text-decoration: none;
    font-weight: 600;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.orders-back-link:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.34);
    transform: translateY(-1px);
}

.orders-back-link .material-symbols-outlined {
    font-size: 20px;
}

.orders-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #607181;
    opacity: 1;
}

.module-container--orders h1 {
    margin: 0;
    color: #1f3442;
    text-shadow: none;
}

.orders-description {
    max-width: 420px;
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.5;
    color: #496072;
    opacity: 1;
}

.orders-grid {
    flex: 1;
    min-height: 420px;
}

.orders-grid .dx-datagrid {
    color: #243746;
}

.orders-grid .dx-datagrid-headers,
.orders-grid .dx-toolbar,
.orders-grid .dx-pager {
    background: rgba(255, 255, 255, 0.38);
}

.orders-grid .dx-datagrid,
.orders-grid .dx-editor-outlined,
.orders-grid .dx-dropdowneditor-button,
.orders-grid .dx-texteditor {
    background: rgba(255, 255, 255, 0.72);
}

.orders-grid .dx-datagrid-rowsview,
.orders-grid .dx-datagrid-header-panel {
    border-radius: 16px;
}

.orders-grid .dx-row-alt > td {
    background: rgba(219, 233, 244, 0.28);
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .sidebar {
        width: 90px;
    }

    .sidebar:hover:not(.force-collapsed) {
        width: 220px;
    }
    
    .main-content {
        margin-left: 90px;
        width: calc(100% - 90px);
        height: calc(100vh - 132px);
    }

    .sidebar:hover:not(.force-collapsed) ~ .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .user-bar {
        margin-left: 90px;
        width: calc(100% - 90px);
        padding: 16px 16px 0;
        flex-direction: column;
        align-items: stretch;
    }

    .sidebar:hover:not(.force-collapsed) ~ .user-bar {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .user-bar__meta {
        min-width: 0;
        align-items: flex-start;
    }

    .theme-menu-button {
        align-self: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-transition-layer,
    body.page-has-transitions .user-bar,
    body.page-has-transitions .main-content,
    body.page-is-leaving .user-bar,
    body.page-is-leaving .main-content {
        animation: none;
        transition: none;
        filter: none;
        transform: none;
    }
}

.links li.active {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform: scale(1.01);
}

.links li.active span,
.links li.active a {
    color: #2563eb;
    font-weight: 600;
}

.links li.active span,
.links li.active a {
    color: #2563eb;
    font-weight: 600;
}

.links h4 {
    color: #222;
    font-weight: 500;
    display: none;
    margin-bottom: 10px;
}

.links hr {
    margin: 10px 8px;
    border: 1px solid #4c4c4c;
}

.sidebar:hover .links hr {
    border-color: transparent;
}

.links li span {
    padding: 12px 10px;
}

.links li a {
    padding: 10px;
    color: #000;
    display: none;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
}

.links .logout-link {
    margin-top: 20px;
}