/* NobleCore – Bizonylatok lista / view Phase 2 UX */

.nc-bd-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    line-height: 1.25;
}

.nc-bd-doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.nc-bd-type-badge,
.nc-bd-status-badge,
.nc-bd-payment-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #f4f4f5;
    color: #3f3f46;
}

.nc-bd-type-badge--info,
.nc-bd-status-badge--info,
.nc-bd-payment-badge--info { background: #e0f2fe; color: #075985; }
.nc-bd-type-badge--primary,
.nc-bd-status-badge--primary,
.nc-bd-payment-badge--primary { background: #e0e7ff; color: #3730a3; }
.nc-bd-type-badge--success,
.nc-bd-status-badge--success,
.nc-bd-payment-badge--success { background: #dcfce7; color: #166534; }
.nc-bd-type-badge--warning,
.nc-bd-status-badge--warning,
.nc-bd-payment-badge--warning { background: #ffedd5; color: #9a3412; }
.nc-bd-type-badge--danger,
.nc-bd-status-badge--danger,
.nc-bd-payment-badge--danger { background: #ffe4e6; color: #9f1239; }
.nc-bd-type-badge--slate,
.nc-bd-status-badge--slate,
.nc-bd-status-badge--gray,
.nc-bd-payment-badge--gray,
.nc-bd-payment-badge--slate { background: #f4f4f5; color: #3f3f46; }

.nc-bd-doc-number {
    display: block;
    font-size: 14px;
    font-weight: 850;
    color: #0f172a;
    letter-spacing: -.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .nc-bd-doc-number { color: #f8fafc; }

.nc-bd-customer-name {
    font-size: 13px;
    font-weight: 750;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .nc-bd-customer-name { color: #e2e8f0; }

.nc-bd-cell-sub {
    font-size: 11px;
    font-weight: 650;
    color: #64748b;
}

.nc-bd-cell-sub--ok { color: #166534; }
.nc-bd-cell-sub--warn { color: #9f1239; font-weight: 800; }

.nc-bd-money {
    font-size: 14px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    white-space: nowrap;
}

.dark .nc-bd-money { color: #f8fafc; }

.nc-bd-overdue-chip {
    display: inline-flex;
    width: fit-content;
    font-size: 11px;
    font-weight: 850;
    color: #9f1239;
}

.nc-bd-cell--status {
    gap: 6px;
}

.nc-bd-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #eef2f3;
    color: #295157;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

.nc-bd-cell--sales {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.nc-bd-sales-name {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .nc-bd-sales-name { color: #cbd5e1; }

.nc-bd-muted { color: #94a3b8; font-size: 12px; }

.nc-bd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.nc-bd-btn--primary {
    background: #295157;
    color: #fff;
}

.nc-bd-mobile-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.dark .nc-bd-mobile-card {
    background: #18181b;
    border-color: #3f3f46;
}

.nc-bd-mobile-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nc-bd-mobile-card__finance,
.nc-bd-mobile-card__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.nc-bd-mobile-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.nc-bd-mobile-card__actions-hint {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

/* Desktop vs mobile column switch */
.nc-bd-col-mobile { display: none !important; }

@media (max-width: 1199.98px) {
    /* Csak a bizonylatlista kártyás nézetére vonatkozik – korábban minden Filament-táblában
       elrejtette a fejlécet és felülírta a cellák margóját (2026-10-30). */
    .fi-ta-table .nc-bd-col-desktop,
    .fi-ta-header-cell.nc-bd-col-desktop,
    .fi-ta-cell.nc-bd-col-desktop {
        display: none !important;
    }

    .fi-ta-table .nc-bd-col-mobile,
    .fi-ta-header-cell.nc-bd-col-mobile,
    .fi-ta-cell.nc-bd-col-mobile {
        display: table-cell !important;
    }

    .fi-ta-table:has(.nc-bd-col-mobile) thead {
        display: none;
    }

    .fi-ta-row > .fi-ta-cell.nc-bd-col-mobile {
        width: 100%;
        padding: 8px 4px !important;
        border-bottom: 0 !important;
    }

    .fi-ta-row:has(> .nc-bd-col-mobile) > .fi-ta-cell:not(.nc-bd-col-desktop):not(.nc-bd-col-mobile) {
        display: table-cell !important;
        padding: 0 8px 12px !important;
        vertical-align: middle;
    }

    .fi-ta-content:has(.nc-bd-col-mobile) {
        overflow-x: hidden !important;
    }

    /* A kártya tartalma egymás alatt (a Filament oszlop-link alapból egy sorba
       rendezte, így a szám, a vevő és az összeg levágódott). */
    .nc-bd-mobile-card a.fi-ta-col {
        display: grid;
        gap: 6px;
        min-width: 0;
    }

    .nc-bd-mobile-card a.fi-ta-col:empty {
        display: none;
    }
}

@media (min-width: 1200px) {
    .nc-bd-col-mobile { display: none !important; }
}

/* View page Phase 2 blocks */
.nc-bd-view-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.nc-bd-view-summary__item {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.dark .nc-bd-view-summary__item {
    background: #27272a;
    border-color: #3f3f46;
}

.nc-bd-view-summary__item span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.nc-bd-view-summary__item strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 900;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .nc-bd-view-summary__item strong { color: #f8fafc; }

.nc-bd-related-list,
.nc-bd-timeline,
.nc-bd-payment-history {
    display: grid;
    gap: 8px;
}

.nc-bd-related-item,
.nc-bd-timeline-item,
.nc-bd-payment-row {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    text-decoration: none;
}

.dark .nc-bd-related-item,
.dark .nc-bd-timeline-item,
.dark .nc-bd-payment-row {
    background: #18181b;
    border-color: #3f3f46;
}

.nc-bd-related-item strong,
.nc-bd-timeline-item strong,
.nc-bd-payment-row strong {
    color: #0f172a;
    font-size: 13px;
}

.dark .nc-bd-related-item strong,
.dark .nc-bd-timeline-item strong,
.dark .nc-bd-payment-row strong { color: #f8fafc; }

.nc-bd-empty {
    padding: 8px 0;
    color: #64748b;
    font-size: 13px;
}

.nc-bd-items-desktop { display: block; }
.nc-bd-items-mobile { display: none; }

.nc-bd-item-card {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 8px;
}

.dark .nc-bd-item-card { border-color: #3f3f46; }

.nc-bd-item-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 1050px) {
    .nc-bd-view-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .nc-bd-view-summary { grid-template-columns: 1fr; }
    .nc-bd-items-desktop { display: none; }
    .nc-bd-items-mobile { display: block; }
}

/* Calculated / read-only editor fields: distinct from disabled controls */
.bd-field input.nc-input:disabled,
.bd-card-fields input.nc-input:disabled,
.nc-input--readonly {
    background: #eef2ff;
    border-style: dashed;
    border-color: #a5b4fc;
    color: #1e293b;
    opacity: 1;
    cursor: default;
    font-weight: 750;
}

.dark .bd-field input.nc-input:disabled,
.dark .bd-card-fields input.nc-input:disabled,
.dark .nc-input--readonly {
    background: #1e1b4b;
    border-color: #6366f1;
    color: #e2e8f0;
}

.bd-field:has(> input.nc-input:disabled) > .bd-label::after,
.bd-card-fields .bd-field:has(> input.nc-input:disabled) > span.bd-label::after {
    content: ' · a rendszer számolja, nem szerkeszthető';
    font-weight: 650;
    color: #64748b;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
}

/* Quote acceptance / version dialog — self-contained, no Installation Project CSS */
/* 2026-11-04: nyitott ablak alatt a háttér nem görgethető. */
html:has(.bd-dialog-backdrop), html:has(.bd-dialog-backdrop) body { overflow: hidden !important; }
.bd-dialog-backdrop, .bd-dialog { overscroll-behavior: contain; }

.bd-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, .55);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.bd-dialog {
    width: min(640px, 100%);
    margin: 24px auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    max-height: min(90vh, 820px);
    overflow: hidden;
}

.dark .bd-dialog {
    background: #18181b;
}

.bd-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #f1f5f9;
}

.dark .bd-dialog-header {
    border-bottom-color: #27272a;
}

.bd-dialog-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 850;
    color: #0f172a;
    line-height: 1.25;
}

.dark .bd-dialog-header h2 {
    color: #f4f4f5;
}

.bd-dialog-header p {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
}

.dark .bd-dialog-header p {
    color: #94a3b8;
}

.bd-dialog-close {
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    flex-shrink: 0;
    font-size: 22px;
    line-height: 1;
}

.bd-dialog-body {
    display: grid;
    gap: 14px;
    padding: 14px 16px;
    overflow: auto;
    min-width: 0;
}

.bd-dialog-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.bd-dialog-grid--one {
    grid-template-columns: minmax(0, 1fr);
}

.bd-dialog-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    align-content: start;
}

.bd-dialog-field--full {
    grid-column: 1 / -1;
}

.bd-dialog-label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.dark .bd-dialog-label {
    color: #d4d4d8;
}

.bd-dialog-body .nc-input,
.bd-dialog-body .nc-select {
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    padding: 8px 12px;
    font-size: 13px;
}

.bd-dialog-body textarea.nc-input {
    min-height: 84px;
    resize: vertical;
}

.dark .bd-dialog-body .nc-input,
.dark .bd-dialog-body .nc-select {
    background: #27272a;
    border-color: #52525b;
    color: #f4f4f5;
}

.bd-dialog-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 700;
}

.bd-dialog-hint {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.bd-dialog-summary {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.dark .bd-dialog-summary {
    background: #27272a;
    border-color: #3f3f46;
}

.bd-dialog-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
}

.bd-dialog-summary-row strong {
    color: #0f172a;
    text-align: right;
    font-weight: 850;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dark .bd-dialog-summary-row strong {
    color: #f4f4f5;
}

.bd-dialog-checks {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: #334155;
}

.bd-dialog-checks label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.bd-dialog-checks input {
    width: auto;
    margin-top: 3px;
}

.dark .bd-dialog-checks {
    color: #e2e8f0;
}

.bd-dialog-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 16px 16px;
    border-top: 1px solid #f1f5f9;
}

.dark .bd-dialog-footer {
    border-top-color: #27272a;
}

@media (max-width: 640px) {
    .bd-dialog {
        margin: 8px auto;
        max-height: calc(100vh - 16px);
    }

    .bd-dialog-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .bd-dialog-summary-row {
        flex-direction: column;
        gap: 2px;
    }

    .bd-dialog-summary-row strong {
        text-align: left;
    }

    .bd-dialog-footer {
        flex-direction: column;
    }

    .bd-dialog-footer .bd-button {
        width: 100%;
    }
}

.bd-email-queue-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(180, 130, 40, .28);
    background: rgba(250, 204, 21, .12);
}

.bd-email-queue-notice p {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 650;
}

.bd-email-queue-notice a {
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}
