/*CLI THEME*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --font-mono:
        "Anonymous Pro", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;

    /* Kolory terminala */
    --bg-main: #020617; /* główne tło */
    --bg-alt: #050816; /* alternatywne tło / panele */
    --bg-elevated: #020712; /* okna/panele */
    --bg-input: #020617;

    --grid-line: rgba(22, 101, 52, 0.25);
    --scanline: rgba(15, 23, 42, 0.48);

    --accent: #22c55e; /* neon green */
    --accent-soft: rgba(34, 197, 94, 0.18);
    --accent-strong: #16a34a;
    --accent-alt: #22d3ee; /* cyjan */
    --accent-warn: #facc15; /* żółty */
    --accent-danger: #f97373; /* czerwony */

    --text-main: #e5e7eb;
    --text-muted: #64748b;
    --text-dim: #475569;

    --border-soft: rgba(22, 163, 74, 0.4);
    --border-strong: rgba(22, 163, 74, 0.9);

    --radius-sm: 2px;
    --radius-md: 3px;
    --radius-lg: 4px;

    --transition-fast: 100ms ease-out;
    --transition-normal: 180ms ease-out;

    --shadow-soft: 0 0 0 1px rgba(15, 23, 42, 1);
}

/* =========================
   GLOBAL / BODY
   ========================= */

body {
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-main);
    background-color: var(--bg-main);
    background-image:
        linear-gradient(transparent 0, rgba(15, 23, 42, 0.55) 1px),
        radial-gradient(circle at top, rgba(34, 197, 94, 0.16), transparent 55%);
    background-size:
        100% 2px,
        100% 100%;
}

/* delikatny scanline + migający glow */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.4) 50%,
        transparent 51%
    );
    background-size: 100% 2px;
    opacity: 0.3;
    mix-blend-mode: soft-light;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        circle at top center,
        rgba(34, 197, 94, 0.18),
        transparent 60%
    );
    opacity: 0.6;
    mix-blend-mode: screen;
    animation: crt-glow 4s ease-in-out infinite alternate;
}

@keyframes crt-glow {
    0% {
        opacity: 0.4;
    }
    100% {
        opacity: 0.8;
    }
}

@media (max-width: 720px) {
    body {
        padding: 8px;
    }
}

/* =========================
   TERMINAL WINDOW (SHELL)
   ========================= */

.shell,
.login-shell,
.upload-shell,
.settings-modal-dialog,
.preview-modal-dialog,
.mini-modal-dialog {
    position: relative;
    width: 100%;
    background-color: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    box-shadow:
        0 0 0 1px #000,
        0 18px 35px rgba(0, 0, 0, 0.9);
}

.shell {
    max-width: 1200px;
    padding: 0;
    display: flex;
    flex-direction: column;
    animation: shell-in 180ms var(--transition-normal) both;
}

@keyframes shell-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pasek tytułu okna terminala */

.shell::before {
    content: "mini@files:~";
    display: block;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border-soft);
    background:
        linear-gradient(90deg, rgba(22, 163, 74, 0.24), transparent), #000;
    color: var(--accent-alt);
    font-size: 12px;
    letter-spacing: 0.03em;
}

/* Wnętrze okna */

.shell > .app-head,
.shell > .layout,
.shell > .flash {
    padding-inline: 14px;
}

.shell > .app-head {
    padding-top: 10px;
}

.shell > .layout {
    padding-bottom: 12px;
}

.shell > .flash {
    margin-top: 10px;
}

/* =========================
   HEADER / TOP BAR
   ========================= */

header.app-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

/* search w górnym pasku */
.app-head .search-form {
    margin-right: 6px;
}

.app-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-title h1 {
    margin: 0;
    font-size: 15px;
    color: var(--accent);
}

.app-title span {
    font-size: 11px;
    color: var(--text-muted);
}

.top-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* =========================
   LAYOUT: PANELS
   ========================= */

.layout {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    gap: 12px;
    margin-top: 4px;
    margin-bottom: 12px;
}
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px; /* dopasuj do gap w .layout jeśli chcesz idealnie */
    min-height: 0;
}

@media (max-width: 880px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.panel {
    background-color: var(--bg-alt);
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* grid lines z tyłu – jak w tmuxie */
.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(15, 23, 42, 0.8) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.8) 1px, transparent 1px);
    background-size: 12px 12px;
    opacity: 0.25;
    mix-blend-mode: soft-light;
}

/* żeby ::before nie zasłaniało treści */
.panel > * {
    position: relative;
    z-index: 1;
}

/* =========================
   PANEL HEADERS
   ========================= */

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px;
}

.panel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent-alt);
}

.panel-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* =========================
   FLASH / STATUS
   ========================= */

.flash {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    border: 1px solid var(--border-soft);
    background-color: #000;
}

.flash-success {
    border-color: var(--accent-strong);
    color: #bbf7d0;
}

.flash-error {
    border-color: var(--accent-danger);
    color: #fecaca;
}

.flash-warning {
    border-color: var(--accent-warn);
    color: #fef3c7;
}

.flash-info {
    border-color: var(--accent-alt);
    color: #e0f2fe;
}

/* =========================
   BREADCRUMBS – prompt
   ========================= */

.breadcrumbs {
    margin-top: 4px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    background-color: #000;
    border: 1px solid var(--grid-line);
    font-size: 11px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    color: var(--text-main);
}

/* prompt po lewej */
.breadcrumbs::before {
    content: "mini@files:";
    color: var(--accent);
    margin-right: 4px;
}

.breadcrumbs a,
.breadcrumbs span {
    font-size: 11px;
    text-decoration: none;
    padding: 1px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.breadcrumbs a {
    color: var(--accent-alt);
}

.breadcrumbs a:hover {
    border-color: var(--accent-alt);
    background-color: var(--accent-soft);
}

.breadcrumbs span {
    color: var(--text-muted);
}

.breadcrumbs .sep {
    padding: 0;
    color: var(--text-dim);
}

/* link "⇧ Katalog wyżej" */
.panel a {
    color: var(--accent-alt);
}

/* =========================
   TREE (po lewej)
   ========================= */

.tree-root {
    list-style: none;
    margin: 6px 0 0 0;
    padding: 4px 4px 4px 4px;
    max-height: 210px;
    overflow: auto;
    border-radius: var(--radius-sm);
    background-color: #000;
    border: 1px solid var(--grid-line);
    font-size: 11px;
}

.tree-sub {
    list-style: none;
    margin: 2px 0 0 8px;
    padding: 0;
}

.tree-node {
    margin: 0;
}

.tree-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 3px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
}

.tree-link:hover {
    background-color: rgba(15, 23, 42, 0.9);
}

.tree-link-active {
    background-color: var(--accent-soft);
    color: var(--accent-alt);
}

.tree-bullet {
    font-size: 10px;
    color: var(--accent-strong);
}

.tree-label {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tree-empty {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

/* =========================
   UPLOAD BOX
   ========================= */

.upload-box {
    margin-top: 8px;
    padding: 6px 7px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--grid-line);
    background-color: #000;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-box label {
    color: var(--text-muted);
}

.upload-box input[type="file"] {
    width: 100%;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 3px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
}

/* przycisk w input[type=file] */
.upload-box input[type="file"]::file-selector-button,
.upload-box input[type="file"]::-webkit-file-upload-button {
    margin-right: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background-color: #000;
    color: var(--accent-alt);
    cursor: pointer;
}

/* progress */

.upload-progress {
    display: none;
    margin-top: 4px;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.upload-progress-bar-wrap {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background-color: #020617;
    border: 1px solid var(--grid-line);
    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background-image: linear-gradient(90deg, var(--accent), var(--accent-alt));
    background-size: 200% 100%;
    animation: progress-move 800ms linear infinite;
}

.upload-progress-label {
    width: 40px;
    text-align: right;
}

/* upload progress meta (MB + MB/s) */
.upload-progress-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 220px;
    line-height: 1.1;
}

.upload-progress-info .upload-progress-label {
    width: auto;
}

.upload-progress-sub {
    font-size: 0.78em;
    opacity: 0.9;
    white-space: nowrap;
}


@keyframes progress-move {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

/* =========================
   CREATE BOX (nowe foldery/pliki)
   ========================= */

.create-box {
    margin-top: 8px;
    padding: 6px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.create-inline {
    display: flex;
    gap: 4px;
    align-items: center;
}

.create-inline input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 3px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* =========================
   FILE PANEL (prawa strona)
   ========================= */

.file-panel {
    min-height: 0;
}

.file-panel-header {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: space-between;
}

/* search */

.search-form {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.search-form input[type="text"] {
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* search info */

.search-info {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

/* bulk actions */

.bulk-actions {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

/* lewa część paska – istniejące akcje grupowe */
.bulk-actions-left {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* prawa część – nowe elementy */
.new-items-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto; /* dociśnięcie do prawej */
    flex-wrap: wrap;
}

.new-items-label {
    font-size: 11px;
    color: var(--text-muted);
}

/* formularze tworzenia w trybie „kompaktowym” na pasku */
.new-item-form input[type="text"] {
    flex: 1;
    min-width: 0;
    max-width: 150px;
    padding: 2px 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-size: 11px;
}

.new-item-form button {
    padding: 2px 7px;
}

/* na węższych ekranach – odpuszczamy margines auto, żeby wszystko schodziło w dół */
@media (max-width: 900px) {
    .new-items-inline {
        margin-left: 0;
    }
}

/* =========================
   FILE TABLE
   ========================= */

.file-list {
    margin-top: 6px;
    flex: 1;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    overflow: auto;
}

table.files {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

table.files thead {
    position: sticky;
    top: 0;
    background-color: #020617;
    z-index: 1;
}

table.files th,
table.files td {
    padding: 4px 6px;
    white-space: nowrap;
}

table.files th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 10px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--grid-line);
}

.sel-header,
.sel-cell {
    width: 22px;
    text-align: center;
}

/* wiersze */

table.files tbody tr.file-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

table.files tbody tr:nth-child(odd) {
    background-color: #020617;
}
table.files tbody tr:nth-child(even) {
    background-color: #000;
}

table.files tbody tr.file-row:hover {
    background-color: rgba(15, 23, 42, 0.95);
}

table.files tbody tr.file-row.is-active {
    background-color: var(--accent-soft);
}

/* komórka z nazwą */

td.name-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-name {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .file-name {
        max-width: 180px;
    }
}

/* ikony i chipy */

.file-icon {
    width: 18px;
    height: 14px;
    border-radius: 0;
    border: 1px solid var(--grid-line);
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--accent);
}

.file-icon::before {
    content: "F";
}
.icon-folder::before {
    content: "D";
}
.icon-image::before {
    content: "IMG";
    font-size: 8px;
}
.icon-audio::before {
    content: "AUD";
    font-size: 8px;
}
.icon-video::before {
    content: "VID";
    font-size: 8px;
}
.icon-archive::before {
    content: "ARC";
    font-size: 8px;
}
.icon-code::before {
    content: "</>";
    font-size: 8px;
}
.icon-text::before {
    content: "TXT";
    font-size: 8px;
}

.file-chip {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    color: var(--text-muted);
}

.file-chip.dir {
    border-color: var(--accent-strong);
    color: var(--accent);
}

.file-chip.img {
    border-color: var(--accent-alt);
    color: var(--accent-alt);
}

/* przycisk z trzema kropkami */

.actions-cell {
    width: 26px;
    text-align: right;
}

.row-menu-btn {
    width: 20px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

/* podświetlenie listy przy zaznaczeniu */

.file-list.pulse-once {
    box-shadow: 0 0 0 1px var(--accent-soft);
}

/* =========================
   BUTTONY
   ========================= */

button {
    font-family: var(--font-mono);
    font-size: 11px;
}

.btn-primary,
.upload-box button,
.inline-edit-form button,
.login-form button,
.search-form button,
.create-inline button,
.bulk-actions button,
.createUploadLinkBtn,
.upload-shell button {
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background-color: #000;
    color: var(--accent-alt);
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
}

.btn-primary:hover,
.upload-box button:hover,
.inline-edit-form button:hover,
.login-form button:hover,
.search-form button:hover,
.create-inline button:hover,
.bulk-actions button:hover,
.createUploadLinkBtn:hover,
.upload-shell button:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent-alt);
    color: var(--text-main);
}

.btn-ghost,
.btn-ghost-accent {
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    color: var(--text-main);
    cursor: pointer;
    font-size: 11px;
}

.btn-ghost-accent {
    border-color: var(--border-soft);
    color: var(--accent-alt);
}

.btn-ghost-accent.copied {
    border-color: var(--accent-strong);
    color: var(--accent);
}

/* Settings / logout */

.settings-link {
    width: 22px;
    height: 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    color: var(--accent-alt);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
}

.logout-link {
    font-size: 11px;
    color: var(--accent-alt);
    text-decoration: none;
}

/* =========================
   CONTEXT MENU / HOVER CARD
   ========================= */

.context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 160px;
    background-color: #000;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    box-shadow:
        0 0 0 1px #000,
        0 16px 30px rgba(0, 0, 0, 0.9);
    padding: 2px 0;
    font-size: 11px;
    display: none;
}

.context-menu button {
    width: 100%;
    padding: 3px 8px;
    border: 0;
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.context-menu button:hover {
    background-color: var(--accent-soft);
    color: var(--accent-alt);
}

.hover-card {
    position: fixed;
    z-index: 9998;
    min-width: 220px;
    max-width: 320px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background-color: #000;
    border: 1px solid var(--grid-line);
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition:
        opacity var(--transition-fast),
        transform var(--transition-fast);
}

.hover-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.hover-card-row {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

.hover-card-row span:last-child {
    color: var(--text-main);
}

/* =========================
   OVERLAY (long ops)
   ========================= */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
}

.overlay.visible {
    display: flex;
}

.overlay-inner {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background-color: #000;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.overlay-spinner {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid rgba(51, 65, 85, 0.8);
    border-top-color: var(--accent-alt);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   PREVIEW MODAL
   ========================= */

.preview-modal,
.settings-modal,
.mini-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8000;
}

.preview-modal.visible,
.settings-modal.visible,
.mini-modal.visible {
    display: flex;
}

.preview-modal-dialog,
.settings-modal-dialog {
    max-width: 900px;
    width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-soft);
}

.preview-modal-header,
.settings-modal-header,
.mini-modal-header {
    padding: 5px 8px;
    border-bottom: 1px solid var(--grid-line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.preview-modal-title,
.settings-modal-title,
.mini-modal-title {
    color: var(--accent-alt);
}

.preview-modal-meta {
    padding: 3px 8px 2px 8px;
    font-size: 10px;
    color: var(--text-muted);
}

.preview-modal-body {
    flex: 1;
    margin: 0 8px 8px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    overflow: auto;
    padding: 6px;
    font-size: 11px;
}

.preview-area {
    min-height: 80px;
}

/* media preview */

.preview-image {
    max-width: 100%;
    max-height: 360px;
    display: block;
}

.preview-video,
.preview-audio {
    width: 100%;
    border-radius: var(--radius-sm);
    background-color: #000;
}

.preview-toolbar {
    margin-top: 4px;
    font-size: 10px;
    text-align: right;
}

.preview-toolbar a {
    color: var(--accent-alt);
    text-decoration: none;
}

/* text editor */

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.edit-ext-badge {
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    padding: 1px 5px;
    font-size: 10px;
}

.edit-dirty-flag.dirty {
    color: var(--accent-warn);
}

.edit-box {
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #020617;
    max-height: 260px;
    overflow: auto;
    margin-bottom: 4px;
}

.inline-edit-form textarea {
    width: 100%;
    height: 220px;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 4px 5px;
    resize: none;
    outline: none;
}

/* media nav */

.media-nav {
    margin-top: 4px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

.media-nav-btn {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    color: var(--accent-alt);
    cursor: pointer;
}

/* mini modale share/upload */

.mini-modal-dialog {
    max-width: 420px;
    width: 94vw;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    font-size: 11px;
}

.mini-modal-body {
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-modal-body input[type="number"],
.mini-modal-body input[type="text"] {
    width: 100%;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

.mini-modal-footer {
    padding: 4px 8px 6px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.mini-result {
    margin-top: 4px;
    border-top: 1px solid var(--grid-line);
    padding-top: 4px;
}

/* =========================
   SETTINGS PANEL (w modalu)
   ========================= */

.settings-grid {
    padding: 6px 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    font-size: 11px;
}
/* Allow one <form> to span multiple settings cards inside the grid */
.settings-grid-form { display: contents; }



.settings-block {
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: #000;
    padding: 6px;
}

.settings-block h3 {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: var(--accent-alt);
}

.settings-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.settings-row label {
    font-size: 11px;
    color: var(--text-muted);
}

.settings-row input,
.settings-row select {
    flex: 1;
    min-width: 0;
    padding: 2px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

/* disk bar */

.disk-bar {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    border: 1px solid var(--grid-line);
    background-color: #020617;
    overflow: hidden;
}

.disk-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background-image: linear-gradient(90deg, var(--accent), var(--accent-alt));
    transition: width 200ms ease-out;
}

.disk-bar-label {
    margin-top: 2px;
    font-size: 10px;
    text-align: right;
    color: var(--text-muted);
}

/* =========================
   LOGIN PAGE / UPLOAD-ONLY
   ========================= */

body.login-page,
body.upload-page {
    align-items: center;
}

.login-shell,
.upload-shell {
    max-width: 420px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-title h1,
.upload-shell h1 {
    margin: 0;
    font-size: 15px;
    color: var(--accent);
}

.login-title span,
.upload-shell p {
    font-size: 11px;
    color: var(--text-muted);
}

.login-form,
.upload-shell form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-form label {
    font-size: 11px;
    color: var(--text-muted);
}

.login-form input,
.upload-shell input[type="file"] {
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--grid-line);
    background-color: var(--bg-input);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 11px;
}

.login-error,
.upload-shell .msg-err,
.upload-shell .msg-ok {
    margin-top: 4px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.login-error,
.upload-shell .msg-err {
    border: 1px solid var(--accent-danger);
    color: #fecaca;
}

.upload-shell .msg-ok {
    border: 1px solid var(--accent-strong);
    color: #bbf7d0;
}

.upload-shell .foot {
    margin-top: 4px;
    font-size: 10px;
    color: var(--text-muted);
}

/* =========================
   LINKS
   ========================= */

a {
    color: var(--accent-alt);
    text-decoration: none;
}

/* =========================
   REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}


/* =========================================
   LAYOUT: full-height shell + internal overflow
   (prevents whole-shell scrolling when file list grows)
   ========================================= */

body.main-app {
    height: 100vh;
    overflow: hidden;
}

.shell {
    height: 100%;
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.shell > .layout {
    flex: 1;
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.layout {
    min-height: 0;
    height: 100%;
}

.panel {
    min-height: 0;
}

.sidebar {
    min-height: 0;
    height: 100%;
    overflow: auto;
}

.file-panel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.file-panel .file-list {
    min-height: 0;
}

/* =========================
   FILE VIEW: LIST / TILES
   ========================= */

.view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.view-toggle-btn { padding: 2px 8px; }
.view-toggle-btn.is-active {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
}

.bulk-sep { opacity: 0.75; }

.tiles-selectall {
    display: none;
    align-items: center;
    gap: 6px;
    user-select: none;
}
body.view-tiles .tiles-selectall { display: inline-flex; }

.file-tiles {
    display: none;
    padding: 10px;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-content: start;
}
body.view-tiles table.files { display: none; }
body.view-tiles .file-tiles { display: grid; }

.file-tile {
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid var(--grid-line);
    background: var(--bg-elevated);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 88px;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast);
}
.file-tile:hover {
    border-color: var(--border-soft);
    box-shadow: 0 10px 22px rgba(0,0,0,0.45);
    transform: translateY(-1px);
}
.file-tile.is-active {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.tile-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tile-main { display:flex; align-items:center; gap:10px; min-width:0; }
.tile-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:700; }
.tile-meta { display:flex; justify-content:space-between; gap:10px; font-size:0.86rem; color: var(--text-muted); }

