* {
    box-sizing: border-box;
}
:root {
    --accent: #3873b7;
    --accent-dark: #28588e;
    --accent-soft: #eaf2fb;
    --accent-border: #c6daef;
    --accent-shadow: #3873b730;
    font-family:
        Segoe UI,
        Arial,
        sans-serif;
    color: #25364a;
    background: #f4f6f9;
    font-size: 14px;
}
body {
    margin: 0;
}
button,
input,
select {
    font: inherit;
}
button {
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    padding: 9px 12px;
}
button:hover {
    background: #eef3f8;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
button:disabled {
    opacity: 0.38;
    cursor: default;
}
.action-icons {
    position: absolute;
    pointer-events: none;
}
.action-control:not([hidden]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    gap: 4px;
    min-width: 36px;
    min-height: 36px;
    padding: 6px;
}
a.action-control {
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
}
a.action-control:not(.primary):hover {
    background: #eef3f8;
}
a.action-control:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.action-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.top {
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px #25364a06;
    height: 82px;
    background: white;
    border-bottom: 1px solid #e3e8ef;
    display: flex;
    align-items: center;
    padding: 0 40px;
    gap: 36px;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: #203e5d;
    letter-spacing: -1px;
    line-height: 1.125;
    white-space: nowrap;
}
.brand > span:last-child {
    color: var(--accent);
}
.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    list-style: none;
    border-radius: 8px;
}
.brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
summary.brand-icon {
    cursor: pointer;
}
summary.brand-icon::-webkit-details-marker {
    display: none;
}
.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 3px;
}
.module {
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 1.4px;
    color: #8a97a7;
}
.header-actions {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 270px;
    max-width: calc(100vw - 32px);
    padding: 18px;
    background: white;
    border: 1px solid #e3e8ef;
    border-radius: 10px;
    box-shadow: 0 8px 24px #25364a1a;
    overflow-wrap: anywhere;
}
.system-menu {
    position: relative;
}
.system-menu .header-panel {
    right: auto;
    left: 0;
    max-width: calc(100vw - 40px);
}
summary.brand-icon:hover,
.system-menu[open] > .brand-icon {
    background: var(--accent-soft);
}
.system-menu a {
    display: block;
    border-radius: 6px;
    color: #203e5d;
    padding: 9px 12px;
    text-decoration: none;
}
.system-menu a:hover,
.system-menu a[aria-current='page'] {
    background: #eef3f8;
}
.profile strong {
    font-size: 12px;
}
.profile small {
    display: block;
    color: #7a8796;
    font-size: 11px;
    margin-top: 5px;
}
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    list-style: none;
    cursor: pointer;
    background: var(--accent-soft);
    color: var(--accent-dark);
    padding: 12px;
    border-radius: 50%;
    font-weight: 600;
}
.avatar::-webkit-details-marker {
    display: none;
}
.avatar:hover,
.profile[open] > .avatar {
    background: var(--accent-border);
}
.avatar:focus-visible,
.brand-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}
main {
    max-width: 1560px;
    margin: auto;
    padding: 36px 40px;
}
.heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 27px;
}
.folder-page {
    padding-block-start: 18px;
}
.folder-page .heading {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.folder-page .heading h1,
#storage-title {
    margin: 0;
}
#storage-panel {
    width: min(600px, 94vw);
}
#storage-panel summary {
    cursor: pointer;
    color: var(--accent-dark);
    font-weight: 600;
}
#storage-folders {
    padding-inline-start: 20px;
    overflow-wrap: anywhere;
}
#storage-folders li + li {
    margin-top: 8px;
}
.eyebrow {
    font-size: 10px;
    color: var(--accent-dark);
    letter-spacing: 1.7px;
    font-weight: 700;
}
h1 {
    font-size: 28px;
    letter-spacing: -0.7px;
    margin: 9px 0;
}
p {
    color: #7a8796;
    line-height: 1.6;
    margin: 0;
}
.badge {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border: 1px solid var(--accent-border);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
}
.explorer {
    background: #fff;
    border: 1px solid #dfe5ed;
    border-radius: 10px;
    box-shadow: 0 4px 18px #25364a05;
    overflow: hidden;
}
.toolbar {
    height: 67px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid #e7ebf1;
}
.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.primary:hover {
    background: var(--accent-dark);
}
.separator {
    width: 1px;
    height: 24px;
    background: #e3e8ee;
    margin: 0 9px;
}
.refresh {
    margin-left: auto;
}
.view-switch {
    display: flex;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    margin-left: 10px;
}
.view-switch button {
    padding: 5px 11px;
    font-size: 21px;
}
.view-switch button[aria-pressed='true'] {
    background: var(--accent-soft);
    color: var(--accent-dark);
}
.address {
    min-height: 61px;
    display: flex;
    align-items: center;
    padding: 10px 18px;
    gap: 5px;
    border-bottom: 1px solid #e7ebf1;
}
.address > button {
    font-size: 18px;
    padding: 5px 10px;
}
#breadcrumbs {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 3px;
    overflow: auto;
    white-space: nowrap;
}
#breadcrumbs button {
    font-size: 12px;
    padding: 6px 8px;
}
#breadcrumbs span {
    color: #a1acb7;
}
.search {
    display: flex;
    align-items: center;
    border: 1px solid #dfe5ed;
    border-radius: 6px;
    padding: 5px 12px;
    gap: 7px;
    color: #8290a0;
}
.search input {
    width: 210px;
    padding: 4px;
    border: 0;
    outline: none;
    font-size: 12px;
}
.workspace {
    display: flex;
    min-height: 490px;
}
aside {
    width: 260px;
    flex-shrink: 0;
    background: #fafbfd;
    border-right: 1px solid #e7ebf1;
    overflow: auto;
    padding: 23px 13px;
    display: flex;
    flex-direction: column;
}
.aside-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #97a2b1;
    margin: 0 12px 18px;
}
.root-link {
    text-align: left;
    font-weight: 600;
    font-size: 12px;
}
.root-link.active {
    background: var(--accent-soft);
    color: var(--accent-dark);
}
#tree {
    margin-top: 8px;
}
.tree-row {
    display: flex;
    align-items: center;
    border-radius: 5px;
    min-height: 35px;
}
.tree-row.active {
    background: var(--accent-soft);
}
.tree-toggle {
    display: grid;
    place-items: center;
    padding: 5px;
    width: 25px;
    flex-shrink: 0;
}
.tree-toggle:not(:disabled)::before {
    content: '';
    width: 0;
    height: 0;
    border: 4px solid transparent;
    border-left: 6px solid currentColor;
    border-right: 0;
}
.tree-row[aria-expanded='true'] > .tree-toggle::before {
    transform: rotate(90deg);
}
.tree-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    flex: 1;
    padding: 7px 3px;
    font-size: 12px;
}
.tree-label span {
    color: #d9ab48;
    margin-right: 6px;
}
.aside-note {
    margin-top: auto;
    padding: 35px 13px 0;
    font-size: 11px;
}
.aside-note strong {
    font-weight: 600;
    color: #64748b;
}
.aside-note p {
    margin-top: 7px;
}
.content {
    padding: 25px 28px;
    flex: 1;
    min-width: 0;
}
.content-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
h2 {
    font-size: 17px;
    margin: 0 0 7px;
    font-weight: 600;
}
#folder-count,
.hint {
    font-size: 11px;
    color: #96a0ad;
}
.folders {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    align-content: start;
}
.folder {
    border: 1px solid #e7ebf0;
    border-radius: 8px;
    min-width: 0;
    position: relative;
    text-align: left;
    padding: 20px 17px;
    background: white;
}
.folder:hover {
    border-color: var(--accent-border);
    background: #f8fbfc;
}
.folder.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent-shadow);
}
.folder-icon {
    display: block;
    width: 49px;
    height: 34px;
    background: #efc66a;
    border-radius: 3px 5px 5px 5px;
    margin: 9px 0 20px;
    position: relative;
    box-shadow: inset 0 -4px #e9b954;
}
.folder-icon:before {
    content: '';
    position: absolute;
    top: -7px;
    left: 0;
    width: 23px;
    height: 10px;
    border-radius: 4px 5px 0 0;
    background: #e6b654;
}
.folder-icon:after {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5d281;
    border-radius: 3px 4px 5px 5px;
}
.folder strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.folder small {
    display: block;
    color: #96a0ad;
    font-size: 10px;
    margin-top: 8px;
}
.folders.list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.list .folder {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 18px;
}
.list .folder-icon {
    transform: scale(0.6);
    margin: 0;
    width: 49px;
    flex-shrink: 0;
}
.list .folder strong {
    flex: 1;
}
.list .folder small {
    margin: 0;
}
.empty {
    grid-column: 1/-1;
    align-self: center;
    text-align: center;
    padding: 65px 10px;
    color: #8996a7;
}
.empty .empty-icon {
    font-size: 48px;
    color: #d5b36a;
    display: block;
    margin-bottom: 15px;
}
.empty h3 {
    color: #4b6076;
    font-size: 16px;
    font-weight: 500;
}
.empty p {
    font-size: 12px;
}
.empty button {
    margin-top: 20px;
}
footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #e7ebf1;
    padding: 12px 21px;
    color: #8b97a5;
    font-size: 10px;
}
.dot {
    padding: 0 10px;
    color: #b5bec7;
}
.footnote {
    font-size: 11px;
    text-align: center;
    margin: 17px 0;
}
.download-status {
    position: fixed;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 110;
    width: min(360px, calc(100% - 32px));
    padding: 14px 44px 14px 16px;
    border: 1px solid #b5d1db;
    border-radius: 8px;
    box-shadow: 0 4px 18px #25364a26;
    background: #edf7f7;
    color: #205766;
    overflow-wrap: anywhere;
}
.download-status button {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 5px 9px;
    font-size: 18px;
}
.download-status progress {
    width: 100%;
    margin-bottom: 6px;
    accent-color: #197e89;
}
#notice {
    white-space: pre-line;
    overflow-wrap: anywhere;
    padding: 12px 15px;
    background: #fff5e7;
    border: 1px solid #f0d7aa;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 18px;
    color: #825c22;
    line-height: 1.6;
}
dialog {
    border: 1px solid #dfe5ed;
    border-radius: 12px;
    width: min(440px, 94vw);
    padding: 28px;
    box-shadow: 0 20px 80px #162c4030;
}
dialog::backdrop {
    background: #172e4560;
}
#document-info-fields dt {
    font-weight: 600;
    margin-top: 10px;
}
#document-info-fields dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
}
#document-audit-operations {
    max-height: min(14rem, 30vh);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    overflow-wrap: anywhere;
}
#document-audit-operations li + li {
    margin-top: 0.75rem;
}
#document-audit-operations:empty,
#document-audit-status:empty,
#document-info-status:empty {
    display: none;
}
dialog p {
    font-size: 12px;
    margin-bottom: 20px;
}
dialog label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-top: 18px;
}
dialog input,
dialog select {
    width: 100%;
    padding: 11px;
    border: 1px solid #d7e0e8;
    border-radius: 6px;
    margin-top: 9px;
    color: #25364a;
    background: white;
}
dialog [hidden] {
    display: none;
}
.modal-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.modal-icon {
    background: #fcf3db;
    color: #c69736;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 22px;
}
.modal-heading button {
    font-size: 24px;
    color: #91a0af;
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 23px;
}
#form-error {
    color: #b64040;
    margin: 15px 0 0;
}
.danger {
    background: #b84040 !important;
    border-color: #b84040 !important;
}
@media (max-width: 900px) {
    .hint {
        display: none;
    }
    .top {
        padding: 0 20px;
    }
    main {
        padding: 25px 18px;
    }
    aside {
        width: 210px;
    }
    .search input {
        width: 140px;
    }
    .toolbar {
        gap: 2px;
        padding: 10px;
    }
    .toolbar button {
        font-size: 12px;
    }
    .content {
        padding: 20px;
    }
    .heading h1 {
        font-size: 24px;
    }
}
@media (max-width: 620px) {
    .profile strong {
        font-size: 10px;
    }
    .top {
        gap: 8px;
        height: 70px;
    }
    .brand {
        font-size: 20px;
    }
    .brand-icon {
        width: 40px;
        height: 40px;
    }
    .module {
        font-size: 9px;
        letter-spacing: 0.6px;
    }
    .workspace {
        min-height: 500px;
    }
    aside {
        width: 150px;
        padding: 18px 5px;
    }
    .aside-note {
        display: none;
    }
    .content {
        padding: 18px 12px;
    }
    .address {
        flex-wrap: wrap;
    }
    .search {
        width: 100%;
        margin-top: 5px;
    }
    .search input {
        width: 100%;
    }
    .toolbar {
        flex-wrap: wrap;
        height: auto;
    }
    .toolbar button {
        padding: 8px;
    }
    .separator {
        display: none;
    }
    .folders {
        grid-template-columns: 1fr;
    }
    .view-switch {
        margin-left: 0;
    }
    .list .folder {
        gap: 3px;
        flex-wrap: wrap;
    }
    footer {
        gap: 8px;
    }
    .footnote {
        font-size: 10px;
    }
}
.document-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 44px;
    padding-top: 5px;
    margin-bottom: 8px;
    clip-path: polygon(0 0, 70% 0, 100% 25%, 100% 100%, 0 100%);
    border-radius: 4px;
    background: #e9eff5;
    color: #526d89;
    font-size: 11px;
    font-weight: 700;
}
.document-select {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}
.list .document-select {
    position: static;
    flex: none;
    margin: 0;
}
.document-icon-pdf {
    background: #fde9e9;
    color: #9d2631;
}
.document-icon-txt {
    background: #e2effc;
    color: #235888;
}
.document-icon-generic {
    font-size: 21px;
}
.list .document-icon {
    margin-bottom: 0;
}
.folder-open {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
    padding: 0;
}
.list .folder-open {
    display: flex;
    align-items: center;
    gap: 12px;
}
.folder-item .document-actions {
    margin-top: 8px;
}
.list .folder-item .document-actions {
    margin-top: 0;
    flex-shrink: 0;
}
.document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.document-actions a {
    color: inherit;
}
.list .document .document-actions {
    flex: 0 0 auto;
    gap: 2px;
}
.document strong {
    overflow-wrap: anywhere;
}

.search-pagination:not([hidden]) {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}
.search-pagination .search-control,
.document-search .search-control {
    padding: .4rem .6rem;
    border: 1px solid #ced9e6;
    border-radius: 6px;
    background: #fff;
    color: #172b46;
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
}
.search-pagination .search-range {
    margin-inline-start: auto;
    color: #495d76;
}
