:root {
    --ink: #142033;
    --muted: #5c6b80;
    --line: #d9e1ea;
    --bg: #eef2f6;
    --sidebar: #102033;
    --sidebar-text: #d5deea;
    --accent: #0f766e;
    --ok: #157347;
    --warn: #9a6700;
    --bad: #b42318;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

a {
    color: var(--accent);
}

.app-shell {
    min-height: 100vh;
}

.sidebar,
.offcanvas.sidebar-panel {
    background: var(--sidebar);
    color: var(--sidebar-text);
    width: 248px;
}

@media (min-width: 992px) {
    .app-shell {
        display: flex;
    }

    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        flex: 0 0 248px;
        display: flex;
        flex-direction: column;
    }

    .app-main {
        flex: 1;
        min-width: 0;
    }
}

.brand {
    padding: 1.25rem 1.25rem 1rem;
}

.brand strong {
    display: block;
    color: #fff;
    font-size: 1.05rem;
    letter-spacing: 0.01em;
}

.brand span {
    color: #93a4b8;
    font-size: 0.8rem;
}

.nav-scroll {
    flex: 1;
}

.nav-link-app,
.logout-form button {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    color: var(--sidebar-text);
    text-decoration: none;
    background: transparent;
    border: 0;
    border-left: 3px solid transparent;
    padding: 0.68rem 1.15rem;
    text-align: left;
}

.nav-link-app:hover,
.nav-link-app.is-active,
.logout-form button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-link-app.is-active {
    border-left-color: #14b8a6;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
}

.content {
    padding: 0 1.25rem 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.15rem;
}

.page-header h1 {
    font-size: 1.55rem;
    margin: 0;
}

.stat-card,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.stat-card {
    padding: 1rem 1.1rem;
    height: 100%;
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 650;
    margin: 0.15rem 0 0;
    line-height: 1.1;
}

.panel-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
}

.panel-body {
    padding: 1rem;
}

.table thead th {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 650;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: currentColor;
}

.status-connected,
.status-active {
    color: var(--ok);
    background: #e8f6ee;
}

.status-offline,
.status-unknown,
.status-disabled {
    color: #475569;
    background: #eef2f6;
}

.status-missing {
    color: var(--warn);
    background: #fff6e5;
}

.status-revoked {
    color: var(--bad);
    background: #fdecec;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: #e7f4f2;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.guest-wrap,
.error-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.guest-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.5rem;
}

.qr-frame {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.75rem;
    display: inline-block;
}

.qr-frame svg {
    display: block;
    width: min(280px, 70vw);
    height: auto;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.82rem;
    word-break: break-all;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-accent:hover {
    background: #115e59;
    border-color: #115e59;
    color: #fff;
}
