* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    background: #f5f5f5;
    color: #222;
}

a { color: #1565c0; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1565c0;
    color: #fff;
    padding: 10px 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.topbar .brand {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}
.topbar .link-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
}
.topbar .link-btn:hover { text-decoration: underline; }

main { padding: 12px; }

/* Login page */
.login-card {
    max-width: 360px;
    margin: 60px auto;
    background: #fff;
    padding: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.login-card h1 { margin: 0 0 16px; font-size: 20px; text-align: center; }
.login-card label { display: block; margin: 12px 0 4px; }
.login-card input[type=text],
.login-card input[type=password] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}
.login-card .btn-primary {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: #1565c0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.login-card .btn-primary:hover { background: #0d47a1; }
.login-card .error {
    color: #c62828;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

/* Admin two-pane */
.admin-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 12px;
    height: calc(100vh - 80px);
}
.pane {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: auto;
    padding: 12px;
}
.pane h2 {
    margin: 0 0 8px;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

/* Tree */
.tree, .tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.tree ul { padding-right: 18px; }
.tree li { line-height: 1.8; }
.tree .node {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
}
.tree .node:hover { background: #e3f2fd; }
.tree .node.selected { background: #bbdefb; }
.tree .toggle {
    width: 12px;
    display: inline-block;
    text-align: center;
    color: #888;
}

/* File grid */
.toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.toolbar button, .toolbar .btn {
    background: #fff;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.toolbar button:hover { background: #f0f0f0; }
.toolbar .crumb { color: #555; margin-inline-start: 8px; }

table.files {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
table.files th, table.files td {
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    text-align: right;
}
table.files th {
    background: #fafafa;
    font-weight: 600;
    color: #555;
}
table.files th a { color: inherit; }
table.files tbody tr:hover { background: #f5faff; }
table.files .col-size, table.files .col-date { white-space: nowrap; }
table.files .col-actions { width: 80px; text-align: center; }
table.files .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
}

.empty { color: #888; padding: 16px; text-align: center; }
.flash { padding: 8px 12px; border-radius: 4px; margin-bottom: 8px; }
.flash.ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.flash.err { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
