/* Fotokaste admin — LumaBooth Dashboard style */

:root {
    --admin-header: #272355;
    --admin-header-text: #ffffff;
    --admin-bg: #eceef2;
    --admin-card: #ffffff;
    --admin-text: #1f1f2e;
    --admin-muted: #6b7280;
    --admin-border: #e2e5eb;
    --admin-accent: #d4147a;
    --admin-accent-soft: #fce7f3;
    --admin-link: #2563eb;
    --admin-danger: #dc2626;
    --admin-warning-bg: #fef3c7;
    --admin-warning-text: #92400e;
    --admin-radius: 12px;
    --admin-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    --admin-max: none;
    --admin-gutter: clamp(16px, 3vw, 32px);
    --admin-topbar-h: 56px;
    --admin-sidebar-w: 248px;
    --admin-sidebar-bg: #272355;
    --admin-sidebar-text: #ffffff;
    --admin-sidebar-muted: rgba(255, 255, 255, 0.68);
    --admin-sidebar-hover: rgba(255, 255, 255, 0.08);
    --admin-sidebar-active: rgba(255, 255, 255, 0.14);
    --admin-sidebar-border: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

body.admin-dashboard,
body.admin-auth {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: visible;
    overflow-y: visible;
}

body.admin-dashboard {
    min-height: 100vh;
    overflow-x: clip;
    max-width: 100%;
}

a { color: var(--admin-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Left sidebar (LumaBooth-style) ── */

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--admin-sidebar-w);
    z-index: 220;
    display: flex;
    flex-direction: column;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    border-right: 1px solid var(--admin-sidebar-border);
    padding: 16px 12px 18px;
    overflow-y: auto;
}

.admin-sidebar-brand {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--admin-sidebar-border);
    margin-bottom: 12px;
}

.admin-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.admin-sidebar-brand-text strong {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.admin-version-badge-sidebar {
    align-self: flex-start;
    color: var(--admin-sidebar-muted);
    background: var(--admin-sidebar-hover);
    border-color: var(--admin-sidebar-border);
}

.admin-sidebar-close {
    display: none;
    color: inherit;
}

.admin-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
}

.admin-sidebar-nav-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.admin-sidebar-nav-foot {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--admin-sidebar-border);
}

.admin-sidebar-section {
    margin: 14px 8px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--admin-sidebar-muted);
}

.admin-sidebar-section:first-child {
    margin-top: 2px;
}

.admin-sidebar-actions {
    display: grid;
    gap: 4px;
    margin: 10px 0 4px;
    padding-top: 10px;
    border-top: 1px solid var(--admin-sidebar-border);
}

button.admin-nav-action {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

button.admin-nav-action:hover {
    background: var(--admin-sidebar-hover);
    color: var(--admin-sidebar-text);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--admin-sidebar-text);
    font-weight: 600;
    font-size: 0.94rem;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.admin-nav-link:hover {
    background: var(--admin-sidebar-hover);
    text-decoration: none;
    color: var(--admin-sidebar-text);
}

.admin-nav-link.is-active {
    background: var(--admin-sidebar-active);
    box-shadow: inset 3px 0 0 var(--admin-accent);
}

.admin-nav-link-muted {
    color: var(--admin-sidebar-muted);
}

.admin-nav-icon {
    flex: 0 0 auto;
    opacity: 0.92;
}

.admin-nav-label {
    min-width: 0;
    line-height: 1.25;
}

.admin-nav-sub {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 2px 0 10px 14px;
    padding: 4px 0 2px 10px;
    border-left: 2px solid var(--admin-sidebar-border);
}

.admin-nav-sublink {
    padding: 8px 10px;
    font-size: 0.86rem;
    gap: 10px;
}

.admin-nav-sublink .admin-nav-icon {
    width: 16px;
    height: 16px;
}

.admin-sidebar-backdrop {
    display: none;
}

body.admin-dashboard > .admin-topbar,
body.admin-dashboard > .admin-main,
body.admin-dashboard > .admin-flash {
    margin-left: var(--admin-sidebar-w);
    width: calc(100% - var(--admin-sidebar-w));
    max-width: calc(100% - var(--admin-sidebar-w));
    box-sizing: border-box;
}

/* ── Top bar ── */

.admin-topbar {
    background: var(--admin-header);
    color: var(--admin-header-text);
    position: sticky;
    top: 0;
    z-index: 200;
}

.admin-topbar-inner {
    margin: 0 auto;
    padding: 0 var(--admin-gutter);
    min-height: var(--admin-topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-topbar-left,
.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.admin-topbar-left {
    flex: 1;
}

.admin-menu-btn {
    display: none;
}

.admin-version-badge {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.35;
    user-select: all;
}

.admin-version-badge-muted {
    color: var(--admin-muted, #64748b);
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.08);
}

.admin-topbar-right { justify-content: flex-end; flex: 0 0 auto; }

.admin-topbar-title-wrap {
    min-width: 0;
}

.admin-topbar-title {
    text-align: left;
    font-size: 1.05rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-icon-btn,
.admin-user-btn {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-icon-btn:hover,
.admin-user-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.admin-back-link {
    color: inherit;
    display: inline-flex;
    padding: 8px;
    border-radius: 8px;
}

.admin-back-link:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.admin-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--admin-accent);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.95rem;
}

/* ── User menu overlay ── */

.admin-user-menu {
    position: fixed;
    inset: 0;
    z-index: 300;
}

.admin-user-menu[hidden] { display: none; }

.admin-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

@media (max-width: 960px) {
    body.admin-dashboard > .admin-topbar,
    body.admin-dashboard > .admin-main,
    body.admin-dashboard > .admin-flash {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .admin-menu-btn {
        display: inline-flex;
    }

    .admin-sidebar {
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 8px 0 28px rgba(0, 0, 0, 0.22);
    }

    body.admin-sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-sidebar-close {
        display: inline-flex;
    }

    .admin-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 210;
        background: rgba(0, 0, 0, 0.4);
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .admin-sidebar-backdrop[hidden] {
        display: none;
    }
}

/* ── Legacy drawer hooks (kept for safety) ── */

.admin-drawer { display: none !important; }

.admin-drawer-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    background: var(--admin-card);
    padding: 16px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

.admin-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-drawer-head-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.admin-drawer-head-title strong {
    font-size: 1.05rem;
}

.admin-drawer-link {
    display: block;
    padding: 12px 8px;
    color: var(--admin-text);
    font-weight: 500;
    border-radius: 8px;
}

.admin-drawer-link:hover {
    background: var(--admin-bg);
    text-decoration: none;
}

.admin-drawer-link-muted { color: var(--admin-muted); }

.admin-user-panel {
    position: absolute;
    top: 56px;
    right: 12px;
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 180px;
    max-height: calc(100vh - 72px);
    overflow: auto;
}

.admin-user-panel a {
    display: block;
    padding: 10px 8px;
    color: var(--admin-text);
    border-radius: 8px;
}

.admin-user-panel a:hover {
    background: var(--admin-bg);
    text-decoration: none;
}

.admin-user-name {
    margin: 0 8px 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ── Main content ── */

.admin-main {
    margin: 0 auto;
    padding: 20px var(--admin-gutter) 48px;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
}

.admin-main-gallery {
    overflow-x: visible;
    overflow-y: visible;
}

.admin-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 16px;
}

.admin-flash {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: var(--admin-radius);
    font-size: 0.95rem;
}

.admin-flash-success {
    background: #dcfce7;
    color: #166534;
}

.admin-flash-error {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Gallery list cards ── */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.gallery-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.gallery-card:hover { text-decoration: none; }

.gallery-card-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--admin-radius);
    overflow: hidden;
    background: #d1d5db;
    box-shadow: var(--admin-shadow);
}

.gallery-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-card-empty {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--admin-muted);
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

.gallery-card-booth-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #1d4ed8;
    color: #eff6ff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.gallery-card-failiem-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #0f766e;
    color: #ecfdf5;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.gallery-card-failiem-badge.is-moving {
    background: #b45309;
    color: #fffbeb;
}

.gallery-card.is-booth .gallery-card-empty {
    background: linear-gradient(160deg, #e8eef8 0%, #dbe7f6 100%);
}

.gallery-card-meta {
    padding: 10px 4px 0;
}

.gallery-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

.gallery-card-date {
    margin: 4px 0 0;
    color: var(--admin-muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.gallery-card-create {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border: 2px dashed #9ca3af;
    border-radius: var(--admin-radius);
    background: transparent;
    cursor: pointer;
    color: var(--admin-text);
    font: inherit;
}

.gallery-card-create-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.gallery-card-create svg {
    opacity: 0.7;
}

.gallery-card-import {
    border-style: solid;
    border-color: #93c5fd;
    background: rgba(29, 78, 216, 0.04);
    color: #1d4ed8;
}

.admin-modal-panel-wide {
    width: min(560px, 100%);
}

.admin-help-text {
    margin: 0 0 14px;
    color: var(--admin-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.fotoshare-types {
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 0 14px;
}

.fotoshare-types legend {
    padding: 0 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.fotoshare-types .admin-checkbox-label {
    margin-bottom: 6px;
}

.fotoshare-preview {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 0.92rem;
}

.fotoshare-preview-meta,
.fotoshare-preview-counts {
    margin-top: 6px;
    color: var(--admin-muted);
}

.fotoshare-preview-warn {
    margin-top: 8px;
    color: #b45309;
}

.fotoshare-progress {
    margin: 0 0 14px;
}

.fotoshare-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.fotoshare-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: #2563eb;
    transition: width 0.25s ease;
}

.admin-form input[type="url"] {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
}

/* ── Dashboard header ── */

.dash-header {
    margin-bottom: 20px;
}

.dash-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-title {
    margin: 0;
    font-size: clamp(1.3rem, 4vw, 1.75rem);
    font-weight: 700;
}

.dash-date-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.dash-date-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dash-date-row .dash-date {
    margin: 0;
}

.dash-date-meta {
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.dash-date-label {
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.dash-date-meta-muted {
    color: var(--admin-muted);
}

.dash-date-meta-warn {
    color: #c45c00;
}

.gallery-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.18);
    color: var(--admin-text);
    font-size: 0.95rem;
}

.gallery-notice-muted {
    background: rgba(100, 116, 139, 0.08);
    border-color: rgba(100, 116, 139, 0.18);
}

.admin-pwa-install-hint {
    margin: 4px 12px 10px;
    font-size: 11px;
    line-height: 1.35;
    color: #6b7280;
}

.gallery-notice-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.gallery-notice-actions p {
    margin: 0;
    flex: 1 1 240px;
}

.expiry-warning-panel {
    margin: 0 0 28px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid #f59e0b;
    background: #fffbeb;
}

.expiry-warning-intro {
    margin: 0 0 12px;
    color: #92400e;
    font-size: 14px;
}

.expiry-warning-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.expiry-warning-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #fde68a;
}

.expiry-warning-text {
    flex: 1 1 220px;
    font-size: 14px;
    color: #78350f;
}

.expiry-warning-text a {
    font-weight: 600;
    color: #9a3412;
    text-decoration: none;
}

.expiry-warning-text a:hover {
    text-decoration: underline;
}

.gallery-notice-warn {
    background: rgba(196, 92, 0, 0.08);
    border-color: rgba(196, 92, 0, 0.2);
}

.admin-modal-hint {
    margin: 0 0 14px;
    color: var(--admin-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.admin-modal-panel-danger h2 {
    color: #b42318;
}

.admin-btn-danger:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.gallery-card.is-purged .gallery-card-thumb {
    opacity: 0.72;
}

.dash-date {
    margin: 6px 0 0;
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.dash-edit-btn {
    background: transparent;
    border: 0;
    padding: 4px;
    cursor: pointer;
    color: var(--admin-muted);
    border-radius: 6px;
}

.dash-edit-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--admin-text);
}

/* ── Dashboard toolbar (viena rinda) ── */

.dash-toolbar-panel {
    display: block;
}

.dash-toolbar-tri {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-bottom: 16px;
    align-items: stretch;
}

.dash-toolbar-col {
    background: var(--admin-card);
    border-radius: 16px;
    box-shadow: var(--admin-shadow);
    padding: 12px 14px;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    overflow: hidden;
}

.dash-toolbar-col-main,
.dash-toolbar-col-share,
.dash-toolbar-col-station {
    justify-content: flex-start;
}

.dash-main-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    min-width: 0;
}

.dash-main-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.dash-main-line > .dash-meta-label,
.dash-main-line > .share-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-text);
    overflow-wrap: normal;
}

.dash-main-line-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    margin-left: auto;
}

.dash-main-line .dash-meta-value {
    overflow-wrap: anywhere;
    text-align: left;
    white-space: nowrap;
}

.dash-main-line-start {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.dash-main-line-start > .dash-meta-label,
.dash-main-line-start > .share-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.dash-main-line-split {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.dash-main-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.dash-main-pair .share-label {
    white-space: nowrap;
}

.dash-main-pair-end {
    margin-left: auto;
    align-self: center;
    justify-content: flex-end;
}

.dash-toolbar-col-main .dash-main-line-split,
.dash-toolbar-col-main .dash-main-line-tools {
    flex-wrap: nowrap;
    gap: 6px;
}

.dash-toolbar-col-main .dash-meta-label,
.dash-toolbar-col-main .dash-meta-value,
.dash-toolbar-col-main .dash-main-pair .share-label {
    font-size: 0.75rem;
}

.dash-toolbar-col-main .dash-edit-btn {
    padding: 2px;
}

.dash-toolbar-col-main .admin-switch {
    width: 34px;
    height: 18px;
    flex-basis: 34px;
}

.dash-toolbar-col-main .admin-switch-slider::before {
    width: 14px;
    height: 14px;
    top: 2px;
    left: 2px;
}

.dash-toolbar-col-main .admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(16px);
}

.dash-main-line-tools {
    align-items: center;
    flex-wrap: nowrap;
}

.dash-main-line-tools .dash-main-note {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.68rem;
    white-space: normal;
    line-height: 1.25;
}

.dash-main-line-tools .tool-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
}

.dash-main-line-tools .dash-toolbar-actions {
    width: auto;
    max-width: 100%;
    margin-left: auto;
    flex: 0 1 auto;
}

.dash-main-album {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
}

.dash-main-note {
    color: var(--admin-muted);
    font-size: 0.75rem;
    line-height: 1.3;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.dash-compact-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.dash-compact-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dash-toolbar-col .dash-compact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

.dash-album-block {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
}

.dash-last-change {
    color: var(--admin-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

.dash-toolbar-col .dash-compact-item-end,
.dash-toolbar-col .dash-compact-item-grow {
    margin-left: 0;
    flex: 1 1 11rem;
    max-width: 100%;
}

.dash-compact-item .dash-meta-label,
.dash-compact-item .share-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.dash-compact-item .dash-meta-value {
    font-size: 0.82rem;
}

.dash-compact-item .dash-download-size {
    color: var(--admin-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.dash-toolbar-col-main .dash-toolbar-actions {
    margin-left: 0;
    margin-top: 0;
    width: 100%;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: flex-end;
}

.dash-toolbar-col .share-toggle-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.dash-toolbar-col .admin-switch {
    width: 40px;
    height: 22px;
    flex: 0 0 40px;
}

.dash-toolbar-col .admin-switch-slider::before {
    width: 16px;
    height: 16px;
    top: 3px;
    left: 3px;
}

.dash-toolbar-col .admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(18px);
}

.dash-toolbar-col-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-content: center;
    align-items: center;
    justify-items: stretch;
    gap: 10px 6px;
    padding: 8px 2px;
    width: 100%;
}

.dash-toolbar-col-stats .dash-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    gap: 6px;
    white-space: normal;
    background: transparent;
    padding: 0;
    min-height: 0;
    text-align: center;
}

.dash-toolbar-col-stats .dash-stat-label {
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: center;
}

.dash-toolbar-col-stats .dash-stat-value {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.1;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
}

.dash-toolbar-col-share .share-input-wrap,
.dash-toolbar-col-station .share-input-wrap {
    flex: 0 0 36px;
    width: 100%;
    max-width: 100%;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding: 0 6px 0 10px;
    background: var(--admin-bg);
    box-sizing: border-box;
}

.dash-toolbar-col-share .dash-compact-row,
.dash-toolbar-col-station .dash-compact-row {
    align-items: flex-start;
}

.dash-toolbar-col-share .dash-compact-item,
.dash-toolbar-col-station .dash-compact-item {
    flex-wrap: nowrap;
    width: auto;
}

.dash-toolbar-col-share .share-label,
.dash-toolbar-col-station .share-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 3. kartītes apakšējā rinda: mazāks teksts, lai Failiem.lv nenokristu uz nākamo rindu */
.dash-toolbar-col-share > .dash-compact-row:last-child {
    gap: 6px 8px;
}

.dash-toolbar-col-share > .dash-compact-row:last-child .share-label,
.dash-toolbar-col-share > .dash-compact-row:last-child .dash-download-size {
    font-size: 0.7rem;
}

.dash-toolbar-col-share .dash-compact-item-grow,
.dash-toolbar-col-share #gallery-failiem-sync {
    flex: 0 1 auto;
    justify-content: flex-start;
    width: auto;
    max-width: 100%;
}

#gallery-failiem-progress {
    margin: 0 0 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.share-copy-inline {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--admin-text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

.share-copy-inline:hover {
    background: rgba(0, 0, 0, 0.05);
}

.share-copy-inline:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tool-btn.is-disabled {
    opacity: 0.38;
    pointer-events: none;
}

.dash-toolbar-col .failiem-status {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (min-width: 760px) {
    .dash-toolbar-tri {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1480px) {
    .dash-toolbar-tri {
        grid-template-columns: minmax(0, 19fr) minmax(0, 27fr) minmax(0, 27fr) minmax(0, 27fr);
        position: -webkit-sticky;
        position: sticky;
        top: var(--admin-topbar-h);
        z-index: 150;
        margin-left: calc(-1 * var(--admin-gutter));
        margin-right: calc(-1 * var(--admin-gutter));
        margin-bottom: 16px;
        padding: 10px var(--admin-gutter) 12px;
        background: var(--admin-bg);
        box-shadow: 0 10px 18px -12px rgba(15, 23, 42, 0.35);
    }
}

.dash-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 8px 12px;
    box-shadow: var(--admin-shadow);
    min-width: 0;
}

.dash-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-width: 0;
}

.dash-toolbar-row-main {
    justify-content: space-between;
}

.dash-toolbar-row-settings {
    gap: 8px 14px;
}

.dash-toolbar-actions-sticky {
    flex: 0 0 auto;
}

@media (min-width: 768px) {
    .dash-toolbar-desktop-wrap {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 12px;
        position: -webkit-sticky;
        position: sticky;
        top: var(--admin-topbar-h);
        z-index: 150;
        margin-bottom: 16px;
        background: var(--admin-card);
        border-radius: var(--admin-radius);
        padding: 8px 12px;
        box-shadow: var(--admin-shadow);
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-panel {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-actions-sticky {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        align-self: center;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 6px;
        background: transparent;
        border-radius: 0;
        padding: 0;
        box-shadow: none;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-row {
        display: flex;
        align-items: center;
        min-width: 0;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-row-main {
        flex-wrap: nowrap;
        gap: 10px 14px;
        justify-content: space-between;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-row-settings {
        flex-wrap: wrap;
        gap: 6px 12px;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-meta {
        flex: 0 1 auto;
        min-width: 0;
        padding-right: 10px;
        margin-right: 0;
        border-right: 1px solid var(--admin-border);
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-stats {
        flex: 1 1 auto;
        min-width: 0;
        justify-content: flex-end;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-share {
        flex: 1 1 12rem;
        min-width: 0;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-share .share-row {
        flex: 1 1 auto;
        min-width: 0;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar .share-input-wrap {
        max-width: none;
        flex: 1 1 auto;
        min-width: 0;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-download {
        flex: 0 0 auto;
    }
}

@media (min-width: 768px) and (max-width: 959px) {
    .dash-toolbar-desktop-wrap .dash-toolbar-stats {
        gap: 4px 8px;
    }

    .dash-toolbar-desktop-wrap .dash-stat {
        gap: 3px;
    }

    .dash-toolbar-desktop-wrap .dash-stat-value {
        font-size: 0.82rem;
    }

    .dash-toolbar-desktop-wrap .dash-stat-label {
        font-size: 0.62rem;
    }

    .dash-toolbar-desktop-wrap .dash-meta-label,
    .dash-toolbar-desktop-wrap .share-label,
    .dash-toolbar-desktop-wrap .dash-download-size {
        font-size: 0.64rem;
    }

    .dash-toolbar-desktop-wrap .dash-meta-value {
        font-size: 0.76rem;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-share .share-input-wrap {
        max-width: 5.5rem;
    }

    .dash-toolbar-desktop-wrap .dash-toolbar-row-settings {
        gap: 6px 10px;
    }
}

.dash-toolbar-stats {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 12px;
    flex: 0 0 auto;
}

.dash-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

.dash-stat-value {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
}

.dash-stat-label {
    color: var(--admin-muted);
    font-size: 0.72rem;
}

.dash-toolbar-meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 12px;
    flex: 0 1 auto;
    min-width: 0;
    padding-right: 10px;
    margin-right: 2px;
    border-right: 1px solid var(--admin-border);
}

.dash-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dash-meta-expiry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.dash-meta-expiry-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.dash-meta-value-muted {
    color: var(--admin-muted);
    font-weight: 500;
}

.dash-meta-label {
    color: var(--admin-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.dash-meta-value {
    font-size: 0.82rem;
    font-weight: 600;
}

.dash-meta-warn .dash-meta-value {
    color: #c45c00;
}

.dash-toolbar-share {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.share-label {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--admin-muted);
}

.share-toggle-form {
    flex-shrink: 0;
    margin: 0;
}

.dash-toolbar-download {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dash-download-size {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--admin-text);
    white-space: nowrap;
}

.failiem-status {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.75rem 0 0;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--admin-text, #111) 8%, transparent);
    font-size: 0.95rem;
    line-height: 1.4;
}

.failiem-status[hidden] {
    display: none !important;
}

.failiem-status.is-busy::before,
.failiem-status.is-wait::before {
    content: "";
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
    animation: failiem-pulse 1s ease-in-out infinite;
}

.failiem-status.is-done {
    opacity: 0.85;
}

.failiem-status.is-error {
    background: color-mix(in srgb, #b42318 14%, transparent);
}

@keyframes failiem-pulse {
    50% { opacity: 0.25; }
}

.dash-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    margin-left: auto;
}

.dash-toolbar .admin-switch {
    width: 40px;
    height: 24px;
}

.dash-toolbar .admin-switch-slider::before {
    width: 18px;
    height: 18px;
}

.dash-toolbar .admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(16px);
}

.dash-toolbar .share-input-wrap {
    min-height: 34px;
    padding: 0 8px;
    max-width: 9rem;
}

.dash-toolbar .share-copy-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: var(--admin-bg);
    cursor: pointer;
    padding: 0;
    color: var(--admin-text);
    text-decoration: none;
}

.tool-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

.tool-btn-danger {
    color: #dc2626;
}

.tool-btn-danger:hover {
    background: rgba(220, 38, 38, 0.08);
}

@media (max-width: 1100px) {
    .dash-toolbar {
        gap: 8px 10px;
        padding: 7px 10px;
    }

    .dash-stat-value {
        font-size: 0.88rem;
    }

    .dash-stat-label,
    .share-label,
    .dash-meta-label,
    .dash-download-size {
        font-size: 0.68rem;
    }

    .dash-meta-value {
        font-size: 0.78rem;
    }

    .dash-toolbar .share-input-wrap {
        max-width: 6.5rem;
    }
}

@media (max-width: 900px) {
    .dash-toolbar-meta {
        padding-right: 8px;
        gap: 6px 8px;
    }

    .dash-toolbar-stats {
        gap: 6px 8px;
    }

    .dash-stat {
        gap: 4px;
    }

    .dash-toolbar .share-input-wrap {
        max-width: 8rem;
    }
}

@media (max-width: 767px) {
    .admin-main {
        overflow: visible;
    }

    .dash-toolbar-panel {
        margin-bottom: 12px;
    }

    .dash-toolbar {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 0;
        padding: 0;
        overflow: visible;
        background: var(--admin-card);
        border-radius: var(--admin-radius);
        box-shadow: var(--admin-shadow);
    }

    .dash-toolbar-row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        width: 100%;
    }

    .dash-toolbar-row-main,
    .dash-toolbar-row-settings {
        width: 100%;
    }

    .dash-toolbar-actions-sticky {
        position: -webkit-sticky;
        position: sticky;
        top: var(--admin-topbar-h);
        z-index: 160;
        margin-left: calc(-1 * var(--admin-gutter));
        margin-right: calc(-1 * var(--admin-gutter));
        margin-bottom: 12px;
        padding: 8px var(--admin-gutter);
        background: var(--admin-bg);
        -webkit-backdrop-filter: none;
    }

    .dash-toolbar-actions-sticky .dash-toolbar-actions {
        margin-left: 0;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        background: var(--admin-card);
        border-radius: var(--admin-radius);
        box-shadow: var(--admin-shadow);
    }

    .dash-toolbar-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        margin: 0;
        border-right: 0;
        border-bottom: 1px solid var(--admin-border);
    }

    .dash-meta,
    .dash-meta-expiry {
        justify-content: space-between;
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .dash-meta-label {
        font-size: 0.8rem;
    }

    .dash-meta-value {
        font-size: 0.92rem;
    }

    .dash-toolbar-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        padding: 12px;
        border-bottom: 1px solid var(--admin-border);
    }

    .dash-stat {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px 6px;
        background: var(--admin-bg);
        border-radius: 10px;
        text-align: center;
        min-height: 56px;
    }

    .dash-stat-value {
        font-size: 1.05rem;
    }

    .dash-stat-label {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .dash-toolbar-share,
    .dash-toolbar-download {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 10px 12px;
        width: 100%;
        padding: 12px;
        border-bottom: 1px solid var(--admin-border);
        white-space: normal;
    }

    .dash-toolbar-share .share-label,
    .dash-toolbar-download .share-label {
        font-size: 0.85rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .dash-toolbar-share .share-toggle-form,
    .dash-toolbar-download .share-toggle-form {
        flex: 0 0 auto;
    }

    .dash-toolbar-share .share-row {
        flex: 1 1 100%;
        width: 100%;
    }

    .dash-toolbar-share .share-input-wrap {
        display: flex !important;
        max-width: none;
        min-height: 42px;
        flex: 1;
    }

    .dash-toolbar-download .dash-download-size {
        flex: 1 1 100%;
        font-size: 0.82rem;
        color: var(--admin-muted);
    }

    .share-label,
    .dash-download-size {
        font-size: 0.85rem;
    }

    .dash-toolbar .admin-switch {
        width: 44px;
        height: 26px;
    }

    .dash-toolbar .admin-switch-slider::before {
        width: 20px;
        height: 20px;
    }

    .dash-toolbar .admin-switch input:checked + .admin-switch-slider::before {
        transform: translateX(18px);
    }

    .dash-toolbar .share-copy-btn {
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    .dash-toolbar .tool-btn {
        width: 44px;
        height: 44px;
    }

    .dash-toolbar .tool-btn svg,
    .dash-toolbar .share-copy-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* ── Stats cards (legacy list pages) ── */

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 18px 20px;
    box-shadow: var(--admin-shadow);
}

.stat-card-label {
    margin: 0 0 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.stat-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-metric-name {
    color: var(--admin-muted);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ── Link sharing ── */

.share-card {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 18px 20px;
    box-shadow: var(--admin-shadow);
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.share-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.share-card-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.share-row {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.share-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 0 12px;
    min-height: 44px;
    min-width: 0;
    overflow: hidden;
}

.share-link-icon {
    flex-shrink: 0;
    color: var(--admin-muted);
}

.share-input-wrap.is-disabled {
    opacity: 0.65;
}

.share-input {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    color: var(--admin-text);
    min-width: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-input-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--admin-muted);
    font-size: 0.95rem;
}

.share-input:focus { outline: none; }

.share-copy-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: var(--admin-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.share-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle switch */
.admin-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    vertical-align: middle;
}

.admin-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.admin-switch-slider {
    position: absolute;
    inset: 0;
    background: #cbd5e1;
    border-radius: 999px;
    transition: background 0.15s;
    pointer-events: none;
}

.admin-switch-slider::before {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-switch input:checked + .admin-switch-slider {
    background: var(--admin-accent);
}

.admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(20px);
}

/* ── Action grid ── */

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    max-width: 720px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--admin-radius);
    cursor: pointer;
    font: inherit;
    color: var(--admin-text);
    text-decoration: none;
    box-shadow: var(--admin-shadow);
}

.action-btn:hover {
    background: #f8fafc;
    text-decoration: none;
}

.action-btn svg {
    color: var(--admin-muted);
}

.action-btn-danger {
    color: var(--admin-danger);
}

.action-btn-danger svg {
    color: var(--admin-danger);
}

.toolbar-hint {
    color: var(--admin-muted);
    font-size: 0.85rem;
}

/* ── Media grid (individual files) ── */

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #d1d5db;
}

.media-card-open {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.media-card-open:hover {
    text-decoration: none;
}

.media-card-open img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.15s ease;
}

.media-card-open:hover img {
    transform: scale(1.03);
}

.media-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #374151;
}

.media-card-check {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
}

.media-card-check input {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--admin-accent);
}

.media-type-badge {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.media-play-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    z-index: 1;
}

.media-play-icon span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    place-items: center;
}

/* ── Gallery view tabs (Faili / Sesijas) ── */

.gallery-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 4px 0 16px;
    padding: 4px;
    border-radius: 10px;
    background: #e5e7eb;
}

.gallery-view-panel[hidden] {
    display: none !important;
}

.gallery-view-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 8px 14px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--admin-muted);
    text-decoration: none;
    cursor: pointer;
}

.gallery-view-tab:hover {
    color: var(--admin-text);
    text-decoration: none;
}

.gallery-view-tab.is-active {
    background: var(--admin-card);
    color: var(--admin-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* ── Booth event (Pasākums) tab ── */

.booth-event-panel {
    margin-bottom: 28px;
}

.booth-event-note {
    margin: 0 0 14px;
    font-size: 0.82rem;
    color: var(--admin-muted);
}

.booth-event-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: 10px;
    background: #e5e7eb;
}

.booth-event-subtab {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--admin-muted);
    text-decoration: none;
}

.booth-event-subtab:hover {
    color: var(--admin-text);
    text-decoration: none;
}

.booth-event-subtab.is-active {
    background: var(--admin-card);
    color: var(--admin-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.booth-event-pane[hidden] {
    display: none !important;
}

.booth-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.booth-metric-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--admin-radius);
    padding: 12px 14px;
    box-shadow: var(--admin-shadow);
    display: grid;
    gap: 2px;
}

.booth-metric-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

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

.booth-settings-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    margin-bottom: 14px;
    overflow: hidden;
}

.booth-settings-card-title {
    margin: 0;
    padding: 12px 16px 4px;
    font-size: 0.92rem;
}

.booth-setting-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
}

.booth-settings-card > .booth-setting-row:first-child,
.booth-settings-card-title + .booth-setting-row {
    border-top: none;
}

.booth-setting-copy {
    min-width: 0;
    flex: 1;
}

.booth-setting-title {
    font-weight: 650;
    font-size: 0.95rem;
}

.booth-setting-hint {
    margin-top: 2px;
    font-size: 0.82rem;
    color: var(--admin-muted);
    line-height: 1.35;
}

.booth-setting-value {
    flex-shrink: 0;
    max-width: 48%;
    text-align: right;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-text);
    word-break: break-word;
}

.booth-setting-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
}

.booth-setting-state-track {
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    flex-shrink: 0;
}

.booth-setting-state-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.booth-setting-state.is-on .booth-setting-state-track {
    background: #2563eb;
}

.booth-setting-state.is-on .booth-setting-state-thumb {
    transform: translateX(18px);
}

.booth-setting-state-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-muted);
    min-width: 4.5rem;
}

.booth-setting-state.is-on .booth-setting-state-text {
    color: #1d4ed8;
}

.booth-mode-toggles {
    display: grid;
    gap: 8px;
}

.booth-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.booth-mode-toggle.is-on {
    border-color: #93c5fd;
    background: #f8fbff;
}

.booth-mode-toggle-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.booth-mode-toggle-title {
    font-weight: 650;
    font-size: 0.95rem;
}

.booth-mode-toggle-hint {
    font-size: 0.8rem;
    color: var(--admin-muted);
}

.booth-countdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.booth-countdown-field {
    display: grid;
    gap: 6px;
    margin: 0;
}

.booth-countdown-field input {
    width: 100%;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 8px 12px;
    font: inherit;
}

.booth-capture-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.booth-capture-msg {
    margin: 0;
    font-size: 0.88rem;
    color: var(--admin-muted);
}

.booth-capture-msg.is-ok {
    color: #15803d;
}

.booth-capture-msg.is-err {
    color: #b91c1c;
}

.booth-layouts-block {
    margin-top: 4px;
}

.booth-layouts-empty {
    border: 1px dashed #cbd5e1;
    border-radius: var(--admin-radius);
    padding: 28px 16px;
    text-align: center;
    color: var(--admin-muted);
    background: #f8fafc;
}

.booth-layouts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.booth-layout-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--admin-radius);
    overflow: hidden;
    box-shadow: var(--admin-shadow);
}

.booth-layout-preview {
    position: relative;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.booth-layout-preview-btn {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    cursor: zoom-in;
    font: inherit;
    color: inherit;
    overflow: hidden;
}

.booth-layout-preview-btn.is-photo {
    background: #0f172a;
}

.booth-layout-preview-btn img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0f172a;
}

.booth-layout-lightbox {
    position: fixed;
    inset: 0;
    /* Above sticky admin topbar (200) and gallery toolbars (150–155). */
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.72);
}

.booth-layout-lightbox[hidden] {
    display: none !important;
}

.booth-layout-lightbox-card {
    position: relative;
    max-width: min(920px, 100%);
    max-height: min(90vh, 100%);
    background: #0b1220;
    border-radius: 16px;
    overflow: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.booth-layout-lightbox-card img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    margin: 0 auto;
    background: #0b1220;
}

.booth-layout-lightbox-title {
    margin: 0;
    padding: 12px 16px;
    color: #e2e8f0;
    font-size: 0.95rem;
    border-top: 1px solid #1e293b;
}

.booth-layout-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.8);
    color: #fff;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.booth-layout-slot {
    position: absolute;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 1px solid rgba(29, 78, 216, 0.55);
    background: rgba(59, 130, 246, 0.18);
    color: #1e3a8a;
    font-size: 0.7rem;
    font-weight: 700;
}

.booth-layout-meta {
    padding: 10px 12px 12px;
}

.booth-layout-meta h3 {
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.booth-layout-meta p {
    margin: 0;
    font-size: 0.78rem;
    color: var(--admin-muted);
}

/* ── Album / session overview (client-like) ── */

.sessions-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sessions-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gallery-albums-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.gallery-albums-toggle > span,
.gallery-albums-toggle .share-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--admin-text);
    white-space: nowrap;
}

.gallery-workspace {
    min-width: 0;
}

.select-all-btn {
    cursor: pointer;
    font-weight: 600;
}

.bulk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.bulk-actions[hidden] { display: none; }

.admin-select,
.admin-btn {
    font: inherit;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--admin-border);
    background: var(--admin-card);
}

.admin-btn-primary {
    background: var(--admin-header);
    color: #fff;
    border-color: var(--admin-header);
    cursor: pointer;
}

.admin-btn-danger {
    background: var(--admin-danger);
    color: #fff;
    border-color: var(--admin-danger);
    cursor: pointer;
}

.admin-album-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 18px 16px;
    padding-bottom: 24px;
}

.admin-album-card {
    width: calc(20% - 13px);
    min-width: 168px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-album-thumb-wrap {
    position: relative;
}

.admin-album-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #d1d5db;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.15s;
}

.admin-album-thumb:hover {
    opacity: 0.92;
    text-decoration: none;
}

.admin-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.admin-album-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #374151;
}

.admin-album-stack {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
}

.admin-album-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 2px;
}

.admin-album-meta-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--admin-muted);
    min-width: 0;
}

.admin-album-cover-type {
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--admin-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.admin-album-count {
    white-space: nowrap;
    text-align: right;
    justify-self: end;
}

.session-guest-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    justify-self: center;
}

.session-guest-spacer {
    width: 40px;
    height: 22px;
    justify-self: center;
}

/* Keep legacy class hooks used by JS / media cards */
.session-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.session-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #d1d5db;
}

.session-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.session-card-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #374151;
}

.session-card-check {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
}

.session-card-check input {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--admin-accent);
}

.session-card-link {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    color: var(--admin-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.session-card-link:hover {
    text-decoration: none;
    background: #fff;
}

.session-card-actions {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
}

.session-card-slot {
    display: flex;
    align-items: center;
    min-width: 32px;
    min-height: 32px;
}

.session-card-slot-left {
    justify-content: flex-start;
}

.session-card-slot-center {
    justify-content: center;
    flex: 1;
}

.session-card-slot-right {
    justify-content: flex-end;
}

.session-card-action {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    color: var(--admin-text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    text-decoration: none;
    pointer-events: auto;
}

.session-card-action:hover {
    background: #fff;
    text-decoration: none;
}

.session-card-action.is-active {
    background: #dc2626;
    color: #fff;
}

.admin-album-card.is-gallery-cover .admin-album-thumb {
    box-shadow: 0 0 0 3px #dc2626;
}

.admin-album-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.78rem;
    color: var(--admin-muted);
    line-height: 1.35;
}

.admin-album-stats.has-values {
    color: var(--admin-text);
}

.admin-album-stats strong {
    color: var(--admin-text);
    font-weight: 700;
}

.admin-album-stats .is-hot strong {
    color: var(--admin-accent, #2563eb);
}

.admin-modal-panel-qr {
    width: min(420px, 100%);
    text-align: center;
}

.session-qr-canvas-wrap {
    display: grid;
    place-items: center;
    margin: 12px auto;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    width: fit-content;
    min-height: 280px;
    min-width: 280px;
}

.session-qr-canvas-wrap img {
    display: block;
    width: 280px;
    height: 280px;
}

.session-qr-url {
    font-size: 0.82rem;
    word-break: break-all;
    color: var(--admin-muted);
    margin: 8px 0 0;
}

.session-stack-icon {
    position: absolute;
    left: 8px;
    bottom: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 6px;
    padding: 4px;
    line-height: 0;
}

.session-play-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.session-play-icon span {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    place-items: center;
}

.sessions-empty {
    text-align: center;
    color: var(--admin-muted);
    padding: 48px 16px;
}

@media (max-width: 1100px) {
    .admin-album-card {
        width: calc(25% - 12px);
    }
}

@media (max-width: 800px) {
    .admin-album-card {
        width: calc(33.333% - 11px);
        min-width: 140px;
    }
}

@media (max-width: 560px) {
    .admin-album-card {
        width: calc(50% - 8px);
        min-width: 0;
        max-width: none;
    }
}

/* ── Modal ── */

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 16px;
}

.admin-modal[hidden] { display: none; }

.admin-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.admin-modal-panel {
    position: relative;
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 24px;
    width: min(420px, 100%);
    max-width: calc(100vw - 32px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    overflow: hidden;
}

.admin-modal-panel-move {
    width: min(520px, 100%);
}

.admin-modal-panel-info {
    width: min(520px, 100%);
}

.admin-modal-panel-due {
    width: min(560px, 100%);
}

.retention-due-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--admin-border);
}

.retention-due-name {
    font-weight: 600;
    min-width: 0;
}

.retention-due-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.retention-due-actions form {
    margin: 0;
}

.admin-choice-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-choice-actions .admin-btn,
.admin-choice-actions .admin-select {
    width: 100%;
    cursor: pointer;
}

.gallery-card-wrap .archive-download {
    margin-top: 8px;
}

.admin-info-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    background: transparent;
    color: var(--admin-muted);
    font: 700 0.78rem/1 Georgia, "Times New Roman", serif;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-info-btn:hover {
    color: var(--admin-text);
}

.admin-switch input:disabled {
    cursor: not-allowed;
}

.admin-switch input:disabled + .admin-switch-slider {
    opacity: 0.4;
}

.settings-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.settings-title-row h2 {
    margin: 0;
}

.settings-flag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 16px;
}

.admin-info-sub {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
}

.admin-info-sub + .admin-info-list {
    margin-bottom: 16px;
}

.admin-info-list {
    margin: 0 0 18px;
    padding-left: 1.2em;
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.admin-modal-panel h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.admin-form label {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 0;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="url"],
.admin-form input[type="email"],
.admin-form select {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.move-media-gallery-select {
    text-overflow: ellipsis;
}

.admin-form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.admin-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 400 !important;
}

.admin-form-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 8px;
}

.admin-form-toggle-row > span {
    font-weight: 600;
}

/* ── Auth page ── */

.admin-auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.admin-auth-card {
    width: min(400px, 100%);
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 32px 28px;
    box-shadow: var(--admin-shadow);
}

.admin-auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.admin-auth-logo img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 16px;
}

.admin-auth-logo h1 {
    margin: 8px 0 0;
    font-size: 1.5rem;
}

.admin-auth-logo p {
    margin: 4px 0 0;
    color: var(--admin-muted);
    font-size: 0.9rem;
}

/* ── Users page table ── */

.admin-panel {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    padding: 20px;
    box-shadow: var(--admin-shadow);
    margin-bottom: 16px;
}

.admin-panel h2 {
    margin: 0 0 16px;
    font-size: 1.1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--admin-border);
    text-align: left;
    vertical-align: middle;
}

.admin-table th {
    color: var(--admin-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.admin-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--admin-accent-soft);
    color: var(--admin-accent);
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Toast ── */

.admin-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.admin-toast[hidden] { display: none; }

@media (min-width: 768px) {
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .session-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (min-width: 1024px) {
    .admin-main { padding: 28px 24px 64px; }
}

/* ── Gallery analytics ── */

.analytics-panel {
    margin-bottom: 16px;
}

.analytics-details {
    background: var(--admin-card);
    border-radius: var(--admin-radius);
    box-shadow: var(--admin-shadow);
    overflow: hidden;
}

.analytics-summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.analytics-summary::-webkit-details-marker {
    display: none;
}

.analytics-summary::marker {
    content: "";
}

.analytics-summary-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.analytics-summary-start {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.analytics-summary-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.analytics-summary-toggle .share-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--admin-muted);
    white-space: nowrap;
}

.analytics-summary-toggle .admin-switch {
    width: 40px;
    height: 24px;
}

.analytics-summary-toggle .admin-switch-slider::before {
    width: 18px;
    height: 18px;
}

.analytics-summary-toggle .admin-switch input:checked + .admin-switch-slider::before {
    transform: translateX(16px);
}

.analytics-summary-meta {
    color: var(--admin-muted);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.analytics-summary::after {
    content: "▾";
    flex-shrink: 0;
    margin-left: 8px;
    color: var(--admin-muted);
    transition: transform 0.15s ease;
}

.analytics-details[open] .analytics-summary::after {
    transform: rotate(180deg);
}

.analytics-body {
    padding: 0 18px 18px;
    border-top: 1px solid var(--admin-border);
}

.analytics-filter {
    margin: 0;
}

.analytics-filter-fields {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    padding-top: 16px;
}

.analytics-filter-fields label {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    width: auto;
    flex: 0 0 auto;
    font-size: 0.9rem;
    font-weight: 500;
}

body.admin-dashboard input[type="date"],
body.admin-auth input[type="date"] {
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: #fff;
    color: #1f1f2e;
    width: 11.5rem;
    max-width: 100%;
    box-sizing: border-box;
    justify-self: start;
    color-scheme: light;
}

body.admin-dashboard input[type="date"]::-webkit-calendar-picker-indicator,
body.admin-auth input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 1;
}

.analytics-filter-reset {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    text-decoration: none;
}

.analytics-filter-reset:hover {
    text-decoration: none;
}

.analytics-subtitle {
    margin: 12px 0 0;
    color: var(--admin-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 16px 0 18px;
}

.analytics-metric {
    background: var(--admin-bg);
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    padding: 12px 14px;
}

.analytics-metric-value {
    display: block;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

.analytics-metric-label {
    display: block;
    margin-top: 4px;
    color: var(--admin-muted);
    font-size: 0.82rem;
}

.analytics-metric-live .analytics-metric-value {
    color: #15803d;
}

.analytics-metric-link {
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, border-color 0.15s;
}

.analytics-metric-link:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.analytics-online-wrap {
    border-top: 1px solid var(--admin-border);
    padding-top: 16px;
    margin-top: 4px;
}

.analytics-metrics-galleries {
    margin-bottom: 0;
}

.analytics-chart-wrap {
    border-top: 1px solid var(--admin-border);
    padding-top: 16px;
}

.analytics-chart-label {
    margin: 0 0 12px;
    color: var(--admin-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.analytics-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    min-height: 120px;
    padding-bottom: 22px;
}

.analytics-chart.is-wide {
    overflow-x: auto;
    padding-bottom: 28px;
}

.analytics-chart.is-wide .analytics-bar {
    flex: 0 0 28px;
    min-width: 28px;
}

.analytics-bar {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 120px;
    justify-content: flex-end;
    position: relative;
}

.analytics-bar-fill {
    width: 100%;
    max-width: 36px;
    min-height: 4px;
    border-radius: 6px 6px 2px 2px;
    background: linear-gradient(180deg, #60a5fa 0%, var(--admin-accent) 100%);
    transition: height 0.2s ease;
}

.analytics-bar-value {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--admin-text);
    line-height: 1;
}

.analytics-bar-label {
    position: absolute;
    bottom: 0;
    font-size: 0.68rem;
    color: var(--admin-muted);
    white-space: nowrap;
    transform: translateY(100%);
    padding-top: 4px;
}

.analytics-chart-empty {
    color: var(--admin-muted);
    font-size: 0.9rem;
    padding: 24px 0;
}

@media (max-width: 640px) {
    .analytics-summary {
        flex-wrap: wrap;
        padding: 12px 14px;
    }

    .analytics-summary-start {
        flex: 1 1 100%;
        flex-wrap: wrap;
    }

    .analytics-summary-meta {
        flex: 1 1 100%;
        white-space: normal;
    }

    .analytics-body {
        padding: 0 14px 14px;
    }

    .analytics-filter-fields {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .analytics-filter-fields label {
        width: auto;
    }
}

/* ── Settings page ── */

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: 10px;
    background: #e5e7eb;
}

.settings-tab {
    appearance: none;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--admin-muted);
    cursor: pointer;
}

.settings-tab:hover {
    color: var(--admin-text);
}

.settings-tab.is-active {
    background: var(--admin-card);
    color: var(--admin-text);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.settings-panel[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .settings-tabs {
        width: 100%;
    }

    .settings-tab {
        flex: 1 1 calc(50% - 4px);
    }
}

.settings-panel h2 {
    margin: 0 0 8px;
}

.settings-intro {
    margin: 0 0 20px;
    color: var(--admin-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.settings-logo-block {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--admin-border);
}

.settings-logo-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 88px;
    padding: 16px;
    border: 1px dashed var(--admin-border);
    border-radius: 12px;
    background: var(--admin-bg);
}

.settings-logo-preview img {
    max-height: 48px;
    max-width: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.settings-logo-preview.is-empty {
    color: var(--admin-muted);
    font-size: 0.9rem;
}

.settings-form {
    max-width: 520px;
}

.settings-social-form {
    max-width: 760px;
}

.settings-social-grid {
    display: grid;
    gap: 0 16px;
}

@media (min-width: 700px) {
    .settings-social-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.settings-form-actions {
    justify-content: flex-start;
}

.settings-hint {
    margin: -6px 0 12px;
    color: var(--admin-muted);
    font-size: 0.82rem;
}

.settings-remove-form {
    margin: 0;
}

.admin-flash-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

/* ── Tiešsaiste (tabula analītikā) ── */

.analytics-table-wrap {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.analytics-table th,
.analytics-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--admin-border);
    text-align: left;
}

.analytics-table th {
    color: var(--admin-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.analytics-table-online {
    font-weight: 700;
    color: #15803d;
}

.analytics-table-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--admin-muted);
    font-size: 0.75rem;
    vertical-align: middle;
}

/* ── Uz augšu (peldoša poga) ── */

.admin-scroll-top {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    z-index: 170;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--admin-card);
    color: var(--admin-accent);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.15s ease;
}

.admin-scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.admin-scroll-top:hover {
    background: var(--admin-accent-soft);
}

.admin-scroll-top:active {
    transform: translateY(0) scale(0.96);
}

@media (max-width: 767px) {
    .admin-scroll-top {
        width: 52px;
        height: 52px;
        right: max(14px, env(safe-area-inset-right, 0px));
        bottom: max(18px, env(safe-area-inset-bottom, 0px));
    }
}

/* ── Drukas monitors ── */

.print-monitor-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.print-monitor-header {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 18px 20px;
}

.print-monitor-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.print-monitor-metric {
    min-width: 140px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03);
}

.print-monitor-metric-live .print-monitor-metric-value {
    color: #15803d;
}

.print-monitor-metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.print-monitor-metric-label {
    display: block;
    margin-top: 4px;
    color: var(--admin-muted);
    font-size: 0.82rem;
}

.print-monitor-metric-muted .print-monitor-metric-value {
    color: var(--admin-muted);
    font-size: 1.1rem;
}

.print-booth-media-muted {
    font-style: italic;
}

.print-monitor-subtitle {
    margin: 12px 0 0;
    color: var(--admin-muted);
    font-size: 0.86rem;
}

.print-monitor-refresh {
    margin-top: 12px;
}

.print-monitor-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-monitor-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-monitor-tab {
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-card);
    color: var(--admin-text);
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    max-width: min(100%, 320px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-monitor-tab.is-active {
    background: var(--admin-accent-soft);
    border-color: var(--admin-accent);
    color: var(--admin-accent);
    font-weight: 600;
}

.print-monitor-filter {
    border: 1px solid var(--admin-border);
    border-radius: 999px;
    background: var(--admin-card);
    color: var(--admin-text);
    padding: 8px 14px;
    font-size: 0.88rem;
    cursor: pointer;
}

.print-monitor-filter.is-active {
    background: var(--admin-accent-soft);
    border-color: var(--admin-accent);
    color: var(--admin-accent);
    font-weight: 600;
}

.print-monitor-empty {
    padding: 28px 20px;
    border-radius: 16px;
    border: 1px dashed var(--admin-border);
    color: var(--admin-muted);
    text-align: center;
}

.print-monitor-empty-hint {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--admin-text);
}

.print-monitor-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.print-booth-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow: hidden;
}

.print-booth-card.is-offline {
    opacity: 0.72;
}

.print-booth-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--admin-border);
}

.print-booth-title-wrap {
    min-width: 0;
}

.print-booth-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.print-booth-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.print-booth-card:not(.is-offline) .print-booth-status::before {
    background: #22c55e;
}

.print-booth-status-idle::before {
    background: #f59e0b !important;
}

.print-booth-title {
    margin: 6px 0 0;
    font-size: 1.15rem;
    font-weight: 700;
}

.print-booth-meta {
    margin: 4px 0 0;
    color: var(--admin-muted);
    font-size: 0.84rem;
}

.print-booth-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.print-booth-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.02);
    border-bottom: 1px solid var(--admin-border);
}

.print-booth-stat strong {
    display: block;
    font-size: 1.1rem;
}

.print-booth-stat span {
    color: var(--admin-muted);
    font-size: 0.78rem;
}

.print-booth-stat-warn strong {
    color: #b45309;
}

.print-booth-stat-alert strong {
    color: #b91c1c;
}

.print-booth-media {
    padding: 10px 18px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.86rem;
    color: var(--admin-muted);
}

.print-booth-media-line + .print-booth-media-line {
    margin-top: 4px;
}

.print-booth-media-label {
    color: var(--admin-text);
    font-weight: 600;
}

.print-booth-media-status.is-alert {
    color: #b91c1c;
}

.print-booth-media-status.is-warn {
    color: #b45309;
}

#print-printer-status-metric.print-booth-stat-alert .print-monitor-metric-value {
    color: #b91c1c;
}

#print-printer-status-metric.print-booth-stat-warn .print-monitor-metric-value {
    color: #b45309;
}

.print-job-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, max-content));
    gap: 12px;
    padding: 14px 18px 18px;
    align-items: start;
    justify-content: start;
}

.print-job-card {
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    width: 148px;
    max-width: 100%;
}

.print-job-media {
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    overflow: hidden;
}

.print-job-thumb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.print-job-thumb-btn img,
.print-job-media img {
    width: auto;
    height: auto;
    max-width: 140px;
    max-height: 320px;
    object-fit: contain;
    display: block;
}

.print-job-thumb-fallback {
    color: var(--admin-muted);
    font-size: 0.75rem;
    padding: 16px 8px;
    text-align: center;
    min-width: 120px;
}

.print-job-body {
    padding: 8px 10px 10px;
    border-top: 1px solid var(--admin-border);
    background: #fff;
}

.print-job-name {
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-job-tags {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    min-height: 18px;
    overflow: hidden;
}

.print-job-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.06);
}

.print-job-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.print-job-badge-printing {
    background: #dbeafe;
    color: #1d4ed8;
}

.print-job-badge-done {
    background: #dcfce7;
    color: #166534;
}

.print-job-badge-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.print-job-counts {
    margin-top: 6px;
    font-size: 0.74rem;
    color: var(--admin-muted);
}

.print-booth-jobs-empty {
    padding: 18px;
    color: var(--admin-muted);
    font-size: 0.88rem;
}

.print-job-gallery-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.print-booth-print-all {
    min-height: 44px;
    font-size: 0.95rem;
}

.print-dialog-modal {
    position: fixed;
    inset: 0;
    z-index: 230;
    display: grid;
    place-items: center;
    padding: 16px;
}

.print-dialog-modal[hidden] {
    display: none !important;
}

.print-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.print-dialog-panel {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    background: var(--admin-card);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.print-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--admin-border);
}

.print-dialog-head h2 {
    margin: 0;
    font-size: 1.15rem;
}

.print-dialog-body {
    overflow: auto;
    padding: 18px;
}

.print-dialog-lead {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.45;
}

.print-dialog-job-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.print-dialog-job-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.02);
}

.print-dialog-job-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.92rem;
    font-weight: 600;
}

.print-dialog-job-copies {
    flex: 0 0 auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--admin-accent);
}

.print-dialog-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 18px 18px;
    border-top: 1px solid var(--admin-border);
}

.print-dialog-foot .admin-btn,
.print-preview-print-btn {
    min-height: 48px;
    padding-left: 20px;
    padding-right: 20px;
    font-size: 1rem;
}

.print-dialog-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.print-dialog-step-btn {
    width: 52px;
    height: 52px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-card);
    color: var(--admin-text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.print-dialog-count-input {
    width: 88px;
    height: 52px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 700;
}

.print-preview-foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px 18px 18px;
    border-top: 1px solid var(--admin-border);
    flex: 0 0 auto;
}

.print-preview-meta {
    margin: 0;
    color: var(--admin-muted);
    font-size: 0.9rem;
    word-break: break-word;
}

.print-preview-print-btn {
    width: 100%;
}

.print-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 220;
    display: grid;
    place-items: center;
    padding: 20px;
}

.print-preview-modal[hidden] {
    display: none !important;
}

.print-preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
}

.print-preview-panel {
    position: relative;
    width: min(960px, 100%);
    max-height: calc(100vh - 40px);
    height: min(900px, calc(100vh - 40px));
    background: var(--admin-card);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

@media (min-width: 1024px) {
    .print-preview-modal {
        padding: 24px;
    }

    .print-preview-panel {
        width: min(1120px, calc(100vw - 48px));
        height: calc(100vh - 48px);
        max-height: calc(100vh - 48px);
    }
}

@media (min-width: 1400px) {
    .print-preview-modal {
        padding: 32px;
    }

    .print-preview-panel {
        width: min(1320px, calc(100vw - 64px));
        height: calc(100vh - 64px);
        max-height: calc(100vh - 64px);
    }
}

@media (min-width: 1800px) {
    .print-preview-panel {
        width: min(1520px, calc(100vw - 80px));
        height: calc(100vh - 72px);
        max-height: calc(100vh - 72px);
    }
}

.print-preview-head {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--admin-border);
    flex: 0 0 auto;
}

.print-preview-head-center {
    min-width: 0;
    text-align: center;
}

.print-preview-head h2 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-preview-counter {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: var(--admin-muted);
}

.print-preview-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: var(--admin-bg);
    color: var(--admin-text);
    cursor: pointer;
}

.print-preview-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.print-preview-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.print-preview-info .print-job-tags {
    justify-content: flex-start;
}

.print-preview-info .print-job-name {
    font-size: 0.92rem;
    font-weight: 600;
    word-break: break-word;
}

.print-preview-info .print-job-counts {
    font-size: 0.78rem;
    color: var(--admin-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.25;
}

.print-job-count-line {
    display: block;
}

.print-booth-stat-printed {
    min-width: 0;
}

.print-booth-stat-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--admin-muted);
    line-height: 1.25;
}

.print-preview-media {
    margin: 0;
    font-size: 0.82rem;
    color: var(--admin-muted);
}

.print-preview-media.is-warn {
    color: #b45309;
}

.print-preview-media.is-alert {
    color: #b91c1c;
    font-weight: 600;
}

.print-preview-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    touch-action: pan-y;
}

.print-preview-body img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

@media (max-width: 767px) {
    .print-job-grid {
        grid-template-columns: repeat(auto-fill, minmax(132px, max-content));
    }

    .print-job-card {
        width: 132px;
    }

    .print-dialog-panel {
        width: 100%;
    }

    .print-preview-modal {
        padding: 10px;
    }

    .print-preview-panel {
        max-height: calc(100vh - 20px);
        height: calc(100vh - 20px);
    }
}

.efpic-switch {
    width: 40px;
    height: 22px;
    border: 0;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    padding: 0;
    cursor: pointer;
    flex: 0 0 40px;
}

.efpic-switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.15s ease;
}

.efpic-switch.is-on {
    background: var(--admin-accent, #e11d8f);
}

.efpic-switch.is-on span {
    left: 3px;
    transform: translateX(18px);
}

.admin-album-card.is-hidden-session {
    opacity: 0.55;
}
