/* Application custom styles */
#notif-dropdown .dropdown-menu-card {
    min-width: 28rem;
}
/* On mobile the bell navigates to /activities?result=unread, hide the dropdown */
@media (max-width: 767.98px) {
    #notif-dropdown .dropdown-menu-card {
        display: none !important;
    }
}
.notif-list {
    max-height: 20rem;
    overflow-y: auto;
}
.notif-dismiss {
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s;
}
.list-group-item:hover .notif-dismiss {
    opacity: 1;
}
.toast-above {
    z-index: 1090;
}
.col-message {
    max-width: 300px;
}
.navbar-divider {
    height: 1.25rem;
}
.input-group-narrow {
    max-width: 500px;
}
.token-value {
    font-size: 0.8rem;
    word-break: break-all;
}
/* Markdown doc tables — Tabler styling */
.markdown table {
    width: 100%;
    border-collapse: collapse;
}
.markdown table th,
.markdown table td {
    padding: 0.5rem 0.75rem;
    border: var(--tblr-border-width) solid var(--tblr-border-color);
    vertical-align: middle;
}
.markdown table thead th {
    background: var(--tblr-bg-surface-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--tblr-secondary);
}
.markdown table tbody tr:hover {
    background: var(--tblr-bg-surface-secondary);
}
.markdown .table-responsive {
    overflow-x: auto;
}
/* Doc scrollspy sidebar */
.doc-toc-sidebar {
    position: sticky;
    top: 4rem;
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
}

/* --- Labels / QR ---*/
.label-qr-preview {
    width: 80px;
    height: 80px;
    object-fit: contain;
}
.label-card {
    position: relative;
}
.label-card .label-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s;
}
.label-card:hover .label-remove {
    opacity: 1;
}

/* Preview page simulation */
.label-preview-page {
    min-height: 200px;
    max-height: 70vh;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    background: white;
    overflow-y: auto;
    overflow-x: hidden;
}
.label-preview-page.landscape {
    /* no special ratio needed — scrollable */
}
.label-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, var(--preview-width, 60px));
    gap: var(--preview-gap, 3px);
    padding: var(--preview-margin, 4px);
    align-content: start;
    justify-content: center;
}
.label-preview-cell {
    width: var(--preview-width, 60px);
    height: var(--preview-height, 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--preview-padding, 2px);
    box-sizing: border-box;
    overflow: hidden;
}
.label-preview-cell img {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-height: var(--preview-img-max, none);
    object-fit: contain;
}
.label-preview-cell .label-preview-text {
    flex: 0 0 auto;
    font-size: var(--preview-font-size, 6px);
    margin-top: calc(var(--preview-padding, 2px) / 2);
    text-align: center;
    width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.2;
}
/* Landscape: QR left, text right */
.label-preview-cell.landscape {
    flex-direction: row;
}
.label-preview-cell.landscape img {
    flex: 0 0 auto;
    width: auto;
    height: 100%;
    min-height: unset;
    max-width: var(--preview-img-max, 50%);
    max-height: none;
}
.label-preview-cell.landscape .label-preview-text {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    margin-top: 0;
    margin-left: var(--preview-padding, 4px);
    text-align: left;
    overflow-wrap: anywhere;
    -webkit-line-clamp: 3;
}
.label-preview-empty {
    grid-column: 1 / -1;
}
.label-preview-cell.has-border,
.label-cell.has-border {
    border: 1px solid #dee2e6;
    border-radius: 2px;
}

/* Qty picker in label queue cards */
.label-qty {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid var(--tblr-border-color);
    border-radius: var(--tblr-border-radius);
    padding: 0 0.25rem;
    height: 1.5rem;
}
.label-qty button {
    background: none;
    border: none;
    padding: 0 0.15rem;
    line-height: 1;
    cursor: pointer;
    color: var(--tblr-secondary);
    font-size: 0.75rem;
}
.label-qty button:hover {
    color: var(--tblr-primary);
}
.label-qty span {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 1rem;
    text-align: center;
}

/* Print styles for label sheets */
@media print {
    .d-print-none { display: none !important; }
    .d-print-block { display: block !important; }

    /* Strip all Tabler wrapper spacing — @page margin handles it */
    body, .page, .page-wrapper, .page-body, .container-xl {
        margin: 0 !important;
        padding: 0 !important;
    }

    .label-print-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, var(--label-width, 35mm));
        gap: var(--label-gap, 4mm);
        justify-content: center;
    }
    .label-cell {
        width: var(--label-width, 35mm);
        height: var(--label-height, 35mm);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: var(--label-padding, 1.5mm);
        box-sizing: border-box;
        overflow: hidden;
        page-break-inside: avoid;
        break-inside: avoid;
    }
    .label-cell img {
        flex: 1 1 0;
        min-height: 0;
        width: 100%;
        max-height: var(--label-img-max, none);
        object-fit: contain;
    }
    .label-cell .label-text {
        flex: 0 0 auto;
        font-size: var(--label-font-size, 8pt);
        margin-top: calc(var(--label-padding, 1.5mm) / 2);
        text-align: center;
        width: 100%;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.2;
    }
    /* Landscape: QR left, text right */
    .label-cell.landscape {
        flex-direction: row;
    }
    .label-cell.landscape img {
        flex: 0 0 auto;
        width: auto;
        height: 100%;
        min-height: unset;
        max-width: var(--label-img-max, 50%);
        max-height: none;
    }
    .label-cell.landscape .label-text {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        margin-top: 0;
        margin-left: var(--label-padding, 2mm);
        text-align: left;
        overflow-wrap: anywhere;
        -webkit-line-clamp: 3;
    }
}

/* ── System banner (reusable full-width strip above navbar) ── */
.system-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--tblr-body-color);
    font-size: var(--tblr-body-font-size);
    font-family: var(--tblr-body-font-family);
    box-shadow: inset 0 -1px rgba(0, 0, 0, 0.1);
}
.system-banner > span {
    min-width: 0;
}
.system-banner > .badge {
    flex-shrink: 0;
    white-space: nowrap;
}
.system-banner.bg-warning-lt {
    background: var(--tblr-warning-lt);
}
