﻿/* ============================ FILE MANAGER – TEMA NERO/GRIGIO ============================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100vh;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: #111;
    color: #ccc;
    display: flex;
    flex-direction: column;
}

a { color: #aaa; text-decoration: none; }
a:hover { color: #fff; text-decoration: underline; }

/* ===== HEADER ===== */
.hdr {
    background: linear-gradient(90deg, #111, #1a1a1a);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
    gap: 8px;
}
.hdr h1 { font-size: 1.3em; color: #eee; }
.hdr .right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ===== BREADCRUMB ===== */
.bcrumb {
    padding: 10px 24px;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    font-size: .9em;
    overflow-x: auto;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 50;
}
.bcrumb a { margin: 0 3px; }
.bcrumb .sep { color: #555; margin: 0 3px; }

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px 24px;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== MESSAGGI ===== */
.msg { padding: 10px 16px; margin: 12px 0; border-radius: 5px; font-weight: 500; }
.msg-success { background: #1a2a1a; color: #7c7; border-left: 3px solid #5a5; }
.msg-error { background: #2a1a1a; color: #e77; border-left: 3px solid #c55; }
.msg-info { background: #1a1a2a; color: #889; border-left: 3px solid #778; }

/* ===== AZIONI (Bottoni fissi in alto) ===== */
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; position: sticky; top: 0; background: #111; z-index: 10; }

/* ===== BOTTONI ===== */
.btn {
    padding: 7px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: .88em;
    font-weight: 500;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.btn-p { background: #333; color: #eee; }
.btn-p:hover { background: #444; }
.btn-s { background: #222; color: #bbb; border: 1px solid #333; }
.btn-s:hover { background: #333; color: #eee; }
.btn-d { background: #c0392b; color: #fff; }
.btn-d:hover { background: #a93226; }
.btn-g { background: #333; color: #ccc; border: 1px solid #444; }
.btn-g:hover { background: #444; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: .8em; }

/* ===== PANNELLI ===== */
.panel {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 18px;
    margin-top: 14px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}
.panel h3 { color: #ccc; margin-bottom: 12px; font-size: 1.05em; }

.panel-scroll {
    max-height: calc(100vh - 310px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 24px;
}
.panel-scroll::-webkit-scrollbar { width: 8px; }
.panel-scroll::-webkit-scrollbar-track { background: #111; border-radius: 4px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.panel-scroll::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== PATHBAR (nome cartella) ===== */
.pathbar {
    margin-bottom: 18px;
    padding: 8px 12px;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-size: .95em;
    overflow-x: auto;
    white-space: nowrap;
}
.pathbar .pth { color: #ddd; font-weight: 600; }
.pathbar a.pth { color: #9fc; text-decoration: none; }
.pathbar a.pth:hover { color: #fff; text-decoration: underline; }
.pathbar .sep { color: #555; margin: 0 4px; }

/* ===== TABELLA ===== */
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th {
    background: #222;
    color: #aaa;
    padding: 10px 12px;
    text-align: left;
    font-size: .78em;
    text-transform: uppercase;
    letter-spacing: .4px;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 2px 4px rgba(0,0,0,.4);
    white-space: nowrap;
    overflow: hidden;
}
.tbl td { padding: 4px 12px; border-bottom: 1px solid #222; font-size: .92em; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbl tr:hover td { background: #222; }
.tbl .nm a { color: #ccc; }
.tbl .nm a:hover { color: #fff; }
.tbl td.nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Larghezze colonne: Name è flessibile (rimasto), le altre fisse */
.tbl th.col-m:nth-of-type(2) { width: 80px; }   /* Size */
.tbl th.col-m:nth-of-type(3) { width: 155px; }  /* Modified */
.tbl th.col-a { width: 130px; }                 /* Actions */

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: .72em;
    font-weight: 600;
}
.badge-admin { background: #c0392b; color: #fff; }
.badge-writer { background: #555; color: #eee; }
.badge-reader { background: #777; color: #fff; }

/* ===== MODALI ===== */
.mol {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.mol.on { display: flex; }
.moc {
    background: #1a1a1a;
    padding: 28px;
    border-radius: 12px;
    width: 420px;
    max-width: 92vw;
    border: 1px solid #333;
}
.moc h3 { color: #ccc; margin-bottom: 16px; }
.moc input, .moc textarea {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border: 1px solid #333;
    background: #111;
    color: #ccc;
    border-radius: 5px;
    font-size: .95em;
}
.moc input:focus, .moc textarea:focus { outline: none; border-color: #555; }
.mbtns { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }

/* ===== VUOTO ===== */
.empty { text-align: center; padding: 40px; color: #555; }

/* ===== VISTA FILE (inline nel PHP) ===== */
.code-view {
    width: 100%;
    height: 400px;
    font-family: Consolas, monospace;
    font-size: .9em;
    padding: 10px;
    background: #111;
    color: #bbb;
    border: 1px solid #333;
    border-radius: 4px;
}
.code-pre {
    background: #111;
    color: #bbb;
    padding: 15px;
    overflow: auto;
    max-height: 500px;
    border-radius: 4px;
    font-size: .85em;
}
.img-view { max-width: 100%; border: 1px solid #333; border-radius: 4px; }

/* ===== LOGIN PAGE ===== */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.box {
    background: #1a1a1a;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    width: 360px;
    text-align: center;
    border: 1px solid #333;
}
.box h2 { color: #eee; margin-bottom: 20px; }
.box input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #333;
    background: #111;
    color: #ccc;
    border-radius: 6px;
    font-size: 1em;
}
.box input:focus { outline: none; border-color: #555; }
.box .btn-p { width: 100%; margin-top: 15px; padding: 12px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .hdr { flex-direction: column; text-align: center; }
    .container { padding: 10px 8px; }
    .panel { padding: 10px 8px; }
    .tbl th, .tbl td { padding: 4px 6px; font-size: .75em; }
    .tbl th.col-m:nth-of-type(2) { width: 55px; }   /* Size */
    .tbl th.col-m:nth-of-type(3) { width: 110px; }  /* Modified */
    .tbl th.col-a { width: 70px; }                  /* Actions */
    .tbl .btn-sm { padding: 3px 5px; font-size: .7em; }
    .pathbar { font-size: .85em; padding: 6px 8px; }
}
