/*
 * Dysk – kolumny w stylu menedzera plikow: klik w folder otwiera jego
 * zawartosc w kolumnie obok, a nie zamiast biezacej. Dzieki temu widac cala
 * sciezke naraz i nie trzeba osobnego paska nawigacji.
 *
 * Paleta i promienie te same, co w mail.css – to ta sama aplikacja.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: "Inter", sans-serif;
    color: #000000;
    background: #ffffff;
    overflow: hidden;
}

.app { display: flex; flex-direction: column; height: 100vh; background: #ffffff; }

/* ═══════════════ pasek gorny ═══════════════ */
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid #5164BE33;
    flex-shrink: 0;
}
.topbar a.back { font-size: 12px; color: #000000; text-decoration: none; }
.topbar a.back:hover { text-decoration: underline; }
.topbar .title { font-size: 14px; font-weight: 600; }
.topbar .spacer { flex: 1; }

/* Zajetosc konta */
.usage { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #000000; }
.usage-bar {
    width: 120px; height: 6px; border-radius: 3px;
    background: #e8ecf8; border: 1px solid #5164BE44; overflow: hidden;
}
.usage-fill { height: 100%; background: #5164BE; width: 0; transition: width .2s; }
.usage.pelny .usage-fill { background: #c0392b; }

/* ═══════════════ kolumny ═══════════════ */
.columns {
    flex: 1; display: flex; overflow-x: auto; overflow-y: hidden;
}
.columns::-webkit-scrollbar { height: 6px; }
.columns::-webkit-scrollbar-thumb { background: #dce0f0; border-radius: 3px; }

.column {
    width: 270px; flex-shrink: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid #5164BE33;
}

.col-header {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 8px 8px 12px;
    border-bottom: 1px solid #5164BE22;
    flex-shrink: 0;
}
.col-name {
    flex: 1; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .7px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.col-btn {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; flex-shrink: 0;
    background: none; border: 1px solid #5164BE44; border-radius: 7px;
    color: #000000; cursor: pointer; font-family: inherit;
    transition: background .15s;
}
.col-btn:hover { background: #f0f2fa; }
.col-btn:disabled { opacity: .4; cursor: default; }

/* Formularz nowego folderu – rozwija sie pod naglowkiem kolumny */
.newdir { display: none; padding: 8px 10px; border-bottom: 1px solid #5164BE22; }
.newdir.open { display: block; }
.newdir input {
    width: 100%; background: #f5f5f5; border: 1px solid #5164BE44;
    border-radius: 8px; padding: 7px 9px; font-size: 12px;
    font-family: inherit; color: #000000; outline: none;
}
.newdir input:focus { border-color: #5164BE; }
.newdir .row { display: flex; gap: 6px; margin-top: 6px; }
.newdir button {
    flex: 1; padding: 6px; font-size: 11px; font-family: inherit;
    border: 1px solid #5164BE66; border-radius: 8px; cursor: pointer;
    background: #e8ecf8; color: #000000;
}
.newdir button.cancel { background: none; }
.newdir button:hover { background: #dce0f0; }

.col-rows { flex: 1; overflow-y: auto; }
.col-rows::-webkit-scrollbar { width: 4px; }
.col-rows::-webkit-scrollbar-thumb { background: #dce0f0; border-radius: 3px; }

.row-node {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px 7px 12px; cursor: pointer;
    border-bottom: 1px solid #5164BE15;
    transition: background .12s;
}
.row-node:hover { background: #f0f2fa; }
.row-node.active { background: #dce0f0; }
.row-node.open   { background: #e8ecf8; }

.row-icon { flex-shrink: 0; display: flex; color: #5164BE; }
.row-name {
    flex: 1; font-size: 13px; color: #000000;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-size { font-size: 10.5px; color: #555555; flex-shrink: 0; }
.row-arrow { font-size: 11px; color: #5164BE; flex-shrink: 0; }

/* Akcje pojedynczego wiersza – widoczne po najechaniu albo zaznaczeniu */
.row-acts { display: none; gap: 4px; flex-shrink: 0; }
.row-node:hover .row-acts, .row-node.active .row-acts { display: flex; }
.row-act {
    background: none; border: none; cursor: pointer; padding: 2px;
    color: #000000; display: flex; font-family: inherit;
}
.row-act:hover { color: #c0392b; }
.row-act.dl:hover { color: #5164BE; }

.col-empty { padding: 14px 12px; font-size: 12px; color: #555555; }
.col-load  { padding: 14px 12px; font-size: 12px; color: #555555; }

/* ═══════════════ komunikaty ═══════════════ */
.toast {
    position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
    background: #ffffff; border: 1px solid #5164BE; border-radius: 10px;
    padding: 9px 16px; font-size: 12.5px; color: #000000;
    box-shadow: 0 4px 14px rgba(0,0,0,.12);
    opacity: 0; pointer-events: none; transition: opacity .2s;
    max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; }

/* Pasek postepu wysylki */
.progress {
    position: fixed; left: 0; top: 0; height: 3px; width: 0;
    background: #5164BE; transition: width .15s; z-index: 50;
}

/* ═══════════════ okno potwierdzenia ═══════════════ */
.confirm-overlay {
    display: none; position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,.25); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; padding: 20px;
}
.confirm-overlay.show { display: flex; }
.confirm-box {
    background: #ffffff; border: 1px solid #5164BE; border-radius: 14px;
    padding: 22px; width: 100%; max-width: 380px;
}
.confirm-box h2 { font-size: 15px; margin-bottom: 8px; font-weight: 600; }
.confirm-box p { font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
.confirm-row { display: flex; gap: 8px; }
.confirm-row button {
    flex: 1; padding: 9px; border-radius: 9px; font-size: 13px;
    font-family: inherit; cursor: pointer; border: 1px solid #5164BE66;
    background: #e8ecf8; color: #000000;
}
.confirm-row button.danger { background: #ffecec; border-color: #ff7070; }
.confirm-row button:hover { filter: brightness(.97); }

/* ═══════════════ ekran kluczy (jak w poczcie) ═══════════════ */
.gate {
    position: fixed; inset: 0; z-index: 999; display: none;
    align-items: center; justify-content: center;
    background: #ffffff; padding: 24px; overflow-y: auto;
}
.gate.show { display: flex; }
.gate-box {
    width: 100%; max-width: 460px; background: #ffffff;
    border: 1px solid #cccccc; border-radius: 14px; padding: 28px;
}
.gate-lock { font-size: 26px; margin-bottom: 10px; }
.gate-box h1 { font-size: 19px; margin: 0 0 8px; font-weight: 600; }
.gate-box p  { font-size: 13.5px; line-height: 1.6; margin: 0 0 16px; }
.gate-btn {
    width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 8px;
    background: #e8ecf8; color: #000000; font-size: 14px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}

/* ═══════════════ telefon ═══════════════ */
@media (max-width: 844px) {
    .column { width: 82vw; }
    .usage-bar { width: 70px; }
    .topbar .title { display: none; }
}
