* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: #f5f4f0;
    color: #111111;
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    border-bottom: 1px solid #111111;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo {
    height: 32px;
    width: auto;
    display: block;
}

.topbar h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.topbar nav a {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 24px;
    border-bottom: 1px solid transparent;
}

.topbar nav a:hover { border-bottom-color: #111111; }

.viewer-wrap {
    padding: 24px 32px;
}

.viewer-frame {
    width: 100%;
    height: 85vh;
    border: 1px solid #111111;
    background: #ffffff;
}

.viewer-image-wrap {
    text-align: center;
    padding: 24px;
    border: 1px solid #111111;
    background: #ffffff;
}

.viewer-image-wrap img {
    max-width: 100%;
    max-height: 85vh;
}

.viewer-note {
    margin-top: 12px;
}

.app-layout {
    display: flex;
    align-items: flex-start;
}

.sidebar {
    width: 230px;
    flex-shrink: 0;
    border-right: 1px solid #111111;
    min-height: calc(100vh - 65px);
    padding: 24px 16px;
    background: #ffffff;
}

.sidebar .tree-root {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 4px 0;
}

.tree-list {
    list-style: none;
    margin-left: 12px;
}

.tree-list a {
    display: block;
    font-size: 13px;
    padding: 4px 0;
    color: #111111;
}

.tree-list a.active, .sidebar .tree-root.active {
    font-weight: 700;
    text-decoration: underline;
}

.sidebar details summary {
    cursor: pointer;
    list-style: none;
}

.sidebar details summary::-webkit-details-marker { display: none; }

.sidebar details summary::before {
    content: "▸";
    display: inline-block;
    width: 12px;
    font-size: 10px;
    color: #666666;
}

.sidebar details[open] > summary::before {
    content: "▾";
}

.tree-leaf a::before {
    content: "";
    display: inline-block;
    width: 12px;
}

.container {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 48px 32px;
}

.login-wrap {
    max-width: 340px;
    margin: 96px auto;
    padding: 40px 32px;
    border: 1px solid #111111;
    background: #ffffff;
}

.login-logo {
    display: block;
    height: 40px;
    width: auto;
    margin: 0 auto 16px;
}

.login-wrap h1 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
    text-align: center;
}

label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    margin-top: 16px;
}

input[type=text], input[type=password], input[type=file] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #111111;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
}

button, .btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: #111111;
    color: #ffffff;
    border: 1px solid #111111;
    font-family: inherit;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

button:hover, .btn:hover { background: #ffffff; color: #111111; }

.btn-ghost {
    background: #ffffff;
    color: #111111;
}
.btn-ghost:hover { background: #111111; color: #ffffff; }

.error {
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid #b3261e;
    color: #b3261e;
    font-size: 13px;
}

.success {
    margin-top: 16px;
    padding: 10px 12px;
    border: 1px solid #1e6b3c;
    color: #1e6b3c;
    font-size: 13px;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.search-bar input[type=text] {
    flex: 1;
}

.btn-clear {
    white-space: nowrap;
}

.breadcrumb {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 24px;
}

.breadcrumb a:hover { border-bottom: 1px solid #111111; }

.breadcrumb .sep {
    margin: 0 8px;
    color: #999999;
}

.folder-link {
    font-weight: 700;
}

.folder-link:hover { border-bottom: 1px solid #111111; }

.path-hint {
    font-style: italic;
}

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #111111;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    text-transform: none;
    letter-spacing: normal;
    font-size: 13px;
}

.checkbox-label input[type=checkbox] {
    width: auto;
}

.inline-reset-form {
    display: flex;
    gap: 8px;
}

.inline-reset-form input[type=text] {
    width: 160px;
    padding: 6px 8px;
    font-size: 12px;
}

.inline-reset-form button {
    margin-top: 0;
    padding: 6px 12px;
    font-size: 11px;
}

.recent-box {
    border: 1px solid #111111;
    background: #ffffff;
    padding: 20px 24px;
    margin-bottom: 24px;
}

.recent-box h2 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

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

.recent-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 6px 0;
    border-bottom: 1px solid #eeeeee;
    font-size: 13px;
}

.recent-list li:last-child { border-bottom: none; }

.recent-list a:hover { border-bottom: 1px solid #111111; }

.recent-list .meta a { text-decoration: underline; }

.sort-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sort-bar a {
    color: #666666;
    border-bottom: 1px solid transparent;
}

.sort-bar a.active {
    color: #111111;
    font-weight: 700;
    border-bottom: 1px solid #111111;
}

.sort-bar a:hover { color: #111111; }

.upload-box {
    border: 1px solid #111111;
    padding: 24px;
    margin-bottom: 40px;
    background: #ffffff;
}

.upload-row {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.upload-row > div {
    flex: 1;
    min-width: 220px;
}

.upload-box h2 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.hint {
    font-size: 12px;
    color: #666666;
    margin-bottom: 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 8px;
    border-bottom: 1px solid #111111;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid #dddddd;
    font-size: 14px;
}

td.actions {
    text-align: right;
    white-space: nowrap;
}

td.actions a {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 16px;
}

td.actions a:hover { border-bottom: 1px solid #111111; }

.meta { color: #666666; font-size: 12px; }

.star-toggle {
    float: right;
    font-size: 15px;
    color: #111111;
    text-decoration: none;
}

.star-toggle:hover { opacity: 0.6; }

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.file-card {
    border: 1px solid #111111;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.file-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f0efe9;
    border: 1px solid #dddddd;
    margin-bottom: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #666666;
}

.folder-card { position: relative; }

.folder-preview {
    position: relative;
}

.folder-card:has(.folder-preview)::before {
    content: "Dossier";
    position: absolute;
    top: 16px;
    left: 16px;
    background: #111111;
    color: #ffffff;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    z-index: 1;
}

.folder-thumb {
    font-weight: 700;
    background: #ffffff;
    border-style: dashed;
}

.generic-thumb { color: #999999; }

.thumb-icon {
    width: 42%;
    height: 42%;
    object-fit: contain;
    opacity: 0.75;
}

img.file-thumb.icon-fallback {
    object-fit: contain;
    padding: 20%;
    background: #f0efe9;
}

.file-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    word-break: break-word;
    margin-bottom: 4px;
}

a.file-name:hover { text-decoration: underline; }

.file-meta {
    font-size: 11px;
    color: #666666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.file-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.file-actions a {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.file-actions a:hover { border-bottom: 1px solid #111111; }

.path-hint {
    font-style: italic;
}

.empty {
    padding: 40px 0;
    text-align: center;
    color: #666666;
    font-size: 13px;
}

.admin-section {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid #111111;
}
