/* jQuadra — global styles. Design tokens from logo/brand_identity_guidelines.md (§2.2). */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/InterVariable.woff2') format('woff2');
}

:root {
    --jq-color-primary: #0B3B60;
    --jq-color-primary-hover: #082943;
    --jq-color-secondary: #00A86B;
    --jq-color-secondary-hover: #008f5b;
    --jq-color-accent: #00C2CB;
    --jq-bg-canvas: #F8FAFC;
    --jq-bg-surface: #FFFFFF;
    --jq-border: #E2E8F0;
    --jq-text-primary: #1E293B;
    --jq-text-secondary: #64748B;
    --jq-color-success: #00A86B;
    --jq-color-warning: #F59E0B;
    --jq-color-danger: #EF4444;
    --jq-radius-sm: 6px;
    --jq-radius-md: 8px;
    --jq-radius-lg: 12px;
    --jq-shadow-card: 0 4px 16px -2px rgba(11, 59, 96, 0.06);
    --jq-shadow-dropdown: 0 10px 25px -5px rgba(11, 59, 96, 0.12);
}

html, body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--jq-bg-canvas);
    color: var(--jq-text-primary);
}

h1:focus {
    outline: none;
}

/* Tabular figures everywhere numbers are compared in columns (guidelines §3.1). */
.mud-table-cell,
.mud-input,
.jq-amount,
.jq-date {
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

/* Account codes: aligned digits, never wrapped. */
.jq-code {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Chart of accounts: codes indented by level (group, account, sub-account). */
.jq-level-2 {
    padding-left: 1.25rem;
}

.jq-level-3 {
    padding-left: 2.5rem;
}

/* Search box of lists: readable width on desktop, full width on phones. */
.jq-search {
    max-width: 24rem;
    min-width: 14rem;
}

/* Filter selects next to a search box. */
.jq-filter {
    max-width: 12rem;
}

/* Amounts and dates are always right-aligned (guidelines §5.2). */
.jq-amount,
.jq-date {
    text-align: right;
    white-space: nowrap;
}

/* MudSimpleTable aligns every cell to the start: amounts and dates stay right-aligned. */
.mud-simple-table table tr > .jq-amount,
.mud-simple-table table tr > .jq-date {
    text-align: right;
}

/* Short texts kept on one line in tables (periods, tax codes with their due date). */
.jq-nowrap {
    white-space: nowrap;
}

/* Inputs with a long label, and summary tables of a few amounts. */
.jq-input-wide {
    min-width: 22rem;
    max-width: 26rem;
}

.jq-summary {
    max-width: 36rem;
}

/* Amount inputs: right-aligned like the amounts they become. */
.jq-amount-input input {
    text-align: right;
}

/* Journal entry grid: room for the account, compact amounts. */
.jq-entry-grid td,
.jq-entry-grid th {
    vertical-align: middle;
}

.jq-entry-grid .jq-account-cell {
    min-width: 22rem;
}

.jq-entry-grid td:nth-child(2),
.jq-entry-grid td:nth-child(3) {
    min-width: 8rem;
}

/* Cancelled settlements stay listed, struck through. */
.jq-cancelled td {
    color: var(--jq-text-secondary);
    text-decoration: line-through;
}

/* Document status chips (guidelines §5.2). */
.jq-status-paid {
    background: #ECFDF5;
    color: #065F46;
}

.jq-status-pending {
    background: #FFFBEB;
    color: #92400E;
}

.jq-status-overdue {
    background: #FEF2F2;
    color: #991B1B;
}

.blazor-error-boundary {
    background: #FEF2F2;
    border-left: 4px solid var(--jq-color-danger);
    padding: 1rem;
    color: #991B1B;
}

    .blazor-error-boundary::after {
        content: "Si è verificato un errore in questa sezione.";
    }

/* Navigation on the Deep Navy drawer: white text, accent marker on the active item. */
.mud-drawer .mud-navmenu .mud-nav-link,
.mud-drawer .mud-navmenu .mud-nav-link .mud-nav-link-icon {
    color: #FFFFFF;
}

    .mud-drawer .mud-navmenu .mud-nav-link:hover:not(.mud-nav-link-disabled) {
        background-color: rgba(255, 255, 255, 0.08);
    }

    .mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) {
        color: #FFFFFF;
        background-color: rgba(0, 194, 203, 0.16);
        box-shadow: inset 3px 0 0 var(--jq-color-accent);
    }

        .mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon {
            color: var(--jq-color-accent);
        }

/* Account pages (static rendering, no MudBlazor inputs: plain HTML forms post to the server). */
.jq-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--jq-bg-canvas);
}

.jq-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--jq-bg-surface);
    border: 1px solid var(--jq-border);
    border-radius: var(--jq-radius-lg);
    box-shadow: var(--jq-shadow-card);
    padding: 2rem;
}

.jq-auth-logo {
    display: block;
    height: 44px;
    width: auto;
    margin: 0 auto 1.5rem auto;
}

.jq-auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--jq-color-primary);
    margin: 0 0 1rem 0;
}

.jq-auth-hint,
.jq-auth-footer {
    color: var(--jq-text-secondary);
    font-size: 0.8125rem;
    margin-top: 1rem;
}

.jq-form .jq-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

    .jq-form .jq-field label {
        font-size: 0.8125rem;
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .jq-form .jq-field input {
        font: inherit;
        padding: 0.625rem 0.75rem;
        border: 1px solid var(--jq-border);
        border-radius: var(--jq-radius-md);
        color: var(--jq-text-primary);
    }

        .jq-form .jq-field input:focus {
            outline: 2px solid var(--jq-color-accent);
            outline-offset: 1px;
            border-color: var(--jq-color-primary);
        }

.jq-field-error {
    color: #991B1B;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.jq-button {
    font: inherit;
    font-weight: 600;
    border-radius: var(--jq-radius-md);
    padding: 0.625rem 1rem;
    cursor: pointer;
    border: 1px solid transparent;
}

.jq-button-primary {
    width: 100%;
    background: var(--jq-color-primary);
    color: #FFFFFF;
}

    .jq-button-primary:hover {
        background: var(--jq-color-primary-hover);
    }

.jq-alert {
    border-radius: var(--jq-radius-md);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.jq-alert-error {
    background: #FEF2F2;
    color: #991B1B;
}

.jq-link {
    color: var(--jq-color-primary);
    font-weight: 500;
}

.jq-user-name {
    color: var(--jq-text-primary);
}

.jq-alert-warning {
    background: #FFFBEB;
    color: #92400E;
}

.jq-steps {
    padding-left: 1.25rem;
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

    .jq-steps li {
        margin-bottom: 0.25rem;
    }

.jq-qr {
    width: 200px;
    height: 200px;
    margin: 0 auto 0.5rem auto;
}

    .jq-qr svg {
        width: 100%;
        height: 100%;
    }

.jq-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: 0.05em;
    word-break: break-all;
}

.jq-recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem 0;
}

    .jq-recovery-codes code {
        display: block;
        text-align: center;
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
        background: var(--jq-bg-canvas);
        border: 1px solid var(--jq-border);
        border-radius: var(--jq-radius-sm);
        padding: 0.375rem;
    }

.jq-button-link {
    display: block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.jq-temporary-password {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--jq-color-primary);
}

.jq-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.jq-muted {
    color: var(--jq-text-secondary);
}

.cursor-pointer {
    cursor: pointer;
}
