:root {
    color-scheme: light;
    --black: #070707;
    --ink: #172033;
    --muted: #667085;
    --line: #dfe6ef;
    --soft: #f2f6fb;
    --white: #fff;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #eaf2ff;
    --yellow: #e8a317;
    --green: #16803c;
    --green-dark: #116530;
    --danger: #b42318;
    --shadow: 0 12px 35px rgba(37, 99, 235, 0.09);
    --topbar-height: 68px;
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
    margin: 0;
    padding-top: var(--topbar-height);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: #f3f6fa;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    left: 0;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    color: var(--white);
    background: #050505;
    border-bottom: 1px solid #242424;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
}

.brand {
    display: flex;
    align-items: center;
    color: var(--white);
}

.brand strong { display: block; font-size: 22px; letter-spacing: -.02em; }

.navigation-toggle {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 5px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid #333;
    border-radius: 10px;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}
.navigation-toggle:hover, .navigation-toggle[aria-expanded="true"] { background: #191919; border-color: #555; }
.navigation-toggle span { width: 19px; height: 2px; display: block; background: currentColor; border-radius: 999px; transition: transform .24s ease, opacity .18s ease; }
.navigation-toggle[aria-expanded="true"] span:first-child { transform: translateY(7px) rotate(45deg); }
.navigation-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.navigation-toggle[aria-expanded="true"] span:last-child { transform: translateY(-7px) rotate(-45deg); }

.is-disabled { opacity: .55; cursor: not-allowed; }

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.playlist-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    border: 1px solid #6273f2;
    border-radius: 10px;
    box-shadow: 0 7px 20px rgba(37, 99, 235, .3);
}
.playlist-button:disabled { color: #fff; cursor: default; opacity: 1; }
.playlist-button .lucide-icon { width: 20px; height: 20px; }

.radio-label { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #d5d5d5; }
.radio-label .lucide-icon { width: 17px; height: 17px; }

.button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.button:focus-visible, .play-button:focus-visible, .icon-action:focus-visible, .playlist-button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
    outline: 3px solid rgba(20, 115, 230, .32);
    outline-offset: 2px;
}

.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 5px 14px rgba(37, 99, 235, .2); }
.button-primary:not(:disabled):hover { background: var(--accent-dark); }
.button-outline { color: #fff; background: transparent; border-color: #575757; }
.button-outline-dark { color: var(--ink); background: #fff; border-color: #d9d9d9; }
.button-compact { min-height: 34px; padding: 0 14px; font-size: 13px; }
.button .lucide-icon { width: 16px; height: 16px; }

.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; white-space: nowrap; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-avatar { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #2563eb, #7c3aed); border-radius: 50%; font-weight: 750; }
.user-identity strong, .user-identity small { display: block; }
.user-identity strong { font-size: 13px; }
.user-identity small { margin-top: 1px; color: #a8a8a8; font-size: 11px; }
.user-chevron { color: #aaa; transition: transform .2s ease; }
.user-chevron .lucide-icon { width: 16px; height: 16px; }
.user-menu[open] .user-chevron { transform: rotate(180deg); }
.user-menu-panel {
    position: absolute;
    z-index: 20;
    top: calc(100% + 16px);
    right: 0;
    width: 180px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    animation: menu-pop .18s ease-out;
}
.user-menu-panel button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; color: #fff; background: #111; border: 0; border-radius: 5px; cursor: pointer; }
.user-menu-panel .lucide-icon { width: 16px; height: 16px; }

@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-7px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.footer {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 8px 20px;
    color: #e8e8e8;
    background: var(--black);
    font-size: 12px;
    text-align: center;
}

.login-page { background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 48%, #fff8eb 100%); }
.login-main {
    min-height: calc(100vh - 100px);
    flex: 1;
    display: grid;
    place-items: start center;
    padding: 60px 20px;
}
.login-card {
    width: min(456px, 100%);
    padding: 28px 26px 26px;
    background: #fff;
    border: 1px solid #dce6f4;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.login-heading { display: flex; align-items: center; justify-content: center; gap: 10px; }
.login-heading h1 { margin: 0; font-size: 21px; }
.login-lock { color: var(--accent); }
.login-lock .lucide-icon { width: 27px; height: 27px; }
.login-card > p { margin: 10px 0 22px; color: var(--muted); text-align: center; }
.field {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 0 13px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.field input { min-width: 0; flex: 1; padding: 10px 0; background: transparent; border: 0; outline: 0; }
.field-icon { color: #667085; }
.field-icon .lucide-icon { width: 18px; height: 18px; }
.password-toggle { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; color: #667085; background: transparent; border: 0; cursor: pointer; }
.password-toggle .lucide-icon { width: 18px; height: 18px; }
.password-toggle [data-lucide-icon="eye-off"], .password-toggle[data-password-visible="true"] [data-lucide-icon="eye"] { display: none; }
.password-toggle[data-password-visible="true"] [data-lucide-icon="eye-off"] { display: block; }
.login-submit { width: 100%; margin-top: 14px; }
.form-alert { padding: 10px 12px; color: #771010; background: #fff0f0; border: 1px solid #f0b8b8; border-radius: 6px; }
.field-error { display: block; margin: 4px 2px 0; color: var(--danger); }

.app-shell { min-height: calc(100vh - 106px); flex: 1; display: block; }
.navigation-scrim {
    position: fixed;
    z-index: 80;
    inset: var(--topbar-height) 0 0;
    padding: 0;
    background: rgba(8, 12, 20, .46);
    border: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity .25s ease, visibility 0s linear .25s;
}
.sidebar {
    position: fixed;
    z-index: 90;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: min(300px, calc(100vw - 42px));
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #fff;
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 46px rgba(15, 23, 42, .18);
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-104%);
    transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .2s ease, visibility 0s linear .28s;
}
.navigation-open { overflow: hidden; }
.navigation-open .sidebar { opacity: 1; visibility: visible; transform: translateX(0); transition-delay: 0s; }
.navigation-open .navigation-scrim { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.sidebar-heading { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
.sidebar-heading strong { font-size: 17px; }
.sidebar-heading button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); background: var(--soft); border: 0; border-radius: 50%; cursor: pointer; }
.sidebar-heading button .lucide-icon { width: 18px; height: 18px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar hr { width: calc(100% - 18px); margin: 10px auto; border: 0; border-top: 1px solid var(--line); }
.sidebar-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 6px; }
.sidebar-link > .lucide-icon { width: 19px; height: 19px; }
.sidebar-link-copy { display: grid; gap: 1px; line-height: 1.15; }
.sidebar-link-copy small { color: var(--muted); font-size: 11px; font-weight: 500; }
.sidebar-link.is-active { color: var(--accent-dark); background: var(--accent-soft); font-weight: 650; }
.library-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.library-badge > .lucide-icon { width: 22px; height: 22px; color: var(--accent); }
.library-badge small, .library-badge strong { display: block; }
.library-badge small { color: var(--muted); }
.library-badge strong { font-size: 13px; }

.panel-main { min-width: 0; padding: 18px; background: #f5f8fc; }
.message-stack { display: grid; gap: 8px; margin-bottom: 12px; }
.message-banner { padding: 11px 14px; border: 1px solid; border-radius: 8px; font-weight: 600; }
.message-banner.success { color: #116530; background: #effaf3; border-color: #a9dfbb; }
.message-banner.error { color: #8f1d16; background: #fff1f0; border-color: #f0b8b3; }
.breadcrumbs { min-height: 34px; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.breadcrumbs a { color: #4d4d4d; }
.breadcrumbs > .lucide-icon { width: 15px; height: 15px; color: #98a2b3; }
.breadcrumbs strong { font-size: 19px; }

.page-heading { min-height: 58px; display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.page-heading-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #7c3aed); border-radius: 11px; font-size: 23px; box-shadow: 0 8px 20px rgba(37, 99, 235, .22); }
.page-heading-icon .lucide-icon { width: 21px; height: 21px; }
.page-heading h1 { margin: 0; color: #14213d; font-size: 21px; }
.page-heading p { margin: 2px 0 0; color: var(--muted); }

.panel-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 2px 12px rgba(0,0,0,.03); overflow: hidden; }
.library-toolbar, .search-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px;
    border-bottom: 1px solid var(--line);
}
.users-toolbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.users-table th:nth-child(2), .users-table th:nth-child(3) { width: 170px; }
.users-table th:nth-child(4) { width: 180px; }
.users-table th:last-child { width: 64px; }
.user-list-name { display: inline-flex; align-items: center; gap: 10px; }
.online-dot { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid #fff; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 1px rgba(22, 163, 74, .2); }
.role-pill, .account-status { width: fit-content; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.role-pill.administrator { color: #5b21b6; background: #ede9fe; }
.role-pill.operator { color: #1d4ed8; background: #e8f0ff; }
.account-status { color: #667085; background: #f1f3f5; }
.account-status.is-active { color: #116530; background: #dcf6e5; }
.user-form-fields { display: grid; gap: 14px; }
.trash-toolbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.audit-card { overflow: visible; }
.audit-list { display: grid; }
.audit-entry { border-bottom: 1px solid var(--line); }
.audit-entry:last-child { border-bottom: 0; }
.audit-entry > summary { min-height: 70px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; list-style: none; }
.audit-entry > summary::-webkit-details-marker { display: none; }
.audit-entry > summary:hover { background: #fafbfc; }
.audit-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--accent-dark); background: var(--accent-soft); border-radius: 10px; }
.audit-icon .lucide-icon { width: 19px; height: 19px; }
.audit-summary { min-width: 0; display: grid; gap: 3px; }
.audit-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-summary small, .audit-items small { color: var(--muted); }
.audit-chevron { display: grid; color: var(--muted); transition: transform .2s ease; }
.audit-chevron .lucide-icon { width: 18px; height: 18px; }
.audit-entry[open] .audit-chevron { transform: rotate(180deg); }
.audit-details { padding: 0 52px 14px 66px; animation: audit-reveal .18s ease-out; }
.audit-items { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.audit-items li { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; background: #fbfcfe; }
.audit-items li + li { border-top: 1px solid var(--line); }
.audit-items li > span:first-child { min-width: 0; display: grid; gap: 2px; }
.audit-items strong { overflow-wrap: anywhere; }
.audit-rename { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
.audit-rename > span:not(.audit-arrow) { min-width: 0; display: grid; gap: 3px; }
.audit-rename small { color: var(--muted); }
.audit-rename strong { overflow-wrap: anywhere; }
.audit-arrow { color: var(--muted); }
.audit-location { display: block; padding: 10px 12px; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; }
@keyframes audit-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.toolbar-actions { display: flex; gap: 8px; }
.search-form { width: min(420px, 100%); display: flex; align-items: center; border: 1px solid #dedede; border-radius: 6px; background: #fff; }
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-form input { min-width: 0; flex: 1; padding: 9px 12px; border: 0; outline: 0; background: transparent; }
.search-form button { width: 42px; align-self: stretch; display: grid; place-items: center; color: #475467; background: transparent; border: 0; cursor: pointer; }
.search-form button .lucide-icon { width: 19px; height: 19px; }
.search-page-header h1 { margin: 0; font-size: 20px; }
.search-page-header p { margin: 3px 0 0; color: var(--muted); }

.table-wrap { overflow-x: auto; }
.library-table { width: 100%; border-collapse: collapse; }
.library-table th, .library-table td { height: 44px; padding: 8px 14px; border-bottom: 1px solid #ececec; text-align: left; }
.library-table th { height: 38px; color: #333; background: #fafafa; font-size: 12px; font-weight: 650; }
.library-table th:nth-child(2) { width: 115px; }
.library-table th:nth-child(3) { width: 110px; }
.library-table th:last-child { width: 150px; }
.library-table tbody tr:hover { background: #f5f9ff; }
.library-table tbody tr.is-highlighted { background: #fff6cf; }
.library-table tbody tr:last-child td { border-bottom: 0; }
.item-name { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
a.item-name:hover { text-decoration: underline; }
.folder-icon { color: var(--yellow); }
.folder-icon .lucide-icon { width: 19px; height: 19px; }
.music-icon { width: 25px; height: 25px; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7c3aed, var(--accent)); border-radius: 50%; font-size: 14px; }
.music-icon .lucide-icon { width: 14px; height: 14px; }
.folder-path { display: inline-flex; align-items: center; gap: 7px; color: #475467; }
.folder-path .folder-icon .lucide-icon { width: 16px; height: 16px; }
.row-actions { text-align: right !important; }
.play-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; color: var(--green); background: #f0fbf4; border: 1px solid #b9e6c8; border-radius: 6px; cursor: pointer; font-weight: 650; }
.play-button:hover { color: #fff; background: var(--green); border-color: var(--green); }
.row-action-group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; }
.icon-action {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    padding: 0;
    color: #475467;
    background: #fff;
    border: 1px solid #d7dee8;
    border-radius: 9px;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.icon-action:hover { transform: translateY(-1px); }
.icon-action-play { color: var(--green); background: #f2fbf5; border-color: #bee5ca; }
.icon-action-play:hover { color: #fff; background: var(--green); border-color: var(--green); }
.icon-action-rename:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.icon-action-delete { color: var(--danger); background: #fff8f7; border-color: #efc7c2; }
.icon-action-delete:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.lucide-icon { width: 18px; height: 18px; display: block; flex: 0 0 auto; }
.item-menu { position: relative; display: inline-block; text-align: left; }
.item-menu summary { width: 32px; height: 32px; display: grid; place-items: center; list-style: none; color: #475467; background: #fff; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 21px; line-height: 1; }
.item-menu summary .lucide-icon { width: 18px; height: 18px; }
.item-menu summary::-webkit-details-marker { display: none; }
.item-menu[open] summary { color: var(--accent-dark); background: var(--accent-soft); border-color: #a9c7f5; }
.item-menu-panel { position: fixed; z-index: 40; min-width: 145px; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.item-menu[open] .item-menu-panel { animation: menu-pop .16s ease-out; }
.item-menu-panel button { width: 100%; padding: 9px 10px; text-align: left; background: transparent; border: 0; border-radius: 5px; cursor: pointer; }
.item-menu-panel form { margin: 0; }
.item-menu-panel button:hover { background: var(--soft); }
.item-menu-panel .danger-action { color: var(--danger); }
.item-menu-panel .danger-action:hover { background: #fff0ef; }
.search-results th:nth-child(2) { width: 34%; }
.search-results td:nth-child(2) a { color: #555; text-decoration: underline; text-underline-offset: 2px; }

.table-footer { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px 14px; color: var(--muted); border-top: 1px solid var(--line); }
.pagination { display: flex; align-items: center; gap: 7px; }
.pagination a, .pagination > span { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 5px; }
.pagination .page-current { color: #fff; background: var(--accent); border-color: var(--accent); }
.pagination .page-total { width: auto; padding: 0 8px; border: 0; }

.empty-state { min-height: 270px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); font-size: 16px; }

.operations-card { margin-top: 14px; }
.operations-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.operations-header h2 { margin: 0; font-size: 16px; }
.operations-header p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.operations-list { display: grid; }
.operation-row { min-height: 58px; display: grid; grid-template-columns: 32px minmax(180px, 1fr) 110px minmax(180px, 1.2fr); align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #edf0f4; }
.operation-row:last-child { border-bottom: 0; }
.operation-icon { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #7c3aed, var(--accent)); border-radius: 7px; }
.operation-icon .lucide-icon { width: 15px; height: 15px; }
.operation-name { min-width: 0; }
.operation-name strong, .operation-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operation-name small { color: var(--muted); font-size: 11px; }
.operation-message { color: var(--muted); font-size: 12px; }
.status-pill { width: fit-content; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.status-pill.pending { color: #8a5200; background: #fff3d6; }
.status-pill.success { color: #116530; background: #dcf6e5; }
.status-pill.error { color: #9b2219; background: #ffe4e1; }
.status-pill.partial { color: #5b36a3; background: #eee7ff; }

.panel-dialog { width: min(520px, calc(100% - 28px)); padding: 0; color: var(--ink); background: #fff; border: 0; border-radius: 13px; box-shadow: 0 24px 80px rgba(15, 23, 42, .28); }
.panel-dialog::backdrop { background: rgba(9, 15, 28, .62); backdrop-filter: blur(2px); }
.panel-dialog form { padding: 22px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dialog-header h2 { margin: 0; font-size: 20px; }
.dialog-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.dialog-close { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; color: #667085; background: #f4f6f8; border: 0; border-radius: 50%; cursor: pointer; }
.dialog-close .lucide-icon { width: 18px; height: 18px; }
.dialog-field { display: grid; gap: 7px; font-weight: 650; }
.dialog-field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #d5dce6; border-radius: 7px; outline: 0; }
.dialog-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.dialog-field select { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1px solid #d5dce6; border-radius: 7px; outline: 0; }
.dialog-field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.rename-name-control { min-width: 0; display: flex; align-items: stretch; background: #fff; border: 1px solid #d5dce6; border-radius: 7px; overflow: hidden; }
.rename-name-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.rename-name-control input { min-width: 0; border: 0; border-radius: 0; box-shadow: none; }
.rename-name-control input:focus { border: 0; box-shadow: none; }
.rename-fixed-extension { display: inline-flex; align-items: center; padding: 0 13px; color: #667085; background: #f4f6f8; border-left: 1px solid #d5dce6; font-weight: 700; user-select: none; }
.rename-fixed-extension[hidden] { display: none; }
.dialog-destination { display: flex; justify-content: space-between; gap: 16px; margin-top: 15px; padding: 10px 12px; color: var(--muted); background: #f6f8fb; border-radius: 7px; font-size: 12px; }
.dialog-destination strong { max-width: 70%; overflow-wrap: anywhere; color: var(--ink); text-align: right; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.upload-dropzone { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 18px; color: var(--muted); background: #f8fbff; border: 2px dashed #b9c9e1; border-radius: 10px; text-align: center; cursor: pointer; }
.upload-dropzone:hover { background: #f1f7ff; border-color: var(--accent); }
.upload-dropzone.is-dragging { color: var(--accent-dark); background: #eaf2ff; border-color: var(--accent); box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .08); }
.upload-dropzone strong { color: var(--accent-dark); }
.upload-dropzone input { width: 1px; height: 1px; position: absolute; opacity: 0; }
.upload-symbol { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--accent); border-radius: 50%; }
.upload-symbol .lucide-icon { width: 20px; height: 20px; }
.upload-summary { margin-top: 10px; color: var(--muted); font-size: 12px; }
.upload-summary.is-error { color: var(--danger); font-weight: 650; }
.upload-name-policy { margin-top: 9px; padding: 9px 11px; color: #344054; background: var(--accent-soft); border-radius: 7px; font-size: 12px; }
.button-danger { color: #fff; background: var(--danger); }
.button-danger:hover { background: #8f1d16; }
.delete-note { margin: 0; padding: 11px 12px; color: #7a271a; background: #fff4f2; border: 1px solid #f2c5bf; border-radius: 7px; font-size: 12px; }

.duplicate-groups { display: grid; gap: 14px; padding: 14px; }
.duplicates-heading form { margin-left: auto; }
.duplicate-group { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; }
.duplicate-group > header { padding: 12px 14px; background: #f7f9fc; border-bottom: 1px solid var(--line); }
.duplicate-group > header strong, .duplicate-group > header span { display: block; }
.duplicate-group > header span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.duplicate-original-name { overflow-wrap: anywhere; }
.duplicate-table th:first-child { width: auto; }
.duplicate-table th:nth-child(2) { width: 30%; }
.duplicate-table th:nth-child(3) { width: 100px; }
.duplicate-table th:last-child { width: 150px; }
.duplicate-action-status { display: block; margin: 4px 0 0 31px; color: var(--muted); font-size: 11px; font-weight: 650; }
.duplicate-action-status.error { color: var(--danger); }
.duplicate-table tr.is-validating { background: #fffaf0; }
.duplicate-table tr.is-validating .row-action-group { opacity: .45; }
.duplicate-table tr.is-removing, .duplicate-group.is-removing { opacity: 0; transform: translateY(-4px); transition: opacity .22s ease, transform .22s ease; }
.trash-table th:nth-child(2) { width: 30%; }
.trash-table th:nth-child(3) { width: 110px; }
.trash-table th:nth-child(4) { width: 145px; }
.trash-table th:last-child { width: 150px; }
.trash-origin { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.trash-origin strong { color: var(--ink); }

.audio-player {
    position: fixed;
    z-index: 30;
    right: 24px;
    bottom: 54px;
    left: 24px;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(260px, 2fr) 34px;
    align-items: center;
    gap: 18px;
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(105deg, #111827, #1e3a5f);
    border: 1px solid #31547d;
    border-radius: 9px;
    box-shadow: 0 16px 50px rgba(0,0,0,.28);
}
.audio-player[hidden] { display: none; }
.audio-title { min-width: 0; }
.audio-title small, .audio-title strong { display: block; }
.audio-title small { color: #aaa; font-size: 11px; }
.audio-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-player audio { width: 100%; height: 36px; }
.audio-player > button { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: transparent; border: 0; cursor: pointer; }
.audio-player > button .lucide-icon { width: 20px; height: 20px; }

@media (max-width: 760px) {
    :root { --topbar-height: 58px; }
    .topbar { min-height: var(--topbar-height); gap: 10px; padding: 7px 10px; }
    .navigation-toggle { width: 40px; height: 40px; }
    .brand strong { font-size: 19px; }
    .radio-label { font-size: 12px; }
    .topbar-actions { gap: 8px; }
    .playlist-button { width: 40px; height: 40px; padding: 0; }
    .user-avatar { width: 36px; height: 36px; }
    .user-identity { min-width: 0; }
    .user-identity strong { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
    .user-identity small { display: none; }
    .user-chevron { display: none; }
    .user-menu-panel { top: calc(100% + 10px); }
    .sidebar { width: min(310px, calc(100vw - 20px)); padding: 14px; }
    .sidebar-link { min-height: 48px; }
    .panel-main { padding: 10px; }
    .page-heading { min-height: 48px; align-items: flex-start; }
    .page-heading-icon { width: 38px; height: 38px; border-radius: 9px; font-size: 20px; }
    .page-heading h1, .breadcrumbs strong { font-size: 18px; }
    .breadcrumbs { min-width: 0; flex-wrap: wrap; gap: 6px; }
    .library-toolbar, .search-page-header { align-items: stretch; flex-direction: column; }
    .users-toolbar { align-items: stretch; flex-direction: column; }
    .users-toolbar .button { width: 100%; }
    .trash-toolbar { align-items: stretch; flex-direction: column; }
    .trash-toolbar .button { width: 100%; }
    .audit-entry > summary { grid-template-columns: 36px minmax(0, 1fr) 20px; gap: 9px; padding: 10px; }
    .audit-entry > summary > .status-pill { grid-column: 2; justify-self: start; }
    .audit-chevron { grid-column: 3; grid-row: 1 / span 2; }
    .audit-summary strong { white-space: normal; overflow-wrap: anywhere; }
    .audit-details { padding: 0 10px 12px; }
    .audit-items li { align-items: flex-start; flex-direction: column; }
    .audit-rename { grid-template-columns: 1fr; gap: 8px; }
    .audit-arrow { transform: rotate(90deg); }
    .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .toolbar-actions .button { width: 100%; min-height: 42px; }
    .search-form { width: 100%; }
    .search-form input, .dialog-field input, .field input { font-size: 16px; }
    .table-wrap { overflow: visible; }
    .library-table { display: block; padding: 8px; }
    .library-table thead { display: none; }
    .library-table tbody { display: grid; gap: 8px; }
    .library-table tbody tr { display: block; padding: 7px 10px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
    .library-table tbody tr.is-highlighted { background: #fff6cf; }
    .library-table td,
    .library-table td:nth-child(2) {
        width: 100%;
        min-height: 36px;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 6px 0;
        border: 0;
        text-align: right;
    }
    .library-table td::before { flex: 0 0 auto; content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
    .library-table td:first-child { align-items: flex-start; padding-top: 8px; }
    .library-table td:first-child::before { padding-top: 5px; }
    .item-name, .folder-path { min-width: 0; justify-content: flex-end; overflow-wrap: anywhere; text-align: right; }
    .row-actions { display: flex !important; text-align: right !important; }
    .row-action-group { min-width: 0; }
    .play-button { min-height: 40px; }
    .icon-action { width: 40px; height: 40px; }
    .item-menu summary { width: 40px; height: 40px; }
    .duplicate-groups { gap: 10px; padding: 8px; }
    .duplicate-group > header { padding: 11px 12px; }
    .duplicates-heading form { width: 100%; margin-left: 0; }
    .duplicates-heading form .button { width: 100%; }
    .trash-table th:nth-child(2), .trash-table th:nth-child(3), .trash-table th:nth-child(4) { width: auto; }
    .table-footer { align-items: flex-start; flex-direction: column; }
    .operations-header { align-items: flex-start; flex-direction: column; }
    .operation-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; padding: 10px 12px; }
    .operation-message { grid-column: 2 / -1; }
    .panel-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); overflow-y: auto; border-radius: 11px; }
    .panel-dialog form { padding: 17px; }
    .dialog-header { margin-bottom: 14px; }
    .dialog-header h2 { font-size: 18px; }
    .dialog-actions { align-items: stretch; flex-direction: column-reverse; }
    .dialog-actions .button { width: 100%; min-height: 44px; }
    .upload-dropzone { min-height: 132px; }
    .audio-player { right: 12px; bottom: 50px; left: 12px; grid-template-columns: 1fr 28px; }
    .audio-player audio { grid-column: 1 / -1; grid-row: 2; }
    .login-main { padding: 30px 12px; }
    .login-card { padding: 23px 18px; }
}

@media (max-width: 390px) {
    .playlist-button { width: 38px; height: 38px; padding: 0; }
    .icon-action { width: 38px; height: 38px; }
    .user-identity { display: none; }
    .brand strong { font-size: 18px; }
    .toolbar-actions { grid-template-columns: 1fr; }
    .library-table td { gap: 8px; }
    .operation-row { grid-template-columns: 28px minmax(0, 1fr); }
    .operation-row .status-pill { grid-column: 2; }
    .operation-message { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

.brand-logo { max-width: 200px; max-height: 44px; object-fit: contain; }
.separator-main { max-width: 1080px; }
.separator-card { padding: 24px; margin-bottom: 24px; }
.separator-card h2 { margin: 0 0 14px; font-size: 19px; }
.separator-card p { color: var(--muted); line-height: 1.65; }
.separator-fields { display: grid; grid-template-columns: 180px 1fr; gap: 20px; margin: 20px 0; }
.separator-fields label { display: grid; gap: 8px; font-weight: 600; }
.separator-fields input, .separator-fields select { min-width: 0; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font: inherit; }
@media (max-width: 600px) { .separator-fields { grid-template-columns: 1fr; } .separator-card { padding: 18px; } }

.catalog-search-header { padding: 24px; border-bottom: 1px solid var(--line); }
.catalog-search-header h1 { margin: 0; font-size: 23px; }
.catalog-search-header p { color: var(--muted); line-height: 1.5; }
.catalog-search-form { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(170px, 1fr) minmax(150px, 1fr) auto; align-items: end; gap: 14px; margin-top: 20px; }
.catalog-search-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; min-width: 0; }
.catalog-search-form input, .catalog-search-form select { width: 100%; min-width: 0; height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: var(--white); }
.catalog-search-form button { min-height: 44px; }
.catalog-result-info { padding: 16px 24px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.catalog-result-info span, .catalog-updated { color: var(--muted); font-size: 12px; }
.catalog-updated { padding: 0 24px 18px; line-height: 1.6; }
.catalog-pagination .pagination > span { border: 0; padding: 0 8px; }
@media(max-width: 1000px) { .catalog-search-form { grid-template-columns: 1fr 1fr; } }
@media(max-width: 600px) { .catalog-search-form { grid-template-columns: 1fr; } .catalog-search-header { padding: 18px; } .catalog-result-info { padding: 14px 18px; } .catalog-pagination { align-items: center; } }
