/* Application styles, copied by Rollup to public/assets/app/css/app.css (loaded after Tabler). */

:root {
    --tblr-font-sans-serif: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/*
 * Page background: the illustration behind a veil, so titles and lists on the
 * page stay readable (cards keep their own solid background). Raise or lower
 * the veil to show more or less of the image.
 */
:root {
    --cips-body-veil: rgba(246, 248, 251, 0.82);
}

[data-bs-theme="dark"] {
    --cips-body-veil: rgba(21, 31, 44, 0.88);
}

body {
    background-color: var(--tblr-body-bg);
    background-image: linear-gradient(var(--cips-body-veil), var(--cips-body-veil)), url('../../img/bg/bg_body.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* Alpine: hide elements until initialised. */
[x-cloak] {
    display: none !important;
}

/* Main menu items as pills, with a little space between them. */
#navbar-menu .navbar-nav {
    gap: 0.25rem;
}

#navbar-menu .navbar-nav > .nav-item > .nav-link {
    border-radius: 999px;
    padding: 0.375rem 6px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* Shared hover for menu pills and header buttons (full screen, theme, user menu). */
#navbar-menu .navbar-nav > .nav-item > .nav-link:hover,
#navbar-menu .navbar-nav > .nav-item > .nav-link.show,
.header-action:hover,
.header-action.show {
    background-color: rgba(var(--tblr-primary-rgb), 0.08);
}

/* Header clock: two compact right-aligned lines; fixed-width digits stop the time from jiggling. */
.navbar-clock {
    align-self: center;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Header buttons: a pill around the avatar, with a little breathing room. */
.navbar .navbar-nav .nav-link.header-action {
    border-radius: 999px;
    padding: 0.25rem 4px;
    transition: background-color 0.15s ease;
}

#navbar-menu .navbar-nav > .nav-item.active > .nav-link {
    background-color: var(--tblr-primary-lt);
    color: var(--tblr-primary);
}

/* Menu icons in a round badge, matching the avatar look of the header buttons. */
#navbar-menu .navbar-nav > .nav-item > .nav-link .nav-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    /* Same values Tabler's .avatar uses (its variables are scoped to .avatar). */
    background-color: var(--tblr-fill-tertiary);
    box-shadow: inset 0 0 0 1px var(--tblr-border-color-translucent);
    opacity: 1;
}

#navbar-menu .navbar-nav > .nav-item > .nav-link .nav-link-icon .icon {
    width: 1rem;
    height: 1rem;
}

/* The active pill replaces Tabler's underline marker. */
#navbar-menu .navbar-nav > .nav-item.active::after {
    display: none;
}

/* Agent logo in the header: fits the navbar height, keeps its proportions. */
.navbar-logo {
    height: 2rem;
    width: auto;
    max-width: 8rem;
    object-fit: contain;
}

/* Document templates page: logo thumbnails and the PDF preview. */
.template-logo {
    height: 6rem;
    width: auto;
    max-width: 12rem;
    object-fit: contain;
    background-color: #fff;
}

.template-preview {
    display: block;
    width: 100%;
    height: 75vh;
    min-height: 32rem;
    border: 0;
}

/* Receipts and payments journal: compact rows; the partner edit button shows on hover. */
.registry-table td,
.registry-table th {
    vertical-align: middle;
    font-size: 0.8125rem;
}

.registry-table .registry-edit {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.registry-table tr:hover .registry-edit,
.registry-table .registry-edit:focus {
    opacity: 1;
}

/* Sprite icons inherit Tabler's .icon sizing; keep strokes crisp. */
svg.icon {
    flex-shrink: 0;
}

/* Livewire-driven modals are rendered conditionally instead of through Bootstrap's JS. */
.modal.modal-livewire {
    display: block;
    background-color: rgba(var(--tblr-dark-rgb), 0.35);
}

/* Tables become stacked cards on small screens. */
@media (max-width: 767.98px) {
    .table-stack thead {
        display: none;
    }

    .table-stack tr {
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--tblr-border-color);
    }

    .table-stack td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border: 0;
        padding: 0.25rem 0.75rem;
    }

    .table-stack td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--tblr-secondary);
    }
}
