:root {
    --topbar-h: 48px;
    --sidebar-w: 210px;
    --bg: #f1f5f9;
    --panel: #1e293b;
    --panel-hover: #334155;
    --accent: #38bdf8;
    --text: #0f172a;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
}

/* Horní lišta */
.topbar {
    height: var(--topbar-h);
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar .brand { font-weight: 700; font-size: 1.1rem; letter-spacing: .3px; }
.topbar .clock { font-variant-numeric: tabular-nums; color: #cbd5e1; }

/* Rozvržení pod lištou */
.layout {
    display: flex;
    min-height: calc(100vh - var(--topbar-h));
}

/* Levý panel */
.sidebar {
    width: var(--sidebar-w);
    background: var(--panel);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
}
.sidebar ul { list-style: none; margin: 0; padding: .5rem 0; flex: 1; }
.sidebar a {
    display: block;
    padding: .65rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--panel-hover); color: #fff; }
.sidebar a.active {
    background: var(--panel-hover);
    color: #fff;
    border-left-color: var(--accent);
    font-weight: 600;
}
.sidebar-footer {
    padding: .75rem 1rem;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
}
.sidebar-footer .user { color: #94a3b8; }
.sidebar-footer .logout { color: var(--accent); text-decoration: none; }
.sidebar-footer .logout:hover { text-decoration: underline; }

/* Viewport */
.viewport { flex: 1; padding: 1.5rem 2rem; }
.viewport h1 { margin-top: 0; }
.placeholder { color: #64748b; }

/* Rozcestník – dlaždice */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.tile {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tile:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
    transform: translateY(-2px);
    border-color: var(--accent);
}
.tile-icon { font-size: 1.8rem; }
.tile-name { font-weight: 600; }
.tile-desc { color: #64748b; font-size: .85rem; }

/* Stav sítě – topologický diagram (SVG) */
.diagram-wrap { overflow-x: auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: .5rem; }
.netdiagram { display: block; width: 100%; height: auto; max-width: 760px; margin: 0 auto; }

.netdiagram .edge { stroke: #94a3b8; stroke-width: 2; }

.netdiagram .dnode rect { fill: #fff; stroke: #cbd5e1; stroke-width: 2; }
.netdiagram .dnode .label { fill: #0f172a; font: 600 13px system-ui, sans-serif; text-anchor: middle; }
.netdiagram .dnode .dot { stroke: #fff; stroke-width: 2; }

.netdiagram .dnode-ok rect { stroke: #22c55e; }
.netdiagram .dnode-ok .dot { fill: #22c55e; }
.netdiagram .dnode-warn rect { stroke: #eab308; }
.netdiagram .dnode-warn .dot { fill: #eab308; }
.netdiagram .dnode-offline rect { stroke: #ef4444; }
.netdiagram .dnode-offline .dot { fill: #ef4444; }

/* Statický prvek (switch) – zvýrazněný tmavý blok */
.netdiagram .dnode-static rect { fill: #1e293b; stroke: #0f172a; }
.netdiagram .dnode-static .label { fill: #fff; }

.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1rem; color: #64748b; font-size: .85rem; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend .chip { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .chip-ok { background: #22c55e; }
.legend .chip-warn { background: #eab308; }
.legend .chip-offline { background: #ef4444; }
.legend .chip-static { background: #1e293b; }

/* Prohlížeč souborů */
.browser-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.zip-folder {
    color: var(--accent);
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    border: 1px solid var(--accent);
    padding: .4rem .8rem;
    border-radius: 6px;
    white-space: nowrap;
}
.zip-folder:hover { background: var(--accent); color: #04263a; }

.breadcrumbs { margin-bottom: 1rem; color: #64748b; font-size: .95rem; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 .4rem; color: #94a3b8; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

.filelist { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.filelist th, .filelist td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid #eef2f7; }
.filelist th { background: #f8fafc; color: #64748b; font-weight: 600; font-size: .85rem; }
.filelist tr:last-child td { border-bottom: 0; }
.filelist tr:hover td { background: #f8fafc; }
.filelist a { color: var(--text); text-decoration: none; }
.filelist a:hover { color: var(--accent); }
.filelist .file { color: #475569; }
.col-size { width: 120px; color: #64748b; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-action { width: 110px; text-align: right; }
.filelist a.download {
    color: var(--accent);
    font-weight: 600;
    font-size: .85rem;
    border: 1px solid var(--accent);
    padding: .2rem .6rem;
    border-radius: 5px;
}
.filelist a.download:hover { background: var(--accent); color: #04263a; }

/* Přihlašovací stránka */
.login-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    background: #0f172a;
}
.login-card {
    background: #1e293b;
    color: #e2e8f0;
    padding: 2rem;
    border-radius: 12px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.login-card h1 { margin: 0; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; }
.login-card input {
    padding: .55rem .7rem;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 1rem;
}
.login-card button {
    padding: .6rem;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #04263a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
}
.login-card button:hover { filter: brightness(1.08); }
.login-card .error { color: #f87171; margin: 0; text-align: center; font-size: .9rem; }
