html,
body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--app-text);
    background: var(--app-bg);
}

.app-shell .content-wrapper {
    min-height: calc(100vh - 57px);
    background: var(--app-bg);
}

.app-container {
    max-width: 1480px;
}

.app-navbar {
    min-height: 57px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    min-width: 132px;
}

.navbar-nav {
    gap: 2px;
}

.navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 11px;
    border-radius: 7px;
    color: #475467;
    font-weight: 600;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--app-primary) !important;
    background: #eef3ff;
}

.dropdown-menu {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

.app-main-nav .dropdown-menu {
    min-width: 245px;
}

.app-main-nav .dropdown-header {
    padding: 8px 12px 6px;
    color: #64748b;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-main-nav .dropdown-item {
    gap: 4px;
    white-space: nowrap;
}

.owner-report-category-grid .dashboard-metric-card {
    height: 100%;
}

.owner-real-result-card {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    align-items: center;
}

.owner-real-result-card .dashboard-metric-label,
.owner-real-result-card strong,
.owner-real-result-card small {
    grid-column: 2;
}

.owner-real-result-card .dashboard-metric-icon {
    grid-row: 1 / span 3;
}

.zus-report-page .dashboard-metric-card {
    height: 100%;
}

.dropdown-item {
    border-radius: 6px;
    font-weight: 500;
}

.app-navbar-actions {
    margin-left: auto;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--app-border);
    color: #475467;
    background: #fff;
}

.icon-button:hover {
    color: var(--app-primary);
    border-color: #c8d6ff;
    background: #f7f9ff;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.page-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0;
}

.page-subtitle {
    margin-top: 3px;
    color: var(--app-muted);
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.accounting-page .form-select,
.owner-dashboard-page .form-select {
    min-width: 220px;
}

.card {
    border: 1px solid var(--app-border);
    border-radius: 8px;
    box-shadow: none;
}

.card-header {
    padding: 12px 16px;
    border-bottom-color: var(--app-border);
    background: #fff;
}

.card-body {
    padding: 16px;
}

.section-title {
    margin: 0;
    font-size: .92rem;
    font-weight: 700;
}

.btn {
    border-radius: 7px;
    font-weight: 600;
}

.btn-sm {
    padding: 5px 9px;
}

.btn-primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
}

.form-control,
.form-select {
    border-color: #d0d5dd;
    border-radius: 7px;
}

.form-label {
    margin-bottom: 5px;
    color: #344054;
    font-size: .82rem;
    font-weight: 600;
}

.table {
    --bs-table-hover-bg: #f8fafc;
}

.table > :not(caption) > * > * {
    padding: 11px 12px;
    border-bottom-color: var(--app-border);
}

.table thead th {
    color: #667085;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f8fafc;
}

.table tbody td {
    vertical-align: middle;
}

.table-responsive {
    border-radius: 8px;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.table-sort-link:hover {
    color: inherit;
}

.app-ajax-content {
    transition: opacity .16s ease;
}

.app-ajax-content.is-loading {
    opacity: .62;
    pointer-events: none;
}

.summary-section-label {
    margin: 4px 0 12px;
    color: #344054;
    font-size: .8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    border-radius: 6px;
    font-weight: 600;
}

.app-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border: 1px solid var(--app-border);
    border-radius: 999px;
    color: #344054;
    background: #f8fafc;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.app-status-badge.is-neutral {
    border-color: #d0d5dd;
    color: #475467;
    background: #f8fafc;
}

.app-status-badge.is-info {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.app-status-badge.is-success {
    border-color: #bbf7d0;
    color: #15803d;
    background: #f0fdf4;
}

.app-status-badge.is-warning {
    border-color: #fde68a;
    color: #b45309;
    background: #fffbeb;
}

.app-status-badge.is-danger {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fef2f2;
}

.ksef-env-segment {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ksef-env-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 124px;
    padding: 16px 18px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    color: #344054;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.ksef-env-option:hover {
    border-color: #bfd4ff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.ksef-env-option-title {
    display: inline-flex;
    align-items: center;
    font-size: .95rem;
    font-weight: 800;
    line-height: 1.2;
}

.ksef-env-option-url {
    color: #475467;
    font-size: .82rem;
    font-weight: 700;
    word-break: break-word;
}

.ksef-env-option-copy {
    color: var(--app-muted);
    font-size: .84rem;
    line-height: 1.45;
}

.btn-check:checked + .ksef-env-option {
    border-color: #84adff;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.btn-check:focus-visible + .ksef-env-option {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.btn-check:checked + .ksef-env-option.is-test {
    border-color: #93c5fd;
    background: #eff6ff;
}

.btn-check:checked + .ksef-env-option.is-prod {
    border-color: #fbbf24;
    background: #fff9eb;
}

.alert {
    border: 0;
    border-radius: 8px;
}

.error-page-wrap {
    display: grid;
    min-height: calc(100vh - 145px);
    place-items: center;
    padding: 24px 0;
}

.error-panel {
    width: min(100%, 620px);
    padding: 34px;
    text-align: center;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: var(--app-surface);
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-size: 1.45rem;
}

.error-icon-danger {
    color: #b42318;
    background: #fee4e2;
}

.error-icon-warning {
    color: #b54708;
    background: #fef0c7;
}

.error-icon-info {
    color: var(--app-primary);
    background: #eef3ff;
}

.error-code {
    margin-bottom: 8px;
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.error-panel h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 0;
}

.error-message {
    max-width: 470px;
    margin: 12px auto 0;
    color: #344054;
    font-size: 1rem;
    line-height: 1.6;
}

.error-details {
    max-width: 500px;
    margin: 10px auto 0;
    color: var(--app-muted);
    line-height: 1.55;
}

.error-help {
    max-width: 500px;
    margin: 22px auto 0;
    padding: 14px;
    text-align: left;
    border: 1px solid #dbe4ff;
    border-radius: 8px;
    background: #f7f9ff;
}

.error-help-title {
    margin-bottom: 6px;
    color: #1d3f9f;
    font-size: .82rem;
    font-weight: 800;
}

.error-help p {
    margin: 0 0 8px;
    color: #344054;
    line-height: 1.5;
}

.error-help code {
    display: block;
    padding: 9px 10px;
    color: #1f2937;
    white-space: normal;
    word-break: break-word;
    border: 1px solid var(--app-border);
    border-radius: 7px;
    background: #fff;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

@media (max-width: 575.98px) {
    .error-panel {
        padding: 26px 18px;
    }

    .error-actions .btn {
        width: 100%;
    }
}

.list-group-item {
    border-color: var(--app-border);
}

.list-group-item-action:hover {
    background-color: #f8fafc;
}

.dashboard-page .card {
    height: 100%;
}

.mobile-quick-actions {
    display: none;
}

@media (max-width: 767.98px) {
    .mobile-quick-actions {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: .25rem;
        padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom));
        border-top: 1px solid #dbe3ef;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -4px 18px rgba(23, 35, 60, .1);
        backdrop-filter: blur(8px);
    }

    .mobile-quick-actions a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 3.2rem;
        border-radius: 10px;
        color: #51627d;
        font-size: .7rem;
        font-weight: 700;
        text-decoration: none;
    }

    .mobile-quick-actions a:active,
    .mobile-quick-actions a:focus-visible {
        color: #2557d6;
        background: #f0f5ff;
    }

    .mobile-quick-actions i {
        margin-bottom: .2rem;
        font-size: 1rem;
    }

    .dashboard-page {
        padding-bottom: 5.5rem;
    }
}

/* Compact, consistent status pills in tables and summary cards. */
.cost-status-badge,
.cost-type-badge,
.app-status-badge {
    min-height: 24px;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
}

.cost-status-badge.is-paid {
    color: #067647;
    background: #ecfdf3;
    border-color: #abefc6;
}

.cost-status-badge.is-pending {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

.cost-status-badge.is-warning {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

.cost-status-badge.is-danger {
    color: #b42318;
    background: #fef3f2;
    border-color: #fecdca;
}

/* EvoBot: a roomier panel with subtle, non-blocking motion. */
.evobot-panel {
    display: flex;
    flex-direction: column;
    width: min(470px, calc(100vw - 32px));
    max-height: min(650px, calc(100vh - 112px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(14px) scale(.98);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.evobot-panel.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.evobot-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f4f7ff 100%);
}

.evobot-header::after {
    position: absolute;
    right: -34px;
    top: -54px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    content: "";
    background: rgba(37, 87, 214, .08);
    pointer-events: none;
}

.evobot-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 7px 1px 0;
    border-radius: 50%;
    background: #12b76a;
    box-shadow: 0 0 0 4px rgba(18, 183, 106, .12);
    animation: evobot-status-pulse 2.2s ease-in-out infinite;
}

.evobot-messages {
    flex: 1 1 auto;
    height: 430px;
    min-height: 280px;
    background: radial-gradient(circle at 100% 0%, #eef3ff 0, #f8fafc 42%, #f8fafc 100%);
}

.evobot-message {
    animation: evobot-message-in .22s ease both;
}

.evobot-message-user {
    border-bottom-right-radius: 4px;
}

.evobot-message-bot {
    border-bottom-left-radius: 4px;
}

.evobot-message-loading {
    background: linear-gradient(100deg, #fff 35%, #f1f5ff 50%, #fff 65%);
    background-size: 220% 100%;
    animation: evobot-message-in .22s ease both, evobot-loading-shimmer 1.8s ease-in-out infinite;
}

@keyframes evobot-message-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes evobot-status-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(18, 183, 106, .12); }
    50% { box-shadow: 0 0 0 6px rgba(18, 183, 106, .04); }
}

@keyframes evobot-loading-shimmer {
    0%, 100% { background-position: 100% 0; }
    50% { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .evobot-panel,
    .evobot-message,
    .evobot-message-loading,
    .evobot-status-dot {
        animation: none;
        transition: none;
    }
}

@media (max-width: 767.98px) {
    .evobot-panel {
        max-height: calc(100vh - 96px);
    }

    .evobot-messages {
        height: min(430px, calc(100vh - 230px));
    }
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: end;
    padding: 26px;
    color: #fff;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(37, 87, 214, .95), rgba(20, 36, 84, .96)),
        radial-gradient(circle at top right, rgba(255, 255, 255, .22), transparent 34%);
    box-shadow: 0 16px 40px rgba(37, 87, 214, .18);
}

.dashboard-hero h1 {
    margin: 4px 0 10px;
    font-size: 1.65rem;
    font-weight: 800;
}

.dashboard-hero .page-subtitle,
.dashboard-hero-meta {
    color: rgba(255, 255, 255, .78);
}

.dashboard-hero-value {
    font-size: clamp(2rem, 4vw, 3.35rem);
    font-weight: 800;
    line-height: 1.05;
}

.dashboard-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-weight: 700;
}

.dashboard-hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    max-width: 420px;
}

.dashboard-hero-actions .btn {
    border-color: rgba(255, 255, 255, .5);
}

.dashboard-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.25rem 0 .65rem;
    color: #24324a;
    font-size: .9rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.dashboard-section-heading small {
    color: #72809a;
    font-size: .75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

.dashboard-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-overview-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 108px;
    padding: 16px 18px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
}

.dashboard-overview-label {
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-overview-item strong {
    font-size: 1.2rem;
    line-height: 1.25;
}

.dashboard-overview-item small {
    margin-top: auto;
    color: var(--app-muted);
    font-weight: 600;
}

.dashboard-metric-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 154px;
    padding: 17px;
    color: var(--app-text);
    text-decoration: none;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.dashboard-metric-card:hover {
    color: var(--app-text);
    border-color: #b7c7ff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.dashboard-metric-card.is-primary {
    border-color: #c8d6ff;
    background: linear-gradient(180deg, #fff 0%, #f7f9ff 100%);
}

.dashboard-metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 16px;
    color: var(--app-primary);
    border-radius: 9px;
    background: #eef3ff;
}

.dashboard-metric-label {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-metric-card strong {
    margin-top: 5px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.dashboard-metric-card small {
    margin-top: auto;
    color: var(--app-muted);
    font-weight: 600;
}

.zus-breakdown-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: auto;
    padding-top: 10px;
}

.zus-breakdown-list.is-compact {
    gap: 3px;
    padding-top: 8px;
}

.zus-breakdown-list span {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 700;
    line-height: 1.3;
}

.zus-breakdown-list strong {
    margin: 0;
    color: var(--app-text);
    font-size: .8rem;
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-task-list,
.dashboard-list {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
}

.dashboard-task-item,
.dashboard-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: 74px;
    padding: 15px 18px;
    color: var(--app-text);
    text-decoration: none;
    border-bottom: 1px solid var(--app-border);
    transition: background .15s ease, color .15s ease;
}

.dashboard-task-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.dashboard-period-control .dashboard-task-item {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.dashboard-task-item > i {
    align-self: center;
    justify-self: end;
}

.dashboard-task-item:last-child,
.dashboard-list-item:last-child {
    border-bottom: 0;
}

.dashboard-task-item:hover,
.dashboard-list-item:hover {
    color: var(--app-primary);
    background: #f8fafc;
}

.dashboard-task-item span:not(.task-icon),
.dashboard-list-item span {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.dashboard-list-item > span:last-child {
    align-items: flex-end;
    min-width: 130px;
}

.dashboard-list-item strong {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.dashboard-task-item small,
.dashboard-list-item small {
    color: var(--app-muted);
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.25;
}

.task-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex: 0 0 36px;
}

.task-danger {
    color: #b42318;
    background: #fee4e2;
}

.task-warning {
    color: #b54708;
    background: #fef0c7;
}

.task-success {
    color: #027a48;
    background: #d1fadf;
}

.dashboard-mini-chart {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    min-height: 172px;
}

.mini-bar-item {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    min-width: 0;
}

.mini-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 132px;
    border-radius: 8px;
    background: #f2f4f7;
}

.mini-bar {
    width: 54%;
    min-height: 8px;
    border-radius: 7px 7px 3px 3px;
    background: rgba(37, 87, 214, .22);
}

.mini-bar.is-current {
    background: var(--app-primary);
}

.mini-bar-item span {
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    text-align: center;
}

.dashboard-progress {
    height: 11px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.dashboard-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--app-primary);
}

.dashboard-progress-value {
    margin-top: 14px;
    font-size: 1.5rem;
    font-weight: 800;
}

.dashboard-empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    color: var(--app-muted);
}

.dashboard-empty-state i {
    color: var(--app-primary);
    font-size: 1.45rem;
}

.dashboard-empty-state strong {
    color: var(--app-text);
}

.integrity-issue-list {
    display: grid;
    gap: 0.875rem;
}

.integrity-issue-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.125rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: #fff;
}

.integrity-issue-main {
    min-width: 0;
}

.integrity-issue-main strong {
    display: block;
    color: var(--app-text);
    margin-bottom: 0.25rem;
}

.integrity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--app-muted);
}

.integrity-issue-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .dashboard-overview-grid {
        grid-template-columns: 1fr;
    }

    .integrity-issue-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .integrity-issue-actions {
        width: 100%;
    }
}

/* Wspólne minimum dostępności i responsywności panelu. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #1d4ed8;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #ffffff;
}

.dashboard-period-filter {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.dashboard-period-filter .form-select {
    min-width: 150px;
}

.dashboard-due-now {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    align-self: flex-start;
    width: 100%;
    min-height: 148px;
    padding: 1.25rem 1.5rem;
    border: 1px solid #f4b4ad;
    border-left: 5px solid #b42318;
    border-radius: 1rem;
    background: #fff7f6;
}

.dashboard-action-grid {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(0, 2fr);
    gap: 1rem;
    align-items: start;
}

.dashboard-action-grid > aside {
    min-width: 0;
}

.dashboard-action-panel {
    display: grid;
    align-content: start;
    gap: 1rem;
    min-width: 0;
}

.dashboard-action-summary {
    padding: 1rem 1.15rem;
    border: 1px solid var(--app-border, #dbe3ef);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 42, 75, .05);
}

.dashboard-action-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding-bottom: .7rem;
    border-bottom: 1px solid #edf0f5;
}

.dashboard-action-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
    padding-top: .75rem;
}

.dashboard-action-summary-grid > * {
    display: flex;
    flex-direction: column;
    gap: .18rem;
    min-width: 0;
    padding: .55rem .65rem;
    border-radius: .65rem;
    color: inherit;
    text-decoration: none;
    background: #f7f9fc;
}

.dashboard-action-summary-grid a:hover,
.dashboard-action-summary-grid a:focus-visible {
    background: #eef4ff;
    color: inherit;
}

.dashboard-action-summary-grid span {
    color: #71809a;
    font-size: .75rem;
}

.dashboard-action-summary-grid strong {
    color: #17233c;
    font-size: .98rem;
}

.dashboard-news-list {
    max-height: 620px;
    overflow-y: auto;
}

.dashboard-alerts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.dashboard-alert-item {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .dashboard-action-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-alerts {
        grid-template-columns: 1fr;
    }
}

.dashboard-due-now strong {
    display: block;
    color: #b42318;
    font-size: 1.75rem;
}

.dashboard-due-now small { color: #7a271a; }

.dashboard-due-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
    color: #7a271a;
}

.dashboard-due-breakdown a {
    color: inherit;
    text-decoration: none;
}

.dashboard-due-breakdown a:hover,
.dashboard-due-breakdown a:focus-visible {
    text-decoration: underline;
}

.dashboard-news-card {
    overflow: hidden;
}

.dashboard-news-list {
    display: flex;
    flex-direction: column;
}

.dashboard-news-item {
    display: block;
    padding: .85rem 1rem;
    color: var(--app-text, #17233c);
    text-decoration: none;
    border-bottom: 1px solid var(--app-border, #dbe3ef);
    transition: background-color .15s ease;
}

.dashboard-news-item:hover,
.dashboard-news-item:focus-visible {
    background: #f4f7ff;
}

.dashboard-news-item strong {
    display: block;
    font-size: .9rem;
    line-height: 1.35;
}

.dashboard-news-item small {
    display: block;
    margin-top: .35rem;
    color: #71809a;
    font-size: .75rem;
}

.dashboard-news-item span {
    display: block;
    margin-top: .3rem;
    color: #53627b;
    font-size: .78rem;
    line-height: 1.35;
}

.revenue-legend .income-line {
    border-color: #059669;
}

.revenue-legend .income-trend-line {
    border-color: #7c3aed;
    border-top-style: dashed;
}

.dashboard-quick-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 1px solid var(--app-border, #dbe3ef);
    border-radius: 1rem;
    box-shadow: 0 8px 24px rgba(24, 42, 75, .05);
}

.dashboard-quick-actions-heading {
    min-width: 10rem;
}

.dashboard-quick-actions-heading span,
.dashboard-quick-actions-heading small {
    display: block;
}

.dashboard-quick-actions-heading span {
    color: #17233c;
    font-weight: 700;
}

.dashboard-quick-actions-heading small,
.dashboard-quick-action small {
    color: #71809a;
    font-size: .78rem;
}

.dashboard-quick-actions-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    flex: 1;
    gap: .65rem;
}

.dashboard-quick-action {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-width: 0;
    padding: .6rem .7rem;
    color: inherit;
    text-decoration: none;
    border-radius: .75rem;
    transition: background-color .15s ease, transform .15s ease;
}

.dashboard-quick-action:hover,
.dashboard-quick-action:focus-visible {
    color: inherit;
    background: #f5f8fc;
    transform: translateY(-1px);
}

.dashboard-quick-action strong,
.dashboard-quick-action small {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-quick-action-icon {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;
    border-radius: .7rem;
}

.dashboard-quick-action-icon.is-primary { color: #2563eb; background: #eaf1ff; }
.dashboard-quick-action-icon.is-info { color: #0891b2; background: #e6f8fb; }
.dashboard-quick-action-icon.is-warning { color: #b45309; background: #fff4d6; }
.dashboard-quick-action-icon.is-success { color: #15803d; background: #e7f8ed; }

@media (max-width: 991.98px) {
    .dashboard-quick-actions { display: block; }
    .dashboard-quick-actions-heading { margin-bottom: .65rem; }
}

@media (max-width: 575.98px) {
    .dashboard-quick-actions-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-quick-action { padding: .5rem .35rem; }
}

.workflow-step-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.workflow-step-link:hover,
.workflow-step-link:focus-visible {
    color: inherit;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .14);
}

.taxes-help-icon {
    margin-left: .25rem;
    color: #72809a;
    cursor: help;
    font-size: .8em;
}

.taxes-help-icon:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 50%;
}

@media (max-width: 767.98px) {
    .dashboard-news-item {
        padding: .75rem 1rem;
    }

    .dashboard-period-filter,
    .dashboard-due-now {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-period-filter .form-select,
    .dashboard-period-filter .btn {
        width: 100%;
    }
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.table-responsive table {
    min-width: 760px;
}

.btn {
    min-height: 38px;
}

@media (max-width: 767.98px) {
    .page-header,
    .page-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

    .filters-card .form-label {
        margin-top: .25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

.dashboard-simulation-grid,
.dashboard-health-grid {
    display: grid;
    gap: 10px;
}

.dashboard-simulation-grid {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-health-grid {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-simulation-grid div,
.dashboard-health-grid div {
    padding: 13px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
}

.dashboard-simulation-grid span,
.dashboard-health-grid span {
    display: block;
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 700;
}

.dashboard-simulation-grid strong,
.dashboard-health-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 1.05rem;
}

.taxes-report-page .taxes-report-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    padding: 22px 24px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%);
    box-shadow: var(--app-shadow-sm);
}

.taxes-report-page .taxes-report-banner-main {
    min-width: 260px;
}

.taxes-report-page .taxes-report-banner-main h2 {
    margin-bottom: .25rem;
    font-size: 1.55rem;
    line-height: 1.1;
}

.taxes-report-page .taxes-report-banner-meta {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    flex: 1 1 640px;
}

.taxes-report-page .taxes-report-banner-meta > div {
    padding: 12px 14px;
    border: 1px solid #e6ecf7;
    border-radius: 12px;
    background: #fff;
}

.taxes-report-page .taxes-report-banner-meta span {
    display: block;
    margin-bottom: 4px;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.taxes-report-page .taxes-report-banner-meta strong {
    font-size: 1.05rem;
    line-height: 1.15;
}

.taxes-report-page .taxes-stat-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow-sm);
}

.taxes-report-page .taxes-stat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.taxes-report-page .taxes-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
}

.taxes-report-page .taxes-stat-label {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.taxes-report-page .taxes-stat-value {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.1;
}

.taxes-report-page .taxes-stat-note {
    margin-top: 4px;
    color: var(--app-muted);
    font-weight: 600;
}

.taxes-report-page .taxes-stat-details {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.taxes-report-page .taxes-stat-details > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid #edf1f7;
    font-size: .95rem;
}

.taxes-report-page .taxes-stat-details span {
    color: var(--app-muted);
    font-weight: 700;
}

.taxes-report-page .taxes-stat-details strong {
    font-weight: 800;
}

.taxes-report-page .taxes-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.taxes-report-page .taxes-preview-item,
.taxes-report-page .taxes-details-item {
    padding: 14px 16px;
    border: 1px solid #e6ecf7;
    border-radius: 12px;
    background: #fbfcff;
}

.taxes-report-page .taxes-preview-item span,
.taxes-report-page .taxes-details-item span {
    display: block;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.taxes-report-page .taxes-preview-item strong,
.taxes-report-page .taxes-details-item strong {
    display: block;
    margin-top: 6px;
    font-size: 1.25rem;
    line-height: 1.2;
}

.taxes-report-page .taxes-preview-item small {
    display: block;
    margin-top: 4px;
    color: var(--app-muted);
    font-weight: 600;
}

.taxes-report-page .taxes-preview-item--accent {
    border-color: #cfe0ff;
    background: #f3f7ff;
}

.owner-dashboard-page .owner-real-result-card {
    border-color: #b9e2c6;
    background: linear-gradient(135deg, #f4fbf6 0%, #ffffff 100%);
}

.taxes-report-page .taxes-details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.taxes-report-page .taxes-details-item--accent {
    grid-column: 1 / -1;
}

.taxes-collapsible {
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
}

.taxes-collapsible > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: #17233c;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.taxes-collapsible > summary::-webkit-details-marker {
    display: none;
}

.taxes-collapsible > summary::after {
    content: '\f078';
    flex: 0 0 auto;
    font-family: 'Font Awesome 6 Free';
    font-size: .8rem;
    font-weight: 900;
    color: #64748b;
    transition: transform .2s ease;
}

.taxes-collapsible[open] > summary {
    border-bottom: 1px solid #e7edf5;
}

.taxes-collapsible[open] > summary::after {
    transform: rotate(180deg);
}

.taxes-collapsible > summary:focus-visible {
    outline: 3px solid rgba(37, 87, 214, .3);
    outline-offset: -3px;
}

.taxes-collapsible > summary small {
    margin-left: auto;
    color: #64748b;
    font-weight: 600;
}

.taxes-collapsible-body {
    padding: 1rem 1rem 0;
}

@media (max-width: 575.98px) {
    .taxes-collapsible > summary {
        padding: .85rem 1rem;
    }

    .taxes-collapsible-body {
        padding: .75rem .75rem 0;
    }
}

@media (max-width: 767.98px) {
    .invoices-page .invoice-column-secondary {
        display: none;
    }

    .invoices-page .modern-table th,
    .invoices-page .modern-table td {
        white-space: nowrap;
    }
}

.taxes-index-page .dashboard-metric-card {
    height: 100%;
    min-height: 164px;
}

.taxes-index-page .taxes-index-summary-grid > [class*="col-"] {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
}

.taxes-index-page .taxes-index-secondary-grid > [class*="col-"] {
    display: flex;
}

.taxes-index-page .taxes-index-secondary-grid .dashboard-metric-card {
    width: 100%;
    min-height: 142px;
}

.taxes-index-page .taxes-index-period-grid .card {
    height: 100%;
}

.taxes-index-page .taxes-index-period-grid .card-body {
    align-content: start;
}

.taxes-index-page .zus-breakdown-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
}

.taxes-index-page .zus-breakdown-list span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--app-muted);
    font-size: .78rem;
}

.taxes-index-page .zus-breakdown-list strong {
    color: var(--app-text);
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .taxes-report-page .taxes-report-banner-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .taxes-report-page .taxes-preview-grid,
    .taxes-report-page .taxes-details-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .taxes-report-page .taxes-report-banner {
        padding: 18px;
    }

    .taxes-report-page .taxes-report-banner-meta {
        grid-template-columns: 1fr;
    }

    .taxes-report-page .taxes-stat-value {
        font-size: 1.55rem;
    }

    .taxes-index-page .taxes-index-summary-grid > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }

    .taxes-index-page .zus-breakdown-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .taxes-index-page .taxes-index-summary-grid > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.cost-summary-card {
    display: flex;
    flex-direction: column;
    min-height: 148px;
    padding: 17px;
    color: var(--app-text);
    text-decoration: none;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.costs-summary-grid > [class*="col-"] {
    display: flex;
}

.costs-summary-grid .cost-summary-card {
    width: 100%;
}
.cost-category-badge {
    display: inline-flex;
    align-items: center;
    max-width: 190px;
    padding: 4px 9px;
    border: 1px solid #d9e2ef;
    border-radius: 999px;
    background: #f5f8fc;
    color: #42526b;
    font-size: .78rem;
    line-height: 1.15;
    white-space: normal;
}
.costs-page .modern-table th,
.costs-page .modern-table td { vertical-align: middle; }
.costs-page .modern-table tbody tr:hover { background: #f8fbff; }
.costs-page .card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 68px;
    padding: 14px 18px;
    border-top: 1px solid var(--app-border);
    background: #fbfcfe;
}
.costs-page .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
}
.costs-page .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 6px 10px;
    font-size: .875rem;
    line-height: 1.2;
}
.costs-page .pagination .page-link svg {
    width: 16px;
    height: 16px;
}

a.cost-summary-card:hover {
    color: var(--app-text);
    border-color: #b7c7ff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    transform: translateY(-1px);
}

.cost-summary-card > span:not(.cost-summary-icon) {
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.cost-summary-card strong {
    margin-top: 6px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.cost-summary-card small {
    margin-top: auto;
    color: var(--app-muted);
    font-weight: 600;
}

.cost-summary-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 16px;
    color: var(--app-primary);
    border-radius: 9px;
    background: #eef3ff;
}

.cost-summary-icon.is-warning {
    color: #b54708;
    background: #fef0c7;
}

.cost-summary-icon.is-info {
    color: #175cd3;
    background: #d1e9ff;
}

.cost-summary-icon.is-danger {
    color: #b42318;
    background: #fee4e2;
}

.cost-summary-icon.is-success {
    color: #027a48;
    background: #d1fadf;
}

.cost-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(130px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.cost-filter-actions {
    display: flex;
    gap: 8px;
}

.modern-table thead th {
    color: var(--app-muted);
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    background: #f8fafc;
    border-bottom: 1px solid var(--app-border);
}

.cost-name-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cost-name-cell span {
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 600;
}

.cost-type-badge,
.cost-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 800;
}

.cost-type-operational {
    color: #344054;
    background: #f2f4f7;
}

.cost-type-zus {
    color: #175cd3;
    background: #d1e9ff;
}

.cost-type-tax {
    color: #b42318;
    background: #fee4e2;
}

.cost-status-badge.is-paid {
    color: #027a48;
    background: #d1fadf;
}

.cost-status-badge.is-pending {
    color: #b54708;
    background: #fef0c7;
}

.cost-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.cost-side-panel {
    display: grid;
    gap: 12px;
}

.cost-side-card {
    padding: 17px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
}

.cost-side-card strong {
    display: block;
    margin-bottom: 6px;
}

.cost-side-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: .9rem;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.ksef-stat-card {
    display: flex;
    flex-direction: column;
    min-height: 132px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
}

.ksef-stat-card > span:not(.cost-summary-icon) {
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ksef-stat-card strong {
    margin-top: auto;
    font-size: 1.75rem;
    line-height: 1;
}

.correction-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.correction-summary div {
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 10px;
    background: #fff;
}

.correction-summary span {
    display: block;
    color: var(--app-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.correction-summary strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
}

.contractor-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.contractor-filter-actions {
    display: flex;
    gap: 8px;
}

.contractor-name-cell,
.contractor-muted-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contractor-name-cell span,
.contractor-muted-stack span {
    color: var(--app-muted);
    font-size: .84rem;
    font-weight: 600;
}

.contractor-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.contractor-side-panel {
    display: grid;
    gap: 12px;
}

.dashboard-kpi .card-body {
    min-height: 132px;
}

.dashboard-kpi-link {
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.dashboard-kpi-link:hover,
.dashboard-kpi-link:focus {
    color: inherit;
    border-color: #b7c7ff;
    box-shadow: 0 10px 24px rgba(37, 87, 214, .12);
    transform: translateY(-1px);
}

.dashboard-kpi-primary {
    border-color: #c8d6ff;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.dashboard-kpi-value {
    margin-top: 4px;
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.25;
}

.dashboard-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    flex: 0 0 38px;
}

.dashboard-kpi-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--app-primary);
    font-size: .82rem;
    font-weight: 700;
}

.revenue-trend-card {
    scroll-margin-top: 76px;
}

.revenue-trend-grid {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 22px;
    align-items: stretch;
}

.revenue-trend-summary {
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
}

.revenue-trend-value {
    margin: 5px 0 7px;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.2;
}

.revenue-chart {
    display: grid;
    grid-template-columns: repeat(6, minmax(58px, 1fr));
    gap: 12px;
    min-height: 245px;
}

.revenue-bar-item {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    min-width: 0;
}

.revenue-bar-value {
    min-height: 32px;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 700;
    text-align: center;
}

.revenue-bar-track {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 160px;
    padding: 0 8px;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.revenue-bar {
    width: 100%;
    max-width: 42px;
    min-height: 8px;
    border-radius: 7px 7px 3px 3px;
    background: #b8c4d8;
}

.revenue-bar.is-current {
    background: var(--app-primary);
    box-shadow: 0 8px 18px rgba(37, 87, 214, .22);
}

.revenue-bar-label {
    color: #344054;
    font-size: .8rem;
    font-weight: 700;
    text-align: center;
}

.revenue-legend {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--app-muted);
    font-size: .82rem;
    font-weight: 700;
}

.revenue-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-bar {
    width: 12px;
    height: 14px;
    border-radius: 3px 3px 1px 1px;
    background: rgba(37, 87, 214, .28);
}

.legend-line {
    width: 22px;
    height: 0;
    border-top: 2px dashed #f59e0b;
}

.legend-line.revenue-line {
    border-top-style: solid;
    border-top-color: var(--app-primary);
}

.revenue-analysis-card .card-body {
    padding: 18px;
}

.revenue-chart-panel {
    position: relative;
    height: 420px;
    padding: 16px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.revenue-chart-panel canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.filters-card {
    margin-bottom: 14px;
}

.filters-card .card-body {
    padding: 14px;
}

.row-clickable {
    cursor: pointer;
}

.cell-primary {
    font-weight: 700;
}

.cell-muted {
    color: var(--app-muted);
    font-size: .86rem;
}

.actions-cell {
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .navbar-brand {
        min-width: auto;
    }

    .app-navbar-actions {
        align-items: stretch !important;
        margin-top: 12px;
        margin-left: 0;
    }

    .navbar-nav .nav-link {
        width: 100%;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-actions {
        justify-content: flex-start;
        max-width: none;
    }

    .dashboard-health-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cost-filter-grid,
    .cost-form-layout,
    .contractor-filter,
    .contractor-form-layout {
        grid-template-columns: 1fr;
    }

    .correction-summary {
        grid-template-columns: 1fr;
    }

    .cost-filter-actions,
    .contractor-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767.98px) {
    .app-container {
        padding-right: 12px;
        padding-left: 12px;
    }

    .page-header {
        margin-bottom: 14px;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        flex: 1 1 auto;
    }

    .table > :not(caption) > * > * {
        padding: 10px 9px;
    }

    .revenue-trend-grid {
        grid-template-columns: 1fr;
    }

    .revenue-chart {
        grid-template-columns: repeat(3, minmax(70px, 1fr));
    }

    .revenue-chart-panel {
        height: 340px;
        padding: 10px;
    }

    .dashboard-hero {
        padding: 20px;
    }

    .dashboard-hero-actions .btn {
        flex: 1 1 100%;
    }

    .dashboard-simulation-grid,
    .dashboard-health-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-mini-chart {
        gap: 6px;
    }

    .cost-filter-actions,
    .contractor-filter-actions,
    .form-actions {
        flex-direction: column;
    }

    .cost-filter-actions .btn,
    .contractor-filter-actions .btn,
    .form-actions .btn {
        width: 100%;
    }
}

/* ===== CRM NEXEVO UI REFRESH 2026 ===== */
:root {
    --app-bg: #f4f6fb;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fafc;
    --app-border: #dfe5ef;
    --app-border-strong: #cbd5e1;
    --app-muted: #64748b;
    --app-text: #172033;
    --app-heading: #0f172a;
    --app-primary: #2557d6;
    --app-primary-dark: #183f9f;
    --app-primary-soft: #edf3ff;
    --app-success: #0f8a5f;
    --app-warning: #c96f13;
    --app-danger: #c24135;
    --app-radius: 8px;
    --app-radius-sm: 6px;
    --app-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --app-shadow: 0 12px 34px rgba(15, 23, 42, .07);
    --app-ring: 0 0 0 .2rem rgba(37, 87, 214, .16);
}

html {
    min-width: 320px;
    background: var(--app-bg);
}

body {
    min-height: 100vh;
    color: var(--app-text);
    background: linear-gradient(180deg, #f8fafc 0%, var(--app-bg) 260px, var(--app-bg) 100%);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.app-shell .wrapper {
    background: transparent;
}

.app-content {
    background: transparent;
}

.app-container {
    width: min(100%, 1500px);
    margin: 0 auto;
    padding-right: 22px;
    padding-left: 22px;
}

.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 64px;
    border-bottom: 1px solid rgba(203, 213, 225, .9) !important;
    background: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
    backdrop-filter: blur(14px);
}

.app-navbar .container-fluid {
    width: min(100%, 1540px);
    margin: 0 auto;
    padding-right: 20px;
    padding-left: 20px;
}

.navbar-brand {
    min-width: 150px;
    padding: 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: flex-start;
    flex-direction: column;
    line-height: 1;
}

.navbar-brand .brand-image {
    max-width: 142px;
    object-fit: contain;
}

.brand-version {
    margin-top: 3px;
    padding-left: 2px;
    color: #98a2b3;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
}

.navbar-toggler {
    width: 40px;
    height: 40px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    box-shadow: none !important;
}

.navbar-nav {
    align-items: center;
    gap: 4px;
}

.navbar-nav .nav-link {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid transparent;
    border-radius: var(--app-radius-sm);
    color: #475569;
    line-height: 1;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.navbar-nav .nav-link i {
    width: 16px;
    text-align: center;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
    color: var(--app-primary) !important;
    border-color: #dbe6ff;
    background: var(--app-primary-soft);
}

.dropdown-menu {
    padding: 7px;
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 38px;
    border-radius: var(--app-radius-sm);
    color: #334155;
}

.dropdown-item.active,
.dropdown-item:active,
.dropdown-item:hover {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.app-navbar-actions .dropdown-menu {
    min-width: 240px !important;
}

.cache-menu {
    width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    box-sizing: border-box;
    right: 0;
    left: auto;
    transform: none !important;
}

.cache-menu-heading {
    margin-bottom: 8px;
    color: #111827;
    font-size: .82rem;
    font-weight: 800;
}

.cache-menu .form-check {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin-bottom: 6px;
    padding-left: 1.75rem;
}

.cache-menu .form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-weight: 600;
}

.cache-help {
    color: #94a3b8;
    font-size: .78rem;
    cursor: help;
}

.cache-help:hover,
.cache-help:focus {
    color: var(--app-primary);
    outline: none;
}

.icon-button {
    width: 38px;
    height: 38px;
    border-color: var(--app-border);
    border-radius: var(--app-radius-sm);
    color: #475569;
    background: #fff;
}

.icon-button:hover,
.icon-button:focus {
    color: var(--app-primary);
    border-color: #c7d7fe;
    background: var(--app-primary-soft);
    box-shadow: var(--app-ring);
}

.page-header {
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.page-title,
.container-fluid > .h4:first-child,
.container-fluid > h1.h4:first-child {
    color: var(--app-heading);
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: 0;
}

.page-subtitle {
    max-width: 760px;
    color: var(--app-muted);
    font-size: .93rem;
}

.page-actions {
    align-items: center;
}

.card {
    overflow: hidden;
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-surface);
    box-shadow: var(--app-shadow-sm);
}

.card:hover {
    box-shadow: 0 10px 28px rgba(15, 23, 42, .055);
}

.card-header,
.card-footer {
    border-color: var(--app-border);
    background: #fff;
}

.card-header {
    min-height: 50px;
    padding: 14px 18px;
}

.card-body {
    padding: 18px;
}

.section-title,
.card-title {
    color: var(--app-heading);
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 38px;
    border-radius: var(--app-radius-sm);
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: none !important;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
.navbar-toggler:focus-visible,
.nav-link:focus-visible,
.dropdown-item:focus-visible {
    outline: 0;
    box-shadow: var(--app-ring) !important;
}

.btn:disabled,
.btn.disabled {
    transform: none;
    cursor: not-allowed;
}

.btn-sm {
    min-height: 32px;
    padding: 5px 10px;
}

.btn-primary {
    border-color: var(--app-primary);
    background: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--app-primary-dark);
    background: var(--app-primary-dark);
}

.btn-outline-secondary {
    color: #475569;
    border-color: var(--app-border-strong);
    background: #fff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    color: var(--app-heading);
    border-color: #aab7c8;
    background: #f8fafc;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: #cfd8e6;
    border-radius: var(--app-radius-sm);
    color: var(--app-text);
    background-color: #fff;
    box-shadow: none !important;
}

textarea.form-control {
    min-height: 108px;
}

.form-control:focus,
.form-select:focus {
    border-color: #8aa8ff;
    box-shadow: var(--app-ring) !important;
}

.form-label {
    color: #334155;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: 0;
}

.form-text,
.text-muted,
.cell-muted {
    color: var(--app-muted) !important;
}

.input-group-text {
    border-color: #cfd8e6;
    border-radius: var(--app-radius-sm);
    color: #64748b;
    background: #f8fafc;
}

.input-group .form-control:focus + .input-group-text {
    border-color: #8aa8ff;
}

.input-group .form-control.is-invalid + .input-group-text {
    border-color: var(--bs-danger);
}

.form-check-input {
    border-color: #cfd8e6;
    box-shadow: none !important;
}

.form-check-input:checked {
    border-color: var(--app-primary);
    background-color: var(--app-primary);
}

.invoice-price-input {
    min-width: 168px;
    flex-wrap: nowrap;
}

.invoice-price-input .form-control {
    min-width: 86px;
}

.invoice-price-input .item-price-mode {
    flex: 0 0 82px;
    min-width: 82px;
    border-left: 0;
    color: #475569;
    font-weight: 700;
    background-color: #f8fafc;
}

.filters-card {
    margin-bottom: 16px;
    background: #fff;
}

.filters-card .card-body {
    padding: 16px;
}

.nav-pills {
    gap: 6px;
}

.nav-pills .nav-link {
    min-height: 38px;
    border-radius: var(--app-radius-sm);
    color: #475569;
    font-weight: 800;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.table-responsive {
    width: 100%;
    border-radius: var(--app-radius);
}

.table {
    margin-bottom: 0;
    color: var(--app-text);
}

.table > :not(caption) > * > * {
    padding: 13px 14px;
    border-bottom-color: var(--app-border);
}

.table thead th,
.modern-table thead th {
    position: relative;
    color: #64748b;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
    background: #f8fafc;
}

.table tbody tr {
    transition: background .12s ease;
}

.table-hover tbody tr:hover,
.row-clickable:hover {
    background: #f8fbff;
}

.cell-primary {
    color: var(--app-heading);
    font-weight: 800;
}

.actions-cell .btn,
.table .btn-sm[title] {
    width: 34px;
    min-width: 34px;
    padding-right: 0;
    padding-left: 0;
}

.actions-cell .btn + .btn,
.actions-cell .btn + form,
.actions-cell form + .btn,
.actions-cell form + form {
    margin-left: 4px;
}

.badge,
.cost-type-badge,
.cost-status-badge {
    min-height: 24px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0;
}

.alert {
    border: 1px solid transparent;
    border-radius: var(--app-radius);
}

.alert-success {
    color: #05603a;
    border-color: #b7ebca;
    background: #ecfdf3;
}

.alert-info {
    color: #175cd3;
    border-color: #b2ddff;
    background: #eff8ff;
}

.alert-warning {
    color: #93370d;
    border-color: #fedf89;
    background: #fffaeb;
}

.alert-danger {
    color: #b42318;
    border-color: #fecdca;
    background: #fef3f2;
}

.cost-summary-card,
.dashboard-metric-card,
.ksef-stat-card,
.cost-side-card,
.correction-summary div {
    border-color: var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
}

.cost-summary-card,
.dashboard-metric-card {
    min-height: 150px;
}

.cost-summary-card:hover,
.dashboard-metric-card:hover,
a.cost-summary-card:hover {
    border-color: #b8c8ff;
    box-shadow: var(--app-shadow);
    transform: translateY(-2px);
}

.cost-summary-icon,
.dashboard-metric-icon,
.dashboard-kpi-icon,
.task-icon {
    border-radius: var(--app-radius-sm);
}

.dashboard-hero {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--app-radius);
    background: linear-gradient(135deg, #123c9c 0%, #2557d6 48%, #0f766e 100%);
    box-shadow: 0 18px 46px rgba(37, 87, 214, .2);
}

.dashboard-hero h1 {
    letter-spacing: 0;
}

.dashboard-hero-actions .btn {
    min-width: 142px;
}

.dashboard-mini-chart,
.revenue-chart-panel {
    border-radius: var(--app-radius);
}

.pagination {
    gap: 4px;
    margin-bottom: 0;
}

.page-link {
    border-color: var(--app-border);
    border-radius: var(--app-radius-sm) !important;
    color: #475569;
    font-weight: 700;
}

.active > .page-link,
.page-link.active {
    border-color: var(--app-primary);
    background: var(--app-primary);
}

.modal-content {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        linear-gradient(145deg, rgba(248, 250, 252, .98) 0%, rgba(238, 244, 255, .96) 54%, rgba(241, 245, 249, .98) 100%),
        radial-gradient(circle at 18% 22%, rgba(37, 87, 214, .14), transparent 30%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(360px, 440px);
    gap: 30px;
    align-items: stretch;
    width: min(100%, 980px);
}

.auth-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    padding: 34px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: var(--app-radius);
    background:
        linear-gradient(135deg, rgba(18, 60, 156, .98) 0%, rgba(37, 87, 214, .96) 52%, rgba(15, 118, 110, .98) 100%);
    box-shadow: 0 24px 58px rgba(15, 23, 42, .16);
}

.auth-intro-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, .14);
}

.auth-kicker {
    display: block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, .76);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.auth-intro h1 {
    max-width: 460px;
    margin: 0;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.08;
}

.auth-intro p {
    max-width: 420px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, .78);
    font-weight: 600;
}

.auth-page .login-box {
    width: 100%;
}

.auth-card {
    position: relative;
    width: 100%;
    min-height: 480px;
    border: 1px solid rgba(203, 213, 225, .92);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.auth-card-accent {
    height: 5px;
    background: linear-gradient(90deg, var(--app-primary) 0%, #0f766e 100%);
}

.auth-card .card-header {
    padding: 34px 30px 12px;
    border-bottom: 0;
}

.auth-card .card-body {
    padding: 12px 30px 30px;
}

.auth-logo {
    height: 58px;
    max-width: 192px;
    object-fit: contain;
}

.auth-brand-name {
    margin-top: 12px;
    color: var(--app-heading);
    font-size: 1.05rem;
    font-weight: 800;
}

.login-box-msg {
    padding-bottom: 18px;
    color: var(--app-muted);
    font-weight: 800;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    font-size: .86rem;
    font-weight: 700;
}

.auth-card .input-group {
    flex-wrap: wrap;
}

.auth-card .input-group .form-control {
    min-height: 46px;
    border-right: 0;
}

.auth-card .input-group .input-group-text {
    min-width: 46px;
    justify-content: center;
    border-left: 0;
}

.auth-card .invalid-feedback {
    flex-basis: 100%;
    margin-top: 6px;
    font-weight: 700;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 18px;
    color: var(--app-muted);
    font-size: .88rem;
    font-weight: 700;
}

.auth-options a {
    color: var(--app-primary);
    text-decoration: none;
}

.auth-options a:hover {
    color: var(--app-primary-dark);
    text-decoration: underline;
}

.invoice-form-card .card-header {
    background: #fff;
}

.invoice-form-card .table-responsive {
    border-radius: 0;
}

.invoice-summary-table {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    overflow: hidden;
    background: #fff;
}

.invoice-summary-table th,
.invoice-summary-table td {
    padding: 11px 13px;
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.invoice-detail-grid > div {
    padding: 13px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #f8fafc;
}

.invoice-detail-grid span {
    display: block;
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.invoice-detail-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--app-heading);
}

.invoice-totals-panel {
    display: grid;
    justify-content: end;
    gap: 6px;
    margin-top: 18px;
    text-align: right;
    font-size: 1rem;
}

.invoice-total-due {
    margin-top: 5px;
    color: var(--app-heading);
    font-size: 1.25rem;
    font-weight: 800;
}

.settings-tabs-header {
    background: #fff;
}

.settings-tabs-header .nav-pills {
    flex-wrap: wrap;
}

.settings-tabs-body .tab-pane > form,
.settings-tabs-body .tab-pane > .card {
    max-width: 920px;
}

.settings-page #evobot-settings {
    position: static;
}

.settings-page #evobot-settings .card {
    max-width: none;
}

.settings-page #evobot-settings .form-check {
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #f8fafc;
}

.settings-page #evobot-settings .form-check-input {
    margin-top: 2px;
}

.settings-page #evobot-settings .form-text {
    color: var(--app-muted);
}

#evobot {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-size: 14px;
}

.evobot-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 1px solid #d8e0ee;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.evobot-toggle:hover,
.evobot-toggle:focus {
    border-color: #b8c8ff;
    background: #f7f9ff;
    box-shadow: 0 18px 44px rgba(37, 87, 214, .18);
    transform: translateY(-2px);
}

.evobot-toggle:focus-visible {
    outline: 3px solid rgba(37, 87, 214, .2);
    outline-offset: 3px;
}

.evobot-toggle-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #f8fafc;
    box-shadow: inset 0 0 0 1px rgba(37, 87, 214, .08);
}

.evobot-toggle-image {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.evobot-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    display: none;
    width: min(400px, calc(100vw - 32px));
    overflow: hidden;
    border-color: #d8e0ee;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .2);
}

.evobot-panel.is-open {
    display: block;
}

.evobot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    background: linear-gradient(180deg, #fff, #f9fbff);
}

.evobot-header > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.evobot-header strong {
    color: var(--app-text);
    font-size: .98rem;
}

.evobot-header span {
    color: var(--app-muted);
    font-size: .76rem;
    font-weight: 600;
}

.evobot-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.evobot-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    color: #667085;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
}

.evobot-icon-btn:hover,
.evobot-icon-btn:focus {
    color: #b42318;
    border-color: #fecdca;
    background: #fff6f5;
}

.evobot-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 330px;
    padding: 14px;
    overflow-y: auto;
    background: #f8fafc;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.evobot-messages::-webkit-scrollbar {
    width: 8px;
}

.evobot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.evobot-messages::-webkit-scrollbar-thumb {
    border: 2px solid #f8fafc;
    border-radius: 999px;
    background: #cbd5e1;
}

.evobot-message {
    display: grid;
    gap: 4px;
    max-width: 88%;
    padding: 10px 12px 11px;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    overflow-wrap: anywhere;
}

.evobot-message strong {
    color: var(--app-muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.evobot-message span {
    color: var(--app-text);
    line-height: 1.55;
    white-space: pre-wrap;
}

.evobot-message-user {
    align-self: flex-end;
    color: #fff;
    border-color: var(--app-primary);
    background: linear-gradient(135deg, var(--app-primary), #1d47b7);
}

.evobot-message-user strong,
.evobot-message-user span {
    color: #fff;
}

.evobot-message-bot {
    align-self: flex-start;
    border-color: #e5eaf2;
}

.evobot-message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.evobot-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 4px 8px;
    color: #344054;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1;
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
}

.evobot-pdf-btn:hover,
.evobot-pdf-btn:focus {
    color: var(--app-primary);
    border-color: #b8c8ff;
    background: #f7f9ff;
}

.evobot-message-loading {
    color: var(--app-muted);
    background: #fff;
}

.evobot-loading-dots::after {
    display: inline-block;
    width: 18px;
    text-align: left;
    content: "";
    animation: evobot-loading-dots 1.2s steps(4, end) infinite;
}

@keyframes evobot-loading-dots {
    0% {
        content: "";
    }

    25% {
        content: ".";
    }

    50% {
        content: "..";
    }

    75%,
    100% {
        content: "...";
    }
}

.evobot-footer {
    padding: 12px;
    background: #fff;
}

.evobot-footer .input-group {
    align-items: stretch;
}

.evobot-footer .form-control {
    min-height: 42px;
    border-right: 0;
    background: #fff;
}

.evobot-footer .form-control:focus {
    border-color: #b8c8ff;
    box-shadow: none;
}

.evobot-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    padding: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.taxes-forecast-grid {
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .taxes-index-period-grid > .col-lg-8 .taxes-forecast-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.payment-toast-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.payment-toast {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 28px;
    gap: 12px;
    align-items: center;
    min-height: 72px;
    padding: 13px 15px;
    color: var(--app-heading);
    text-decoration: none;
    border: 1px solid var(--app-border);
    border-left-width: 5px;
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow-sm);
}

.payment-toast:hover {
    color: var(--app-heading);
    border-color: #b8c8ff;
    box-shadow: var(--app-shadow);
    transform: translateY(-1px);
}

.payment-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--app-radius-sm);
    font-size: 1.05rem;
}

.payment-toast-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.payment-toast-body strong {
    font-size: .98rem;
}

.payment-toast-body span {
    color: var(--app-muted);
    font-weight: 700;
}

.payment-toast-action {
    color: var(--app-muted);
}

.payment-toast-danger {
    border-left-color: #c24135;
    background: #fff7f6;
}

.payment-toast-danger .payment-toast-icon {
    color: #b42318;
    background: #fee4e2;
}

.payment-toast-warning {
    border-left-color: #c96f13;
    background: #fffbf2;
}

.payment-toast-warning .payment-toast-icon {
    color: #b54708;
    background: #fef0c7;
}

.payment-toast-primary {
    border-left-color: var(--app-primary);
    background: #f7f9ff;
}

.payment-toast-primary .payment-toast-icon {
    color: var(--app-primary);
    background: var(--app-primary-soft);
}

.tax-filter-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.tax-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

.table-sort-link:hover {
    color: var(--app-primary);
}

.table-sort-link .fas {
    color: var(--app-muted);
    font-size: .78rem;
}

.tax-detail-summary {
    display: grid;
    gap: 8px;
    color: var(--app-muted);
}

.app-toast-stack {
    position: sticky;
    /* Navbar and its dropdowns must remain above flash messages. */
    top: 76px;
    z-index: 1020;
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.app-toast {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 36px;
    gap: 12px;
    align-items: center;
    min-height: 74px;
    padding: 14px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow);
    transition: opacity .18s ease, transform .18s ease;
}

.app-toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.app-toast-success {
    border-color: rgba(25, 135, 84, .28);
}

.app-toast-danger {
    border-color: rgba(220, 53, 69, .28);
}

.app-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: #eef8f1;
    color: #198754;
    font-size: 1rem;
}

.app-toast-danger .app-toast-icon {
    background: #fff1f2;
    color: #dc3545;
}

.app-toast-body {
    display: grid;
    gap: 2px;
}

.app-toast-body strong {
    color: var(--app-text);
}

.app-toast-body span {
    color: var(--app-muted);
}

.app-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--app-muted);
}

.app-toast-close:hover {
    background: var(--app-primary-soft);
    color: var(--app-primary);
}

@media (max-width: 1199.98px) {
    .app-container {
        padding-right: 18px;
        padding-left: 18px;
    }

    .table-responsive .table {
        min-width: 860px;
    }

    .invoice-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .auth-shell {
        grid-template-columns: minmax(0, 440px);
        justify-content: center;
    }

    .auth-intro {
        display: none;
    }

    .app-navbar .container-fluid {
        padding-right: 14px;
        padding-left: 14px;
    }

    .navbar-collapse {
        margin-top: 12px;
        padding: 12px;
        border: 1px solid var(--app-border);
        border-radius: var(--app-radius);
        background: #fff;
        box-shadow: var(--app-shadow);
    }

    .navbar-nav {
        align-items: stretch;
        gap: 5px;
    }

    .navbar-nav .nav-link {
        justify-content: flex-start;
        width: 100%;
    }

    .dropdown-menu {
        margin-top: 4px;
        box-shadow: none;
    }

    .app-navbar-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px !important;
        width: 100%;
    }

    .app-navbar-actions form,
    .app-navbar-actions .dropdown,
    .app-navbar-actions .icon-button {
        width: 100%;
    }

    .icon-button {
        min-width: 100%;
    }

    .cache-menu {
        width: min(320px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        right: 0;
        left: auto;
    }

    .page-header {
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 13px;
    }

    .app-container {
        padding: 16px 12px !important;
    }

    .page-header {
        gap: 12px;
        margin-bottom: 14px;
    }

    .page-title,
    .container-fluid > .h4:first-child,
    .container-fluid > h1.h4:first-child {
        font-size: 1.22rem;
    }

    .page-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .page-actions .btn,
    .filters-card .btn,
    .card-footer .btn {
        width: 100%;
    }

    .card-header,
    .card-body,
    .card-footer {
        padding: 14px;
    }

    .card-header.d-flex,
    .card-footer.d-flex {
        align-items: flex-start !important;
        flex-direction: column;
        gap: 10px;
    }

    .filters-card .row > [class*="col-"] {
        width: 100%;
    }

    .table-responsive {
        margin-right: -2px;
        margin-left: -2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive .table {
        min-width: 780px;
    }

    .dashboard-hero {
        padding: 18px;
    }

    .dashboard-hero-value {
        font-size: 2rem;
    }

    .dashboard-hero-actions .btn {
        width: 100%;
        min-width: 0;
    }

    .cost-summary-card,
    .dashboard-metric-card {
        min-height: 132px;
    }

    .auth-page {
        padding: 14px;
    }

    .auth-card {
        min-height: 0;
    }

    .auth-card .card-header {
        padding: 26px 22px 10px;
    }

    .auth-card .card-body {
        padding: 10px 22px 24px;
    }

    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .invoice-totals-panel {
        justify-content: stretch;
        text-align: left;
    }

    .payment-toast {
        grid-template-columns: 38px minmax(0, 1fr);
        min-height: 0;
    }

    .payment-toast-action {
        display: none;
    }

    .payment-toast-icon {
        width: 38px;
        height: 38px;
    }

    .dashboard-list-item,
    .dashboard-task-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 14px;
    }

    .dashboard-task-item {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 10px;
    }

    .dashboard-period-control .dashboard-task-item {
        grid-template-columns: auto minmax(0, 1fr) auto auto;
    }

    .dashboard-list-item > span:last-child {
        align-items: flex-start;
        min-width: 0;
        text-align: left !important;
    }

    .tax-filter-grid {
        grid-template-columns: 1fr;
    }

    .tax-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .app-toast {
        grid-template-columns: 40px minmax(0, 1fr) 32px;
    }

    .app-toast-icon {
        width: 40px;
        height: 40px;
    }

    #evobot {
        right: 14px;
        bottom: 14px;
        left: 14px;
        display: flex;
        justify-content: flex-end;
        pointer-events: none;
    }

    .evobot-toggle,
    .evobot-panel {
        pointer-events: auto;
    }

    .evobot-panel {
        right: 0;
        bottom: 68px;
        width: 100%;
        max-height: calc(100vh - 96px);
    }

    .evobot-messages {
        height: min(340px, calc(100vh - 230px));
    }

    .evobot-message {
        max-width: 94%;
    }
}

@media (max-width: 420px) {
    .navbar-brand .brand-image {
        max-width: 118px;
    }

    .brand-version {
        font-size: 8px;
    }

    .btn {
        min-height: 40px;
    }

    .actions-cell .btn,
    .table .btn-sm[title] {
        width: 32px;
        min-width: 32px;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .evobot-toggle {
        width: 54px;
        height: 54px;
    }

    .evobot-toggle-inner {
        width: 42px;
        height: 42px;
    }

    .evobot-toggle-image {
        width: 35px;
        height: 35px;
    }
}

.jpk-checklist {
    display: grid;
    gap: 12px;
}

.jpk-checklist-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
}

.jpk-checklist-label {
    margin-bottom: 4px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #60708f;
    text-transform: uppercase;
    letter-spacing: 0;
}

.jpk-checklist-value {
    color: #1f2a44;
    word-break: break-word;
}

.field-help {
    margin-left: 6px;
    color: #7b8aa8;
    cursor: help;
}

.jpk-settings-note {
    color: #55657f;
    background: #f8fbff;
}

.jpk-xml-preview {
    max-height: 760px;
    padding: 18px;
    overflow: auto;
    font-size: .82rem;
    line-height: 1.55;
    color: #d7e2ff;
    border: 1px solid #1f325c;
    border-radius: 10px;
    background: #10213f;
    white-space: pre-wrap;
    word-break: break-word;
}

.periods-report-page {
    padding-bottom: 10px;
}

.periods-report-header {
    align-items: flex-start;
}

.periods-lock-badge {
    align-self: center;
}

.periods-report-note {
    display: flex;
    align-items: center;
    min-height: 58px;
}

.periods-section-card,
.periods-validation-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
    overflow: hidden;
}

.periods-section-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    font-size: .8rem;
    font-weight: 700;
    color: #55657f;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #f8fafc;
}

.periods-filters-wrap {
    background: #fbfcfe;
}

.periods-kpi-card {
    min-height: 158px;
}

.periods-kpi-card .dashboard-metric-icon {
    color: #3b4b68;
    background: #eef2f7;
}

.periods-kpi-card-income {
    background: linear-gradient(180deg, #ffffff 0%, #f5fbff 100%);
}

.periods-kpi-card-income .dashboard-metric-icon {
    color: #175cd3;
    background: #eaf2ff;
}

.periods-kpi-card-tax {
    background: linear-gradient(180deg, #ffffff 0%, #fff6f5 100%);
}

.periods-kpi-card-tax .dashboard-metric-icon {
    color: #b42318;
    background: #fee4e2;
}

.periods-kpi-card-zus {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
}

.periods-kpi-card-zus .dashboard-metric-icon {
    color: #b54708;
    background: #fef0c7;
}

.periods-kpi-card-balance {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.periods-kpi-card-balance .dashboard-metric-icon {
    color: #067647;
    background: #dcfae6;
}

.periods-kpi-card-vat-output {
    background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.periods-kpi-card-vat-output .dashboard-metric-icon {
    color: #444ce7;
    background: #eceeff;
}

.periods-kpi-card-vat-input {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.periods-kpi-card-vat-input .dashboard-metric-icon {
    color: #067647;
    background: #dcfae6;
}

.periods-kpi-card-validation.is-clean {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.periods-kpi-card-validation.is-clean .dashboard-metric-icon {
    color: #067647;
    background: #dcfae6;
}

.periods-kpi-card-validation.has-warnings {
    background: linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
    border-color: #f2d08a;
}

.periods-kpi-card-validation.has-warnings .dashboard-metric-icon {
    color: #b54708;
    background: #fef0c7;
}

.periods-kpi-card-validation.has-errors {
    background: linear-gradient(180deg, #ffffff 0%, #fff6f5 100%);
    border-color: #f2b5ad;
}

.periods-kpi-card-validation.has-errors .dashboard-metric-icon {
    color: #b42318;
    background: #fee4e2;
}

.periods-trend-card {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow-sm);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.periods-trend-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    font-size: .8rem;
    font-weight: 700;
    color: #55657f;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    background: #f8fafc;
}

.periods-validation-list {
    display: grid;
    gap: 12px;
}

.periods-validation-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e6ecf5;
    border-radius: 10px;
    background: #fcfdff;
}

.periods-validation-item.is-error {
    border-color: #f2b5ad;
    background: #fff7f6;
}

.periods-validation-item.is-warning {
    border-color: #f2d08a;
    background: #fffdf7;
}

.periods-validation-icon {
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
}

.periods-validation-item.is-error .periods-validation-icon {
    color: #b42318;
}

.periods-validation-item.is-warning .periods-validation-icon {
    color: #b54708;
}

.periods-validation-title {
    margin-bottom: 4px;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #51627d;
}

.periods-validation-message {
    color: #1f2a44;
    line-height: 1.45;
}

.periods-chart-container {
    position: relative;
    height: 280px;
}

.periods-comparison-card.is-positive {
    background: linear-gradient(180deg, #ffffff 0%, #f4fbf7 100%);
}

.periods-comparison-card.is-positive .dashboard-metric-icon {
    color: #067647;
    background: #dcfae6;
}

.periods-comparison-card.is-negative {
    background: linear-gradient(180deg, #ffffff 0%, #fff6f5 100%);
}

.periods-comparison-card.is-negative .dashboard-metric-icon {
    color: #b42318;
    background: #fee4e2;
}

@media (max-width: 767.98px) {
    .jpk-checklist-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .periods-lock-badge {
        align-self: flex-start;
    }

    .periods-section-chip {
        align-self: flex-start;
    }

    .periods-chart-container {
        height: 220px;
    }
}

/* Final notification controls override: keep badges fully visible and rounded. */
.app-navbar-actions > .dropdown,
.app-navbar-actions > .dropdown > .icon-button,
.app-navbar-actions > .logout-form,
.app-navbar-actions > .logout-form > .icon-button,
.cache-dropdown,
.cache-dropdown > .icon-button {
    overflow: visible;
}

.app-navbar-actions .icon-button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 14px !important;
}

.app-navbar-actions .notification-count {
    top: -7px !important;
    right: -7px !important;
    left: auto !important;
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    transform: none !important;
    z-index: 2;
}

.app-navbar-actions .icon-button > i {
    position: relative;
    z-index: 1;
}

.app-navbar-actions .notifications-dropdown {
    border-radius: 16px !important;
    overflow: hidden;
}

.notification-count,
.notification-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 999px !important;
    line-height: 1;
}

.notification-count {
    padding: 0;
    border: 2px solid #fff;
    font-size: .72rem;
    font-weight: 800;
}

.notification-type-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    margin-right: 8px !important;
    font-size: .9rem;
}

.notifications-dropdown .dropdown-item {
    border-radius: 12px;
    padding: 10px 12px;
}

.application-errors-dropdown {
    min-width: min(420px, calc(100vw - 24px));
}

.application-error-item {
    display: flex;
    align-items: flex-start;
    gap: .35rem;
    padding: .65rem .75rem;
    border-radius: 12px;
    line-height: 1.25;
}

.application-error-item + .application-error-item {
    border-top: 1px solid #edf0f5;
    border-radius: 0;
}

.application-error-item strong {
    display: inline-block;
    max-width: 320px;
    overflow-wrap: anywhere;
    font-size: .82rem;
}

.error-count {
    background: #c62828 !important;
}

.notification-form {
    margin: 0;
}

.notification-item {
    width: 100%;
    border: 0;
    text-align: left;
    font: inherit;
}

@media (max-width: 991.98px) {
    .app-navbar-actions .icon-button {
        width: 100%;
        min-width: 0;
    }
}

/* Final desktop density override (kept at EOF intentionally). */
@media (min-width: 992px) {
    html, body { font-size: 13px; }
    .app-navbar { min-height: 58px; }
    .app-navbar .container-fluid { padding-left: 14px; padding-right: 14px; }
    .navbar-brand { min-width: 132px; }
    .navbar-brand .brand-image { max-width: 128px; }
    .navbar-nav .nav-link { padding: 6px 9px; font-size: .88rem; }
    .app-container { padding-left: 16px; padding-right: 16px; }
    .app-container.py-4 { padding-top: 1.15rem !important; padding-bottom: 1.15rem !important; }
    .page-header { gap: 10px; margin-bottom: 14px; }
    .page-title, .container-fluid > .h4:first-child, .container-fluid > h1.h4:first-child { font-size: 1.25rem; }
    .page-subtitle { font-size: .84rem; }
    .card-header { min-height: 44px; padding: 10px 14px; }
    .card-body { padding: 14px; }
    .card-footer { padding: 10px 14px; }
    .section-title { font-size: .98rem; }
    .dashboard-metric-card, .cost-summary-card { min-height: 124px; }
    .dashboard-metric-card strong { font-size: 1.2rem; }
    .dashboard-metric-card small, .dashboard-metric-label { font-size: .78rem; }
    .form-label { margin-bottom: .25rem; font-size: .79rem; }
    .form-control, .form-select { min-height: 34px; padding: .35rem .6rem; font-size: .84rem; }
    .btn { padding: .38rem .68rem; font-size: .83rem; }
    .table { font-size: .82rem; }
    .table > :not(caption) > * > * { padding: .48rem .6rem; }
    .app-container .row.g-3 { --bs-gutter-x: .75rem; --bs-gutter-y: .75rem; }
    .alert { padding: .65rem .8rem; margin-bottom: .75rem; }
}
.purchase-register-row.is-clickable {
    cursor: pointer;
}

.purchase-register-row.is-clickable:hover,
.purchase-register-row.is-clickable:focus-visible {
    background: var(--app-surface-muted, #f5f8ff);
    outline: none;
}

.register-total-row th,
.register-total-row td {
    background: #eef3fa;
    border-top: 2px solid #cbd8ea;
    color: #12213d;
    font-weight: 700;
}

.ksef-login-notice-modal .modal-content {
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(18, 33, 61, .2);
}

.ksef-login-notice-modal .modal-header {
    border-bottom: 1px solid #e5ebf4;
    padding: 1.25rem 1.5rem;
}

.ksef-login-notice-modal .modal-body,
.ksef-login-notice-modal .modal-footer { padding: 1.25rem 1.5rem; }
.ksef-login-notice-eyebrow { display: block; color: #2860d8; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .25rem; }
.ksef-login-notice-lead { color: #17233c; font-size: 1.05rem; font-weight: 600; margin-bottom: .35rem; }
.ksef-login-notice-list { display: grid; gap: .5rem; }
.ksef-login-notice-item { align-items: center; background: #f6f8fc; border: 1px solid #e3eaf5; border-radius: 10px; display: flex; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; }
.ksef-login-notice-item small { color: #657894; display: block; margin-top: .15rem; }
.ksef-login-notice-amount { color: #17233c; white-space: nowrap; }
.accounting-sortable-table thead th[data-sort-key] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.accounting-sortable-table thead th[data-sort-key]:hover,
.accounting-sortable-table thead th[data-sort-key]:focus-visible,
.accounting-sortable-table thead th[data-sort-key].is-sorted {
    color: var(--nexevo-primary, #2563eb);
}

.accounting-sort-indicator {
    display: inline-block;
    margin-left: .35rem;
    color: #94a3b8;
    font-size: .8em;
    line-height: 1;
}

.accounting-sortable-table thead th.is-sorted .accounting-sort-indicator {
    color: currentColor;
    font-weight: 700;
}

.accounting-calendar-card { overflow: hidden; }
.accounting-calendar-toolbar { display: flex; align-items: center; gap: .75rem; }
.accounting-calendar-legend { display: flex; flex-wrap: wrap; gap: .9rem 1.25rem; padding: .85rem 1.25rem; border-bottom: 1px solid #e4eaf3; color: #64748b; font-size: .82rem; }
.accounting-calendar-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.accounting-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid #e4eaf3; border-top: 1px solid #e4eaf3; }
.accounting-calendar-weekday { padding: .7rem .75rem; background: #f7f9fc; color: #64748b; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-right: 1px solid #e4eaf3; border-bottom: 1px solid #e4eaf3; }
.accounting-calendar-day { min-height: 142px; padding: .55rem; background: #fff; border-right: 1px solid #e4eaf3; border-bottom: 1px solid #e4eaf3; }
.accounting-calendar-day.is-outside-month { background: #f8fafc; }
.accounting-calendar-day.is-outside-month .accounting-calendar-day-number { color: #b4bfce; }
.accounting-calendar-day.is-today { box-shadow: inset 0 0 0 2px #2563eb; }
.accounting-calendar-day-number { display: inline-flex; align-items: center; justify-content: center; width: 1.8rem; height: 1.8rem; margin-bottom: .3rem; color: #334155; font-size: .84rem; font-weight: 800; }
.accounting-calendar-day.is-today .accounting-calendar-day-number { color: #fff; background: #2563eb; border-radius: 50%; }
.accounting-calendar-events { display: grid; gap: .28rem; }
.accounting-calendar-event { display: grid; grid-template-columns: auto 1fr; gap: 0 .35rem; padding: .35rem .45rem; border-left: 3px solid; border-radius: 6px; text-decoration: none; font-size: .72rem; line-height: 1.2; overflow: hidden; }
.accounting-calendar-event:hover { filter: brightness(.97); transform: translateY(-1px); }
.accounting-calendar-event-label { grid-column: 1 / -1; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.accounting-calendar-event-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounting-calendar-event-amount { grid-column: 1 / -1; margin-top: .15rem; font-weight: 700; white-space: nowrap; }
.accounting-calendar-more { color: #64748b; font-size: .7rem; font-weight: 700; padding: .15rem .35rem; }
.accounting-calendar-dot { display: inline-block; width: .62rem; height: .62rem; flex: 0 0 .62rem; border-radius: 50%; }
.accounting-calendar-event.is-invoice, .accounting-calendar-dot.is-invoice { color: #1d4ed8; border-color: #3b82f6; background: #eff6ff; }
.accounting-calendar-event.is-zus, .accounting-calendar-dot.is-zus { color: #047857; border-color: #10b981; background: #ecfdf5; }
.accounting-calendar-event.is-tax, .accounting-calendar-dot.is-tax { color: #b45309; border-color: #f59e0b; background: #fffbeb; }
.accounting-calendar-event.is-jpk, .accounting-calendar-dot.is-jpk { color: #7c3aed; border-color: #8b5cf6; background: #f5f3ff; }
.accounting-calendar-event.is-expense, .accounting-calendar-dot.is-expense { color: #be123c; border-color: #f43f5e; background: #fff1f2; }
.accounting-calendar-dot { border: 0; }
.accounting-calendar-summary .list-group-item { padding: .8rem 1.25rem; }
.accounting-calendar-list-date { width: 3rem; color: #64748b; font-weight: 800; }
@media (max-width: 767.98px) {
    .accounting-calendar-toolbar { flex-wrap: wrap; }
    .accounting-calendar-toolbar .text-muted { width: 100%; margin-left: 0 !important; }
    .accounting-calendar-grid { min-width: 720px; }
    .accounting-calendar-card { overflow-x: auto; }
    .accounting-calendar-day { min-height: 116px; }
    .accounting-calendar-event-text { display: none; }
    .accounting-calendar-event { display: block; text-align: center; }
    .accounting-calendar-event-label { display: block; }
}
