body.app-body {
    background: #f4f7fb;
    color: #1f2937;
    font-size: 0.95rem;
}
:root {
    --sidebar-bg: #0f172a;
    --sidebar-text: #ffffff;
}
.app-shell {
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--sidebar-bg), color-mix(in srgb, var(--sidebar-bg) 85%, #ffffff 15%));
    color: var(--sidebar-text);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    min-height: 100vh;
    transition: width .18s ease, padding .18s ease;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 86px;
    padding: 24px 10px;
}
.sidebar-nav {
    margin-top: 0;
}
.side-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: color-mix(in srgb, var(--sidebar-text) 82%, transparent);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 44px;
    text-decoration: none;
}
.side-link-button {
    border: 0;
    background: transparent;
}
.side-link-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.side-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.side-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.side-link-label {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-caret {
    font-size: .9rem;
    opacity: .75;
    line-height: 1;
}
.side-sublink {
    padding: 8px 12px;
    font-size: .86rem;
    border-radius: 12px;
}
.side-sublink.active {
    background: color-mix(in srgb, var(--sidebar-text) 12%, transparent);
}
.side-link:hover,
.side-link.active {
    color: var(--sidebar-text);
    background: color-mix(in srgb, var(--sidebar-text) 10%, transparent);
}
.sidebar-submenu .ps-3 {
    padding-left: .75rem !important;
}
.app-shell.sidebar-collapsed .sidebar-submenu .ps-3 {
    padding-left: 0 !important;
}
.app-shell.sidebar-collapsed .side-link {
    justify-content: center;
    padding-inline: 10px;
}
.app-shell.sidebar-collapsed .side-link-main {
    justify-content: center;
}
.app-shell.sidebar-collapsed .side-link-label,
.app-shell.sidebar-collapsed .side-caret {
    display: none;
}
.app-shell.sidebar-collapsed .sidebar-submenu.show {
    display: block;
}
.main-content {
    flex: 1;
    min-width: 0;
    padding: 24px;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -24px -24px 24px;
    padding: 10px 24px;
    background: linear-gradient(180deg, var(--sidebar-bg), color-mix(in srgb, var(--sidebar-bg) 88%, #ffffff 12%));
    color: var(--sidebar-text);
    border-bottom: 1px solid color-mix(in srgb, var(--sidebar-text) 16%, transparent);
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 54px;
}
.topbar-left,
.topbar-right,
.topbar-context,
.topbar-center {
    display: flex;
    align-items: center;
}
.topbar-left,
.topbar-right {
    gap: 12px;
    flex: 1 1 0;
    min-width: 0;
}
.topbar-context {
    gap: 12px;
    min-width: 0;
}
.topbar-left {
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}
.topbar-right {
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}
.topbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    justify-content: center;
    min-width: 0;
    pointer-events: none;
}
.topbar-app-name {
    color: color-mix(in srgb, var(--sidebar-text) 72%, transparent);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .01em;
}
.topbar-separator {
    width: 1px;
    height: 18px;
    background: color-mix(in srgb, var(--sidebar-text) 18%, transparent);
}
.topbar-icon-btn,
.topbar-chip,
.topbar-user,
.topbar-create-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.topbar-icon-btn {
    width: 34px;
    padding: 0;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--sidebar-text) 18%, transparent);
    color: var(--sidebar-text);
}
.topbar-icon-btn:hover,
.topbar-chip:hover {
    color: var(--sidebar-text);
    background: color-mix(in srgb, var(--sidebar-text) 10%, transparent);
    border-color: color-mix(in srgb, var(--sidebar-text) 32%, transparent);
}
.topbar-icon-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.topbar-chip,
.topbar-user {
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--sidebar-text) 14%, transparent);
    background: color-mix(in srgb, var(--sidebar-text) 8%, transparent);
    color: var(--sidebar-text);
    font-size: .85rem;
    white-space: nowrap;
}
.topbar-role {
    font-weight: 600;
}
.topbar-user {
    color: color-mix(in srgb, var(--sidebar-text) 88%, transparent);
}
.topbar-user-link:hover {
    color: var(--sidebar-text);
    background: color-mix(in srgb, var(--sidebar-text) 12%, transparent);
    border-color: color-mix(in srgb, var(--sidebar-text) 26%, transparent);
}
.topbar-create-btn {
    width: 34px;
    padding: 0;
    border: 1px solid rgba(125, 211, 252, .6);
    background: #dbeafe;
    color: #0f4c81;
}
.topbar-create-btn:hover {
    background: #bfdbfe;
    border-color: rgba(96, 165, 250, .9);
    color: #0c3b63;
}
.topbar-create-btn-todo {
    border-color: rgba(252, 165, 165, .72);
    background: #fee2e2;
    color: #991b1b;
}
.topbar-create-btn-todo:hover {
    background: #fecaca;
    border-color: rgba(248, 113, 113, .9);
    color: #7f1d1d;
}
.topbar-create-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.topbar-create-icon svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}
.topbar-logout {
    background: color-mix(in srgb, #ef4444 18%, transparent);
    border-color: color-mix(in srgb, #ef4444 42%, transparent);
}
.topbar-logout:hover {
    background: color-mix(in srgb, #ef4444 28%, transparent);
    border-color: color-mix(in srgb, #ef4444 60%, transparent);
}
.topbar .dropdown-toggle::after {
    margin-left: .45rem;
}
.topbar .dropdown-menu {
    margin-top: 10px;
}
.topbar .dropdown-item.active,
.topbar .dropdown-item:active {
    background: #eff6ff;
    color: #1d4ed8;
}
.topbar .text-secondary {
    color: color-mix(in srgb, var(--sidebar-text) 65%, transparent) !important;
}
.page-title {
    color: var(--sidebar-text);
    font-size: 1.48rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 36vw;
}
.soft-card,
.kpi-card,
.search-card,
.form-section {
    border: 0;
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}
.accountant-list-card {
    overflow: hidden;
}
.accountant-list-card .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
}
.accountant-list-card .card-body {
    padding-top: 0;
}
#accountant-package-form .card-body {
    padding-top: 1.25rem;
}
#accountant-package-form .row {
    align-items: flex-start;
}
#accountant-package-form .attachment-dropzone {
    min-height: 220px;
}
#accountant-package-form textarea.form-control {
    min-height: 220px;
}
#accountant-package-form .form-actions {
    margin-top: .25rem;
}
.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
}
.table thead th {
    background: #f8fafc;
    color: #475569;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.table tbody tr:hover {
    background: rgba(248, 250, 252, .7);
}
.status-pill {
    border-radius: 999px;
    padding: .35rem .65rem;
    font-size: .78rem;
}
.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at top right, #dbeafe, #f8fafc 50%);
}
.login-card {
    width: 100%;
    max-width: 430px;
    border: 0;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}
.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: #eef2ff;
    margin-right: 6px;
    margin-bottom: 4px;
    font-size: .8rem;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.readonly-output {
    background: #f8fafc;
    font-weight: 600;
}
.hint-box {
    background: #eff6ff;
    border-radius: 14px;
    padding: 12px 14px;
    color: #1d4ed8;
    font-size: .9rem;
}
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.mobile-shortcuts {
    display: none;
}
.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

/* Dokumentumok (desktop) – számok és gyors szűrő */
.money-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.currency-cell {
    white-space: nowrap;
}
.invoice-table-card {
    padding-bottom: 120px; /* ~2 sor hely a lefelé nyíló gyors panelnek */
}
.invoice-filter-dropdown {
    width: min(760px, 92vw);
}
.invoice-filter-dropdown .form-label {
    margin-bottom: .25rem;
}
.invoice-filter-grid {
    --bs-gutter-x: 12px;
    --bs-gutter-y: 10px;
}
.invoice-filter-grid > [class*='col-'] {
    min-width: 0;
}
.invoice-filter-actions {
    flex-wrap: nowrap;
    white-space: nowrap;
}
.invoice-filter-actions-col {
    margin-left: auto;
    min-width: 0;
}
@media (min-width: 1680px) {
    .invoice-filter-grid {
        display: grid;
        grid-template-columns: minmax(220px, 1.35fr) minmax(320px, 2fr) minmax(210px, 1.25fr) minmax(170px, 0.95fr) minmax(170px, 0.95fr) minmax(170px, 0.95fr) auto;
        align-items: end;
    }
    .invoice-filter-grid > [class*='col-'] {
        width: auto;
        max-width: none;
        padding-right: 0;
        padding-left: 0;
        margin-left: 0;
    }
    .invoice-filter-grid > .invoice-filter-actions-col {
        justify-self: end;
    }
    .payment-filter-card .invoice-filter-grid {
        grid-template-columns: minmax(200px, 1.25fr) minmax(300px, 1.8fr) minmax(190px, 1.1fr) minmax(150px, 0.8fr) minmax(155px, 0.85fr) minmax(155px, 0.85fr) auto;
    }
}
@media (max-width: 1679.98px) {
    .invoice-filter-actions-col {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }
    .invoice-filter-actions {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        white-space: normal;
    }
}
@media (min-width: 1200px) and (max-width: 1679.98px) {
    .invoice-filter-card .invoice-filter-grid {
        display: grid;
        grid-template-columns: minmax(200px, 1.2fr) minmax(280px, 1.7fr) minmax(170px, 1fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) auto;
        align-items: end;
    }
    .invoice-filter-card.invoice-filter-card-with-company .invoice-filter-grid {
        grid-template-columns: minmax(185px, 1.1fr) minmax(260px, 1.55fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) auto;
    }
    .invoice-filter-card.invoice-filter-card-no-partner .invoice-filter-grid {
        grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1fr) minmax(155px, 0.9fr) minmax(155px, 0.9fr) auto;
    }
    .invoice-filter-card.invoice-filter-card-with-company.invoice-filter-card-no-partner .invoice-filter-grid {
        grid-template-columns: minmax(200px, 1.2fr) minmax(175px, 1fr) minmax(175px, 1fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) auto;
    }
    .invoice-filter-card .invoice-filter-grid > [class*='col-'] {
        width: auto;
        max-width: none;
        padding-right: 0;
        padding-left: 0;
        margin-left: 0;
    }
    .invoice-filter-card .invoice-filter-grid > .invoice-filter-actions-col {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        margin-left: 0;
        justify-self: end;
    }
    .invoice-filter-card .invoice-filter-actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
    .payment-filter-card .invoice-filter-grid {
        display: grid;
        grid-template-columns: minmax(190px, 1.2fr) minmax(280px, 1.7fr) minmax(170px, 1fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) auto;
        align-items: end;
    }
    .payment-filter-card.payment-filter-card-with-company .invoice-filter-grid {
        grid-template-columns: minmax(170px, 1.1fr) minmax(250px, 1.55fr) minmax(170px, 1fr) minmax(165px, 0.95fr) minmax(145px, 0.8fr) minmax(145px, 0.8fr) auto;
    }
    .payment-filter-card .invoice-filter-grid > [class*='col-'] {
        width: auto;
        max-width: none;
        padding-right: 0;
        padding-left: 0;
        margin-left: 0;
    }
    .payment-filter-card .invoice-filter-grid > .invoice-filter-actions-col {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        margin-left: 0;
        justify-self: end;
    }
    .payment-filter-card .invoice-filter-actions {
        width: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
        white-space: nowrap;
    }
}
@media (max-width: 991.98px) {
    .invoice-filter-actions {
        flex-wrap: wrap;
    }
}
.company-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: #ecfeff;
    color: #155e75;
    font-size: .8rem;
}
.summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.summary-chip {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 10px 12px;
}
.dashboard-filter-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dashboard-priority-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.dashboard-priority-card {
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    border: 1px solid #e2e8f0;
}
.dashboard-priority-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .09);
}
.dashboard-priority-label {
    color: #475569;
    font-size: .88rem;
    margin-bottom: .4rem;
}
.dashboard-priority-value {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.1;
}
.dashboard-priority-meta {
    color: #64748b;
    font-size: .82rem;
    margin-top: .55rem;
}
.dashboard-priority-card-danger {
    border-color: #fecaca;
    background: linear-gradient(180deg, #fff, #fff5f5);
}
.dashboard-priority-card-warning {
    border-color: #fde68a;
    background: linear-gradient(180deg, #fff, #fffaf0);
}
.dashboard-priority-card-primary {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #fff, #f6faff);
}
.dashboard-priority-card-success {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #fff, #f3fff7);
}
.dashboard-priority-card-rose {
    border-color: #fecdd3;
    background: linear-gradient(180deg, #fff, #fff5f7);
}
.dashboard-priority-card-sky {
    border-color: #bae6fd;
    background: linear-gradient(180deg, #fff, #f2fbff);
}
.dashboard-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.dashboard-action-link {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-height: 94px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #dbe5f0;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    color: #0f172a;
    text-decoration: none;
    transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.dashboard-action-link:hover {
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
}
.dashboard-action-label {
    font-weight: 700;
}
.dashboard-action-meta {
    color: #64748b;
    font-size: .84rem;
}
.dashboard-mini-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.dashboard-mini-stat {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.dashboard-mini-stat-label {
    color: #64748b;
    font-size: .82rem;
}
.dashboard-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dashboard-link-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid #dbe5f0;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
}
.dashboard-link-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}
.dashboard-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dashboard-feed-item {
    display: block;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: inherit;
    text-decoration: none;
}
.dashboard-feed-item:hover {
    border-color: #93c5fd;
    background: #f8fbff;
}
.dashboard-feed-title {
    font-weight: 700;
    margin-bottom: .35rem;
}
.dashboard-feed-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .8rem;
    color: #64748b;
    font-size: .82rem;
}
.dashboard-empty-box {
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    padding: 16px;
    color: #64748b;
    background: #f8fafc;
}
@media (max-width: 767.98px) {
    .dashboard-mini-stats {
        grid-template-columns: 1fr;
    }
}
.partner-picker {
    position: relative;
}
.partner-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    box-shadow: 0 12px 26px rgba(15, 23, 42, .12);
}
.partner-picker-menu .list-group-item {
    border: 0;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
}
.partner-picker-menu .list-group-item:last-child {
    border-bottom: 0;
}
.partner-picker-menu .list-group-item:hover,
.partner-picker-menu .list-group-item.active {
    background: #eff6ff;
}
.account-row {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
}
.account-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.storage-list li + li {
    margin-top: .35rem;
}

.backup-file-table-wrap {
    border: 1px solid #e6ebf2;
    border-radius: 16px;
    overflow: hidden;
    background: #fbfdff;
}

.backup-file-table {
    margin-bottom: 0;
}

.backup-file-table thead th {
    background: #f5f8fc;
    color: #526075;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-bottom: 1px solid #dde6f0;
    padding: .9rem 1rem;
}

.backup-file-table tbody td {
    padding: .95rem 1rem;
    border-bottom: 1px solid #eef3f8;
    vertical-align: middle;
}

.backup-file-table tbody tr:last-child td {
    border-bottom: 0;
}

.backup-file-table tbody tr:hover {
    background: #f9fbfe;
}

.settings-anchor {
    scroll-margin-top: 24px;
}

.settings-editor-card {
    overflow: hidden;
}

.settings-editor-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e7edf4;
    background: linear-gradient(180deg, #fbfdff, #f5f8fc);
}

.settings-editor-table thead th {
    background: #f8fafc;
    color: #526075;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .85rem 1rem;
    border-bottom: 1px solid #dde6f0;
}

.settings-editor-table tbody td,
.settings-editor-table tfoot td {
    padding: .9rem 1rem;
    border-bottom: 1px solid #eef3f8;
    vertical-align: middle;
}

.settings-editor-table tbody tr:last-child td {
    border-bottom: 0;
}

.settings-editor-table tfoot td {
    background: #fbfdff;
    border-top: 1px solid #e7edf4;
    border-bottom: 0;
}

.settings-editor-note {
    color: #64748b;
    font-size: .9rem;
    line-height: 1.45;
}

.settings-input-compact {
    width: 120px;
    min-width: 120px;
}

.settings-editor-card .btn {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .settings-menu-card {
        position: sticky;
        top: 18px;
        z-index: 20;
    }
    .settings-editor-table thead {
        display: none;
    }
    .settings-editor-table tbody tr,
    .settings-editor-table tfoot tr {
        display: grid;
        grid-template-columns: minmax(240px, 1.35fr) minmax(120px, 140px) minmax(260px, 2fr) auto;
        align-items: center;
    }
    .settings-editor-table--three tbody tr,
    .settings-editor-table--three tfoot tr {
        grid-template-columns: minmax(240px, 1.45fr) minmax(120px, 140px) minmax(260px, 2.1fr);
    }
    .settings-editor-table--three tfoot td {
        grid-column: 1 / -1;
    }
}
@media (max-width: 992px) {
    .sidebar {
        display: none;
    }
    .main-content {
        padding: 18px;
    }
    .topbar {
        margin: -18px -18px 18px;
        padding: 10px 18px;
    }
    .mobile-shortcuts {
        display: block;
    }
    .partner-picker-menu {
        position: static;
        margin-top: 8px;
    }
    .topbar-center,
    .topbar-user {
        display: none;
    }
    .topbar-create-btn {
        display: inline-flex;
    }
    .page-title {
        max-width: 48vw;
    }
    .calendar-sort-controls {
        width: 100%;
        justify-content: flex-start;
        margin-top: 12px;
    }
    .bulk-actions-right {
        justify-content: flex-start;
        flex-basis: 100%;
    }
    .table-truncate-text,
    .table-truncate-link {
        max-width: 190px;
    }
}
@media (max-width: 640px) {
    .topbar {
        gap: 10px;
    }
    .topbar-left,
    .topbar-right,
    .topbar-context {
        gap: 8px;
    }
    .topbar-separator,
    .topbar-role {
        display: none;
    }
    .page-title {
        max-width: 52vw;
        font-size: 1.48rem;
    }
}


.document-form-grid {
    display: grid;
    gap: 1rem;
}
.document-form-section {
    border: 1px solid var(--form-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
    overflow: hidden;
}
.document-form-header {
    padding: .55rem .95rem;
    background: var(--form-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}
.document-form-title {
    font-size: .98rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}
.document-form-copy {
    margin: 0;
    font-size: .84rem;
    opacity: .92;
    line-height: 1.35;
    flex: 1 1 280px;
}
.document-form-body {
    padding: 1rem 1.05rem 1.1rem;
    background: linear-gradient(180deg, var(--form-soft-bg), #ffffff 34%);
}
.document-form-body .form-control,
.document-form-body .form-select {
    border-color: color-mix(in srgb, var(--form-accent) 18%, #dbe4f0 82%);
}
.document-form-body .form-control:focus,
.document-form-body .form-select:focus {
    border-color: color-mix(in srgb, var(--form-accent) 55%, #dbe4f0 45%);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--form-accent) 16%, transparent);
}
.document-form-body .readonly-output {
    background: color-mix(in srgb, var(--form-accent) 6%, #ffffff 94%);
}
.document-form-body .form-hint {
    min-height: 1.25rem;
    line-height: 1.1;
    margin-top: .25rem;
}
.document-form-note {
    border-radius: 16px;
    padding: .9rem 1rem;
    background: color-mix(in srgb, var(--form-accent) 8%, #ffffff 92%);
    border: 1px solid color-mix(in srgb, var(--form-accent) 16%, #e2e8f0 84%);
    color: #334155;
    font-size: .9rem;
}
.transfer-detail-disabled {
    opacity: .56;
}
.transfer-detail-disabled .form-control,
.transfer-detail-disabled .form-select,
.transfer-detail-disabled .input-group-text,
.transfer-detail-disabled .btn,
.transfer-detail-disabled .document-form-note,
.transfer-detail-disabled .readonly-output {
    pointer-events: none;
}
.invoice-prefill-card {
    height: 100%;
    min-height: 168px;
    border-radius: 16px;
    padding: .9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--form-accent) 16%, #dbe4f0 84%);
    background: linear-gradient(180deg, rgba(255,255,255,.98), color-mix(in srgb, var(--form-accent) 5%, #ffffff 95%));
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.invoice-prefill-card-title {
    font-weight: 700;
    color: #0f172a;
}
.invoice-prefill-card-copy {
    color: #64748b;
    font-size: .85rem;
    line-height: 1.35;
}
.invoice-prefill-status {
    font-size: .82rem;
    color: #64748b;
    line-height: 1.35;
}
.invoice-prefill-status.is-success {
    color: #166534;
}
.invoice-prefill-status.is-warning {
    color: #92400e;
}
.invoice-prefill-status.is-danger {
    color: #b91c1c;
}
.invoice-prefill-status.is-loading {
    color: #1d4ed8;
}
.invoice-prefill-summary {
    border-radius: 14px;
    padding: .75rem .85rem;
    background: color-mix(in srgb, var(--form-accent) 7%, #ffffff 93%);
    border: 1px solid color-mix(in srgb, var(--form-accent) 14%, #dbe4f0 86%);
}
.invoice-prefill-summary-title {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #475569;
    margin-bottom: .45rem;
}
.invoice-prefill-summary-list {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.invoice-prefill-summary-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .88rem;
    line-height: 1.3;
}
.invoice-prefill-summary-label {
    color: #475569;
    font-weight: 600;
}
.invoice-prefill-summary-value {
    color: #0f172a;
    text-align: right;
    word-break: break-word;
}
.btn-pdf-prefill {
    background: #eab308;
    border-color: #eab308;
    color: #ffffff;
    font-weight: 600;
}
.btn-pdf-prefill:hover,
.btn-pdf-prefill:focus {
    background: #ca8a04;
    border-color: #ca8a04;
    color: #ffffff;
}
.btn-partner-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
    font-weight: 600;
    white-space: nowrap;
    width: 100%;
    min-height: 2.55rem;
}
.partner-default-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: .95rem 1rem 1rem;
    border: 1px solid color-mix(in srgb, var(--form-accent) 14%, #dbe4f0 86%);
    border-radius: 16px;
    background: rgba(255, 255, 255, .78);
}
.partner-default-card-label {
    margin-bottom: .55rem;
    font-weight: 600;
}
.partner-default-card-select {
    min-height: 11.25rem;
}
.partner-default-card-help {
    min-height: 3.5rem;
    margin-top: .65rem;
    margin-bottom: .9rem;
}
@media (max-width: 991.98px) {
    .partner-default-card-help {
        min-height: 0;
    }
}
.btn-partner-apply:hover,
.btn-partner-apply:focus {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #075985;
}
.invoice-prefill-modal {
    border-radius: 22px;
    overflow: hidden;
}
.invoice-prefill-modal .modal-header,
.invoice-prefill-modal .modal-footer {
    border-color: rgba(148, 163, 184, .18);
}
.invoice-prefill-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
}
.invoice-prefill-warning {
    border-radius: 14px;
    padding: .85rem 1rem;
    background: #fff7d6;
    border: 1px solid #f6d878;
    color: #8a5a00;
    font-size: .9rem;
    line-height: 1.45;
}
.invoice-prefill-quick-drop {
    min-height: 112px;
    border: 2px dashed rgba(234, 179, 8, .55);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 251, 235, .98), rgba(254, 249, 195, .88));
    padding: .85rem .95rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: .22rem;
    cursor: pointer;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.invoice-prefill-quick-drop:hover,
.invoice-prefill-quick-drop:focus {
    border-color: rgba(202, 138, 4, .88);
    background: linear-gradient(180deg, rgba(255, 247, 214, 1), rgba(254, 240, 138, .78));
    box-shadow: 0 0 0 3px rgba(234, 179, 8, .12);
    outline: none;
}
.invoice-prefill-quick-drop.is-dragover {
    border-color: rgba(202, 138, 4, 1);
    background: linear-gradient(180deg, rgba(254, 240, 138, .72), rgba(253, 224, 71, .4));
}
.invoice-prefill-quick-title {
    font-size: .88rem;
    font-weight: 700;
    color: #854d0e;
}
.invoice-prefill-quick-copy {
    font-size: .78rem;
    color: #a16207;
    line-height: 1.3;
}
.invoice-prefill-quick-status {
    margin-top: .2rem;
    font-size: .76rem;
}
.prefill-candidate-table th {
    white-space: nowrap;
}
.prefill-candidate-table td {
    vertical-align: middle;
}
.document-form-actions {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    border: 1px solid var(--form-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    padding: 1rem 1.1rem;
}
.form-preset-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}
.form-preset-btn {
    display: flex;
    align-items: center;
    gap: .7rem;
    width: 100%;
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    padding: .7rem .8rem;
    text-align: left;
}
.form-preset-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.85);
    box-shadow: 0 0 0 1px rgba(148, 163, 184, .35);
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .document-form-header {
        align-items: flex-start;
    }

    .document-form-copy {
        flex-basis: 100%;
    }
}



.detail-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.detail-section-card {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px;
    background: linear-gradient(180deg, #ffffff, #fafcff);
}
.detail-section-heading {
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    margin-bottom: 12px;
}
.detail-grid {
    display: grid;
    gap: 10px;
}
.detail-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.detail-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.detail-item {
    min-width: 0;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 14px;
    padding: 10px 12px;
}
.detail-item-wide {
    grid-column: span 2;
}
.detail-label {
    font-size: .76rem;
    color: #64748b;
    margin-bottom: 4px;
}
.detail-value {
    font-weight: 600;
    color: #1f2937;
    line-height: 1.35;
    word-break: break-word;
}
.detail-note-box {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 12px 14px;
    background: #ffffff;
}
.detail-note-copy {
    color: #334155;
    line-height: 1.55;
    word-break: break-word;
}
.attachment-count-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:34px;
    height:34px;
    padding:0 10px;
    border-radius:999px;
    background:#eff6ff;
    color:#2563eb;
    font-weight:800;
    font-size:.95rem;
    border:1px solid rgba(37,99,235,.14);
}
.invoice-attachment-list{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.invoice-attachment-card{
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px 16px;
    border:1px solid rgba(148,163,184,.28);
    border-radius:16px;
    background:linear-gradient(180deg, #ffffff, #f8fbff);
    color:#0f172a;
    text-decoration:none;
    transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}
.invoice-attachment-card:hover{
    border-color:rgba(37,99,235,.4);
    box-shadow:0 10px 24px rgba(15,23,42,.08);
    transform:translateY(-1px);
    color:#0f172a;
}
.invoice-attachment-card-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:42px;
    height:42px;
    border-radius:12px;
    background:#eff6ff;
    color:#2563eb;
    flex:0 0 auto;
}
.invoice-attachment-card-body{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
    flex:1 1 auto;
}
.invoice-attachment-card-title{
    font-weight:700;
    color:#0f172a;
    line-height:1.35;
    word-break:break-word;
}
.invoice-attachment-card-meta{
    font-size:.85rem;
    color:#64748b;
}
.invoice-attachment-card-action{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:0 12px;
    border-radius:999px;
    background:#2563eb;
    color:#fff;
    font-size:.85rem;
    font-weight:700;
    flex:0 0 auto;
}

@media (max-width: 1200px) {
    .detail-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .detail-grid-2,
    .detail-grid-4 {
        grid-template-columns: 1fr;
    }

    .detail-item-wide {
        grid-column: auto;
    }
    .invoice-attachment-card{
        align-items:flex-start;
        flex-wrap:wrap;
    }
    .invoice-attachment-card-action{
        margin-left:56px;
    }
}


.list-summary-bar {
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .08);
    padding: .9rem 1rem;
    margin-top: 18px;
    margin-bottom: 12px;
}
.list-summary-heading {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .45rem;
    font-weight: 700;
}
.list-summary-items {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}
.list-summary-chip {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
    border-radius: 14px;
    background: #f8fafc;
    padding: .6rem .8rem;
    border: 1px solid #e2e8f0;
}
.list-summary-currency {
    font-weight: 700;
    color: #0f172a;
    min-width: 42px;
}
.list-summary-values {
    display: flex;
    flex-wrap: wrap;
    gap: .95rem;
    color: #334155;
    font-size: .9rem;
}
.list-summary-values strong {
    font-weight: 700;
}
@media (max-width: 992px) {
    .list-summary-values {
        gap: .6rem;
        font-size: .84rem;
    }
}

.quick-inline-trigger {
    font-size: .95rem;
    line-height: 1;
    color: #64748b;
}
.quick-inline-trigger svg {
    display: block;
}
.quick-inline-trigger:hover {
    color: #0f172a;
}
.inline-badge-group {
    display: inline-flex;
    align-items: stretch;
    line-height: 1;
    --inline-badge-trigger-width: 1.4rem;
}
.inline-badge-label {
    display: inline-flex;
    align-items: center;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding-right: .28rem;
    margin-right: 0;
}
.inline-badge-label--fixed {
    min-width: 5.2rem;
    justify-content: center;
}
.inline-badge-group > .inline-badge-label:only-child {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    padding-right: calc(.28rem + var(--inline-badge-trigger-width));
}
.inline-badge-trigger,
.inline-badge-static {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--inline-badge-trigger-width);
    min-width: var(--inline-badge-trigger-width);
    height: auto;
    padding: 0;
    margin-left: 0;
    border: 0;
    border-left: 1px solid rgba(255,255,255,.22);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
    color: #ffffff !important;
    line-height: 1;
    flex: 0 0 auto;
}
.inline-badge-static {
    cursor: default;
}
.inline-badge-trigger:hover,
.inline-badge-trigger:focus {
    color: #ffffff !important;
    filter: brightness(.95);
}

.rf-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f172a;
}
.rf-indicator svg {
    display: block;
}
.rf-indicator:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}
.quick-inline-panel {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    min-width: 210px;
    z-index: 30;
    padding: .65rem;
    border-radius: 14px;
    background: rgba(255,255,255,.98);
    border: 1px solid #dbe4f0;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .14);
}
.quick-inline-panel .btn {
    white-space: nowrap;
}
@media (max-width: 992px) {
    .quick-inline-panel {
        left: auto;
        right: 0;
        min-width: 200px;
    }
}



.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.calendar-toolbar-compact {
    gap: 1rem 1.25rem;
}
.calendar-week-nav {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    flex: 0 1 auto;
}
.calendar-week-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.calendar-week-button:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}
.calendar-toolbar-form {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: .85rem;
    flex: 1 1 420px;
    flex-wrap: wrap;
    min-width: 0;
}
.calendar-company-inline {
    min-width: 220px;
}
.calendar-company-inline .form-select {
    min-width: 220px;
}
.calendar-filters{
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:1rem;
    flex-wrap:wrap;
}
.calendar-company-filter{
    display:flex;
    flex-direction:column;
    gap:.35rem;
    min-width: 260px;
}
.calendar-company-filter .form-select{
    max-width: 420px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}
.calendar-day {
    min-width: 0;
    border: 1px solid #dbe4f0;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
    display: flex;
    flex-direction: column;
    min-height: 420px;
}
.calendar-day.is-today {
    border-color: color-mix(in srgb, var(--form-accent) 48%, #dbe4f0 52%);
    box-shadow: 0 14px 28px rgba(37, 99, 235, .12);
}
.calendar-day-header {
    padding: .9rem .95rem .75rem;
    border-bottom: 1px solid #e6eef8;
}
.calendar-day-name {
    font-size: .9rem;
    font-weight: 700;
    color: #0f172a;
}
.calendar-day-date {
    font-size: .8rem;
    color: #64748b;
}
.calendar-day-body {
    padding: .85rem;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    flex: 1;
}
.calendar-section{
    display:flex;
    flex-direction:column;
    gap:.65rem;
}
.calendar-section-title{
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #64748b;
    margin-bottom: .05rem;
}
.calendar-divider{
    border-top: 1px dashed #dbe4f0;
    margin: .15rem 0;
}
.calendar-tile {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: .8rem .85rem;
    border-radius: 16px;
    border: 1px solid #dbe4f0;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}
.calendar-tile:hover {
    border-color: color-mix(in srgb, var(--form-accent) 40%, #dbe4f0 60%);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .09);
}
.calendar-tile-title {
    font-size: .88rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}
.calendar-tile-meta{
    margin-top: .25rem;
    font-size: .76rem;
    color: #64748b;
    word-break: break-word;
}
.calendar-tile-amount {
    margin-top: .45rem;
    font-weight: 700;
    color: #1d4ed8;
}
.calendar-tile.is-paid .calendar-tile-amount{
    color:#15803d;
}
.calendar-empty {
    margin: auto 0;
    border: 1px dashed #dbe4f0;
    border-radius: 16px;
    background: #f8fafc;
    padding: 1rem;
    text-align: center;
    color: #64748b;
    font-size: .88rem;
}
.calendar-empty-compact{
    padding: .75rem;
    font-size: .82rem;
}
.calendar-day-footer {
    margin-top: auto;
    padding-top: .35rem;
    border-top: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.calendar-day-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: .45rem .6rem;
    font-size: .82rem;
}
.calendar-day-total strong {
    color: #0f172a;
}
.calendar-day-total-paid{
    background: #f0fdf4;
    border-color: #bbf7d0;
}
@media (max-width: 1400px) {
    .calendar-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .calendar-day {
        min-height: 320px;
    }
}
@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    .calendar-day {
        min-height: 0;
    }
}

/* Invoice details emphasis */
.amount-strip{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}
.amount-box{
    flex:1 1 220px;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:12px 14px;
    background:#ffffff;
}
.amount-box-open{
    border-color:#cbd5e1;
    box-shadow: 0 6px 16px rgba(15,23,42,.06);
}
.amount-label{
    font-size:.78rem;
    color:#64748b;
    margin-bottom:4px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.03em;
}
.amount-value{
    font-size:1.25rem;
    font-weight:700;
    color:#0f172a;
    letter-spacing:.01em;
}
.detail-item-emph{
    border-color:#dbe4f0;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}
.detail-item-small .detail-value{
    font-weight:600;
    font-size:.95rem;
}
.rf-help-row{
    min-height:18px;
}

/* Payment batch cube icon (invoices list / invoice view)
   Default: light brown fill + black outline
   In draft batch: green fill + black outline
*/
.batch-cube{
    --cube-fill: #d2b48c; /* light brown */
    --cube-stroke: #0b0b0b;
    display:inline-block;
}
.batch-cube.batch-cube--draft{
    --cube-fill: #2ecc71; /* green */
}
.batch-cube .cube-face{ fill: var(--cube-fill); }
.batch-cube .cube-stroke{
    fill: none;
    stroke: var(--cube-stroke);
    stroke-width: 1.15;
    stroke-linejoin: round;
    stroke-linecap: round;
}

/* Newly created / highlighted invoice row */
.invoice-row-highlight{
    background: rgba(13, 110, 253, 0.08) !important;
}
.invoice-row-highlight td{
    border-top-color: rgba(13, 110, 253, 0.18);
    border-bottom-color: rgba(13, 110, 253, 0.18);
}

/* Invoices bulk actions bar */
.bulk-actions-bar{
    padding:14px 16px;
    border:1px solid rgba(15,23,42,.10);
    border-radius:18px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    margin:12px 12px 0 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.bulk-actions-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
}
.bulk-actions-row + .bulk-actions-row{
    margin-top:12px;
    padding-top:12px;
    border-top:1px solid rgba(15,23,42,.08);
}
.bulk-actions-row-left{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap;
    min-width:160px;
}
.bulk-actions-controls{
    display:flex;
    align-items:center;
    gap:10px;
    flex:1 1 auto;
    min-width:0;
    flex-wrap:nowrap;
    justify-content:flex-start;
    overflow-x:auto;
    padding-bottom:2px;
}
.bulk-actions-right{
    display:flex;
    justify-content:flex-end;
    margin-left:auto;
}
.bulk-count{
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:#0f172a;
    font-size:.95rem;
    font-weight:500;
}
.bulk-check{
    display:inline-flex;
    width:22px;
    height:22px;
    border-radius:999px;
    align-items:center;
    justify-content:center;
    background: rgba(13,110,253,.12);
    color:#0d6efd;
    font-weight:800;
}
.bulk-check svg{
    width:14px;
    height:14px;
    stroke:currentColor;
    stroke-width:2.2;
    fill:none;
    stroke-linecap:round;
    stroke-linejoin:round;
}
.bulk-actions-bar .form-select-sm{
    min-width: 150px;
    max-width: 188px;
    flex:0 1 188px;
}
.bulk-actions-bar .form-control{
    min-width: 220px;
}
.bulk-ok-btn{
    min-width:64px;
    font-weight:700;
}
.bulk-primary-action,
.bulk-paid-action,
.bulk-delete-action{
    color:#ffffff !important;
    border-color:transparent !important;
    font-weight:700;
}
.bulk-primary-action:hover,
.bulk-primary-action:focus{
    background:#1d4ed8;
}
.bulk-paid-action:hover,
.bulk-paid-action:focus{
    background:#15803d;
}
.bulk-delete-action:hover,
.bulk-delete-action:focus{
    background:#b91c1c;
}

.invoice-id-link{
    color:#2563eb;
    text-decoration:none;
}
.invoice-id-link:hover{
    color:#1d4ed8;
    text-decoration:underline;
}
.partner-filter-link{
    color:#2563eb;
    text-decoration:none;
}
.partner-filter-link:hover{
    color:#1d4ed8;
    text-decoration:underline;
}
.table-hover-link{
    color:inherit;
    text-decoration:none;
}
.table-hover-link:hover{
    color:#2563eb;
    text-decoration:underline;
}
.invoice-sort-link{
    display:inline-flex;
    align-items:center;
    gap:.35rem;
    color:inherit;
    text-decoration:none;
    cursor:pointer;
    transition:color .15s ease;
}
.invoice-sort-link:hover{
    color:#2563eb;
}
.invoice-sort-link.is-active{
    color:#1d4ed8;
}
.invoice-sort-indicator{
    font-size:.82em;
    line-height:1;
    opacity:.9;
}
.attachment-quick-link{
    color:#64748b;
}
.attachment-quick-link:hover{
    color:#2563eb;
}
.attachment-picker-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.attachment-picker-link{
    justify-content:flex-start;
    text-align:left;
}
.invoice-todo-trigger{
    color:#dc2626;
}
.invoice-todo-trigger.is-done{
    color:#15803d;
}
.invoice-todo-trigger:hover,
.invoice-todo-trigger:focus{
    color:inherit;
    opacity:.85;
}
.todo-modal-item{
    border:1px solid rgba(148,163,184,.28);
    border-radius:16px;
    padding:1rem;
    background:rgba(248,250,252,.92);
}
.todo-modal-item + .todo-modal-item{
    margin-top:.85rem;
}
.invoice-todo-list,
.todo-reminder-list{
    display:flex;
    flex-direction:column;
}
.todo-invoice-search-results:empty{
    display:none;
}
.todo-description-cell{
    min-width:280px;
    max-width:420px;
}
.filter-field{
    min-width:180px;
}
.table-truncate-text,
.table-truncate-link{
    display:inline-block;
    max-width:min(26vw, 280px);
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    vertical-align:bottom;
}
.currency-cell{
    white-space:nowrap;
}
.currency-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:2.7rem;
    letter-spacing:.03em;
    font-weight:700;
}
.invoice-list-responsive{
    overflow-x:auto;
    overflow-y:visible;
    padding-bottom:120px;
}
.invoice-list-table,
.invoice-list-table tbody,
.invoice-list-table tr,
.invoice-list-table td{
    overflow:visible;
}
.invoice-list-table .quick-inline-panel{
    z-index:60;
}
.bulk-actions-bar .modal-content{
    border-radius:18px;
}

@media (max-width: 992px){
    .invoice-prefill-toolbar{
        align-items:flex-start;
    }
    .invoice-prefill-summary-item{
        flex-direction:column;
    }
    .invoice-prefill-summary-value{
        text-align:left;
    }
    .bulk-actions-row-left,
    .bulk-actions-controls{
        flex-wrap:wrap;
        overflow:visible;
    }
    .bulk-actions-bar .form-select-sm{
        min-width: 150px;
        max-width:none;
        flex:1 1 150px;
    }
}
.calendar-sort-controls{
    display:flex;
    gap:12px;
    align-items:flex-end;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.calendar-sort-group{
    min-width:170px;
}
.calendar-sort-group .form-label{
    font-size:.8rem;
    color:#64748b;
}
@media (max-width: 992px) {
    .calendar-toolbar-form {
        flex-basis: 100%;
        justify-content: flex-start;
    }
}
.calendar-tile-title,
.calendar-tile-meta,
.calendar-tile-submeta{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.calendar-tile-submeta{
    font-size:.82rem;
    color:#94a3b8;
    margin-top:2px;
}

/* Dokumentum műveleti napló */
.activity-log-scroll{
    max-height:240px; /* kb. 5 sor + fejlécek */
    overflow-y:auto;
    border:1px solid rgba(15,23,42,.08);
    border-radius:12px;
}
.activity-log-scroll .table{ margin-bottom:0; }
.activity-log-scroll thead th{ position:sticky; top:0; z-index:1; }

/* --- Csatolmány drag & drop --- */
.attachment-dropzone{
    border:2px dashed rgba(15,23,42,.25);
    border-radius:18px;
    padding:16px;
    background:rgba(15,23,42,.03);
    cursor:pointer;
    transition:border-color 120ms ease, background 120ms ease;
}
.attachment-dropzone:hover{
    border-color:rgba(37,99,235,.55);
    background:rgba(37,99,235,.05);
}
.attachment-dropzone.is-dragover{
    border-color:rgba(37,99,235,.85);
    background:rgba(37,99,235,.08);
}
.attachment-dropzone-inner{ display:flex; flex-direction:column; gap:6px; }
.attachment-dropzone-title{ font-weight:700; }
.attachment-dropzone-meta{ color:rgba(15,23,42,.7); font-size:.9rem; }

/* --- Oldalszovegek szerkesztese --- */
.ui-text-editor{
    display:flex;
    flex-direction:column;
}
.ui-text-editor-head{
    display:grid;
    grid-template-columns:minmax(220px, 1.15fr) minmax(240px, 1fr) minmax(300px, 1.15fr) minmax(220px, 1fr);
    gap:16px;
    padding:14px 18px;
    border-bottom:1px solid rgba(15,23,42,.08);
    background:linear-gradient(180deg, #f8fafc, #f1f5f9);
    color:#475569;
    font-size:.82rem;
    font-weight:800;
    letter-spacing:.03em;
    text-transform:uppercase;
}
.ui-text-editor-list{
    display:flex;
    flex-direction:column;
}
.ui-text-entry{
    padding:18px;
    border-bottom:1px solid rgba(15,23,42,.08);
}
.ui-text-entry:last-child{
    border-bottom:0;
}
.ui-text-entry-grid{
    display:grid;
    grid-template-columns:minmax(220px, 1.15fr) minmax(240px, 1fr) minmax(300px, 1.15fr) minmax(220px, 1fr);
    gap:16px;
    align-items:start;
}
.ui-text-entry-cell{
    min-width:0;
}
.ui-text-entry-label{
    display:none;
    margin-bottom:8px;
    color:#64748b;
    font-size:.78rem;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.02em;
}
.ui-text-entry-value{
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    word-break:break-word;
    line-height:1.45;
}
.ui-text-entry-key-value{
    font-size:1rem;
}
.ui-text-entry-textarea{
    min-height:106px;
    resize:vertical;
}
@media (max-width: 1199.98px){
    .ui-text-editor-head,
    .ui-text-entry-grid{
        grid-template-columns:minmax(200px, 1fr) minmax(200px, 1fr);
    }
}
@media (max-width: 767.98px){
    .ui-text-editor-head{
        display:none;
    }
    .ui-text-entry{
        padding:16px;
    }
    .ui-text-entry-grid{
        grid-template-columns:1fr;
        gap:14px;
    }
    .ui-text-entry-label{
        display:block;
    }
}

/* Report center */
.report-center-page{
    display:flex;
    flex-direction:column;
    gap:0;
}
.report-hero{
    border:1px solid rgba(37,99,235,.10);
    background:
        radial-gradient(circle at top right, rgba(96,165,250,.20), transparent 34%),
        linear-gradient(180deg, #ffffff, #f8fbff);
}
.report-hero-top{
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:flex-start;
}
.report-hero-title{
    margin:6px 0 10px 0;
    font-size:1.75rem;
    line-height:1.1;
    font-weight:800;
    color:#0f172a;
}
.report-hero-text{
    max-width:760px;
    color:#5b6b82;
}
.report-hero-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.report-hero-meta{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:18px;
}
.report-overline{
    font-size:.76rem;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#64748b;
}
.report-chip-wrap{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}
.report-chip{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:7px 12px;
    border-radius:999px;
    background:#eef4ff;
    color:#1e3a8a;
    font-size:.88rem;
    font-weight:700;
}
.report-chip.active{
    background:#dbeafe;
    color:#1d4ed8;
}
.report-chip.tiny{
    padding:4px 9px;
    font-size:.76rem;
}
.report-layout-grid{
    display:grid;
    grid-template-columns:minmax(0, 1.55fr) minmax(320px, .95fr);
    gap:18px;
}
.report-filter-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:14px;
}
.report-filter-actions{
    display:flex;
    gap:10px;
    align-items:flex-end;
    flex-wrap:wrap;
}
.report-save-form{
    padding:14px;
    border:1px solid rgba(15,23,42,.08);
    border-radius:18px;
    background:linear-gradient(180deg, #ffffff, #f8fafc);
}
.report-checkline{
    display:flex;
    align-items:flex-start;
    gap:10px;
    font-size:.95rem;
    color:#475569;
}
.report-view-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}
.report-view-item{
    display:flex;
    justify-content:space-between;
    gap:14px;
    padding:14px 16px;
    border:1px solid rgba(15,23,42,.08);
    border-radius:16px;
    background:#fff;
}
.report-view-item.active{
    border-color:rgba(37,99,235,.28);
    background:linear-gradient(180deg, #f8fbff, #eef5ff);
}
.report-view-title{
    font-size:1rem;
    font-weight:700;
    color:#0f172a;
}
.report-view-meta,
.report-view-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}
.report-kpi-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
}
.report-kpi-card{
    border:1px solid rgba(15,23,42,.08);
    border-radius:22px;
    background:linear-gradient(180deg, #ffffff, #f9fbfd);
    box-shadow:0 12px 30px rgba(15,23,42,.05);
}
.report-kpi-title{
    font-size:1.08rem;
    margin:8px 0 12px 0;
    font-weight:800;
    color:#0f172a;
}
.report-stat-line{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:7px 0;
    border-top:1px solid rgba(15,23,42,.06);
}
.report-stat-line:first-of-type{
    border-top:0;
}
.report-two-col{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
}
.report-three-col{
    display:grid;
    grid-template-columns:1.05fr .95fr 1fr;
    gap:18px;
}
.report-section-head{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    flex-wrap:wrap;
}
.report-section-title{
    margin:4px 0 0 0;
    font-size:1.25rem;
    font-weight:800;
    color:#0f172a;
}
.report-sublist-title{
    margin-bottom:10px;
    font-size:.95rem;
    font-weight:800;
    color:#334155;
}
.report-table{
    --bs-table-bg: transparent;
}
.report-table thead th{
    font-size:.78rem;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:#64748b;
    border-bottom-color:rgba(15,23,42,.10);
}
.report-table tbody td{
    border-bottom-color:rgba(15,23,42,.08);
}
.report-mini-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
}
.report-mini-card{
    padding:14px 16px;
    border:1px solid rgba(15,23,42,.08);
    border-radius:18px;
    background:linear-gradient(180deg, #ffffff, #f8fafc);
}
.report-mini-value{
    margin-top:8px;
    font-size:1.2rem;
    font-weight:800;
    color:#0f172a;
}
.report-empty-text{
    color:#64748b;
    font-size:.95rem;
}
.user-company-access-panel{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.user-company-access-mode{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
}
.user-company-access-mode-option{
    display:block;
    margin:0;
    cursor:pointer;
}
.user-company-access-mode-option input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}
.user-company-access-mode-card{
    display:flex;
    align-items:center;
    min-height:52px;
    padding:0 16px;
    border:1px solid rgba(37,99,235,.14);
    border-radius:14px;
    background:#f8fafc;
    color:#0f172a;
    transition:border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.user-company-access-mode-option input:checked + .user-company-access-mode-card{
    background:#eff6ff;
    border-color:rgba(37,99,235,.45);
    box-shadow:0 0 0 1px rgba(37,99,235,.12);
}
.user-company-access-mode-title{
    font-weight:700;
    font-size:.95rem;
}
.user-company-access-list{
    display:none;
    gap:10px;
}
.user-company-access-list.is-active{
    display:grid;
}
.user-company-access-item{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:12px 14px;
    border:1px solid rgba(15,23,42,.08);
    border-radius:14px;
    background:#fff;
    cursor:pointer;
    transition:border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.user-company-access-item.is-selected{
    background:#f0f7ff;
    border-color:rgba(37,99,235,.32);
    box-shadow:0 0 0 1px rgba(37,99,235,.08);
}
.user-company-access-checkbox{
    margin-top:2px;
    width:18px;
    height:18px;
    flex:0 0 auto;
}
.user-company-access-item-body{
    display:flex;
    flex-direction:column;
    gap:4px;
    min-width:0;
}
.user-company-access-item-title{
    font-weight:700;
    color:#0f172a;
}
.user-company-access-item-meta{
    font-size:.85rem;
    color:#64748b;
}
@media (max-width: 1399.98px){
    .report-layout-grid,
    .report-two-col,
    .report-three-col{
        grid-template-columns:1fr;
    }
}
@media (max-width: 1199.98px){
    .report-filter-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .report-kpi-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 767.98px){
    .report-hero-top,
    .report-view-item{
        flex-direction:column;
    }
    .report-filter-grid,
    .report-kpi-grid,
    .report-mini-grid{
        grid-template-columns:1fr;
    }
    .user-company-access-mode{
        grid-template-columns:1fr;
    }
}
