:root {
    --ink: #17202a;
    --muted: #6b7280;
    --line: #d9e2ec;
    --soft: #f4f7fb;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --danger: #b42318;
    --warning: #b7791f;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: #eef3f7;
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    background: #14213d;
    color: #fff;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 22px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,.16);
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: #fca311;
    color: #111827;
    font-weight: 800;
}

.brand small {
    display: block;
    color: rgba(255,255,255,.7);
}

.sidebar .nav-link {
    min-height: 42px;
    border-radius: 8px;
    color: rgba(255,255,255,.78);
    font-weight: 600;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.logout-link {
    position: absolute;
    bottom: 24px;
    left: 18px;
    right: 18px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
}

.content {
    min-width: 0;
    padding: 26px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.topbar h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 800;
}

.topbar p {
    margin: 3px 0 0;
    color: var(--muted);
}

.user-pill,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    font-weight: 700;
    white-space: nowrap;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.cue-module-frame {
    height: calc(100vh - 150px);
    min-height: 680px;
    overflow: hidden;
}

.cue-module-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.metric {
    min-height: 118px;
}

.metric span {
    color: var(--muted);
    font-weight: 700;
    font-size: .86rem;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 10px;
    font-size: 1.65rem;
}

.metric small {
    color: var(--muted);
}

.table {
    vertical-align: middle;
}

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

.btn-primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.text-money-positive {
    color: #087f5b;
    font-weight: 800;
}

.text-money-negative {
    color: var(--danger);
    font-weight: 800;
}

.login-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: #eef3f7;
}

.login-box {
    width: min(420px, 100%);
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .logout-link {
        position: static;
        display: block;
        margin-top: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}
