/*
 * The look of Mensualia's pages: the portal's menu on the left on a computer and on top on a phone, its themes (#60,
 * #73) and the parts of its pages. The body carries the theme of Advanced Widgets the user chose and its Bootstrap look:
 * the theme's --antilia-theme-* properties color the components, Bootstrap (the look gives Bootstrap's own properties
 * the theme's colors) and this sheet, so no rule below writes a fixed color of its own. The html tag carries the
 * theme's code (mensualia-theme-light, -blue, -green, -red or -dark) and Bootstrap's color mode.
 */

/* ---- The themes ---- */

/* The page around the content, in the theme's color for it */
body.antilia-theme {
    background-color: var(--antilia-theme-page);
}

.card {
    --bs-card-border-radius: 0.75rem;
    --bs-card-inner-border-radius: calc(0.75rem - 1px);
    box-shadow: var(--antilia-theme-shadow);
}

.list-group {
    box-shadow: var(--antilia-theme-shadow);
}


/* ---- The frame of the portal ---- */

.mensualia-shell {
    display: flex;
    min-height: 100vh;
}

.mensualia-sidebar {
    flex: 0 0 15.5rem;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
    border-right: 1px solid var(--antilia-theme-border);
    background: var(--antilia-theme-nav);
}

.mensualia-brand {
    display: block;
    margin: 0 0.5rem 1.5rem;
    text-decoration: none;
}

.mensualia-brand img {
    display: block;
    height: 2.5rem;
    width: auto;
}

/* The page the user is on, in the menu: in the theme's color on its soft tint, readable in the dark theme too */
.mensualia-sidebar .antilia-menu-link.antilia-menu-current {
    color: var(--antilia-theme-primary-text) !important;
    background: var(--antilia-theme-primary-soft) !important;
    font-weight: 600;
}

/* The logo on the pages without the portal's frame: the login, choosing a company, no access. */
.mensualia-logo {
    display: block;
    height: 3.5rem;
    width: auto;
}

/* At the foot of the customers' payment page: the company's page, made with Mensualia. */
.mensualia-powered {
    margin-top: 2.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--antilia-theme-muted);
}

.mensualia-powered img {
    height: 1.5rem;
    width: auto;
    vertical-align: middle;
}

.mensualia-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mensualia-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    min-height: 3.75rem;
    padding: 0.5rem 1.75rem;
    border-bottom: 1px solid var(--antilia-theme-border);
    background: color-mix(in srgb, var(--antilia-theme-surface) 88%, transparent);
    backdrop-filter: blur(8px);
}

.mensualia-topbar-end {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mensualia-company {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
}

.mensualia-company .badge {
    font-weight: 500;
    color: var(--antilia-theme-primary-text) !important;
    background: var(--antilia-theme-primary-soft) !important;
}

.mensualia-main {
    flex: 1 1 auto;
    padding: 1.75rem;
}

/* The title of each page */
.mensualia-main > h1,
.mensualia-main > div > h1 {
    font-weight: 650;
    letter-spacing: -0.01em;
}

.mensualia-main h2.h6,
.mensualia-narrow h2.h6,
.mensualia-page h2.h6 {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--antilia-theme-muted);
}

/* The fields of a form of the settings no wider than what they hold */
.mensualia-settings-form .form-control {
    max-width: 32rem;
}

.mensualia-narrow {
    max-width: 28rem;
    margin: 4rem auto;
    padding: 0 1rem;
}

/* The demo's accounts on the login page (#109): each email a button that fills the form, written as code, wrapping on a
   phone rather than overflowing the box */
.mensualia-demo-accounts h2 {
    font-weight: 600;
}

.mensualia-demo-email {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-family: var(--bs-font-monospace);
    font-size: 0.875em;
    text-align: start;
    text-decoration: underline dotted;
    text-underline-offset: 0.2em;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.mensualia-demo-email:hover {
    text-decoration-style: solid;
}

/* A customer's portal (#18): room for the table of their documents */
.mensualia-narrow.mensualia-portal {
    max-width: 56rem;
}

/* The head of a section of a page: its title, and its main action at the right, such as adding a person (#73) */
.mensualia-section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.mensualia-section-head h2 {
    margin-top: 0;
}

/* ---- The figures of the home page ---- */

.mensualia-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
}

/* the six figures in two rows of three on a computer, and in one row on a wide screen, never five and one alone */
@media (min-width: 992px) {
    .mensualia-figures {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1800px) {
    .mensualia-figures {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* each figure: its icon next to its name, then the value and what it stands for under them */
.mensualia-figure {
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0.15rem;
    padding: 1rem 1.15rem;
}

.mensualia-figure > :not(.mensualia-figure-icon) {
    grid-column: 1 / -1;
}

.mensualia-figure > .mensualia-figure-icon + * {
    grid-column: 2;
}

.mensualia-figure .value {
    font-size: 1.6rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

/* the icon of each figure, on a tint of its color */
.mensualia-figure-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.35rem;
    border-radius: 0.55rem;
    color: var(--antilia-theme-accent);
    background: var(--antilia-theme-primary-soft);
}

.mensualia-figure-icon svg {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.mensualia-figure-icon.is-danger {
    color: var(--antilia-theme-error);
    background: color-mix(in srgb, var(--antilia-theme-error) 14%, transparent);
}

.mensualia-figure-icon.is-accent {
    color: var(--antilia-theme-success);
    background: color-mix(in srgb, var(--antilia-theme-success) 14%, transparent);
}

/* ---- The pages around the portal (#128): the choice of a company, the accountant's panel, a firm's condominiums ---- */

/* the bar at the top, as the portal's: the logo, and the choices of theme and language and the person's menu */
.mensualia-topbar-plain {
    padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.mensualia-topbar-brand {
    display: block;
}

.mensualia-topbar-logo {
    display: block;
    height: 2.25rem;
    width: auto;
}

.mensualia-page {
    width: 100%;
    max-width: 66rem;
    margin: 0 auto;
    padding: 2.25rem clamp(1rem, 4vw, 2.5rem) 3.5rem;
}

.mensualia-page-wide {
    max-width: 86rem;
}

.mensualia-page-head {
    margin-bottom: 1.75rem;
}

.mensualia-page-head h1 {
    margin-bottom: 0.3rem;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.mensualia-page-head .lead {
    margin-bottom: 0;
    font-size: 1.05rem;
    color: var(--antilia-theme-muted);
}

/* the way back to the choice of a company, above the title */
.mensualia-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--antilia-theme-muted);
    text-decoration: none;
}

.mensualia-back:hover,
.mensualia-back:focus-visible {
    color: var(--antilia-theme-primary-text);
}

/* the views over several companies: a card each, its icon on the theme's color, what it shows, an arrow */
.mensualia-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    margin-bottom: 2.25rem;
}

.mensualia-shortcuts:not(:has(a)) {
    display: none;
}

.mensualia-shortcut {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--antilia-theme-border);
    background: linear-gradient(135deg, var(--antilia-theme-primary-soft), var(--antilia-theme-surface) 75%);
    color: inherit;
    text-decoration: none;
}

.mensualia-shortcut-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    color: var(--antilia-theme-on-primary);
    background: var(--antilia-theme-primary);
}

.mensualia-shortcut-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    fill: currentColor;
}

.mensualia-shortcut-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.mensualia-shortcut-title {
    font-size: 1.05rem;
    font-weight: 650;
}

.mensualia-shortcut-help {
    font-size: 0.85rem;
    color: var(--antilia-theme-muted);
}

.mensualia-shortcut-arrow {
    flex: 0 0 auto;
    color: var(--antilia-theme-muted);
    transition: transform 0.15s ease, color 0.15s ease;
}

.mensualia-shortcut-arrow svg {
    display: block;
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

/* a card that is a link rises a little under the pointer, its arrow toward where it goes */
.mensualia-shortcut,
.mensualia-company-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

a.mensualia-shortcut:hover,
a.mensualia-shortcut:focus-visible,
a.mensualia-company-card:hover,
a.mensualia-company-card:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--antilia-theme-primary) 45%, var(--antilia-theme-border));
    box-shadow: 0 0.6rem 1.4rem color-mix(in srgb, var(--antilia-theme-primary) 16%, transparent);
}

a:hover > .mensualia-shortcut-arrow,
a:focus-visible > .mensualia-shortcut-arrow {
    transform: translateX(3px);
    color: var(--antilia-theme-primary-text);
}

@media (prefers-reduced-motion: reduce) {
    .mensualia-shortcut,
    .mensualia-company-card,
    .mensualia-shortcut-arrow {
        transition: none;
    }

    a.mensualia-shortcut:hover,
    a.mensualia-company-card:hover {
        transform: none;
    }
}

/* how many there are, next to a section's title */
.mensualia-count {
    margin-left: 0.4rem;
    padding: 0.05rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    letter-spacing: 0;
    color: var(--antilia-theme-primary-text);
    background: var(--antilia-theme-primary-soft);
}

.mensualia-company-search {
    width: min(100%, 18rem);
}

/* the companies, a card each: its logo or initials, its name, its kind of business and the person's role */
.mensualia-company-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 0.85rem;
}

.mensualia-company-card {
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--antilia-theme-border);
    color: inherit;
    text-decoration: none;
}

.mensualia-company-card.is-inactive {
    opacity: 0.7;
    box-shadow: none;
}

.mensualia-company-card-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    min-width: 0;
}

.mensualia-company-card-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-weight: 600;
    line-height: 1.25;
}

.mensualia-company-card-meta {
    font-size: 0.8rem;
    color: var(--antilia-theme-muted);
}

.mensualia-dot::before {
    content: "·";
    margin: 0 0.4em;
}

/* the person's role in a company, a small tag in the theme's color */
.mensualia-role {
    display: inline-block;
    margin-top: 0.2rem;
    padding: 0.05rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--antilia-theme-primary-text);
    background: var(--antilia-theme-primary-soft);
}

/* a company's mark: its initials on a tint of one of the theme's colors, or its logo */
.mensualia-avatar {
    --avatar: var(--antilia-theme-primary);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: color-mix(in srgb, var(--avatar) 75%, var(--antilia-theme-text));
    background: color-mix(in srgb, var(--avatar) 16%, var(--antilia-theme-surface));
}

.mensualia-avatar-2 {
    --avatar: var(--antilia-theme-success);
}

.mensualia-avatar-3 {
    --avatar: var(--antilia-theme-accent);
}

.mensualia-avatar-4 {
    --avatar: var(--antilia-theme-warning);
}

/* a logo is drawn for paper, as on the company's invoices: its chip is white in every theme, the dark one too */
.mensualia-avatar.has-logo {
    padding: 0.2rem;
    border: 1px solid var(--antilia-theme-border);
    background: var(--bs-white);
}

.mensualia-avatar.has-logo img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    object-fit: contain;
}

/* the invitations not answered yet, above the companies */
.mensualia-invitations {
    display: grid;
    gap: 0.75rem;
}

.mensualia-invitation {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid color-mix(in srgb, var(--antilia-theme-primary) 35%, var(--antilia-theme-border));
}

.mensualia-invitation-name {
    flex: 1 1 12rem;
    min-width: 0;
}

/* the totals of a view over several companies: as many in a row as fit */
.mensualia-figures.mensualia-figures-auto {
    grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}

.mensualia-figure-icon.is-warning {
    color: color-mix(in srgb, var(--antilia-theme-warning) 80%, var(--antilia-theme-text));
    background: color-mix(in srgb, var(--antilia-theme-warning) 16%, transparent);
}

/* how the month's sales compare with last month's: up in green, down in red */
.mensualia-change {
    font-weight: 550;
}

.mensualia-change.is-up {
    color: color-mix(in srgb, var(--antilia-theme-success) 80%, var(--antilia-theme-text));
}

.mensualia-change.is-down {
    color: color-mix(in srgb, var(--antilia-theme-error) 80%, var(--antilia-theme-text));
}

.mensualia-change.is-flat {
    color: var(--antilia-theme-muted);
}

/* the accountant's clients, a card each: a line of color along its top when the PAC rejected or holds a document */
.mensualia-client-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
    gap: 1rem;
}

.mensualia-client {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--antilia-theme-border);
}

.mensualia-client::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--client-mark, transparent);
}

.mensualia-client.is-bad {
    --client-mark: var(--antilia-theme-error);
}

.mensualia-client.is-pending {
    --client-mark: var(--antilia-theme-warning);
}

.mensualia-client > .card-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.15rem 1.25rem 1.1rem;
}

.mensualia-client-head {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
}

.mensualia-client-name {
    flex: 1 1 auto;
    min-width: 0;
}

.mensualia-client-name h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 0.1rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.mensualia-client-head .status {
    flex: 0 0 auto;
    margin-top: 0.15rem;
}

.mensualia-client-main {
    padding-bottom: 0.9rem;
    border-bottom: 1px dashed var(--antilia-theme-border);
}

.mensualia-client-value {
    font-size: 1.65rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.mensualia-client-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1rem;
    margin: 0;
}

.mensualia-client-facts dt {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--antilia-theme-muted);
}

.mensualia-client-facts dt::first-letter {
    text-transform: uppercase;
}

.mensualia-client-facts dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mensualia-client-commission {
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: var(--antilia-theme-primary-text);
    background: var(--antilia-theme-primary-soft);
}

.mensualia-client-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--antilia-theme-border);
    background: color-mix(in srgb, var(--antilia-theme-page) 55%, var(--antilia-theme-surface));
}

/* ---- Mensualia's administration (#115) ---- */

/* the mark of the administration at the top, on a tint of the theme's color, so the team knows where it is */
.mensualia-admin-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.55rem;
    color: var(--antilia-theme-primary-text);
    background: var(--antilia-theme-primary-soft);
}

.mensualia-admin-mark svg {
    width: 0.95rem;
    height: 0.95rem;
    fill: currentColor;
}

/* the sidebar of the administration: a thin line of the theme's color along its edge */
.mensualia-admin .mensualia-sidebar {
    box-shadow: inset -3px 0 0 var(--antilia-theme-primary-soft);
}

/* the newest companies and requests of the summary: one line each, its badge at the end */
.mensualia-admin-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--antilia-theme-border);
}

.mensualia-admin-list li:last-child {
    border-bottom: 0;
}

.mensualia-admin-list li > div {
    min-width: 0;
}

.mensualia-admin-list .fw-semibold {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* a company's details, in their dialog */
.mensualia-admin-details dt {
    font-weight: 500;
    color: var(--antilia-theme-muted);
}

.mensualia-admin-details dd {
    margin-bottom: 0.5rem;
}

/* the tabs of the pilot's page: their panels a little apart from them */
.mensualia-admin .antilia-tabs-panel > .mensualia-table-scroll:first-child,
.mensualia-admin .antilia-tabs-panel > .card:first-child {
    margin-top: 1rem;
}

/* ---- Logos ---- */

/* The company's logo (#48), next to its name at the top of the portal, on its invoices and on its payment page */
.mensualia-company-logo {
    height: 2rem;
    max-width: 10rem;
    width: auto;
    margin-right: 0.25rem;
    vertical-align: middle;
    object-fit: contain;
}

/* The preview of the design of the documents (#38): the first page of an invoice of example, as wide as it fits */
.mensualia-design-preview {
    display: block;
    width: 100%;
    max-width: 52rem;
    height: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    background: #fff;
}

.mensualia-issuer-logo {
    display: block;
    height: 2rem;
    max-width: 10rem;
    width: auto;
    margin-bottom: 0.25rem;
    object-fit: contain;
    object-position: left;
}

.mensualia-pay-logo {
    display: block;
    height: 4rem;
    max-width: 12.5rem;
    width: auto;
    margin-bottom: 0.75rem;
    object-fit: contain;
    object-position: left;
}

/* The branch the user looks at, next to the company's name */
.mensualia-branch {
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
}

.mensualia-branch .form-select {
    width: auto;
    min-width: 12rem;
}

/* ---- Filters and tables ---- */

/* The filters above a table, on a card of their own */
.mensualia-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--antilia-theme-border);
    border-radius: 0.75rem;
    background: var(--antilia-theme-surface);
    box-shadow: var(--antilia-theme-shadow);
}

.mensualia-filters > div > label {
    display: block;
}

.mensualia-filters .form-control,
.mensualia-filters .form-select {
    width: auto;
    min-width: 9rem;
}

.mensualia-filters .mensualia-search {
    min-width: 16rem;
}

/* a dropdown of Advanced Widgets as small as its select (form-select-sm), as in the filters, so it lines up with the
   other small fields next to it */
.form-select-sm.antilia-dropdown-native + .antilia-dropdown-toggle.form-select {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    padding-left: 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--bs-border-radius-sm);
}

/* The choices of a radio group (Wicket's RadioChoice) side by side, each with room after it */
.mensualia-radios {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0;
}

.mensualia-radios input[type="radio"] {
    margin: 0 0.4rem 0 0;
    accent-color: var(--antilia-theme-primary);
}

.mensualia-radios label {
    margin-right: 1.5rem;
}

/* A field's label above it, also over the dropdowns of Advanced Widgets, which are inline */
.form-label {
    display: block;
}

/* A choice whose texts are long, such as the DGI's units of measure (#108): the chosen one wraps in its button rather
   than ending in «…» */
.mensualia-whole-choice .antilia-dropdown-value {
    white-space: normal;
    overflow-wrap: anywhere;
}

/* A data table of Advanced Widgets on a card, its corners rounded, its header fixed over the rows that scroll */
/* Every data table of Advanced Widgets on a card of its own, apart from what follows it (#73); a table wider than its
   card, its columns no narrower than their values need (PortalTable), scrolls sideways inside it */
.mensualia-table-scroll {
    margin-bottom: 1.75rem;
    overflow-x: auto;
    border: 1px solid var(--antilia-theme-border);
    border-radius: 0.75rem;
    background: var(--antilia-theme-surface);
    box-shadow: var(--antilia-theme-shadow);
}

.mensualia-table-scroll:last-child {
    margin-bottom: 0;
}

/* Each value on one line, cut with an ellipsis and whole in its tooltip, so the rows keep one height; the long texts,
   such as a list of permissions, wrap (Columns.wrap) */
.ant-data-table > tbody > tr > td:not(.mensualia-wrap) {
    white-space: nowrap;
}

.ant-data-table > tbody > tr > td.mensualia-wrap {
    white-space: normal;
}

/* The handles that move and resize a column, only under the pointer, where there is one, so the headers read clean */
@media (hover: hover) {
    .ant-data-table > thead .antilia-col-mover,
    .ant-data-table > thead .antilia-col-resizer::after {
        opacity: 0;
        transition: opacity 0.15s;
    }

    .ant-data-table > thead th:hover .antilia-col-mover,
    .ant-data-table > thead th:focus-within .antilia-col-mover {
        opacity: 0.6;
    }

    .ant-data-table > thead th:hover .antilia-col-resizer::after,
    .ant-data-table > thead th:focus-within .antilia-col-resizer::after {
        opacity: 0.55;
    }
}

/* The scrolling body of a table (Tables.configure): at most that high, and only as high as its rows when they are
   few, so a short list leaves no empty room under it */
.ant-data-table-body {
    height: auto !important;
    max-height: 62vh;
}

/* The data tables a little smaller than the text of the page, so a row of many columns fits a screen; room between
   the columns, so an amount does not touch the text next to it */
.ant-data-table {
    font-size: 0.875rem;
}

.ant-data-table th,
.ant-data-table td {
    padding: 0.3rem 0.5rem;
}

.ant-data-table > tbody > tr > td,
.ant-data-table > tfoot > tr > td {
    font-variant-numeric: tabular-nums;
}

.ant-data-table > tfoot > tr > td {
    font-weight: 650;
    white-space: nowrap;
}

/* A column's own color, such as red for what is overdue, is for its cells, not for its header */
.ant-data-table > thead th.text-danger {
    color: var(--antilia-theme-on-primary, #fff) !important;
}

/* A cell too narrow for its text cuts it with «…», in every table, also the small ones whose columns are not
   resized; the whole text is in its title */
.ant-data-table > tbody > tr > td {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dates, amounts, statuses and phones on one line */
.ant-data-table td.mensualia-nowrap,
.ant-data-table th.mensualia-nowrap {
    white-space: nowrap;
}

/* What a table shows when it has no rows: an icon and a sentence */
.mensualia-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--antilia-theme-muted);
}

.mensualia-empty svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
    opacity: 0.6;
}

/* An icon of Advanced Widgets inside a cell or a text, as high as the text */
.mensualia-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em;
}

/* the totals below the lines of a document: each a label and its amount, to the right */
.mensualia-totals > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.15rem 0.5rem;
}

.mensualia-totals dt,
.mensualia-totals dd {
    margin: 0;
    font-weight: inherit;
}

.mensualia-totals dd {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.mensualia-timeline {
    list-style: none;
    padding-left: 0;
    border-left: 2px solid var(--antilia-theme-border);
}

.mensualia-timeline li {
    position: relative;
    padding: 0 0 1rem 1.25rem;
}

.mensualia-timeline li::before {
    content: "";
    position: absolute;
    left: -0.4rem;
    top: 0.35rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--antilia-theme-primary);
}

.mensualia-message {
    white-space: pre-wrap;
}

/* ---- Statuses ---- */

/* Each status has a fixed color: authorized and paid green, pending gray, rejected and overdue red, contingency and
   partly paid amber. In the dark theme, the same colors on dark tints. */
.status {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    padding: 0.1rem 0.55rem;
    border-radius: 1rem;
    font-size: 0.82em;
    font-weight: 550;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 0.45em;
    height: 0.45em;
    border-radius: 50%;
    background: currentColor;
}

/* The colors of a status from the theme's: its color as text, darkened or lightened toward the text, on a tint of it */
.status-ok {
    --status-base: var(--antilia-theme-success);
}

.status-pending {
    --status-base: var(--antilia-theme-muted);
}

.status-bad {
    --status-base: var(--antilia-theme-error);
}

.status-warn {
    --status-base: var(--antilia-theme-warning);
}

/* A non-fiscal receipt (#39): told apart from the fiscal documents, neither good nor bad */
.status-info {
    --status-base: var(--antilia-theme-accent);
}

.status-ok,
.status-pending,
.status-bad,
.status-warn,
.status-info {
    color: color-mix(in srgb, var(--status-base) 70%, var(--antilia-theme-text));
    background: color-mix(in srgb, var(--status-base) 15%, var(--antilia-theme-surface));
}

/* ---- The bars of a figure ---- */

/* A bar that shows a figure, such as how much of a month is paid (#107), is a still fill in the theme's color, as
   Advanced Widgets draws a full bar: its striped, moving fill is for something still loading. Each pseudo-element has
   its own rule, since a browser drops a rule with one it does not know. */
.mensualia-still-bar .antilia-progress-bar-value::-webkit-progress-value {
    background-image: linear-gradient(to bottom, var(--antilia-theme-progress), var(--antilia-theme-progress-dark));
    animation: none;
}

.mensualia-still-bar .antilia-progress-bar-value::-moz-progress-bar {
    background-image: linear-gradient(to bottom, var(--antilia-theme-progress), var(--antilia-theme-progress-dark));
    animation: none;
}

/* ---- The choices of language and theme at the top ---- */

/* The choice of the language (#50): Español · English · Français, the one in use in bold. */
.mensualia-languages {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.mensualia-languages a {
    color: var(--antilia-theme-muted);
    text-decoration: none;
}

.mensualia-languages a:hover,
.mensualia-languages a:focus-visible {
    text-decoration: underline;
}

.mensualia-languages a[aria-current="true"] {
    color: var(--bs-body-color, #212529);
    font-weight: 600;
}

/* The choice of the theme (#73): a menu whose button is the swatch of the theme in use */
.mensualia-themes .antilia-menu-link {
    padding-inline: 0.5rem;
}

/* A theme's swatch: its own element in the theme, its primary color over the page's */
.mensualia-swatch {
    display: inline-block;
    flex: 0 0 auto;
    width: 1.1rem;
    height: 1.1rem;
    border: 1px solid var(--antilia-theme-border);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--antilia-theme-primary) 55%, var(--antilia-theme-page) 55%);
    vertical-align: middle;
}

/* ---- A phone ---- */

@media (max-width: 768px) {
    .mensualia-shell {
        flex-direction: column;
    }

    /* the menu across the top: the logo, and under it the pages in a row that scrolls sideways */
    .mensualia-sidebar {
        position: static;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        padding: 0.75rem 1rem 0.5rem;
        border-right: 0;
        border-bottom: 1px solid var(--antilia-theme-border);
    }

    .mensualia-brand {
        margin: 0 0 0.5rem;
    }

    .mensualia-brand img {
        height: 2rem;
    }

    .mensualia-sidebar nav {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .mensualia-sidebar .antilia-menu-list {
        flex-direction: row !important;
        flex-wrap: nowrap;
        white-space: nowrap;
        box-shadow: none;
    }

    .mensualia-topbar {
        position: static;
        padding: 0.5rem 1rem;
    }

    .mensualia-topbar-end {
        flex-wrap: wrap;
    }

    .mensualia-languages {
        flex-wrap: nowrap;
    }

    .mensualia-main {
        padding: 1rem;
    }

    /* the figures of the home page two by two */
    .mensualia-figures {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .mensualia-figures.mensualia-figures-auto {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mensualia-page {
        padding-top: 1.5rem;
    }

    .mensualia-client-cards,
    .mensualia-company-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .mensualia-figure {
        padding: 0.75rem;
    }

    .mensualia-figure .value {
        font-size: 1.15rem;
    }

    /* a table keeps its columns readable and scrolls sideways in its card instead of squeezing them */
    .mensualia-table-scroll > table.ant-data-table {
        min-width: 40rem;
    }

    .mensualia-table-scroll > table.ant-data-table:has(> thead th:nth-child(8)) {
        min-width: 72rem;
    }

    /* the filters one under the other, each as wide as the screen */
    .mensualia-filters > div {
        flex: 1 1 100%;
    }

    .mensualia-filters .form-control,
    .mensualia-filters .form-select,
    .mensualia-filters .antilia-dropdown,
    .mensualia-filters .antilia-autocomplete,
    .mensualia-filters .mensualia-search {
        width: 100%;
        min-width: 0;
    }
}

/* ---- The autocomplete of the filters (#60) ---- */

/* a customer among the suggestions: the name, and under it the identity number */
.mensualia-choice {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.mensualia-choice small {
    color: var(--antilia-theme-muted);
}

/* in a filter, as small as the other fields of the filters */
.mensualia-filters .antilia-autocomplete {
    min-width: 16rem;
}

.mensualia-filters .antilia-autocomplete-field {
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.125rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--bs-border-radius-sm);
}

/* The issue screen (#17): each line a card that wraps on a phone, its amounts in columns. */
.mensualia-issue-line .form-label {
    color: var(--mensualia-muted);
}

.mensualia-issue-amount {
    font-variant-numeric: tabular-nums;
}

/* The demo's band (#62): a demonstration, with fictitious data, where the PAC, the messages and the payments are
   simulated; amber, so it is seen in every screenshot and every frame of the video without hiding anything */
.mensualia-demo-band {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.6rem;
    padding: 0.35rem 1rem;
    background: #fff3cd;
    color: #5c4300;
    border-bottom: 1px solid #f0d58a;
    font-size: 0.875rem;
    line-height: 1.35;
    text-align: center;
}

/* The customer's WhatsApp, simulated, in the demo (#62): a chat as a phone shows it, in Mensualia's own drawing */
.mensualia-chat {
    display: flex;
    flex-direction: column;
    max-width: 30rem;
    min-height: 100vh;
    margin: 0 auto;
    background: #efe7dc;
}

.mensualia-chat-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.9rem;
    background: #f6f6f6;
    border-bottom: 1px solid #ddd;
}

.mensualia-chat-back {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: #1f6fd6;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mensualia-chat-avatar {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid #ddd;
}

.mensualia-chat-name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 650;
    color: #111;
}

.mensualia-chat-verified {
    width: 1rem;
    height: 1rem;
}

.mensualia-chat-verified circle {
    fill: #25a244;
}

.mensualia-chat-verified path {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mensualia-chat-sub {
    font-size: 0.8rem;
    color: #667;
}

.mensualia-chat-note {
    margin: 0.75rem 1rem 0;
    padding: 0.4rem 0.7rem;
    border-radius: 0.6rem;
    background: #fdf6d8;
    color: #5c4300;
    font-size: 0.8rem;
    text-align: center;
}

.mensualia-chat-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem 1.5rem;
}

.mensualia-chat-day {
    align-self: center;
    margin: 0.4rem 0 0.1rem;
    padding: 0.2rem 0.7rem;
    border-radius: 0.6rem;
    background: #ffffff;
    color: #555;
    font-size: 0.8rem;
}

.mensualia-chat-bubble {
    align-self: flex-start;
    max-width: 88%;
    padding: 0.5rem 0.65rem 0.35rem;
    border-radius: 0 0.75rem 0.75rem 0.75rem;
    background: #ffffff;
    color: #111;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.mensualia-chat-text {
    white-space: pre-line;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    line-height: 1.4;
}

.mensualia-chat-time {
    margin-top: 0.15rem;
    color: #8a8a8a;
    font-size: 0.72rem;
    text-align: right;
}

.mensualia-chat-button {
    display: block;
    margin: 0.4rem -0.65rem -0.35rem;
    padding: 0.6rem;
    border-top: 1px solid #e6e6e6;
    color: #1f6fd6;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.mensualia-chat-empty {
    margin: 2rem 0;
    color: #555;
    text-align: center;
}

/* The QR code of the customer's WhatsApp, simulated, on the invoice's page in the demo: under its title and text,
   since beside them, in the narrow column next to the invoice, the text would break after each word (#129) */
.mensualia-qr {
    display: block;
}

.mensualia-qr svg {
    display: block;
    width: 7.5rem;
    height: 7.5rem;
}

/* the receipt of a transfer a customer reported, in its dialog (#114) */
.mensualia-receipt {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    margin: 0 auto;
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
}

.mensualia-receipt-pdf {
    width: 100%;
    height: 70vh;
}
