/* Lumynq admin: plain Bootstrap 5 plus a small, mobile-first shell. */

:root {
    --lq-sidebar-width: 248px;
    --lq-sidebar-bg: #121916;
    --lq-sidebar-fg: #c6cec8;
    --lq-accent: #c8ff72;
    --lq-topbar-height: 4.75rem;
}

html, body {
    font-family: "Lumynq Brand", system-ui, sans-serif;
    background: #f3f5f1;
}

h1:focus {
    outline: none;
}

/* ---- shell ------------------------------------------------------------ */

.app {
    min-height: 100vh;
}

.nav-toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--lq-topbar-height);
    background: var(--lq-sidebar-bg);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    gap: 0.75rem;
}

.nav-burger {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    margin: 0;
}

    .nav-burger span {
        display: block;
        height: 2px;
        background: #fff;
        border-radius: 2px;
    }

.brand {
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    font-size: 1.15rem;
}

    .brand:hover {
        color: var(--lq-accent);
    }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--lq-sidebar-width);
    background: var(--lq-sidebar-bg);
    color: var(--lq-sidebar-fg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
}

.nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1035;
    display: none;
    margin: 0;
}

.nav-toggle:checked ~ .sidebar {
    transform: translateX(0);
}

.nav-toggle:checked ~ .nav-scrim {
    display: block;
}

.sidebar-brand {
    height: var(--lq-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
    padding: 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

    .sidebar-nav .nav-link {
        color: var(--lq-sidebar-fg);
        border-radius: 6px;
        padding: 0.6rem 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.6rem;
    }

        .sidebar-nav .nav-link:hover {
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
        }

        .sidebar-nav .nav-link.active {
            background: rgba(255, 255, 255, 0.16);
            color: #fff;
            font-weight: 600;
        }

.nav-icon {
    width: 1.25rem;
    text-align: center;
    opacity: 0.85;
}

.user-menu {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1rem;
}

    .user-menu summary {
        cursor: pointer;
        list-style: none;
        display: flex;
        flex-direction: column;
    }

        .user-menu summary::-webkit-details-marker {
            display: none;
        }

    .user-menu .user-name {
        color: #fff;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .user-menu .user-role {
        font-size: 0.75rem;
        opacity: 0.7;
    }

    .user-menu .user-menu-body {
        padding-top: 0.5rem;
    }

    .user-menu .nav-link,
    .user-menu .btn-link {
        color: var(--lq-sidebar-fg);
        padding: 0.25rem 0;
        text-decoration: none;
        display: block;
    }

        .user-menu .nav-link:hover,
        .user-menu .btn-link:hover {
            color: #fff;
        }

.content {
    padding: 1rem;
}

.page-body {
    max-width: 1280px;
}

@media (min-width: 768px) {
    .sidebar {
        transform: none;
    }

    .content {
        margin-left: var(--lq-sidebar-width);
        padding: 1.5rem 2rem;
    }
}

/* ---- auth pages ------------------------------------------------------- */

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.auth-brand {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--lq-sidebar-bg);
    margin-bottom: 1.5rem;
}

.auth-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 1.75rem;
    width: 100%;
    max-width: 440px;
}

/* ---- page chrome ------------------------------------------------------ */

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

    .page-header h1 {
        font-size: 1.5rem;
        margin: 0;
        margin-right: auto;
    }

.publish-banner {
    position: sticky;
    top: 0.5rem;
    z-index: 1020;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.toast-area {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1090;
    min-width: 260px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 1rem;
    height: 100%;
}

    .stat-card .stat-label {
        font-size: 0.8rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #6c757d;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .stat-card .stat-sub {
        color: #6c757d;
        font-size: 0.85rem;
    }

.weekday-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.chip {
    border: 1px solid #ced4da;
    background: #fff;
    color: #495057;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

    .chip:disabled {
        opacity: 0.6;
    }

.chip-on {
    background: var(--lq-sidebar-bg);
    border-color: var(--lq-sidebar-bg);
    color: #fff;
}

.actions-menu {
    position: relative;
}

    .actions-menu .dropdown-menu {
        right: 0;
        left: auto;
    }

.menu-scrim {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

/* Above the scrim and above anything later on the page (the next card, the
   Groups panel, a table row): the menu is positioned inside .actions-menu and
   no ancestor may clip it. */
.actions-menu .dropdown-menu.show {
    z-index: 1001;
}

/* ---- screens ---------------------------------------------------------- */

.device-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    /* No overflow: hidden here: it would clip the Actions menu at the card
       edge (the screenshot keeps the rounded corners itself, below). */
    height: 100%;
    display: flex;
    flex-direction: column;
}

.device-shot {
    aspect-ratio: 16 / 9;
    border-radius: 9px 9px 0 0;
    overflow: hidden;
    background: #111 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 90'%3E%3Crect width='160' height='90' fill='%23111'/%3E%3Ctext x='80' y='50' fill='%23555' font-size='9' font-family='sans-serif' text-anchor='middle'%3Eno screenshot yet%3C/text%3E%3C/svg%3E") center/cover no-repeat;
}

    .device-shot img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.device-body {
    padding: 0.75rem 1rem;
    flex: 1;
}

.device-meta {
    font-size: 0.85rem;
    color: #6c757d;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    row-gap: 0.15rem;
}

    .device-meta dt {
        font-weight: 500;
    }

    .device-meta dd {
        margin: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.device-footer {
    border-top: 1px solid #eef0f2;
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, 100%);
    background: #fff;
    z-index: 1060;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.drawer-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid #e3e6ea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drawer-body {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
}

.drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1055;
}

.event-row {
    display: grid;
    grid-template-columns: 5.5rem 4.5rem 1fr;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #f0f1f3;
}

.key-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    word-break: break-all;
    user-select: all;
}

pre.heartbeat {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.8rem;
    max-height: 320px;
    overflow: auto;
}

/* ---- platform --------------------------------------------------------- */

/* The Platform entry sits apart from the tenant pages in the sidebar. */
.sidebar-nav .nav-link-platform {
    color: var(--lq-accent);
    margin-top: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 6px 6px;
}

    .sidebar-nav .nav-link-platform:hover,
    .sidebar-nav .nav-link-platform.active {
        color: #fff;
    }

/* The screens table lives in a card that clips (overflow hidden, horizontal
   scroll), so its Actions menu is rendered outside the table, fixed at the
   click position and kept inside the viewport by the inline min()/max(). */
.dropdown-menu.platform-menu {
    position: fixed;
    z-index: 1001;
    transform: translateX(-100%);
    min-width: 12rem;
    max-height: 21rem;
    overflow-y: auto;
}

/* Keyboard activation has no click position: centre the menu instead. */
.dropdown-menu.platform-menu-centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.platform-notes {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-now-playing {
    max-width: 200px;
}

.platform-user-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f1f3;
}

/* Addresses and keys: one click selects the whole value for copying. */
code.copyable {
    user-select: all;
    cursor: copy;
}

/* ---- media ------------------------------------------------------------ */

.dropzone {
    border: 2px dashed #b8c0cc;
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    background: #fff;
    color: #6c757d;
    transition: border-color 0.15s, background 0.15s;
}

    .dropzone.dragover {
        border-color: var(--lq-accent);
        background: #effadd;
    }

.upload-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    padding: 0.35rem 0;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.media-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.media-thumb {
    aspect-ratio: 4 / 3;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.85rem;
    text-align: center;
    padding: 0.5rem;
    position: relative;
}

    .media-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        position: absolute;
        inset: 0;
    }

.media-kind {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
}

.media-body {
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
}

.media-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-footer {
    padding: 0.35rem 0.5rem;
    border-top: 1px solid #eef0f2;
    display: flex;
    gap: 0.35rem;
    justify-content: flex-end;
}

/* ---- playlists -------------------------------------------------------- */

.playlist-row {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: auto 72px 1fr;
    gap: 0.75rem;
    align-items: start;
}

    .playlist-row.dragging {
        opacity: 0.5;
    }

    .playlist-row.drop-before {
        box-shadow: 0 -3px 0 0 var(--lq-accent);
    }

    .playlist-row.drop-after {
        box-shadow: 0 3px 0 0 var(--lq-accent);
    }

    .playlist-row.dirty {
        border-color: var(--lq-accent);
    }

.drag-handle {
    cursor: grab;
    color: #adb5bd;
    font-size: 1.25rem;
    line-height: 1;
    padding-top: 0.35rem;
    user-select: none;
}

.row-thumb {
    width: 72px;
    height: 54px;
    border-radius: 6px;
    background: #e9ecef;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #6c757d;
    overflow: hidden;
}

    .row-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.row-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

.row-name {
    font-weight: 600;
    flex-basis: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-controls {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

/* ---- tables ----------------------------------------------------------- */

.table-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow: hidden;
}

    .table-card .table {
        margin-bottom: 0;
    }

.audit-details {
    max-width: 480px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8rem;
}

/* ---- misc ------------------------------------------------------------- */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 6px;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


/* Locally served website typography and wordmark. */
@font-face {
    font-family: "Lumynq Brand";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("brand/dm-sans.ttf") format("truetype");
}
.lumynq-logo {
    display: inline-flex;
    align-items: baseline;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: "Lumynq Brand", sans-serif;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.05em;
    line-height: 1;
    color: #fff;
}
.lumynq-logo-mark {
    display: inline-block;
    flex: none;
    width: .676471em;
    height: .772805em;
    margin-right: .088235em;
    background: #c8ff72;
    clip-path: polygon(0 4.854%,26.087% 0,26.087% 72.312%,100% 58.56%,100% 81.395%,0 100%);
}
.lumynq-logo-period { color: #c8ff72; }
.auth-brand {
    display: inline-flex;
    background: #121916;
    border-radius: .5rem;
    padding: .75rem 1rem;
}
.topbar .lumynq-logo { font-size: 31px; }
