*{box-sizing:border-box}
:root{font-family:Inter,system-ui,Arial,sans-serif;color:#e9eef7;background:#0b1020}
body{margin:0;background:#0b1020;color:#e9eef7}
a{color:#8ab4ff;text-decoration:none}
.auth-body{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-card,.card,.panel-form{background:#141b2d;border:1px solid #25304b;border-radius:16px;box-shadow:0 16px 50px rgba(0,0,0,.22)}
.auth-card{width:min(420px,100%);padding:32px}
.auth-card h1{margin:0 0 6px}.auth-card p{color:#9ba8bd;margin-top:0}
label{display:block;margin:16px 0 7px;color:#c9d3e4}
input,select{width:100%;padding:12px 13px;border:1px solid #33415f;background:#0e1525;color:#fff;border-radius:10px}
button,.button-link{display:inline-block;border:0;border-radius:10px;background:#5d8cff;color:#fff;padding:12px 16px;font-weight:700;cursor:pointer}
.auth-card button,.panel-form button{width:100%;margin-top:20px}
.topbar{min-height:64px;padding:0 28px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #222d47;background:#11182a}
.topbar div{display:flex;gap:10px;align-items:center}.topbar span{color:#8491a8;font-size:.9rem}
.topbar nav{display:flex;gap:18px}
.container{max-width:1120px;margin:auto;padding:34px 22px}.narrow{max-width:720px}
.page-head,.card-row{display:flex;justify-content:space-between;align-items:center;gap:20px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px}
.card{padding:20px}.card h3{margin-top:0}.card p{color:#b7c2d4}
.status{padding:5px 9px;border-radius:999px;background:#26324d;font-size:.8rem}
.status.online{background:#173f2c;color:#86efac}.status.erro{background:#4a1f27;color:#fca5a5}.status.criando{background:#453816;color:#fde68a}
.panel-form{padding:24px}.inline{display:flex;align-items:center;gap:10px}.inline span{white-space:nowrap;color:#9aa6ba}
.alert,.success{padding:12px 14px;border-radius:10px;margin:14px 0}.alert{background:#4a1f27;color:#ffd1d1}.success{background:#173f2c;color:#bbf7d0}
@media(max-width:640px){.topbar{padding:15px;display:block}.topbar nav{margin-top:12px;flex-wrap:wrap}.page-head{align-items:flex-start;flex-direction:column}.inline{display:block}.inline span{display:block;margin-top:7px}}

.actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.actions form{margin:0}
.btn{display:inline-block;border:0;border-radius:9px;background:#5d8cff;color:#fff;padding:9px 12px;font-weight:700;cursor:pointer}
.btn.small{font-size:.86rem}
.btn.secondary{background:#26324d}
.btn.warning{background:#805d12}
.btn.danger{background:#7f1d1d}
.logbox{background:#080c16;border:1px solid #27314a;border-radius:12px;padding:18px;overflow:auto;min-height:340px;white-space:pre-wrap;color:#cbd5e1}
.status.parado{background:#3b3048;color:#ddd6fe}

.file-layout{display:grid;grid-template-columns:260px 1fr;gap:18px}
.file-list{max-height:70vh;overflow:auto}
.file-list a{display:block;padding:7px 0;border-bottom:1px solid #26324d;word-break:break-all}
.editor{width:100%;min-height:62vh;background:#080c16;color:#dbeafe;border:1px solid #33415f;border-radius:10px;padding:14px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;resize:vertical}
.metric-box{font-size:.9rem;color:#b7c2d4;margin:10px 0;padding:8px 10px;background:#0f1728;border-radius:9px}
.checkline{display:flex;gap:10px;align-items:center;margin-top:18px}.checkline input{width:auto}
.muted{color:#8996aa}
@media(max-width:760px){.file-layout{grid-template-columns:1fr}}

.tools-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:14px;margin:18px 0}
.mini-form h3{margin-top:0}
.mini-form input[type=file]{margin-top:10px}
.file-row{display:flex;align-items:center;gap:10px;border-bottom:1px solid #26324d}
.file-row>a:first-child{flex:1;border:0}
.download-link{font-size:1.1rem;padding:6px 8px}
.env-editor{min-height:45vh}
.backup-row{padding:9px 0;border-bottom:1px solid #26324d;word-break:break-all}
/* ===== HOMEELAB UI MELHORIAS ===== */

.card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
}

.actions form {
    margin: 0;
    width: 100%;
}

.actions .btn,
.actions button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 12px;
    border-radius: 10px;
}

.actions a.btn {
    box-sizing: border-box;
}

.editor {
    width: 100%;
    min-height: calc(100vh - 260px);
    height: calc(100vh - 260px);
    resize: vertical;

    background: #080c16;
    color: #e5edf8;

    border: 1px solid #33415f;
    border-radius: 12px;

    padding: 16px;

    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 14px;
    line-height: 1.55;

    tab-size: 4;
}

.file-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    align-items: stretch;
}

.file-layout > section.card {
    min-width: 0;
}

.file-list {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
}

.file-row {
    min-height: 40px;
}

.file-row > a:first-child {
    padding: 10px 5px;
}

.download-link {
    min-width: 36px;
    text-align: center;
}

@media (min-width: 1000px) {
    .actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .actions {
        grid-template-columns: 1fr 1fr;
    }

    .file-layout {
        grid-template-columns: 1fr;
    }

    .editor {
        min-height: 65vh;
        height: 65vh;
    }
}

@media (max-width: 420px) {
    .actions {
        grid-template-columns: 1fr;
    }
}
