.udm-dashboard {
    --udm-orange: #ff6600;
    --udm-black: #101010;
    --udm-white: #fff;
    --udm-muted: #6e6761;
    --udm-border: #ece7e2;
    background: var(--udm-white);
    border: 1px solid var(--udm-border);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(16, 16, 16, 0.08);
    color: var(--udm-black);
    left: 50%;
    margin: 24px 0;
    max-width: calc(100vw - 32px);
    overflow: hidden;
    position: relative;
    transform: translateX(-50%);
    width: calc(100vw - 32px);
}

.udm-dashboard,
.udm-dashboard * {
    box-sizing: border-box;
}

.udm-dashboard-header {
    align-items: center;
    background: var(--udm-black);
    color: var(--udm-white);
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 28px;
}

.udm-dashboard-header span {
    color: var(--udm-orange);
    display: block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.udm-dashboard-header h2 {
    color: var(--udm-white);
    font-size: 34px;
    line-height: 1.1;
    margin: 0;
}

.udm-count-pill {
    align-items: center;
    background: var(--udm-white);
    border-radius: 8px;
    color: var(--udm-black);
    display: flex;
    flex-direction: column;
    height: 82px;
    justify-content: center;
    min-width: 92px;
}

.udm-count-pill strong {
    color: var(--udm-orange);
    font-size: 28px;
    line-height: 1;
}

.udm-count-pill small {
    color: var(--udm-muted);
    font-weight: 800;
    text-transform: uppercase;
}

.udm-profile-notice {
    background: #fff7f1;
    border-bottom: 1px solid #ffd5b9;
    color: var(--udm-black);
    font-weight: 800;
    padding: 14px 22px;
}

.udm-profile-panel {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid var(--udm-border);
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    padding: 22px;
}

.udm-profile-summary {
    align-items: center;
    display: flex;
    gap: 14px;
    min-width: 0;
}

.udm-avatar {
    align-items: center;
    background: var(--udm-orange);
    border-radius: 50%;
    color: #fff;
    display: flex;
    flex: 0 0 56px;
    font-size: 18px;
    font-weight: 900;
    height: 56px;
    justify-content: center;
    width: 56px;
}

.udm-profile-summary span {
    color: var(--udm-muted);
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.udm-profile-summary strong {
    color: var(--udm-black);
    display: block;
    font-size: 20px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.udm-profile-form {
    align-items: end;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.udm-profile-form label {
    display: block;
}

.udm-profile-form label span {
    color: var(--udm-black);
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.udm-profile-form input {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: 8px;
    color: var(--udm-black);
    min-height: 44px;
    padding: 9px 11px;
    width: 100%;
}

.udm-profile-form input:focus {
    border-color: var(--udm-orange);
    box-shadow: 0 0 0 1px var(--udm-orange);
    outline: none;
}

.udm-profile-button {
    margin-top: 0;
    white-space: nowrap;
}

.udm-document-filter {
    align-items: end;
    background: #fff7f1;
    border-bottom: 1px solid #ffd5b9;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 220px)) minmax(180px, 1fr) minmax(220px, 1fr);
    padding: 18px 22px;
}

.udm-document-filter label {
    color: var(--udm-black);
    display: block;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.udm-document-filter select {
    background: #fff;
    border: 1px solid #ffd5b9;
    border-radius: 8px;
    color: var(--udm-black);
    min-height: 44px;
    padding: 8px 10px;
    width: 100%;
}

.udm-document-filter .udm-filter-button {
    height: 44px;
    margin-top: 0;
    padding: 10px 16px;
    width: 100%;
}

.udm-all-files-button {
    align-items: center;
    background: #101010;
    border: 1px solid #101010;
    border-radius: 8px;
    color: #fff !important;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    height: 44px;
    min-height: 44px;
    padding: 10px 16px;
    text-decoration: none !important;
    white-space: nowrap;
    width: 100%;
}

.udm-folder-list {
    display: grid;
    gap: 22px;
    padding: 24px;
}

.udm-category-folder {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(16, 16, 16, 0.06);
    overflow: hidden;
}

.udm-folder-icon,
.udm-subfolder-icon {
    background: #ff6600;
    border: 1px solid #d95700;
    border-radius: 5px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 16px rgba(255, 102, 0, 0.2);
    display: inline-block;
    flex: 0 0 auto;
    height: 54px;
    position: relative;
    width: 78px;
}

.udm-folder-icon::before,
.udm-subfolder-icon::before {
    background: #ff6600;
    border: 1px solid #d95700;
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    content: "";
    height: 16px;
    left: -1px;
    position: absolute;
    top: -12px;
    width: 34px;
}

.udm-folder-icon::after,
.udm-subfolder-icon::after {
    background: rgba(255, 255, 255, 0.42);
    border-radius: 3px;
    content: "";
    height: 14px;
    left: 9px;
    position: absolute;
    right: 9px;
    top: 9px;
}

.udm-subfolder {
    background: #fff;
    border: 1px solid #f0e4dc;
    border-radius: 8px;
    overflow: hidden;
}

.udm-desktop-folder {
    align-items: center;
    background: #fffaf7;
    cursor: pointer;
    display: flex;
    gap: 14px;
    justify-content: flex-start;
    list-style: none;
    min-height: 0;
    outline: 0;
    padding: 20px;
    text-align: left;
    width: 100%;
}

.udm-desktop-folder::-webkit-details-marker,
.udm-subfolder summary::-webkit-details-marker {
    display: none;
}

.udm-desktop-folder strong {
    color: var(--udm-black);
    display: block;
    font-size: 18px;
    line-height: 1.25;
    max-width: none;
    overflow-wrap: anywhere;
    text-shadow: none;
    white-space: normal;
}

.udm-desktop-folder:focus strong,
.udm-desktop-folder:hover strong {
    color: var(--udm-orange);
}

.udm-desktop-subfolder em {
    background: #f4f1ee;
    border-radius: 999px;
    color: var(--udm-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    margin-left: auto;
    padding: 4px 8px;
    white-space: nowrap;
}

.udm-subfolder-list {
    background: #fff;
    display: grid;
    gap: 18px;
    padding: 20px;
}

.udm-category-folder:not([open]) .udm-subfolder-list,
.udm-subfolder:not([open]) .udm-document-grid {
    display: none;
}

.udm-subfolder .udm-document-grid {
    border-top: 1px solid #f0e4dc;
    grid-column: auto;
}

.udm-document-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 18px;
    width: 100%;
}

.udm-document-card {
    background: #fff;
    border: 1px solid var(--udm-border);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    min-height: 235px;
    min-width: 0;
    padding: 18px;
    perspective: 700px;
    transition: box-shadow 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.udm-document-card:hover {
    border-color: #ffc39d;
    box-shadow: 0 18px 35px rgba(255, 102, 0, 0.16);
}

.udm-file-badge {
    align-items: center;
    background: #fff7f1;
    border: 1px solid #ffd5b9;
    border-radius: 8px;
    color: var(--udm-orange);
    display: flex;
    font-size: 17px;
    font-weight: 900;
    height: 64px;
    justify-content: center;
    margin-bottom: 18px;
    max-width: 92px;
    overflow: hidden;
    padding: 0 10px;
    text-align: center;
}

.udm-document-content {
    flex: 1;
    min-width: 0;
}

.udm-document-content h3 {
    color: var(--udm-black);
    font-size: 19px;
    line-height: 1.25;
    margin: 0 0 8px;
    overflow-wrap: break-word;
}

.udm-document-content p {
    color: var(--udm-muted);
    font-size: 14px;
    margin: 0;
    overflow-wrap: break-word;
}

.udm-document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.udm-document-meta span {
    background: #f4f1ee;
    border-radius: 999px;
    color: #37312d;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 9px;
}

.udm-download-button {
    align-items: center;
    background: var(--udm-orange);
    border: 1px solid var(--udm-orange);
    border-radius: 8px;
    color: var(--udm-white) !important;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    margin-top: 18px;
    min-height: 44px;
    padding: 10px 16px;
    text-decoration: none !important;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.udm-download-button:hover,
.udm-download-button:focus {
    background: var(--udm-black);
    border-color: var(--udm-black);
    color: var(--udm-white) !important;
    transform: translateY(-1px);
}

.udm-empty-state,
.udm-login-required {
    padding: 38px 28px;
    text-align: center;
}

.udm-empty-icon {
    align-items: center;
    background: #fff7f1;
    border: 1px solid #ffd5b9;
    border-radius: 50%;
    color: var(--udm-orange);
    display: inline-flex;
    font-weight: 900;
    height: 74px;
    justify-content: center;
    margin-bottom: 16px;
    width: 74px;
}

.udm-empty-state h3,
.udm-login-required h2 {
    color: var(--udm-black);
    margin: 0 0 8px;
}

.udm-empty-state p,
.udm-login-required p {
    color: var(--udm-muted);
    margin: 0 auto;
    max-width: 520px;
}

.udm-login-required .udm-download-button {
    margin-top: 20px;
}

@media (max-width: 900px) {
    .udm-profile-panel,
    .udm-profile-form,
    .udm-document-filter {
        grid-template-columns: 1fr;
    }

    .udm-profile-form,
    .udm-document-filter {
        align-items: stretch;
    }

    .udm-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .udm-folder-list {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .udm-dashboard {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
        margin: 12px 0;
        max-width: 100vw;
        width: 100vw;
    }

    .udm-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px;
    }

    .udm-document-filter {
        gap: 10px;
        padding: 14px;
    }

    .udm-dashboard-header h2 {
        font-size: 28px;
    }

    .udm-count-pill {
        flex-direction: row;
        gap: 8px;
        height: auto;
        justify-content: flex-start;
        min-width: 100%;
        padding: 12px 14px;
    }

    .udm-document-grid {
        gap: 10px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
    }

    .udm-desktop-folder {
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
    }

    .udm-folder-icon,
    .udm-subfolder-icon {
        height: 44px;
        width: 64px;
    }

    .udm-desktop-folder strong {
        font-size: 15px;
    }

    .udm-subfolder-list {
        gap: 12px;
        padding: 12px;
    }

    .udm-document-card {
        min-height: 0;
        padding: 12px;
    }

    .udm-file-badge {
        font-size: 13px;
        height: 48px;
        margin-bottom: 12px;
        max-width: 70px;
    }

    .udm-document-content h3 {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .udm-document-content p {
        font-size: 12px;
    }

    .udm-document-meta {
        gap: 5px;
        margin-top: 10px;
    }

    .udm-document-meta span {
        font-size: 10px;
        padding: 5px 7px;
    }

    .udm-document-card .udm-download-button {
        font-size: 13px;
        min-height: 38px;
        padding: 8px 10px;
    }
}
