:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1e1e1e;
    --border: #2a2a2a;
    --orange: #f39c12;
    --purple: #5d5b8d;
    --text: #f0f0f0;
    --muted: #888;
    --danger: #e74c3c;
    --ok: #2ecc71;
    --warn: #f39c12;
    --radius: 10px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--orange);
    color: #000;
    font-weight: 800;
    border-radius: 6px;
    font-size: 1.1rem;
}

.brand-mark.lg {
    width: 56px;
    height: 56px;
    font-size: 1.8rem;
    border-radius: 10px;
}

.brand-text { color: var(--purple); }

.nav { display: flex; gap: 1rem; align-items: center; }
.nav a {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}
.nav a:hover, .nav a.active {
    color: var(--text);
    background: var(--surface-2);
    text-decoration: none;
}
.nav-logout { color: var(--muted) !important; }

.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--orange);
}

.stat-label { color: var(--muted); font-size: 0.85rem; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.8rem; color: var(--muted); }

.field input,
.field select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    min-width: 160px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-primary { background: var(--orange); color: #000; }
.btn-primary:hover { filter: brightness(1.1); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-block { width: 100%; }

.result-count { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.page-desc { color: var(--muted); margin-bottom: 1.5rem; }
.muted { color: var(--muted); font-size: 0.85rem; }

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.photo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.photo-thumb {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--surface-2);
}

.photo-thumb img,
.photo-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.photo-thumb:hover img,
.photo-thumb:hover video { transform: scale(1.03); }

.photo-thumb {
    position: relative;
}

.media-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--orange);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.photo-meta {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    font-size: 0.8rem;
}

.photo-meta strong { font-size: 0.85rem; }

.empty {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.empty p { margin-bottom: 0.5rem; }

.pagination {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    justify-content: center;
}

.pagination a {
    padding: 0.4rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
}

.pagination a.active {
    background: var(--orange);
    color: #000;
    border-color: var(--orange);
}

.table-wrap { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.data-table th {
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table code {
    font-size: 0.8rem;
    color: var(--purple);
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem;
}

.status-dot.ok { background: var(--ok); }
.status-dot.warn { background: var(--warn); }
.status-dot.offline { background: var(--danger); }

.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-brand h1 {
    color: var(--purple);
    font-size: 1.5rem;
    margin: 0.75rem 0 0.25rem;
}

.login-brand p { color: var(--muted); font-size: 0.9rem; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid var(--danger);
    color: #ff8a80;
}

@media (max-width: 600px) {
    .nav { gap: 0.5rem; }
    .nav a { font-size: 0.8rem; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
}
