/* BitGuard Files - BitGuard Security brand (see CLAUDE.md, "Branding"). */
:root {
    --brand: #041c47;        /* primary: navy */
    --brand-dark: #020f27;   /* darker navy for hover/pressed */
    --accent: #14367c;       /* secondary: royal blue (the "BIT" in the logo) */
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1d2433;
    --muted: #5f6b7a;
    --danger: #c92a2a;
    --ok: #2b8a3e;
    --border: #d9dee7;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
/* ---- Layout: navy sidebar on the left, content on the right ---- */
.with-sidebar { display: flex; min-height: 100vh; }
.sidebar { width: 240px; flex-shrink: 0; background: var(--brand); color: #fff;
           position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-head { padding: 1.25rem 1.25rem .5rem; display: flex; align-items: center; justify-content: space-between; }
.brand { display: block; }
.brand img { display: block; height: 40px; width: auto; }
.sidebar-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.app-name { padding: 0 1.25rem 1rem; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.side-nav { flex: 1; overflow-y: auto; padding: .25rem .75rem; }
.nav-section { margin: 1rem .5rem .35rem; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .55; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; margin: .1rem 0; border-radius: 6px;
              color: rgba(255,255,255,.85); text-decoration: none; }
.side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-nav a.active { background: var(--accent); color: #fff; font-weight: 600; }
.side-nav svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8;
                stroke-linecap: round; stroke-linejoin: round; }
.side-footer { padding: 1rem 1.25rem 1.25rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .9rem; }
.side-footer .who { opacity: .85; margin-bottom: .35rem; word-break: break-word; }
.side-footer .link { color: #fff; opacity: .85; text-decoration: underline; font: inherit; cursor: pointer; }
.side-footer .link:hover { opacity: 1; background: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1100px; margin: 2rem auto; padding: 0 1.5rem; flex: 1; }
.no-sidebar main { max-width: 1100px; margin-top: 3rem; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; }

/* Menu toggle: only on small screens (CSS-only, no JavaScript). */
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-toggle-label { display: none; cursor: pointer; border: 1px solid rgba(255,255,255,.4); border-radius: 6px;
                    padding: .3rem .7rem; font-size: .9rem; }
@media (max-width: 800px) {
    .with-sidebar { display: block; }
    .sidebar { width: auto; height: auto; position: static; }
    .sidebar-head { padding: .75rem 1rem; }
    .brand img { height: 32px; }
    .nav-toggle-label { display: inline-block; }
    .sidebar-body { display: none; }
    .nav-toggle:checked + .sidebar-body { display: flex; }
    .nav-toggle:focus-visible ~ .sidebar-body, .nav-toggle:focus-visible + .sidebar-body { outline: 2px solid #fff; }
    main { margin-top: 1.25rem; padding: 0 1rem; }
}
h1 { font-size: 1.5rem; margin-top: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; }
.narrow { max-width: 440px; margin: 0 auto; }
label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
input[type=text], input[type=email], input[type=password], select {
    width: 100%; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
button, .button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px;
    padding: .55rem 1rem; font: inherit; cursor: pointer; margin-top: 1rem; text-decoration: none; }
button:hover, .button:hover { background: var(--brand-dark); }
button.secondary { background: #e9ecf2; color: var(--text); }
button.danger { background: var(--danger); }
button.small { padding: .3rem .6rem; margin: .1rem; font-size: .85rem; }
button.link { background: none; padding: 0; margin: 0; }
form.inline { display: inline; }
.error, .validation-summary-errors { color: var(--danger); }
.field-validation-error { color: var(--danger); font-size: .9rem; }
.notice { background: #e7f5ff; border: 1px solid #a5d8ff; border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1rem; }
.notice.ok { background: #ebfbee; border-color: #b2f2bb; }
.notice.bad { background: #fff5f5; border-color: #ffc9c9; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.1rem; background: #f1f3f5;
          padding: .4rem .6rem; border-radius: 4px; user-select: all; word-break: break-all; }
.codes { columns: 2; font-family: ui-monospace, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.qr { display: block; width: 220px; height: 220px; image-rendering: pixelated; margin: 1rem 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #eef1f6; font-size: .9rem; }
.tag { display: inline-block; padding: .1rem .45rem; border-radius: 4px; font-size: .8rem; background: #e9ecf2; }
.tag.ok { background: #d3f9d8; } .tag.bad { background: #ffe3e3; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
textarea { width: 100%; padding: .55rem .65rem; border: 1px solid var(--border); border-radius: 6px;
           font: inherit; font-family: ui-monospace, Menlo, Consolas, monospace; }
label.check { font-weight: 400; display: flex; gap: .5rem; align-items: flex-start; }
label.check input { margin-top: .25rem; }
.small { font-size: .85rem; }
p.small { margin: .25rem 0 0; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 1.5rem; }
table.kv th { width: 140px; background: none; }
.danger-zone { border-color: #ffc9c9; }
.tree .folder::before { content: "\1F4C1  "; }
.tree .depth-2 { padding-left: 2rem; } .tree .depth-3 { padding-left: 3.5rem; } .tree .depth-4 { padding-left: 5rem; }
details summary { cursor: pointer; color: var(--accent); font-size: .85rem; }
.row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.row-form input[type=text] { width: auto; flex: 1; min-width: 140px; }
.row-form button { margin-top: 0; }
a { color: var(--accent); }
.login-logo { display: block; width: 280px; max-width: 80%; height: auto; margin: 0 auto 1.5rem; }
.tree .mount::before { content: "\2601  "; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 0 0 1rem; }
.toolbar .button { margin-top: 0; }
.toolbar a.active { font-weight: 700; text-decoration: none; color: var(--text); }
a.button.secondary { background: #e9ecf2; color: var(--text); }
a.button.small { padding: .3rem .7rem; font-size: .9rem; }
.tag.role-admin { background: var(--brand); color: #fff; }
.tag.role-web { background: #dbe4ff; }
.tag.role-ftp { background: #fff3bf; }

/* Admin > Folders: drag and drop (wwwroot/js/folders.js) */
.tree .folder.draggable { cursor: grab; }
.tree.dragging .folder.draggable { cursor: grabbing; }
.tree tr.drop-over td { background: color-mix(in srgb, var(--accent) 12%, transparent); outline: 2px dashed var(--accent); outline-offset: -2px; }
.tree details + details { margin-top: .25rem; }
label.check.small { font-size: .85rem; align-items: center; }

/* Admin > Folders: collapsible tree (wwwroot/js/folders.js) */
.tree tr.tree-hidden { display: none; }
.tree .twisty { background: none; border: 0; padding: 0 .3rem 0 0; margin: 0; width: 1.4rem; color: var(--text);
                font-size: .9rem; cursor: pointer; line-height: 1; }
.tree .twisty:hover, .tree .twisty:focus-visible { color: var(--accent); }
.tree .twisty-space { display: inline-block; width: 1.4rem; }
.tree .child-count { margin-left: .35rem; }
#tree-tools input[type=search] { width: auto; flex: 1; min-width: 180px; max-width: 360px; margin: 0; }
#tree-tools button { margin-top: 0; }
label.check.small input { margin-top: 0; }

/* Radio groups (e.g. a web user's access level) */
fieldset.choice { border: 1px solid var(--border); border-radius: 6px; padding: .5rem 1rem .75rem; margin: 1rem 0; }
fieldset.choice legend { font-weight: 600; padding: 0 .25rem; }

/* Files area */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 1rem; font-size: 1.05rem; }
.crumbs .sep { color: var(--muted); }
.files .folder::before { content: "\1F4C1  "; }
.files .mount::before { content: "\2601  "; }
.files .file::before { content: "\1F4C4  "; }
.files td { vertical-align: top; }
input[type=file] { margin: .5rem 0; }

/* Tabs (Audit log: Portal activity / FTP activity) */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin: 0 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem 1rem; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--accent); font-weight: 600; }

/* Files page: ▸ toggles that show a folder's contents inline (wwwroot/js/files.js) */
table.files .twisty { background: none; border: 0; padding: 0 .3rem 0 0; margin: 0; width: 1.4rem; color: var(--text);
                      font-size: .9rem; cursor: pointer; line-height: 1; }
table.files .twisty:hover, table.files .twisty:focus-visible { color: var(--accent); }
table.files .twisty-space { display: inline-block; width: 1.4rem; }
table.files tr.sub-row td { background: #fafbfc; }

/* Visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
input.narrow-num { width: 6rem; display: inline-block; margin: 0 .25rem; }

/* File explorer (2026-11-03): deeper levels, and file rows added when a folder is opened */
.tree .depth-5 { padding-left: 6.5rem; } .tree .depth-6 { padding-left: 8rem; } .tree .depth-7 { padding-left: 9.5rem; }
.tree .depth-8, .tree .depth-9, .tree .depth-10 { padding-left: 11rem; }
.tree tr.file-row td { background: #fafbfc; }
.tree tr.file-row a.file { color: var(--text); }
.tree details summary { cursor: pointer; }

/* Small filter links under a tab bar (Email > Log) */
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; font-size: .9rem; color: var(--muted); }
.filters a { text-decoration: none; }
.filters a.active { font-weight: 600; color: var(--brand); text-decoration: underline; }
