@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --ink: #0c2b41;
    --ink-soft: #5a7188;
    --surface: #ffffff;
    --surface-2: #f4f9ff;
    --line: #d9e3ef;
    --brand: #1f7cbc;
    --brand-2: #123f66;
    --accent: #f4ae2b;
    --danger: #c73245;
    --success: #179a62;
    --radius-xl: 18px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --shadow-1: 0 10px 26px rgba(7, 48, 82, 0.08);
    --shadow-2: 0 18px 42px rgba(7, 48, 82, 0.12);
}

* {
    box-sizing: border-box;
}

html, body {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    color: var(--ink);
    line-height: 1.45;
}

h1, h2, h3 {
    margin-top: 0;
    font-weight: 780;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    margin-bottom: 0.9rem;
}

h2, h3 {
    font-size: clamp(1.06rem, 1.65vw, 1.25rem);
}

p {
    margin-top: 0.2rem;
    margin-bottom: 0.55rem;
}

label {
    display: block;
    margin-top: 0.18rem;
    margin-bottom: 0.16rem;
    font-weight: 650;
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.2;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.required-star {
    color: #b22a40;
    font-weight: 800;
    margin-left: 0.12rem;
}

.label-nowrap {
    white-space: nowrap;
}

a {
    color: var(--brand-2);
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    padding: 0.5rem 0.85rem;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:active {
    transform: translateY(1px) scale(0.985);
}

.btn-sm {
    padding: 0.32rem 0.62rem;
    font-size: 0.82rem;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(120deg, var(--brand-2), var(--brand));
    border: none;
}

.btn-primary:not(:disabled):hover,
.btn-success:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(17, 86, 135, 0.22);
}

.btn-success {
    color: #fff;
    background: linear-gradient(120deg, #0f8057, #24b877);
    border: none;
}

.btn-progress {
    position: relative;
    animation: btnPulse 0.9s ease-in-out infinite;
}

@keyframes btnPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.btn-warning {
    color: #302111;
    background: linear-gradient(120deg, #f2a824, #ffd370);
    border: none;
}

.btn-outline-secondary {
    border-color: #c4d2e2;
    color: #365872;
    background: #ffffff;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
    border-color: #7da5c5;
    color: #1f4a69;
    background: #edf5fd;
}

.btn-outline-danger {
    border-color: #cf3348;
    color: #b21f35;
}

.btn-outline-brand-soft {
    border-color: #9ec2de;
    color: #1d5f92;
    background: #f3f9ff;
}

.btn-outline-brand-soft:hover,
.btn-outline-brand-soft:focus-visible {
    border-color: #6aa4cf;
    color: #154b78;
    background: #e8f3ff;
}

.invoice-remove-line-btn {
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    line-height: 1;
    max-width: 100%;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    min-height: 40px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

input[type="file"] {
    width: 100%;
    max-width: 100%;
    font-size: 0.88rem;
}

.file-picked-name {
    margin-top: 0.3rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.form-control-account {
    width: 100%;
    font-family: "Consolas", "Courier New", monospace;
    letter-spacing: 0.04em;
}

.form-control:focus,
.form-select:focus {
    border-color: #7dbce0;
    box-shadow: 0 0 0 0.18rem rgba(16, 109, 149, 0.13);
}

.date-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input-with-icon .form-control {
    padding-right: 2.35rem;
}

.date-input-with-icon input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0;
}

.date-input-trigger {
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 8px;
    border: 1px solid #c2d3e3;
    background: #edf4fb;
    color: #2a5876;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.date-input-trigger:hover,
.date-input-trigger:focus-visible {
    border-color: #7da5c5;
    background: #dfeefb;
    color: #173e57;
}

.date-input-trigger svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.content {
    animation: fadeRise 0.3s ease both;
}

@keyframes fadeRise {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.grid {
    display: grid;
    gap: 0.95rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-1);
    padding: 1rem;
    max-width: 100%;
}

.tile:hover {
    box-shadow: var(--shadow-2);
}

.tile-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.metric {
    font-size: 1.55rem;
    font-weight: 800;
}

.metric-sub {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.pill {
    display: inline-block;
    padding: 0.2rem 0.64rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 780;
}

.pill-info {
    background: #dceeff;
    color: #154768;
}

.pill-warning {
    background: #fff1ce;
    color: #885800;
}

.pill-critical {
    background: #ffe1e6;
    color: #8f1c2e;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.95rem;
}

.hero-main {
    background: linear-gradient(126deg, #d9eef9, #deefff 65%, #ecf8ff);
    color: #11324a;
    border-radius: var(--radius-xl);
    padding: 1.1rem 1.2rem;
    box-shadow: var(--shadow-2);
}

.hero-main p {
    opacity: 1;
}

.hero-company-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.hero-company-logo {
    width: 120px;
    height: 120px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(17, 50, 74, 0.2);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 6px 14px rgba(13, 54, 82, 0.15);
}

.hero-kpi-tile {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(16, 61, 89, 0.14);
    box-shadow: none;
}

.hero-kpi-tile h3 {
    color: #1a4767;
    font-size: 0.96rem;
}

.hero-kpi-tile p {
    color: #173d5a;
    margin-bottom: 0.3rem;
}

.hero-stat {
    background: var(--surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-1);
    padding: 1rem;
}

.progress-wrap {
    margin-top: 0.7rem;
    background: #e7eff8;
    border: 1px solid rgba(105, 143, 176, 0.18);
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #8ed3ff, #66b9ff, #93c7ff);
}

.compliance-progress {
    background: linear-gradient(90deg, #74cfff 0%, #66b9ff 48%, #ff5f73 100%);
}

.checklist-tile {
    min-height: 160px;
}

.alert-list {
    display: grid;
    gap: 0.5rem;
}

.alert-item {
    border-radius: var(--radius-lg);
    padding: 0.66rem 0.78rem;
    border: 1px solid #dbe8f9;
    background: #f5f9ff;
    font-size: 0.92rem;
}

.alert-item.warning {
    border-color: #ffe0ab;
    background: #fff7e7;
}

.alert-item.critical {
    border-color: #ffc6cf;
    background: #fff1f4;
}

.chart {
    display: grid;
    gap: 0.5rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 70px 1fr auto;
    align-items: center;
    gap: 0.62rem;
    font-size: 0.88rem;
}

.chart-stack {
    display: flex;
    height: 12px;
    width: 100%;
    border-radius: 999px;
    overflow: hidden;
    background: #eaf0f8;
}

.chart-rev {
    background: #2eb37b;
}

.chart-exp {
    background: #f2a824;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

.table-modern th,
.table-modern td {
    padding: 0.62rem 0.52rem;
    border-bottom: 1px solid #edf2f8;
    vertical-align: middle;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.entry-row-sale td {
    background: #f1fff7;
}

.entry-row-expense td {
    background: #fff3f4;
}

.table-modern th {
    color: var(--ink-soft);
    font-weight: 700;
    background: #f8fbff;
    position: sticky;
    top: 0;
}

.muted {
    color: var(--ink-soft);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.72rem;
    align-items: end;
}

.form-grid > div {
    min-width: 0;
    position: relative;
    z-index: 0;
}

.form-grid > div > label {
    min-height: 0;
    margin-bottom: 0.1rem;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.16rem;
}

.form-row-top {
    align-items: flex-start;
}

.invoice-auto-switch {
    margin-top: 0.16rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.invoice-auto-switch .form-check-input {
    margin-top: 0;
    cursor: pointer;
}

.invoice-auto-switch .form-check-label {
    margin: 0;
    cursor: pointer;
}

.form-row-check {
    min-height: 40px;
    align-items: center;
}

.form-span-2 {
    grid-column: span 2;
}

.form-span-full {
    grid-column: 1 / -1;
}

.form-row-check-wide {
    width: 100%;
    min-width: 0;
}

.settings-check-row {
    align-items: center;
    min-height: 40px;
    margin-top: 0;
}

.settings-check-row span {
    color: var(--ink-soft);
    font-weight: 650;
    line-height: 1.2;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.settings-info-hint {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 1.12rem;
    height: 1.12rem;
    margin-left: 0.38rem;
    border-radius: 999px;
    border: 1px solid #6f93b5;
    background: #ebf5ff;
    color: #235378;
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
}

.settings-info-card {
    min-width: 230px;
    max-width: min(360px, calc(100vw - 1rem));
    left: 0;
}

.settings-info-hint:hover .day-hover-card,
.settings-info-hint:focus-within .day-hover-card {
    opacity: 1;
    transform: translateY(0);
}

.settings-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.settings-bottom-checks {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.85rem;
}

.document-check-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: center;
}

.document-check-row .form-row-check {
    min-width: 0;
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
}

.account-inline-hint {
    display: grid;
    grid-template-columns: minmax(360px, 1.8fr) minmax(280px, 1fr);
    gap: 0.6rem;
    align-items: start;
}

.account-inline-note {
    margin: 0.35rem 0 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.settings-account-row,
.settings-profile-check {
    width: 100%;
}

.settings-account-row {
    align-self: end;
    margin-top: 0.62rem;
}

.settings-profile-check {
    margin-top: 0.45rem;
}

.invoice-bank-field {
    min-width: 0;
}

.file-picker-btn {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
    margin-top: 0;
}

.file-picker-btn.file-picker-btn-lower {
    margin-top: 0.56rem;
    transform: none;
}

.file-picker-field {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding-bottom: 0;
}

.file-picker-field .file-picked-name {
    position: static;
    margin: 0.28rem 0 0;
    line-height: 1.1;
}

.file-picker-field.file-picker-field-lower {
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    align-self: auto;
}

.file-picker-field.file-picker-field-lower > label {
    margin-top: 0;
    margin-bottom: 0.16rem;
}

.file-picker-field.file-picker-field-lower .file-picked-name {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.28rem);
    margin: 0;
    transform: none;
}

.file-picker-field.file-picker-field-static-note .file-picked-name {
    position: static;
    left: auto;
    right: auto;
    top: auto;
    margin: 0.28rem 0 0;
    transform: none;
}

.attachment-list {
    display: grid;
    gap: 0.35rem;
    align-items: start;
}

.attachment-list .attachment-chip {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    width: 100%;
}

.expense-paid-row {
    margin-top: 0.2rem;
}

.expense-edit-notes-offset {
    margin-top: 0.45rem;
}

.field-help {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    margin-left: 0.3rem;
    border-radius: 999px;
    border: 1px solid #9eb7cf;
    color: #35556f;
    background: #eef5fc;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    cursor: help;
    user-select: none;
    vertical-align: middle;
}

.theme-dark .field-help {
    border-color: #5b7995;
    color: #d5e4f2;
    background: #22384d;
}

.theme-dark .required-star {
    color: #ff9cae;
}

.theme-dark .settings-info-hint {
    border-color: #6c9dc6;
    color: #d8ecff;
    background: #234760;
}

.period-line {
    margin-bottom: 0.25rem;
}

.period-main-value {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.22rem;
}

.period-remaining {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.18rem;
}

.period-remaining.state-good {
    color: #1b8c59;
}

.period-remaining.state-mid {
    color: #b07412;
}

.period-remaining.state-low {
    color: #b11f37;
}

.period-usage {
    margin-bottom: 0.2rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.invoice-actions {
    align-items: flex-start;
}

.row-action-submenu {
    position: relative;
}

.row-action-submenu-toggle {
    min-width: 40px;
    width: 40px;
    padding: 0.32rem 0;
    font-size: 1rem;
    line-height: 1;
    text-align: center;
}

.row-action-submenu-panel {
    position: absolute;
    top: calc(100% + 0.32rem);
    right: 0;
    z-index: 12;
    min-width: 176px;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(8, 42, 74, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.36rem;
}

tbody tr:last-child .row-action-submenu-panel,
tbody tr:nth-last-child(2) .row-action-submenu-panel {
    top: auto;
    bottom: calc(100% + 0.32rem);
}

.tile:has(.row-action-submenu-panel) {
    overflow: visible;
}

.theme-dark .row-action-submenu-panel {
    border-color: rgba(159, 190, 214, 0.26);
    background: #172b3d;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.36);
}

.row-action-submenu-panel .btn {
    width: 100%;
    justify-content: center;
}

.invoice-action-floating-menu {
    position: fixed;
    top: min(var(--invoice-menu-top, 8.2rem), calc(100vh - 11rem));
    left: max(0.75rem, min(var(--invoice-menu-left, calc(100vw - 15rem)), calc(100vw - 14.75rem)));
    right: auto;
    bottom: auto;
    z-index: 23000;
    width: min(220px, calc(100vw - 2rem));
}

tbody tr:last-child .invoice-action-floating-menu,
tbody tr:nth-last-child(2) .invoice-action-floating-menu {
    top: min(var(--invoice-menu-top, 8.2rem), calc(100vh - 11rem));
    bottom: auto;
}

.inline-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.field-with-bubble {
    position: relative;
}

.field-with-bubble:focus-within {
    z-index: 1200;
}

.label-with-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.field-warning-marker {
    display: inline-grid;
    place-items: center;
    width: 1.05rem;
    height: 1.05rem;
    border: 1px solid #ff9aac;
    border-radius: 999px;
    background: #fff1f4;
    color: #b4233f;
    font-size: 0.72rem;
    font-weight: 900;
    line-height: 1;
}

.field-error-bubble {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0.25rem;
    z-index: 2400;
    width: fit-content;
    max-width: min(360px, calc(100vw - 3rem));
    padding: 0.48rem 0.62rem;
    border: 1px solid #ffc6cf;
    border-radius: 12px;
    background: #fff1f4;
    color: #8b1830;
    box-shadow: 0 12px 26px rgba(111, 22, 43, 0.12);
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.28;
    pointer-events: none;
}

.field-error-bubble::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 18px;
    width: 10px;
    height: 10px;
    background: inherit;
    border-left: 1px solid #ffc6cf;
    border-top: 1px solid #ffc6cf;
    transform: rotate(45deg);
}

.app-footer {
    border-top: 1px solid var(--line);
    margin-top: 1rem;
    padding-top: 0.75rem;
    padding-bottom: 0.35rem;
}

.app-footer-inner {
    color: var(--ink-soft);
    font-size: 0.84rem;
    line-height: 1.3;
}

.theme-dark .app-footer-inner a {
    color: #87d6ff;
    font-weight: 800;
}

.theme-dark .app-footer-inner a:hover,
.theme-dark .app-footer-inner a:focus {
    color: #b9e8ff;
}

.actions-nowrap {
    flex-wrap: nowrap;
    align-items: center;
}

.actions-nowrap .btn {
    white-space: nowrap;
    min-width: 160px;
}

.marketplace-page-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.marketplace-source-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.marketplace-source-card {
    position: relative;
    overflow: hidden;
}

.marketplace-source-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -55px auto;
    width: 140px;
    height: 140px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(59, 148, 203, 0.18), transparent 66%);
    pointer-events: none;
}

.marketplace-source-card-ready::after {
    background: radial-gradient(circle, rgba(47, 201, 133, 0.18), transparent 66%);
}

.marketplace-import-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.marketplace-form-wide {
    grid-column: span 2;
}

.marketplace-form-divider {
    grid-column: 1 / -1;
    height: 1px;
    margin: 0.15rem 0 0.25rem;
    background: var(--line);
}

.marketplace-table td {
    vertical-align: top;
}

.marketplace-table td p {
    margin: 0.2rem 0 0;
}

.marketplace-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.revenue-form-grid > :not(.entry-form-primary):not(.entry-form-amount),
.expense-form-grid > :not(.entry-form-primary):not(.entry-form-amount) {
    order: 10;
}

.revenue-form-grid > .entry-form-primary,
.expense-form-grid > .entry-form-primary {
    order: 1;
}

.revenue-form-grid > .entry-form-amount,
.expense-form-grid > .entry-form-amount {
    order: 2;
}

.auth-card {
    width: min(460px, 96vw);
    padding: 1.25rem;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 0.45rem;
}

.auth-brand img {
    width: min(260px, 78%);
    height: auto;
    object-fit: contain;
}

.auth-brand .brand-dark {
    display: none;
}

.auth-form {
    display: grid;
    gap: 0.42rem;
}

.auth-section-title {
    margin: 0.55rem 0 0;
    font-size: 1rem;
}

.auth-inline-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.auth-check-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.15rem 0;
}

@media (max-width: 520px) {
    .auth-inline-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.auth-form .btn {
    margin-top: 0.4rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0 0.55rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

.auth-google-form {
    margin-top: 0;
}

.auth-google-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
}

.auth-google-mark {
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: #fff;
    color: #1f6feb;
    border: 1px solid rgba(15, 35, 55, 0.12);
    font-weight: 900;
}

.auth-remember {
    margin-top: 0.1rem;
    margin-bottom: 0.15rem;
}

.auth-hint {
    margin-top: 0.75rem;
    font-size: 0.84rem;
}

.auth-terms-row {
    align-items: flex-start;
    line-height: 1.35;
}

.legal-page {
    width: min(940px, 96vw);
    margin: 1.5rem auto;
    background: rgba(255, 255, 255, 0.94);
}

.legal-page h3 {
    margin-top: 1.2rem;
}

.backup-restore-label {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.backup-restore-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.cookie-consent {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 2200;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: min(920px, calc(100vw - 2rem));
    margin: 0 auto;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.cookie-consent p {
    margin: 0.15rem 0 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.cookie-consent strong {
    color: var(--ink);
}

.cookie-consent-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    pointer-events: auto;
}

.assistant-task-list {
    display: grid;
    gap: 0.55rem;
}

.assistant-task-row {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) minmax(180px, max-content);
    gap: 0.75rem;
    align-items: center;
    padding: 0.72rem 0;
    border-top: 1px solid var(--line);
}

.assistant-task-row:first-child {
    border-top: 0;
}

.assistant-task-row p {
    margin: 0.15rem 0 0;
}

.assistant-task-date {
    color: var(--ink-soft);
    font-weight: 750;
    white-space: nowrap;
    justify-self: end;
}

.assistant-task-row > div:nth-child(4) {
    grid-column: 3;
    justify-self: end;
}

@media (max-width: 1120px) {
    .assistant-task-row {
        grid-template-columns: 86px minmax(0, 1fr);
    }

    .assistant-task-row > div:nth-child(3),
    .assistant-task-row > div:nth-child(4) {
        grid-column: 2;
        justify-self: start;
    }

    .assistant-task-date {
        justify-self: start;
    }
}

.theme-dark .cookie-consent {
    background: rgba(15, 27, 39, 0.96);
    border-color: rgba(125, 181, 228, 0.32);
    color: #e8f2ff;
}

.theme-dark .cookie-consent strong {
    color: #eef7ff;
}

.theme-dark .cookie-consent p {
    color: #c7d8ea;
}

.theme-dark .cookie-consent a {
    color: #77c8ff;
}

.theme-dark .progress-wrap {
    background: rgba(104, 138, 171, 0.22);
    border-color: rgba(141, 185, 225, 0.22);
}

.theme-dark .legal-page,
.theme-dark .auth-card {
    color: var(--ink);
}

.theme-dark .legal-page {
    background: rgba(15, 27, 39, 0.96);
    border-color: rgba(125, 181, 228, 0.28);
}

.theme-dark .legal-page h1,
.theme-dark .legal-page h2,
.theme-dark .legal-page h3 {
    color: #eef7ff;
}

.theme-dark .legal-page p,
.theme-dark .legal-page li {
    color: #c7d8ea;
}

.theme-dark .legal-page .muted {
    color: #9fb5cb !important;
}

.theme-dark .auth-brand .brand-light {
    display: none;
}

.theme-dark .auth-brand .brand-dark {
    display: block;
}

.theme-dark .legal-source-link {
    color: #87d6ff;
    font-weight: 800;
}

.theme-dark .legal-source-link:hover,
.theme-dark .legal-source-link:focus {
    color: #b9e8ff;
}

.theme-dark .field-error-bubble {
    border-color: rgba(255, 126, 151, 0.58);
    background: #3b2028;
    color: #ffd2dc;
    box-shadow: 0 14px 30px rgba(2, 13, 23, 0.42);
}

.theme-dark .field-error-bubble::before {
    border-color: rgba(255, 126, 151, 0.58);
}

.theme-dark .field-warning-marker {
    border-color: rgba(255, 126, 151, 0.72);
    background: #3b2028;
    color: #ffd2dc;
}

.docs-page {
    display: grid;
    gap: 1rem;
}

.docs-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 1rem;
    align-items: stretch;
    overflow: hidden;
}

.docs-hero h1 {
    margin: 0.45rem 0 0.45rem;
}

.docs-hero p {
    max-width: 780px;
    color: var(--ink-soft);
    font-size: 1.02rem;
}

.docs-hero-card {
    display: grid;
    align-content: center;
    gap: 0.35rem;
    min-height: 130px;
    padding: 1rem;
    border: 1px solid rgba(76, 147, 199, 0.25);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(117, 197, 255, 0.32), transparent 48%),
        linear-gradient(135deg, rgba(241, 248, 255, 0.92), rgba(226, 241, 252, 0.86));
}

.docs-hero-card strong {
    color: var(--ink);
    font-size: 1.02rem;
}

.docs-hero-card span {
    color: var(--ink-soft);
}

.docs-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.docs-menu {
    position: sticky;
    top: 1rem;
    display: grid;
    gap: 0.35rem;
}

.docs-menu h2 {
    margin-bottom: 0.35rem;
}

.docs-menu a {
    display: block;
    padding: 0.58rem 0.7rem;
    border-radius: 12px;
    color: var(--ink-soft);
    font-weight: 760;
    text-decoration: none;
    transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.docs-menu a:hover,
.docs-menu a:focus-visible {
    color: var(--brand-2);
    background: rgba(120, 188, 236, 0.16);
    transform: translateX(2px);
}

.docs-content {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.docs-section {
    scroll-margin-top: 1rem;
}

.docs-section h2 {
    margin-bottom: 0.55rem;
}

.docs-section ul {
    margin: 0.65rem 0 0;
    padding-left: 1.15rem;
}

.docs-section li {
    margin-bottom: 0.42rem;
}

.docs-callout {
    display: grid;
    gap: 0.22rem;
    margin: 0.8rem 0;
    padding: 0.85rem 0.95rem;
    border-left: 4px solid #5fb5f4;
    border-radius: 14px;
    background: rgba(225, 242, 255, 0.72);
}

.docs-callout span {
    color: var(--ink-soft);
}

.theme-dark .docs-hero-card {
    border-color: rgba(125, 181, 228, 0.28);
    background:
        radial-gradient(circle at top right, rgba(37, 130, 196, 0.28), transparent 48%),
        linear-gradient(135deg, rgba(17, 35, 51, 0.94), rgba(19, 44, 64, 0.9));
}

.theme-dark .docs-hero p,
.theme-dark .docs-hero-card span,
.theme-dark .docs-callout span {
    color: #c7d8ea;
}

.theme-dark .docs-hero-card strong,
.theme-dark .docs-section h2,
.theme-dark .docs-menu h2 {
    color: #eef7ff;
}

.theme-dark .docs-menu a {
    color: #c7d8ea;
}

.theme-dark .docs-menu a:hover,
.theme-dark .docs-menu a:focus-visible {
    color: #eef7ff;
    background: rgba(104, 177, 231, 0.18);
}

.theme-dark .docs-callout {
    border-left-color: #5fb5f4;
    background: rgba(38, 75, 104, 0.38);
}

@media (max-width: 980px) {
    .docs-hero,
    .docs-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-menu {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .docs-menu h2 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .docs-menu {
        grid-template-columns: minmax(0, 1fr);
    }
}

.expense-doc-actions .btn-expense-status {
    min-width: 210px;
}

.invoice-client-card {
    order: 1;
}

.invoice-settings-card {
    order: 2;
}

.invoice-issue-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    grid-auto-rows: 1fr;
    justify-items: stretch;
}

.invoice-issue-grid > .tile {
    min-width: 0;
    width: 100%;
    height: 100%;
}

.invoice-settings-card .form-grid,
.invoice-client-card .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.invoice-settings-card .form-grid > div,
.invoice-client-card .form-grid > div {
    min-width: 0;
}

.invoice-numbering-preview {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.invoice-qty-input {
    max-width: 84px;
}

.invoice-unit-input {
    max-width: 84px;
}

.invoice-price-field {
    max-width: 186px;
}

.input-with-suffix.invoice-price-field {
    gap: 0;
}

.input-with-suffix.invoice-price-field > .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.currency-inline-input {
    width: 56px;
    max-width: 56px;
    min-width: 56px;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.02em;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
}

.invoice-vat-input {
    max-width: 78px;
}

.invoice-gross-preview {
    max-width: 186px;
}

.invoice-line-name-input {
    min-width: 0;
}

.invoice-lines-grid {
    grid-template-columns:
        minmax(130px, 1.1fr)
        minmax(260px, 2.4fr)
        minmax(74px, 0.8fr)
        minmax(74px, 0.8fr)
        minmax(170px, 1.4fr)
        minmax(72px, 0.7fr)
        minmax(170px, 1.4fr)
        minmax(132px, 1fr);
    gap: 0.5rem;
    align-items: end;
}

.invoice-lines-grid > div {
    min-width: 0;
}

@media (max-width: 1560px) {
    .invoice-lines-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .invoice-lines-grid .invoice-field-catalog,
    .invoice-lines-grid .invoice-field-name {
        grid-column: span 2;
    }

    .invoice-lines-grid .invoice-field-qty,
    .invoice-lines-grid .invoice-field-unit,
    .invoice-lines-grid .invoice-field-net,
    .invoice-lines-grid .invoice-field-vat,
    .invoice-lines-grid .invoice-field-gross {
        grid-column: span 1;
    }

    .invoice-lines-grid .invoice-field-actions {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 1180px) {
    .invoice-lines-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .invoice-lines-grid .invoice-field-catalog,
    .invoice-lines-grid .invoice-field-name,
    .invoice-lines-grid .invoice-field-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .invoice-lines-grid {
        grid-template-columns: 1fr;
    }

    .invoice-lines-grid > div {
        grid-column: 1 / -1;
    }

    .invoice-price-field,
    .invoice-gross-preview,
    .invoice-qty-input,
    .invoice-unit-input,
    .invoice-vat-input {
        max-width: 100%;
    }
}

.sidebar:not(.collapsed) + main .invoice-lines-grid {
    grid-template-columns:
        minmax(120px, 1fr)
        minmax(230px, 2.1fr)
        minmax(74px, 0.78fr)
        minmax(74px, 0.78fr)
        minmax(158px, 1.25fr)
        minmax(70px, 0.68fr)
        minmax(158px, 1.25fr)
        minmax(132px, 1fr);
}

@media (max-width: 1760px) {
    .sidebar:not(.collapsed) + main .invoice-lines-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-catalog,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-name {
        grid-column: span 2;
    }

    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-qty,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-unit,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-net,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-vat,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-gross {
        grid-column: span 1;
    }

    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-actions {
        grid-column: 1 / -1;
        justify-self: start;
    }
}

@media (max-width: 1260px) {
    .sidebar:not(.collapsed) + main .invoice-lines-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-catalog,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-name,
    .sidebar:not(.collapsed) + main .invoice-lines-grid .invoice-field-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1200px) {
    .invoice-issue-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }

    .invoice-settings-card .form-grid,
    .invoice-client-card .form-grid,
    .document-check-row {
        grid-template-columns: 1fr;
    }

    .invoice-settings-card .form-grid > div,
    .invoice-client-card .form-grid > div {
        grid-column: 1 / -1;
        width: 100%;
    }

    .invoice-settings-card .form-grid .form-control,
    .invoice-settings-card .form-grid .form-select,
    .invoice-client-card .form-grid .form-control,
    .invoice-client-card .form-grid .form-select,
    .invoice-settings-card .form-grid input,
    .invoice-client-card .form-grid input {
        width: 100%;
        max-width: 100%;
    }

    .form-row-check {
        min-height: 0;
        margin-top: 0.08rem;
        display: grid;
        grid-template-columns: 18px minmax(0, 1fr);
        column-gap: 0.42rem;
        row-gap: 0;
        align-items: start;
    }

    .form-row-check .form-check-input,
    .form-row-check input[type="checkbox"] {
        margin-top: 0.12rem;
        flex: 0 0 auto;
        justify-self: start;
    }

    .form-row-check span {
        margin: 0;
        line-height: 1.2;
        min-width: 0;
        display: block;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: normal;
    }
}

.input-with-suffix {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.input-with-suffix .form-control {
    min-width: 0;
}

.input-suffix {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--ink-soft);
    white-space: nowrap;
}

.catalog-unit-input {
    width: 100%;
    max-width: none;
}

.catalog-stock-input {
    width: 100%;
    max-width: none;
}

.catalog-price-wrap {
    width: 100%;
    max-width: none;
}

.catalog-price-input {
    width: 100%;
    max-width: none;
}

.catalog-currency-select {
    width: 100%;
    max-width: none;
}

.catalog-vat-select {
    width: 100%;
    min-width: 118px;
    max-width: none;
}

.catalog-form-grid {
    grid-template-columns:
        minmax(300px, 2.6fr)
        minmax(86px, 0.8fr)
        minmax(130px, 1.15fr)
        minmax(135px, 1fr)
        minmax(170px, 1.25fr)
        minmax(96px, 0.85fr)
        minmax(118px, 0.95fr);
    align-items: end;
}

.catalog-name-field {
    min-width: 0;
}

.catalog-filters-grid {
    grid-template-columns:
        minmax(260px, 2.4fr)
        repeat(5, minmax(90px, 1fr));
    align-items: end;
}

@media (max-width: 1320px) {
    .catalog-form-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

@media (max-width: 1080px) {
    .catalog-filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }
}

.catalog-table {
    width: 100%;
    table-layout: fixed;
}

.catalog-table th,
.catalog-table td {
    text-align: center;
    vertical-align: middle;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.catalog-table th:nth-child(1),
.catalog-table td:nth-child(1),
.catalog-table th:nth-child(9),
.catalog-table td:nth-child(9) {
    text-align: left;
}

.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2),
.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3),
.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4),
.catalog-table th:nth-child(6),
.catalog-table td:nth-child(6),
.catalog-table th:nth-child(7),
.catalog-table td:nth-child(7),
.catalog-table th:nth-child(8),
.catalog-table td:nth-child(8),
.catalog-table th:nth-child(10),
.catalog-table td:nth-child(10) {
    white-space: nowrap;
}

.catalog-table .actions {
    justify-content: center;
}

.catalog-table th:nth-child(1),
.catalog-table td:nth-child(1) { width: 17%; }

.catalog-table th:nth-child(2),
.catalog-table td:nth-child(2) { width: 9%; }

.catalog-table th:nth-child(3),
.catalog-table td:nth-child(3) { width: 6%; }

.catalog-table th:nth-child(4),
.catalog-table td:nth-child(4) { width: 8%; }

.catalog-table th:nth-child(5),
.catalog-table td:nth-child(5) { width: 10%; }

.catalog-table th:nth-child(6),
.catalog-table td:nth-child(6) { width: 8%; }

.catalog-table th:nth-child(7),
.catalog-table td:nth-child(7) { width: 7%; }

.catalog-table th:nth-child(8),
.catalog-table td:nth-child(8) { width: 9%; }

.catalog-table th:nth-child(9),
.catalog-table td:nth-child(9) { width: 12%; }

.catalog-table th:nth-child(10),
.catalog-table td:nth-child(10) {
    width: 14%;
    overflow: visible;
}

.catalog-details-row td {
    max-width: none;
    overflow: visible;
    white-space: normal;
    background: rgba(231, 244, 255, 0.55);
}

.catalog-details-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem 0.9rem;
    padding: 0.75rem 0.55rem;
    text-align: left;
}

.catalog-details-grid > div {
    min-width: 0;
}

.catalog-details-grid span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.12rem;
}

.catalog-details-grid strong {
    display: block;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.catalog-details-wide {
    grid-column: span 2;
}

.catalog-details-actions .btn {
    margin-top: 0.12rem;
}

.customers-list-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 220px);
}

.customers-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.customers-table {
    min-width: 980px;
    table-layout: fixed;
}

.customers-table th,
.customers-table td {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customers-table th:nth-child(1),
.customers-table td:nth-child(1) { width: 12%; }

.customers-table th:nth-child(2),
.customers-table td:nth-child(2) { width: 11%; }

.customers-table th:nth-child(3),
.customers-table td:nth-child(3) { width: 11%; }

.customers-table th:nth-child(4),
.customers-table td:nth-child(4) { width: 8%; }

.customers-table th:nth-child(5),
.customers-table td:nth-child(5) { width: 14%; }

.customers-table th:nth-child(6),
.customers-table td:nth-child(6) { width: 10%; }

.customers-table th:nth-child(7),
.customers-table td:nth-child(7) { width: 7%; }

.customers-table th:nth-child(8),
.customers-table td:nth-child(8) {
    width: 7%;
    text-align: right;
}

.customers-table th:nth-child(9),
.customers-table td:nth-child(9) {
    width: 20%;
    overflow: visible;
}

.customer-details-row td {
    max-width: none;
    overflow: visible;
    white-space: normal;
    background: rgba(231, 244, 255, 0.55);
}

.customer-details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem 0.9rem;
    padding: 0.75rem 0.55rem;
}

.customer-details-grid > div {
    min-width: 0;
}

.customer-details-grid span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.12rem;
}

.customer-details-grid strong {
    display: block;
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.customer-details-wide {
    grid-column: span 2;
}

.sidebar:not(.collapsed) + main .customers-list-grid {
    grid-template-columns: 1fr;
}

.pager {
    margin-top: 0.65rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: start;
    gap: 0.55rem 0.9rem;
}

.pager-buttons {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    justify-content: center;
    flex-wrap: nowrap;
    justify-self: center;
}

.pager-info {
    text-align: right;
    font-size: 0.88rem;
}

.pager-page-inline {
    min-width: 54px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}

.pager-nav-btn {
    width: 40px;
    min-width: 40px;
    padding-left: 0;
    padding-right: 0;
    text-align: center;
    font-size: 1rem;
    line-height: 1;
}

.calendar-events-pagination {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.pager-left,
.pager-right {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.pager-left label {
    margin: 0;
    white-space: nowrap;
}

.pager-left .form-select {
    min-width: 52px;
    max-width: 58px;
    width: 56px;
    padding-left: 0.45rem;
    padding-right: 1.45rem;
}

.pager-right {
    justify-self: end;
}

.th-sort-btn {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 780;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    cursor: pointer;
}

.th-sort-btn:hover,
.th-sort-btn:focus-visible {
    color: var(--brand-2);
    text-decoration: underline;
}

.th-sort-icon {
    font-size: 0.76rem;
    line-height: 1;
    color: #5d7993;
}

.th-sort-btn.active .th-sort-icon {
    color: var(--brand-2);
}

.table-filter-row th {
    padding-top: 0.38rem;
    padding-bottom: 0.42rem;
    background: rgba(236, 242, 249, 0.75);
}

.table-filter-row .form-select-sm,
.table-filter-row .form-control {
    min-height: 30px;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    font-size: 0.84rem;
}

.toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 21000;
    display: grid;
    gap: 0.5rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
    align-items: start;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-2);
    padding: 0.62rem 0.72rem;
    animation: toastIn 0.26s ease-out both;
}

.toast-message {
    font-size: 0.9rem;
    font-weight: 620;
}

.toast-dismiss {
    border: none;
    background: transparent;
    color: #5b7086;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin-top: -0.04rem;
}

.toast-success {
    border-color: #8dd9ba;
    background: #eefcf5;
}

.toast-info {
    border-color: #a5c9ea;
    background: #eef6ff;
}

.toast-warning {
    border-color: #f2cd7e;
    background: #fff8e9;
}

.toast-error {
    border-color: #e8a6af;
    background: #fff1f3;
}

.invoice-edit-overlay,
.entry-preview-overlay,
.entry-edit-overlay,
.entry-delete-overlay,
.customers-edit-overlay,
.catalog-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(12, 18, 30, .55);
    animation: overlayIn 0.22s ease both;
}

.invoice-edit-overlay > .tile,
.entry-preview-overlay > .tile,
.entry-edit-overlay > .tile,
.entry-delete-overlay > .tile,
.customers-edit-overlay > .tile,
.catalog-dialog-overlay > .tile {
    animation: modalIn 0.24s ease-out both;
}

.catalog-dialog-modal {
    width: min(520px, calc(100% - 2rem));
}

.badge-status {
    padding: 0.18rem 0.5rem;
    border-radius: 9px;
    font-size: 0.74rem;
    font-weight: 780;
}

.badge-issued {
    background: #deedff;
    color: #1f4f78;
}

.badge-paid {
    background: #ddf8e9;
    color: #13623f;
}

.badge-overdue {
    background: #ffe3e8;
    color: #8a1728;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

.calendar-controls {
    align-items: end;
}

.calendar-page-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.35rem;
}

.calendar-page-title {
    margin-bottom: 0;
}

.calendar-page-title-row .settings-info-hint {
    margin-left: 0;
    flex-shrink: 0;
}

.calendar-info-card {
    min-width: 290px;
    max-width: min(460px, calc(100vw - 1rem));
}

.calendar-toolbar {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.calendar-toolbar-separator {
    height: 1px;
    margin: 0.8rem 0 0.95rem;
    background: color-mix(in srgb, var(--ink-soft) 22%, transparent);
}

.calendar-source-explainer {
    margin: 0 0 0.9rem;
    max-width: 72ch;
}

.calendar-day-details-separator {
    height: 1px;
    margin: 1.1rem 0 1rem;
    background: color-mix(in srgb, var(--ink-soft) 22%, transparent);
}

.calendar-day-details {
    padding: 0.1rem 0 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    max-width: 1280px;
    margin: 0 auto;
}

.calendar-day-event-grid {
    grid-template-columns: minmax(72px, 0.3fr) minmax(220px, 1fr) minmax(220px, 1fr);
    align-items: start;
}

.calendar-day-event-grid > div {
    align-self: start;
}

.calendar-month-nav {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
}

.calendar-nav-prev {
    min-width: 40px;
    padding-inline: 0.6rem;
}

.calendar-nav-next {
    min-width: 40px;
    padding-inline: 0.6rem;
}

.calendar-today-btn {
    white-space: nowrap;
}

.calendar-current-month-title {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.01em;
    min-width: 170px;
}

.calendar-year-select {
    width: 120px;
    min-width: 120px;
}

.calendar-active-days-toggle {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    min-height: 38px;
    gap: 0.5rem;
    margin: 0;
    white-space: nowrap;
}

.calendar-active-days-toggle label {
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.calendar-active-days-toggle input[type="checkbox"] {
    margin: 0;
}

.calendar-view-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: auto;
    min-width: 0;
}

.calendar-view-mode-label {
    display: inline-flex;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.calendar-view-mode-select {
    width: 150px;
    min-width: 0;
}

.calendar-label-revenue {
    color: var(--success);
    font-weight: 700;
}

.calendar-label-expense {
    color: var(--danger);
    font-weight: 700;
}

.calendar-source-block {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
    display: grid;
    gap: 0.28rem;
}

.calendar-source-block p {
    margin: 0;
}

.calendar-source-title {
    margin-bottom: 0.2rem;
}

.calendar-kv {
    margin: 0;
    line-height: 1.32;
}

.calendar-summary-footer {
    display: grid;
    gap: 0.38rem;
}

.calendar-summary-footer {
    margin-top: 0.85rem;
}

.calendar-month-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (max-width: 1100px) {
    .calendar-month-sections {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .calendar-month-sections {
        grid-template-columns: 1fr;
    }
}

.calendar-day-details .grid > div > p {
    margin: 0 0 0.28rem;
}

.calendar-detail-break {
    height: 1px;
    margin: 0.45rem 0 0.45rem;
    background: color-mix(in srgb, var(--ink-soft) 24%, transparent);
}

.pit36-headline {
    margin-bottom: 0.45rem;
}

.pit36-year-nav {
    min-height: 40px;
}

.pit36-year-value {
    min-width: 86px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pit36-sheet {
    border: 1px solid #c9d3df;
    border-radius: 14px;
    background: linear-gradient(180deg, #f5f8fc 0%, #ffffff 100%);
    padding: 0.9rem;
}

.pit36-sheet-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    color: #23384c;
    border-bottom: 1px solid #d7e0ea;
    padding-bottom: 0.5rem;
    margin-bottom: 0.6rem;
}

.pit36-sheet-title strong {
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.pit36-sheet-title span {
    font-weight: 700;
    color: #3f576d;
}

.pit36-intro {
    margin-bottom: 0.6rem;
}

.pit36-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
}

.pit36-table th,
.pit36-table td {
    border: 1px solid #c9d3df;
    padding: 0.55rem 0.6rem;
    vertical-align: top;
}

.pit36-table thead th {
    background: #e9eef4;
    color: #23384c;
    font-weight: 800;
    text-align: left;
}

.pit36-table .pit36-col-keys th {
    background: #f4f7fb;
    color: #5a6f85;
    font-weight: 700;
}

.pit36-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #1f4f77;
}

.pit36-summary {
    margin-top: 0.65rem;
    border: 1px solid #bfcddd;
    border-radius: 10px;
    background: #f8fbff;
    padding: 0.65rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
}

.pit36-summary strong {
    font-size: 1.15rem;
    color: #163f63;
    font-variant-numeric: tabular-nums;
}

.pit36-details {
    margin-top: 0.7rem;
}

.theme-dark .pit36-sheet {
    border-color: rgba(159, 190, 214, 0.24);
    background: linear-gradient(180deg, #172b3d 0%, #102333 100%);
}

.theme-dark .pit36-sheet-title {
    color: #e6f2ff;
    border-bottom-color: rgba(159, 190, 214, 0.22);
}

.theme-dark .pit36-sheet-title span,
.theme-dark .pit36-intro {
    color: #b8ccdd;
}

.theme-dark .pit36-table {
    background: #102333;
}

.theme-dark .pit36-table th,
.theme-dark .pit36-table td {
    border-color: rgba(159, 190, 214, 0.24);
}

.theme-dark .pit36-table thead th {
    background: #20384c;
    color: #e8f4ff;
}

.theme-dark .pit36-table .pit36-col-keys th {
    background: #172d40;
    color: #b9cfdf;
}

.theme-dark .pit36-num,
.theme-dark .pit36-summary strong {
    color: #9bd5ff;
}

.theme-dark .pit36-summary {
    border-color: rgba(159, 190, 214, 0.24);
    background: #14283a;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.45rem;
    min-width: 0;
    width: 100%;
}

.calendar-scroll {
    overflow-x: hidden;
    padding: 2px 2px 6px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 700;
    color: var(--ink-soft);
    font-size: 0.82rem;
    padding: 0.2rem 0;
}

.calendar-month-cell {
    min-height: 132px;
    height: 132px;
    border: 1px solid #dfe9f5;
    border-radius: 12px;
    background: #fff;
    padding: 0.45rem;
    position: relative;
    overflow: visible;
}

.calendar-month-cell.empty {
    background: #f6f9fc;
    border-style: dashed;
}

.calendar-month-cell.filtered {
    background: #f6f9fc;
    border-style: dashed;
    color: #87a0b7;
}

.calendar-month-cell.clickable {
    cursor: pointer;
    text-align: left;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-month-cell.clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-1);
}

.calendar-month-cell.selected {
    border-color: #1f9a5f;
    box-shadow: 0 0 0 2px rgba(31, 154, 95, 0.18);
}

.calendar-month-cell.holiday.selected,
.calendar-month-cell.saturday.selected,
.calendar-month-cell.sunday.selected,
.calendar-button.holiday.selected,
.calendar-button.saturday.selected,
.calendar-button.sunday.selected {
    border-color: #1f9a5f;
    box-shadow: 0 0 0 2px rgba(31, 154, 95, 0.26);
}

.calendar-month-cell.saturday {
    background: #f8fcff;
}

.calendar-month-cell.sunday {
    background: #fff6f8;
}

.calendar-month-cell.holiday {
    border-color: #efb05c;
    background: #fff9ef;
}

.calendar-grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.calendar-cell {
    background: #fff;
    border: 1px solid #e4edf7;
    border-radius: 12px;
    min-height: 132px;
    height: 132px;
    padding: 0.45rem;
    font-size: 0.8rem;
    position: relative;
    overflow: visible;
}

.calendar-cell .day {
    font-weight: 800;
    margin-bottom: 0.32rem;
}

.calendar-button {
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.calendar-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-1);
    border-color: #bfd5ec;
}

.calendar-button.selected {
    border-color: #1f9a5f;
    box-shadow: 0 0 0 2px rgba(31, 154, 95, 0.18);
}

.calendar-button.saturday {
    background: #f8fcff;
}

.calendar-button.sunday {
    background: #fff6f8;
}

.calendar-button.holiday {
    border-color: #efb05c;
    background: #fff9ef;
}

.calendar-day-number {
    font-size: 1.86rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0;
    white-space: nowrap;
}

.calendar-day-label {
    font-size: 0.72rem;
    color: #52708a;
    margin-bottom: 0;
    white-space: nowrap;
}

.calendar-day-head {
    position: absolute;
    top: 0.45rem;
    left: 0.45rem;
    right: 0.45rem;
    min-height: 1.9rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.calendar-add-event-btn {
    position: absolute;
    top: 0.38rem;
    right: 0.36rem;
    width: 1.4rem;
    height: 1.4rem;
    border: 1px solid rgba(39, 93, 132, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #1d658f;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.calendar-add-event-btn:hover {
    background: #f0f8ff;
    border-color: rgba(29, 101, 143, 0.45);
}

.calendar-holiday-slot {
    margin-top: 2.02rem;
    min-height: 0;
    margin-bottom: 0.08rem;
}

.calendar-holiday-name {
    font-size: 0.72rem;
    color: #8b4f03;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.kpi {
    font-size: 0.78rem;
    color: #35556f;
    margin-bottom: 0.22rem;
    line-height: 1.25;
}

.calendar-badges {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    margin-top: 0.25rem;
    max-height: 4.6rem;
    overflow: hidden;
}

.calendar-overflow-indicator {
    position: absolute;
    right: 0.3rem;
    bottom: 0.32rem;
    border-radius: 999px;
    border: 1px solid rgba(53, 88, 115, 0.35);
    background: rgba(255, 255, 255, 0.92);
    color: #355873;
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.14rem;
    padding: 0.12rem 0.42rem;
    pointer-events: none;
    z-index: 2;
}

.calendar-overflow-indicator .plus {
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1;
}

.calendar-badge {
    display: inline-block;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.08rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.calendar-badge.revenue {
    background: #ddf8e9;
    color: #0f6a42;
}

.calendar-badge.expense {
    background: #ffe2ea;
    color: #ad2d4d;
}

.calendar-badge.due {
    background: #deedff;
    color: #1e4b74;
}

.calendar-badge.idle {
    background: #eef4fa;
    color: #6b8298;
}

.calendar-badge.holiday {
    background: #ffe9c8;
    color: #8b4f03;
}

.calendar-badge.more {
    background: #e8eef5;
    color: #4f6780;
}

.calendar-month-cell.today,
.calendar-button.today {
    border-color: #1d7bb7;
    box-shadow: 0 0 0 2px rgba(29, 123, 183, 0.22);
}

.calendar-month-cell.today.selected,
.calendar-button.today.selected,
.calendar-month-cell.holiday.today.selected,
.calendar-month-cell.saturday.today.selected,
.calendar-month-cell.sunday.today.selected,
.calendar-button.holiday.today.selected,
.calendar-button.saturday.today.selected,
.calendar-button.sunday.today.selected {
    border-color: #1f9a5f;
    box-shadow: 0 0 0 2px rgba(31, 154, 95, 0.3);
}

.day-hover-card {
    position: absolute;
    left: 0.45rem;
    right: auto;
    width: max-content;
    min-width: 250px;
    max-width: min(350px, calc(100vw - 1rem));
    top: auto;
    bottom: calc(100% + 0.35rem);
    z-index: 40;
    border: 1px solid #cfdceb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 16px 36px rgba(10, 47, 77, 0.18);
    padding: 0.5rem 0.55rem;
    font-size: 0.74rem;
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

.day-hover-card.hover-card-below {
    top: calc(100% + 0.35rem);
    bottom: auto;
}

.day-hover-card.hover-card-above {
    top: auto;
    bottom: calc(100% + 0.35rem);
}

.day-hover-card p {
    margin: 0.12rem 0;
}

.calendar-month-cell:hover .day-hover-card,
.calendar-button:hover .day-hover-card {
    opacity: 1;
    transform: translateY(0);
}

.calendar-month-cell:hover,
.calendar-button:hover {
    z-index: 20;
}

.pie-wrap {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 1rem;
    align-items: center;
}

.chart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    align-items: start;
}

.chart-left,
.chart-right {
    min-width: 0;
}

.pie-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 10px solid #fff;
    box-shadow: var(--shadow-1);
}

.pie-svg {
    width: 170px;
    height: 170px;
    filter: drop-shadow(0 8px 20px rgba(9, 45, 72, 0.12));
}

.pie-text {
    font-size: 15px;
    font-weight: 800;
    fill: #214962;
}

.vchart-shell {
    display: grid;
    grid-template-columns: 66px 1fr;
    gap: 0.6rem;
    min-width: 0;
}

.vchart-y {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #56728a;
    height: 180px;
    align-self: end;
}

.vchart-grid {
    display: grid;
    gap: 0.45rem;
    align-items: end;
    min-height: 260px;
    min-width: 0;
}

.vchart-bars {
    height: 180px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0.25rem;
    border-bottom: 1px solid #bccddd;
    border-left: 1px solid #bccddd;
    border-top: 1px dashed #d8e4f0;
    position: relative;
    background:
        repeating-linear-gradient(
            to top,
            transparent 0,
            transparent 25%,
            rgba(188, 205, 221, 0.35) 25.5%
        );
}

.vbar {
    width: min(22px, calc(48% - 2px));
    border-radius: 8px 8px 0 0;
}

.vbar.rev {
    background: #2eb37b;
}

.vbar.exp {
    background: #f2a824;
}

.vbar.inc {
    background: #2a8dd6;
}

.vchart-label {
    margin-top: 0.35rem;
    font-size: 0.72rem;
    text-align: center;
    color: #4d6981;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-hover-card {
    left: 50%;
    right: auto;
    width: max-content;
    min-width: 210px;
    max-width: min(320px, calc(100vw - 2rem));
    font-size: 0.73rem;
    transform: translate(-50%, 4px);
    overflow-wrap: anywhere;
}

.vchart-col {
    min-width: 0;
    position: relative;
}

.vchart-col:hover .chart-hover-card,
.pie-legend-item:hover .chart-hover-card {
    opacity: 1;
    transform: translate(-50%, 0);
}

.pie-legend {
    display: grid;
    gap: 0.25rem;
}

.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    position: relative;
}

.pie-legend-item p {
    margin: 0;
}

.pie-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.pie-dot.rev {
    background: #2eb37b;
}

.pie-dot.exp {
    background: #f2a824;
}

.pie-dot.inc {
    background: #2a8dd6;
}

.pie-income {
    margin-top: 0.45rem;
    text-align: left;
    font-size: 1.05rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    object-fit: cover;
    margin-right: 0.5rem;
    border: 1px solid rgba(22, 74, 108, 0.18);
}

.sidebar.collapsed {
    width: 84px;
}

details > summary {
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.theme-dark {
    --ink: #e9f2fb;
    --ink-soft: #afc2d5;
    --surface: #142433;
    --surface-2: #0f1b28;
    --line: #294157;
    --brand: #2f8fc0;
    --brand-2: #0f6485;
    --accent: #f4ae2b;
    --danger: #ff5f73;
    --success: #2fc985;
    --bs-heading-color: #eaf3fb;
}

.theme-dark .page,
.theme-dark body,
.theme-dark main,
.theme-dark .content {
    background: linear-gradient(180deg, #0f1b28, #121f2d);
}

.theme-dark .tile,
.theme-dark .hero-stat,
.theme-dark .calendar-month-cell,
.theme-dark .calendar-cell,
.theme-dark .table-modern th {
    background: #142433;
    color: #e8f1fa;
}

.theme-dark h1,
.theme-dark h2,
.theme-dark h3,
.theme-dark h4,
.theme-dark h5,
.theme-dark h6 {
    color: #eaf3fb;
}

.theme-dark .table-modern td {
    border-bottom-color: #233a4f;
    color: #dcebf8;
}

.theme-dark .customer-details-row td {
    background: rgba(29, 62, 86, 0.58);
}

.theme-dark .customer-details-grid strong {
    color: #e8f1fa;
}

.theme-dark .catalog-details-row td {
    background: rgba(29, 62, 86, 0.58);
}

.theme-dark .catalog-details-grid strong {
    color: #e8f1fa;
}

.theme-dark .catalog-filters-grid .form-control::placeholder {
    color: #bcd0e2;
    opacity: 1;
}

.theme-dark .catalog-table td:nth-child(1),
.theme-dark .catalog-table td:nth-child(2),
.theme-dark .catalog-table td:nth-child(9) {
    color: #eef6ff;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: #0f1f2f;
    color: #e7f0f9;
    border-color: #2a4358;
}

.theme-dark .date-input-trigger {
    border-color: #3d5a73;
    background: #173043;
    color: #d8e8f7;
}

.theme-dark .date-input-trigger:hover,
.theme-dark .date-input-trigger:focus-visible {
    border-color: #5d84a3;
    background: #20415a;
    color: #eff8ff;
}

.theme-dark .entry-row-sale td {
    background: #173427;
}

.theme-dark .entry-row-expense td {
    background: #3a1f28;
}

.theme-dark .alert-item {
    border-color: #35516a;
    background: #1a2e42;
    color: #dbeaf9;
}

.theme-dark .alert-item.warning {
    border-color: #7e6540;
    background: #3a3020;
    color: #ffe6b8;
}

.theme-dark .alert-item.critical {
    border-color: #7a3c4a;
    background: #3b2028;
    color: #ffd2dc;
}

.theme-dark .day-hover-card {
    border-color: #35516a;
    background: #16283a;
    color: #d9e9f7;
    box-shadow: 0 16px 36px rgba(2, 13, 23, 0.45);
}

.theme-dark .hero-main {
    background: linear-gradient(126deg, #19364e, #1d4868 65%, #1f4f74);
    color: #eaf3fb;
}

.theme-dark .hero-kpi-tile {
    background: rgba(20, 44, 61, 0.55);
    border-color: rgba(170, 205, 231, 0.18);
}

.theme-dark .hero-kpi-tile h3,
.theme-dark .hero-kpi-tile p {
    color: #e5f3ff;
}

.theme-dark .hero-company-logo {
    border-color: rgba(173, 207, 232, 0.24);
    background: rgba(20, 44, 61, 0.82);
}

.theme-dark .period-remaining.state-good {
    color: #34d399;
}

.theme-dark .period-remaining.state-mid {
    color: #ffd189;
}

.theme-dark .period-remaining.state-low {
    color: #ffb0bf;
}

.theme-dark .vchart-bars {
    border-bottom-color: #4c667f;
    border-left-color: #4c667f;
    border-top-color: #415a72;
    background:
        repeating-linear-gradient(
            to top,
            transparent 0,
            transparent 25%,
            rgba(76, 102, 127, 0.35) 25.5%
        );
}

.theme-dark .vchart-y,
.theme-dark .vchart-label {
    color: #bfd4e7;
}

.theme-dark .pie-text {
    fill: #ecf6ff;
}

.theme-dark .day-hover-card p {
    color: #d9e9f7;
}

.theme-dark .calendar-month-cell,
.theme-dark .calendar-button,
.theme-dark .calendar-cell,
.theme-dark .calendar-month-cell.clickable,
.theme-dark .calendar-button.saturday,
.theme-dark .calendar-button.sunday,
.theme-dark .calendar-button.holiday,
.theme-dark .calendar-month-cell.saturday,
.theme-dark .calendar-month-cell.sunday,
.theme-dark .calendar-month-cell.holiday {
    background: #16293b;
    color: #deecfa;
    border-color: #35516a;
}

.theme-dark .calendar-month-cell.saturday,
.theme-dark .calendar-button.saturday {
    background: #1a3148;
    border-color: #3c6281;
}

.theme-dark .calendar-month-cell.sunday,
.theme-dark .calendar-button.sunday {
    background: #3a2430;
    border-color: #6d3f4e;
}

.theme-dark .calendar-month-cell.holiday,
.theme-dark .calendar-button.holiday {
    background: #3b3120;
    border-color: #8a6a34;
}

.theme-dark .calendar-day-number,
.theme-dark .calendar-day-label,
.theme-dark .calendar-holiday-name,
.theme-dark .calendar-weekday {
    color: #deecfa;
}

.theme-dark .calendar-badge.revenue {
    background: #1f4b36;
    color: #bcf0d8;
}

.theme-dark .calendar-badge.expense {
    background: #552636;
    color: #ffd2e3;
}

.theme-dark .calendar-badge.due {
    background: #1d3f5c;
    color: #cce5ff;
}

.theme-dark .calendar-month-cell.today,
.theme-dark .calendar-button.today {
    border-color: #66b8ff;
    box-shadow: 0 0 0 2px rgba(102, 184, 255, 0.28);
}

.theme-dark .calendar-add-event-btn {
    background: rgba(27, 45, 63, 0.92);
    color: #bfe4ff;
    border-color: rgba(116, 162, 195, 0.45);
}

.theme-dark .calendar-add-event-btn:hover {
    background: rgba(38, 63, 85, 0.95);
}

.theme-dark .calendar-overflow-indicator {
    border-color: rgba(124, 160, 187, 0.46);
    background: rgba(20, 34, 48, 0.92);
    color: #cce7ff;
}

.event-day-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.42rem;
}

.event-day-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.55rem;
    border: 1px solid #dce8f4;
    border-radius: 10px;
    padding: 0.48rem 0.55rem;
    background: #f8fbff;
}

.event-day-content {
    display: grid;
    gap: 0.18rem;
}

.event-day-description {
    color: var(--ink-soft);
    line-height: 1.3;
}

.event-upcoming-content {
    display: grid;
    gap: 0.2rem;
}

.event-upcoming-title {
    display: block;
}

.event-upcoming-description {
    color: var(--ink-soft);
    line-height: 1.32;
}

.theme-dark .event-day-list li {
    border-color: #32506a;
    background: #182a3a;
}

.theme-dark .calendar-month-cell.selected,
.theme-dark .calendar-button.selected,
.theme-dark .calendar-month-cell.holiday.selected,
.theme-dark .calendar-button.holiday.selected,
.theme-dark .calendar-month-cell.saturday.selected,
.theme-dark .calendar-button.saturday.selected,
.theme-dark .calendar-month-cell.sunday.selected,
.theme-dark .calendar-button.sunday.selected {
    border-color: #6ad7a1;
    box-shadow: 0 0 0 2px rgba(106, 215, 161, 0.46);
}

.theme-dark .sidebar {
    background: linear-gradient(180deg, #182838 0%, #1a2f40 45%, #132534 100%);
    border-right-color: rgba(159, 190, 214, 0.2);
}

.theme-dark .top-row {
    background: rgba(20, 36, 51, 0.86);
    border-bottom-color: rgba(162, 196, 224, 0.18);
}

.theme-dark .btn-outline-secondary {
    border-color: #44627b;
    color: #d8e8f7;
    background: #173043;
}

.theme-dark .btn-outline-secondary:hover,
.theme-dark .btn-outline-secondary:focus-visible {
    border-color: #5d84a3;
    color: #eff8ff;
    background: #20415a;
}

.theme-dark .top-note-title {
    color: #dcedfb;
}

.theme-dark .top-note-sub {
    color: #b5cadf;
}

.theme-dark .navbar-brand {
    color: #e5f1fb !important;
}

.theme-dark .brand-sub {
    color: #bdd1e1 !important;
}

.theme-dark .nav-caption {
    color: #a8c0d4 !important;
}

.theme-dark .nav-item .nav-link {
    color: #d9eaf8 !important;
}

.theme-dark .nav-item .nav-link:hover {
    background-color: rgba(157, 193, 220, 0.18) !important;
}

.theme-dark .nav-item a.active {
    background-color: rgba(228, 241, 252, 0.95) !important;
    color: #143853 !important;
}

.theme-dark .nav-icon {
    background: rgba(155, 196, 225, 0.2);
    color: #def0ff;
}

@media (max-width: 1199px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .chart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 959px) {
    h1 {
        margin-bottom: 0.72rem;
    }

    .tile {
        padding: 0.78rem;
        border-radius: 14px;
    }

    .tile-headline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.38rem;
    }

    .content {
        padding-left: 0.72rem !important;
        padding-right: 0.72rem !important;
        padding-bottom: 0.8rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 0.72rem;
    }

    .marketplace-import-form-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-form-wide {
        grid-column: span 1;
    }

    .hero-company-row {
        align-items: flex-start;
    }

    .hero-company-logo {
        width: 84px;
        height: 84px;
    }

    .table-modern {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .table-modern th {
        position: static;
    }

    .actions {
        width: 100%;
    }

    .actions .btn {
        flex: 1 1 140px;
    }

    .pit36-year-value {
        min-width: 72px;
    }

    .row-action-submenu {
        width: 100%;
    }

    .row-action-submenu-panel {
        position: static;
        margin-top: 0.35rem;
        width: 100%;
        box-shadow: none;
    }

    .invoice-action-floating-menu {
        position: fixed;
        top: min(var(--invoice-menu-top, 8.2rem), calc(100vh - 11rem));
        left: max(0.75rem, min(var(--invoice-menu-left, 0.75rem), calc(100vw - 14.75rem)));
        right: auto;
        width: min(220px, calc(100vw - 1.5rem));
        box-shadow: 0 16px 30px rgba(8, 42, 74, 0.22);
    }

    .actions-nowrap {
        flex-wrap: wrap;
        width: 100%;
    }

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

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.62rem;
    }

    .form-span-2,
    .form-span-full {
        grid-column: 1 / -1;
    }

    .form-row,
    .form-row-top,
    .form-row-check,
    .invoice-auto-switch {
        flex-wrap: wrap;
        align-items: center;
        gap: 0.45rem;
    }

    .document-check-row,
    .account-inline-hint {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .account-inline-note {
        margin-top: 0.18rem;
    }

    .file-picker-field.file-picker-field-lower .file-picked-name {
        position: static;
        margin-top: 0.25rem;
    }

    .expense-paid-row,
    .expense-edit-notes-offset {
        margin-top: 0.55rem;
    }

    .pager-buttons {
        flex-wrap: nowrap;
    }

    .pager {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .pager-left,
    .pager-right {
        justify-self: center;
    }

    .pager-info {
        text-align: center;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .calendar-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.42rem;
    }

    .calendar-controls {
        gap: 0.55rem;
        align-items: stretch;
    }

    .calendar-toolbar {
        justify-content: flex-start;
        align-items: stretch;
        gap: 0.5rem;
    }

    .calendar-month-nav {
        min-height: 0;
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
    }

    .calendar-month-nav .btn,
    .calendar-today-btn {
        width: auto;
    }

    .calendar-today-btn {
        width: 100%;
        min-height: 40px;
    }

    .calendar-view-mode {
        width: 100%;
        min-width: 0;
    }

    .calendar-active-days-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .calendar-current-month-title {
        min-width: 140px;
    }

    .pit36-sheet-title,
    .pit36-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .pit36-summary strong {
        font-size: 1.02rem;
    }

    .calendar-view-mode-select {
        width: min(150px, 100%);
        max-width: 100%;
    }

    .calendar-month-grid {
        grid-template-columns: repeat(7, minmax(0, 1fr));
        min-width: 0;
        width: 100%;
        gap: 0.3rem;
    }

    .calendar-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }

    .calendar-weekday {
        font-size: 0.7rem;
        padding: 0.12rem 0;
    }

    .calendar-month-cell,
    .calendar-button {
        min-height: 88px;
        height: 88px;
        padding: 0.28rem;
    }

    .calendar-day-head {
        margin-bottom: 0.1rem;
    }

    .calendar-day-label {
        display: none;
    }

    .calendar-month-cell .calendar-badges {
        display: none;
    }

    .calendar-holiday-slot {
        min-height: 0;
    }

    .calendar-holiday-name {
        font-size: 0.62rem;
        line-height: 1.05;
    }

    .calendar-add-event-btn {
        width: 1.2rem;
        height: 1.2rem;
        font-size: 0.88rem;
        border-radius: 7px;
        right: 0.2rem;
        top: 0.2rem;
        bottom: auto;
    }

    .day-hover-card {
        display: none;
    }

    .pie-wrap {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .vchart-shell {
        grid-template-columns: 52px 1fr;
        gap: 0.42rem;
    }

    .vchart-y {
        flex-direction: column;
        justify-content: space-between;
        height: 152px;
        align-self: end;
        font-size: 0.68rem;
        gap: 0;
    }

    .vchart-grid {
        min-height: 220px;
    }

    .vchart-bars {
        gap: 0.14rem;
        height: 152px;
    }

    .vbar {
        width: min(18px, calc(45% - 2px));
    }
}

@keyframes overlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px) translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@media (min-width: 1200px) {
    .page:has(.entry-edit-overlay),
    .page:has(.entry-preview-overlay),
    .page:has(.invoice-edit-overlay),
    .page:has(.catalog-dialog-overlay) {
        overflow: hidden;
    }

    .page:has(.entry-edit-overlay) .sidebar,
    .page:has(.entry-preview-overlay) .sidebar,
    .page:has(.invoice-edit-overlay) .sidebar,
    .page:has(.catalog-dialog-overlay) .sidebar {
        visibility: hidden;
        pointer-events: none;
    }

    .page:has(.entry-edit-overlay) .sidebar + main,
    .page:has(.entry-preview-overlay) .sidebar + main,
    .page:has(.invoice-edit-overlay) .sidebar + main,
    .page:has(.catalog-dialog-overlay) .sidebar + main {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 640px) {
    .assistant-task-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .assistant-task-row .btn {
        width: 100%;
    }

    .cookie-consent {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-consent-actions {
        width: 100%;
        justify-content: space-between;
    }

    .content {
        padding-left: 0.6rem !important;
        padding-right: 0.6rem !important;
    }

    h1 {
        font-size: 1.35rem;
    }

    h2,
    h3 {
        font-size: 1rem;
    }

    .tile {
        padding: 0.68rem;
    }

    .btn,
    .form-control,
    .form-select {
        min-height: 38px;
    }

    .calendar-grid,
    .calendar-grid-compact {
        grid-template-columns: 1fr;
    }

    .calendar-month-cell,
    .calendar-button {
        min-height: 78px;
        height: 78px;
    }
}
