@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css");

body {
    --kessai-dark: #1f2937;
    --kessai-accent: #b7965f;
    --kessai-accent-dark: #9d7d49;
    --kessai-accent-soft: #f4efe6;
    background: #f6f7f9;
    color: #1f2937;
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.auth-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.app-sidebar {
    --sidebar-width: 246px;
    --sidebar-collapsed-width: 82px;
    position: fixed;
    top: 18px;
    left: 18px;
    bottom: 18px;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 18px 14px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .66), rgba(238, 241, 245, .42));
    box-shadow: 0 28px 70px rgba(31, 41, 55, .16), inset 0 1px 0 rgba(255, 255, 255, .94), inset 0 -1px 0 rgba(255, 255, 255, .36);
    backdrop-filter: blur(28px) saturate(150%);
    transition: width .22s ease, padding .22s ease;
}

.app-sidebar-top {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    border-bottom: 0;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 4px 0 4px 4px;
    color: var(--kessai-dark);
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.app-sidebar-brand span,
.app-sidebar-link span {
    overflow: hidden;
    white-space: nowrap;
    transition: opacity .14s ease, width .2s ease;
}

.app-sidebar-brand .brand-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 6px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85);
}

.app-sidebar-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(31, 41, 55, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    color: #4b5563;
    transition: background-color .18s ease, color .18s ease, transform .22s ease;
}

.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
    background: #ffffff;
    color: #111827;
}

.app-sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 8px;
    padding: 8px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
}

.app-sidebar-nav::-webkit-scrollbar {
    display: none;
}

.app-sidebar-section {
    display: grid;
    gap: 6px;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 0;
}

.app-sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 28px;
    padding: 0 14px 2px;
    border: 0;
    background: transparent;
    color: #7b8494;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
}

.app-sidebar-section-title i {
    width: auto;
    color: #9ca3af;
    font-size: .78rem;
    letter-spacing: 0;
    transition: transform .18s ease, color .18s ease;
}

.app-sidebar-section-title:hover,
.app-sidebar-section-title:focus {
    color: #4b5563;
}

.app-sidebar-section-title:hover i,
.app-sidebar-section-title:focus i {
    color: #4b5563;
}

.app-sidebar-section-body {
    display: grid;
    gap: 6px;
}

.app-sidebar-section.is-section-collapsed .app-sidebar-section-body {
    display: none;
}

.app-sidebar-section.is-section-collapsed .app-sidebar-section-title i {
    transform: rotate(-90deg);
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 999px;
    color: #394252;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.app-sidebar-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    color: #6b7280;
    font-size: 1.08rem;
}

.app-sidebar-link:hover,
.app-sidebar-link:focus {
    background: rgba(255, 255, 255, .72);
    color: #111827;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 8px 22px rgba(31, 41, 55, .08);
    transform: translateX(2px);
}

.app-sidebar-link:hover i,
.app-sidebar-link:focus i {
    color: var(--kessai-dark);
}

.app-sidebar-logout {
    flex: 0 0 auto;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(31, 41, 55, .08);
}

.app-sidebar-logout .app-sidebar-link {
    min-height: 40px;
}

.app-sidebar-button {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
}

.app-sidebar-button i {
    color: #111827;
}

.app-sidebar-button:hover,
.app-sidebar-button:focus {
    background: rgba(255, 255, 255, .72);
    color: #000000;
}

.app-sidebar + .page-shell {
    margin-left: 282px;
    margin-right: 28px;
    max-width: none;
    transition: margin-left .22s ease;
}

.app-sidebar:not(.sidebar-ready),
.app-sidebar:not(.sidebar-ready) + .page-shell {
    transition: none;
}

.app-sidebar.is-collapsed {
    width: var(--sidebar-collapsed-width);
    padding-right: 12px;
    padding-left: 12px;
}

.app-sidebar.is-collapsed .app-sidebar-top {
    justify-content: center;
    flex-direction: column;
    min-height: 58px;
    gap: 10px;
}

.app-sidebar.is-collapsed .app-sidebar-brand {
    display: none;
}

.app-sidebar.is-collapsed .app-sidebar-brand span,
.app-sidebar.is-collapsed .app-sidebar-link span,
.app-sidebar.is-collapsed .app-sidebar-section-title {
    display: none;
    width: 0;
    opacity: 0;
}

.app-sidebar.is-collapsed .app-sidebar-toggle {
    transform: rotate(180deg);
}

.app-sidebar.is-collapsed .app-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    min-height: 48px;
    gap: 0;
    padding-right: 0;
    padding-left: 0;
    margin-right: auto;
    margin-left: auto;
}

.app-sidebar.is-collapsed .app-sidebar-link i {
    width: 24px;
    margin: 0;
    text-align: center;
    line-height: 1;
}

.app-sidebar.is-collapsed .app-sidebar-link:hover,
.app-sidebar.is-collapsed .app-sidebar-link:focus {
    transform: none;
}

.app-sidebar.is-collapsed .app-sidebar-nav {
    justify-items: center;
}

.app-sidebar.is-collapsed .app-sidebar-section {
    width: 100%;
    padding-top: 8px;
    border-top-color: rgba(31, 41, 55, .06);
}

.app-sidebar.is-collapsed .app-sidebar-section-body,
.app-sidebar.is-collapsed .app-sidebar-section.is-section-collapsed .app-sidebar-section-body {
    display: grid;
    gap: 6px;
}

.app-sidebar.is-collapsed .app-sidebar-logout {
    display: flex;
    justify-content: center;
}

.app-sidebar.is-collapsed + .page-shell {
    margin-left: 118px;
    margin-right: 28px;
    max-width: none;
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 16px 48px;
}

.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
}

.panel-form {
    position: relative;
}

.panel-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #6b7280;
}

.panel-close:hover,
.panel-close:focus {
    background: transparent;
    color: var(--kessai-dark);
}

.panel-close:focus-visible {
    outline: 2px solid rgba(183, 150, 95, .45);
    outline-offset: 2px;
}

.metric {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid var(--kessai-accent);
    border-radius: 8px;
    padding: 18px;
}

.metric span {
    color: #6b7280;
    font-size: .85rem;
}

.metric strong {
    display: block;
    font-size: 1.55rem;
    margin-top: 4px;
}

/* Dashboard financial overview */
.dashboard-metric,
.dashboard-chart-card,
.dashboard-recent-card {
    border: 1px solid rgba(255, 255, 255, .72);
    background: linear-gradient(145deg, rgba(255, 255, 255, .76), rgba(238, 242, 247, .38));
    box-shadow: 0 16px 36px rgba(31, 41, 55, .09), inset 0 1px 0 rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.dashboard-metric {
    position: relative;
    display: block;
    min-height: 174px;
    padding: 20px;
    overflow: hidden;
    border-radius: 22px;
    color: var(--kessai-dark);
    text-decoration: none;
}

.dashboard-metric::after {
    position: absolute;
    top: -46px;
    right: -30px;
    width: 134px;
    height: 134px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(183, 150, 95, .18), rgba(183, 150, 95, 0) 70%);
    content: "";
    pointer-events: none;
}

.dashboard-metric:hover {
    color: var(--kessai-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(31, 41, 55, .12), inset 0 1px 0 rgba(255, 255, 255, .96);
}

.dashboard-metric-fund,
.dashboard-metric-operations {
    transition: transform .2s ease, box-shadow .2s ease;
}

.dashboard-metric-operations::after {
    background: radial-gradient(circle, rgba(92, 136, 178, .18), rgba(92, 136, 178, 0) 70%);
}

.dashboard-metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, .84);
    border-radius: 13px;
    background: rgba(255, 255, 255, .56);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .88);
    color: #4b5563;
}

.dashboard-metric-operations .dashboard-metric-icon {
    color: #3e709f;
}

.dashboard-metric-label,
.dashboard-metric small {
    display: block;
    color: #6b7280;
    font-size: .8rem;
}

.dashboard-metric-label {
    font-weight: 700;
}

.dashboard-metric strong {
    display: block;
    margin: 5px 0 9px;
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    letter-spacing: -.04em;
}

.dashboard-metric small i {
    margin-left: 3px;
}

.dashboard-chart-card,
.dashboard-recent-card {
    padding: 24px;
    border-radius: 24px;
}

.dashboard-chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--kessai-accent-dark);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.dashboard-chart-heading p {
    margin: 0;
    color: #6b7280;
    font-size: .86rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 6px;
    color: #4b5563;
    font-size: .8rem;
    white-space: nowrap;
}

.legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 5px;
    border-radius: 50%;
}

.fund-dot,
.chart-dot-fund {
    fill: #b7965f;
    background: #b7965f;
}

.operations-dot,
.chart-dot-operations {
    fill: #5c88b2;
    background: #5c88b2;
}

.dashboard-chart-wrap {
    min-height: 300px;
    margin-top: 12px;
}

.dashboard-chart {
    display: block;
    width: 100%;
    height: 300px;
    overflow: visible;
}

.chart-grid {
    stroke: rgba(75, 85, 99, .12);
    stroke-width: 1;
}

.chart-axis-label {
    fill: #8a94a4;
    font-size: 11px;
}

.chart-line {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
}

.chart-line-fund {
    stroke: #b7965f;
}

.chart-line-operations {
    stroke: #5c88b2;
}

.chart-dot {
    stroke: rgba(255, 255, 255, .94);
    stroke-width: 2;
}

.dashboard-chart-empty {
    display: grid;
    min-height: 260px;
    place-items: center;
    border: 1px dashed rgba(107, 114, 128, .25);
    border-radius: 18px;
    color: #6b7280;
    font-size: .9rem;
    text-align: center;
}

.dashboard-type-badge {
    display: inline-flex;
    padding: 4px 9px;
    border: 1px solid rgba(183, 150, 95, .20);
    border-radius: 999px;
    background: rgba(244, 239, 230, .7);
    color: #806431;
    font-size: .75rem;
    font-weight: 700;
}

.dashboard-recent-table tbody tr:last-child > * {
    border-bottom-width: 0;
}

.dashboard-recent-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--kessai-dark);
    --bs-table-border-color: rgba(75, 85, 99, .10);
    --bs-table-hover-bg: rgba(255, 255, 255, .30);
    margin-bottom: 0;
}

.dashboard-recent-table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none;
}

.dashboard-recent-table thead th {
    color: #7b8494;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.dashboard-recent-table tbody tr {
    transition: background-color .18s ease;
}

.dashboard-recent-table tbody tr:hover {
    background-color: rgba(255, 255, 255, .30);
}

@media (max-width: 575.98px) {
    .dashboard-metric {
        min-height: 158px;
        padding: 18px;
        border-radius: 18px;
    }

    .dashboard-chart-card,
    .dashboard-recent-card {
        padding: 18px;
        border-radius: 20px;
    }

    .dashboard-chart-heading {
        flex-direction: column;
        gap: 8px;
    }

    .dashboard-chart-wrap,
    .dashboard-chart {
        min-height: 240px;
        height: 240px;
    }

    .chart-legend {
        padding-top: 0;
    }
}

.table > :not(caption) > * > * {
    padding: .75rem;
}

.payments-table {
    table-layout: auto;
}

.payments-table th:last-child,
.payments-table td:last-child {
    width: 48px;
    padding-left: .35rem;
}

.actions-table th:last-child,
.actions-table td:last-child {
    width: 1%;
}

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

.project-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
}

.project-actions form {
    margin: 0;
}

.form-control,
.form-select,
.btn {
    border-radius: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    --bs-btn-active-bg: transparent;
    --bs-btn-active-border-color: transparent;
    --bs-btn-active-color: currentColor;
    --bs-btn-focus-box-shadow: none;
}

.btn i {
    line-height: 1;
}

.btn:active,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    color: inherit;
    background: inherit;
    border-color: inherit;
    box-shadow: inherit;
}

.btn:focus,
.btn:focus-visible {
    box-shadow: inherit;
}

.btn-icon {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 1.9rem;
    height: 1.9rem;
}

.btn-primary {
    color: var(--kessai-accent-dark);
    border-color: rgba(255, 255, 255, .64);
    background: linear-gradient(145deg, rgba(255, 255, 255, .64), rgba(239, 242, 246, .34));
    box-shadow: 0 12px 28px rgba(31, 41, 55, .10), inset 0 1px 0 rgba(255, 255, 255, .88);
    backdrop-filter: blur(18px) saturate(130%);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:first-child:active,
:not(.btn-check) + .btn-primary:active {
    color: #6f5428;
    border-color: rgba(255, 255, 255, .82);
    background: linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(244, 246, 249, .44));
    box-shadow: 0 14px 32px rgba(31, 41, 55, .13), inset 0 1px 0 rgba(255, 255, 255, .94);
}

.btn-withdrawal {
    border-color: rgba(255, 255, 255, .58);
    background: linear-gradient(145deg, rgba(255, 255, 255, .46), rgba(239, 242, 246, .20));
    color: #dc2626;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.btn-withdrawal i {
    color: #dc2626;
}

.btn-withdrawal:hover,
.btn-withdrawal:focus,
.btn-withdrawal:active,
.btn-withdrawal.active,
.btn-withdrawal:first-child:active,
:not(.btn-check) + .btn-withdrawal:active {
    border-color: rgba(255, 255, 255, .76);
    background: linear-gradient(145deg, rgba(255, 255, 255, .58), rgba(244, 246, 249, .30));
    color: #b91c1c;
}

.btn-withdrawal:hover i,
.btn-withdrawal:focus i {
    color: #b91c1c;
}

.btn-income {
    color: #15803d;
}

.btn-income i {
    color: #15803d;
}

.btn-income:hover,
.btn-income:focus,
.btn-income:active,
.btn-income.active,
.btn-income:first-child:active,
:not(.btn-check) + .btn-income:active {
    color: #166534;
}

.btn-income:hover i,
.btn-income:focus i {
    color: #166534;
}

.btn-outline-secondary {
    border-color: rgba(255, 255, 255, .62);
    background: linear-gradient(145deg, rgba(255, 255, 255, .58), rgba(239, 242, 246, .30));
    color: var(--kessai-accent-dark);
    box-shadow: 0 10px 26px rgba(31, 41, 55, .09), inset 0 1px 0 rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px) saturate(130%);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-outline-secondary:first-child:active,
:not(.btn-check) + .btn-outline-secondary:active {
    border-color: rgba(255, 255, 255, .82);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(244, 246, 249, .40));
    color: #6f5428;
    box-shadow: 0 12px 30px rgba(31, 41, 55, .12), inset 0 1px 0 rgba(255, 255, 255, .94);
}

.btn-outline-secondary i {
    color: currentColor;
}

.btn-primary i {
    color: currentColor;
}

.btn-outline-secondary:disabled,
.btn-outline-secondary.disabled {
    border-color: rgba(255, 255, 255, .42);
    background: linear-gradient(145deg, rgba(255, 255, 255, .28), rgba(239, 242, 246, .14));
    color: #9ca3af;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .56);
}

.inline-add-trigger td {
    padding-top: 12px;
    padding-bottom: 4px;
}

.inline-add-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--kessai-accent-dark);
    font-size: .9rem;
    font-weight: 600;
    text-decoration: none;
}

.inline-add-cta:hover,
.inline-add-cta:focus {
    color: var(--kessai-dark);
    text-decoration: none;
}

.btn-outline-secondary.remove-category,
.btn-outline-secondary.remove-assignment,
.btn-outline-secondary.remove-category:hover,
.btn-outline-secondary.remove-category:focus,
.btn-outline-secondary.remove-category:active,
.btn-outline-secondary.remove-category:disabled,
.btn-outline-secondary.remove-assignment:hover,
.btn-outline-secondary.remove-assignment:focus,
.btn-outline-secondary.remove-assignment:active,
.btn-outline-secondary.remove-assignment:disabled {
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.btn i.bi-trash {
    color: #991b1b;
}

.btn:hover i.bi-trash,
.btn:focus i.bi-trash {
    color: #7f1d1d;
}

a {
    color: var(--kessai-accent-dark);
}

a:hover {
    color: var(--kessai-dark);
}

.badge.text-bg-success {
    border: 1px solid rgba(255, 255, 255, .66);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(220, 252, 231, .42)) !important;
    color: #15803d !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px) saturate(140%);
}

.badge.text-bg-secondary {
    border: 1px solid rgba(255, 255, 255, .66);
    background: linear-gradient(145deg, rgba(255, 255, 255, .72), rgba(254, 226, 226, .42)) !important;
    color: #b91c1c !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px) saturate(140%);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--kessai-accent);
    box-shadow: 0 0 0 .2rem rgba(183, 150, 95, .18);
}

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

.panel h1,
.panel h2 {
    color: var(--kessai-dark);
}

.accent-line {
    width: 42px;
    height: 3px;
    background: var(--kessai-accent);
    border-radius: 999px;
    margin: 10px 0 18px;
}

.text-muted-small {
    color: #6b7280;
    font-size: .88rem;
}

.kessai-modal {
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, .52)),
        rgba(255, 255, 255, .42);
    box-shadow:
        0 28px 70px rgba(31, 41, 55, .26),
        inset 0 1px 0 rgba(255, 255, 255, .94),
        inset 0 -1px 0 rgba(255, 255, 255, .28);
    -webkit-backdrop-filter: blur(30px) saturate(165%);
    backdrop-filter: blur(30px) saturate(165%);
    overflow: hidden;
}

.liquid-modal {
    border-color: rgba(255, 255, 255, .78);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .30)),
        rgba(255, 255, 255, .24);
    box-shadow:
        0 34px 90px rgba(31, 41, 55, .28),
        inset 0 1px 0 rgba(255, 255, 255, .96),
        inset 0 -1px 0 rgba(255, 255, 255, .22);
    -webkit-backdrop-filter: blur(34px) saturate(180%);
    backdrop-filter: blur(34px) saturate(180%);
}

.kessai-modal .modal-header,
.kessai-modal .modal-footer {
    border-color: rgba(255, 255, 255, .48);
    padding: 20px 24px;
}

.kessai-modal .modal-header,
.kessai-modal .modal-body,
.kessai-modal .modal-footer {
    background: transparent;
}

.kessai-modal .modal-body {
    padding: 22px 24px;
}

.client-licenses-table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--kessai-dark);
    --bs-table-border-color: rgba(75, 85, 99, .12);
    --bs-table-hover-bg: rgba(255, 255, 255, .20);
}

.client-licenses-table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, .68);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .74), rgba(244, 239, 230, .46)),
        rgba(244, 239, 230, .34);
    color: var(--kessai-accent-dark);
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 10px 22px rgba(31, 41, 55, .08);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

.modal-backdrop.show {
    opacity: .42;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.modal-close {
    position: static;
    flex: 0 0 auto;
    margin-left: auto;
    align-self: flex-start;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
}

.sales-form {
    position: relative;
}

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

.sales-close {
    position: static;
    flex: 0 0 auto;
}

.sales-section {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .50)),
        rgba(255, 255, 255, .42);
    border: 1px solid rgba(255, 255, 255, .70);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 14px 34px rgba(31, 41, 55, .08), inset 0 1px 0 rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.sales-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.entity-select-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 2.35rem;
    gap: 8px;
    align-items: center;
}

.entity-create-button {
    width: 2.35rem;
    height: 2.35rem;
    border-color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .58);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84);
}

.entity-create-button:hover,
.entity-create-button:focus {
    border-color: rgba(183, 150, 95, .42);
    background: rgba(244, 239, 230, .68);
}

.payment-header {
    margin-bottom: 24px;
}

.payment-context-card {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 8px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .48)),
        rgba(255, 255, 255, .40);
    box-shadow: 0 14px 34px rgba(31, 41, 55, .08), inset 0 1px 0 rgba(255, 255, 255, .92);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    backdrop-filter: blur(22px) saturate(145%);
}

.payment-context-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.payment-context-main > div:last-child {
    min-width: 0;
}

.payment-context-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 8px;
    background: rgba(244, 239, 230, .54);
    color: var(--kessai-accent-dark);
    font-size: 1.2rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}

.payment-context-label,
.payment-context-meta > div > span:first-child {
    display: block;
    color: #111827;
    font-size: .74rem;
    font-weight: 400;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.payment-context-title {
    margin: 2px 0 0;
    color: var(--kessai-dark);
    font-size: 1.15rem;
    font-weight: 400;
    line-height: 1.2;
}

.payment-context-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.payment-context-meta > div {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .66);
    border-radius: 8px;
    background: rgba(255, 255, 255, .52);
}

.payment-context-meta > div > span:first-child {
    overflow-wrap: anywhere;
}

.payment-context-meta .payment-context-value {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: #111827;
    font-size: .95rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-context-meta > div:first-child .payment-context-value {
    white-space: normal;
}

.payment-distribution-section {
    padding: 18px;
}

.distribution-card-grid {
    display: grid;
    gap: 14px;
}

.distribution-card {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .76), rgba(255, 255, 255, .44)),
        rgba(255, 255, 255, .34);
    border: 1px solid rgba(255, 255, 255, .70);
    border-radius: 8px;
    padding: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86), 0 10px 26px rgba(31, 41, 55, .07);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
}

.distribution-card-collapsible {
    padding: 0;
    overflow: hidden;
}

.distribution-card-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 70px;
    padding: 0 18px;
    cursor: pointer;
    user-select: none;
}

.distribution-card-summary::-webkit-details-marker {
    display: none;
}

.distribution-card-summary::marker {
    content: "";
}

.distribution-card-summary span,
.distribution-card-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--kessai-dark);
    font-weight: 800;
}

.distribution-card-summary i,
.distribution-card-title i {
    color: var(--kessai-accent-dark);
    font-size: 1.15rem;
}

.distribution-card-summary > .bi-chevron-down {
    color: #4b5563;
    font-size: .95rem;
    transition: transform .18s ease;
}

.distribution-card-collapsible[open] .distribution-card-summary > .bi-chevron-down {
    transform: rotate(180deg);
}

.distribution-card-body {
    padding: 0 16px 16px;
}

.distribution-card-title {
    margin-bottom: 14px;
}

.distribution-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.sales-table {
    margin-bottom: 0;
}

.sales-table thead th {
    color: #4b5563;
    font-size: .83rem;
    font-weight: 700;
    text-transform: uppercase;
}

.sales-table tfoot td {
    padding-top: .85rem;
    border-bottom: 0;
}

.inline-add-row .form-control,
.inline-add-row .form-select {
    min-height: 2.35rem;
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, .72);
}

.inline-add-row .form-control::placeholder {
    color: #94a3b8;
}

.inline-category-controls {
    display: grid;
    grid-template-columns: minmax(106px, .72fr) minmax(130px, 1fr);
    gap: 6px;
}

.inline-add-button {
    width: 2.35rem;
    height: 2.35rem;
    border-color: #cbd5e1;
    background: rgba(255, 255, 255, .70);
    color: var(--kessai-accent-dark);
    box-shadow: none;
}

.inline-add-button:hover,
.inline-add-button:focus,
.inline-add-button:active {
    border-color: var(--kessai-accent);
    background: rgba(244, 239, 230, .72);
    color: #6f5428;
    box-shadow: none;
}

.inline-add-button:disabled {
    border-color: #e5e7eb;
    background: rgba(255, 255, 255, .42);
    color: #9ca3af;
}

.sales-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

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

.project-detail-summary > div {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px 16px;
}

.project-detail-summary span {
    display: block;
    color: #6b7280;
    font-size: .82rem;
    margin-bottom: 4px;
}

.project-detail-summary strong {
    display: block;
    color: var(--kessai-dark);
    font-size: 1.05rem;
    font-weight: 700;
}

.distribution-detail-grid {
    display: grid;
    gap: 16px;
}

.distribution-detail-card {
    border-left: 4px solid var(--kessai-accent);
}

.distribution-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.distribution-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--kessai-accent-soft);
    color: var(--kessai-accent-dark);
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 10px;
    white-space: nowrap;
}

.distribution-chip-maintenance {
    background: #eef2ff;
    color: #3730a3;
}

.login-body {
    min-height: 100vh;
    background-color: #ae8b61;
    background:
        linear-gradient(90deg, rgba(183, 150, 95, .02), rgba(255, 255, 255, .16)),
        url("../img/fondo-login.jpg") center / cover no-repeat;
    color: #1f2937;
}

.login-html {
    background-color: #ae8b61;
}

.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100svh;
    margin: 0;
    padding:
        max(32px, env(safe-area-inset-top))
        max(20px, env(safe-area-inset-right))
        max(32px, env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.login-showcase {
    display: none;
}

.login-shell::after {
    display: none;
}

.login-card {
    align-self: center;
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    margin: 0;
    padding: 46px 44px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 28px;
    background: rgba(255, 255, 255, .50);
    box-shadow: 0 32px 90px rgba(66, 45, 22, .22), inset 0 1px 0 rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(3px) saturate(145%) contrast(105%);
    backdrop-filter: blur(1px) contrast(130%);
}

.login-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.login-card-header .auth-logo {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    margin: 0;
    padding: 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.login-card h2 {
    margin: 0;
    color: var(--kessai-dark);
    font-size: 2rem;
    font-weight: 800;
}

.login-card p {
    margin: 4px 0 0;
    color: #5b6472;
}

.login-alert {
    margin: -8px 0 16px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
    text-align: center;
    font-size: .84rem;
    font-weight: 600;
    line-height: 1.3;
    max-height: 100px;
    overflow: hidden;
    transition: opacity .25s ease, max-height .25s ease, margin .25s ease, padding .25s ease;
}

.login-alert.is-dismissing {
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.login-alert.alert-danger {
    color: #991b1b;
    background: rgba(254, 226, 226, .82);
}

.login-alert.alert-success {
    color: #166534;
    background: rgba(220, 252, 231, .82);
}

.alert-success:not(.login-alert) {
    max-height: 200px;
    overflow: hidden;
    transition: opacity .25s ease, max-height .25s ease, margin .25s ease, padding .25s ease, border-width .25s ease;
}

.alert.is-auto-dismissing {
    overflow: hidden;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    opacity: 0;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-field .form-label {
    margin-bottom: 8px;
    color: #263241;
    font-weight: 700;
}

.login-input {
    position: relative;
}

.login-input i {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    color: var(--kessai-accent-dark);
    transform: translateY(-50%);
}

.login-input .form-control {
    min-height: 62px;
    padding-left: 58px;
    border: 1px solid rgba(255, 255, 255, .64);
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
    font-size: 1.05rem;
}

.login-input .form-control::placeholder {
    color: #8a93a1;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #4b5563;
    font-size: .92rem;
}

.login-options a,
.login-alt a {
    color: #755a2d;
    font-weight: 700;
    text-decoration: none;
}

.login-options a:hover,
.login-alt a:hover {
    color: var(--kessai-dark);
}

.login-submit {
    min-height: 64px;
    margin-top: 10px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937, #4b3a21);
    box-shadow: 0 14px 26px rgba(31, 41, 55, .24);
    font-weight: 800;
}

.login-submit:hover,
.login-submit:focus {
    background: linear-gradient(135deg, #111827, #3f301b);
}

.login-alt {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    font-size: .92rem;
}

.login-alt span {
    height: 1px;
    background: rgba(31, 41, 55, .15);
}

@media (max-width: 1100px) {
    .payment-context-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .app-sidebar {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        height: 76px;
        flex-direction: row;
        align-items: center;
        padding: 10px;
        border-radius: 22px;
    }

    .app-sidebar.is-collapsed {
        width: auto;
        padding: 10px;
    }

    .app-sidebar-top {
        min-height: 0;
        padding: 0;
        border-bottom: 0;
    }

    .app-sidebar-brand {
        min-height: 0;
        padding: 0 10px 0 0;
        border-right: 1px solid rgba(31, 41, 55, .12);
        border-bottom: 0;
    }

    .app-sidebar-toggle {
        display: none;
    }

    .app-sidebar.is-collapsed .app-sidebar-top {
        min-height: 0;
        flex-direction: row;
    }

    .app-sidebar-brand span,
    .app-sidebar-link span {
        display: none;
    }

    .app-sidebar.is-collapsed .app-sidebar-brand span,
    .app-sidebar.is-collapsed .app-sidebar-link span {
        display: none;
    }

    .app-sidebar-nav {
        display: flex;
        flex: 1;
        gap: 4px;
        justify-content: space-around;
        min-width: 0;
        padding: 0 8px;
    }

    .app-sidebar-section {
        display: contents;
    }

    .app-sidebar-section-title {
        display: none;
    }

    .app-sidebar-section-body,
    .app-sidebar-section.is-section-collapsed .app-sidebar-section-body {
        display: contents;
    }

    .app-sidebar-link {
        justify-content: center;
        min-width: 40px;
        min-height: 46px;
        padding: 0 8px;
    }

    .app-sidebar-link i {
        width: auto;
    }

    .app-sidebar-logout {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
    }

    .app-sidebar-button {
        width: 46px;
        height: 46px;
    }

    .app-sidebar + .page-shell {
        margin-left: auto;
        padding-bottom: 110px;
    }

    .sales-section-header,
    .sales-header {
        flex-direction: column;
    }

    .sales-section-header .d-flex {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .payment-context-card {
        grid-template-columns: 1fr;
    }

    .payment-context-meta {
        grid-template-columns: 1fr;
    }

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

    .distribution-detail-header {
        flex-direction: column;
    }

    .login-body {
        background:
            linear-gradient(180deg, rgba(183, 150, 95, .12), rgba(255, 255, 255, .18)),
            url("../img/fondo-login.jpg") center / cover no-repeat;
    }

    .login-shell {
        width: 100%;
        min-height: 100svh;
        margin: 0;
        padding:
            max(20px, env(safe-area-inset-top))
            max(12px, env(safe-area-inset-right))
            max(20px, env(safe-area-inset-bottom))
            max(12px, env(safe-area-inset-left));
        border-radius: 0;
    }

    .login-showcase {
        display: none;
    }

    .login-card {
        width: 100%;
        margin: 0;
        padding: 20px;
    }

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

@media (max-height: 720px) {
    .login-shell {
        padding-top: max(14px, env(safe-area-inset-top));
        padding-bottom: max(14px, env(safe-area-inset-bottom));
    }

    .login-card {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .login-card-header {
        margin-bottom: 18px;
    }

    .login-card-header .auth-logo {
        width: 60px;
        height: 60px;
        padding: 8px;
    }

    .login-form {
        gap: 12px;
    }

    .login-input .form-control,
    .login-submit {
        min-height: 54px;
    }

    .login-submit {
        margin-top: 4px;
    }

    .login-alt {
        margin-top: 16px;
    }
}

/* Mobile-first refinements shared by every authenticated screen. */
@media (max-width: 767.98px) {
    html {
        -webkit-text-size-adjust: 100%;
    }

    body {
        overflow-x: hidden;
    }

    .page-shell,
    .app-sidebar + .page-shell,
    .app-sidebar.is-collapsed + .page-shell {
        margin-right: 0;
        margin-left: 0;
        padding: 20px 12px calc(104px + env(safe-area-inset-bottom));
    }

    .page-shell > .d-flex.justify-content-between.align-items-center.mb-4 {
        align-items: stretch !important;
        flex-direction: column;
        gap: 14px;
        margin-bottom: 20px !important;
    }

    .page-shell > .d-flex.justify-content-between.align-items-center.mb-4 > .btn {
        width: 100%;
        min-height: 46px;
    }

    .panel,
    .sales-section {
        padding: 16px;
        border-radius: 16px;
    }

    .metric {
        min-height: 104px;
        padding: 16px;
        border-radius: 14px;
    }

    .metric strong {
        font-size: 1.35rem;
        overflow-wrap: anywhere;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    .btn:not(.btn-icon) {
        min-height: 44px;
    }

    .alert {
        margin-bottom: 16px;
        padding: 12px 14px;
    }

    .table-responsive,
    .panel > table {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(107, 114, 128, .45) transparent;
    }

    .table-responsive {
        margin-right: -4px;
        padding-bottom: 4px;
    }

    .panel > table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .panel > table > :not(caption) > * > * {
        white-space: nowrap;
    }

    .panel > .fund-people-table,
    .panel > .fund-withdrawals-table,
    .panel > .operations-withdrawals-table {
        display: table;
        width: 100%;
        table-layout: fixed;
        overflow: visible;
    }

    .fund-people-table > :not(caption) > * > *,
    .fund-withdrawals-table > :not(caption) > * > *,
    .operations-withdrawals-table > :not(caption) > * > * {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .fund-people-table td:first-child {
        width: 34%;
    }

    .fund-people-table td:nth-child(2) {
        width: 46%;
    }

    .fund-withdrawals-table th:first-child,
    .fund-withdrawals-table td:first-child,
    .operations-withdrawals-table th:first-child,
    .operations-withdrawals-table td:first-child {
        width: 28%;
    }

    .fund-withdrawals-table th:nth-child(2),
    .fund-withdrawals-table td:nth-child(2),
    .operations-withdrawals-table th:nth-child(2),
    .operations-withdrawals-table td:nth-child(2) {
        width: 47%;
    }

    .fund-withdrawals-table th:last-child,
    .fund-withdrawals-table td:last-child,
    .operations-withdrawals-table th:last-child,
    .operations-withdrawals-table td:last-child {
        width: 25%;
    }

    .payments-table,
    .sales-table {
        min-width: 560px;
    }

    /* Categories only have a name, percentage and one action: keep them usable
       without horizontal scrolling on a phone. */
    .sales-table.categories-table {
        width: 100%;
        min-width: 0;
        table-layout: fixed;
    }

    .categories-table th,
    .categories-table td {
        padding: .5rem .25rem;
    }

    .categories-table th:first-child,
    .categories-table td:first-child {
        width: calc(100% - 116px);
    }

    .categories-table th:nth-child(2),
    .categories-table td:nth-child(2) {
        width: 72px !important;
    }

    .categories-table th:last-child,
    .categories-table td:last-child {
        width: 44px !important;
    }

    .categories-table .form-control,
    .categories-table .form-select {
        min-width: 0;
        padding-right: .5rem;
        padding-left: .5rem;
    }

    .categories-table .btn-icon {
        width: 36px;
        height: 36px;
    }

    .sales-header {
        align-items: flex-start;
        flex-direction: row;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 18px;
    }

    .sales-header > :first-child {
        min-width: 0;
    }

    .sales-close {
        align-self: flex-start;
        margin-left: auto;
    }

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

    .inline-category-controls {
        grid-template-columns: 1fr;
    }

    .payment-context-card {
        padding: 16px;
        border-radius: 16px;
    }

    .payment-context-main {
        align-items: flex-start;
    }

    .payment-context-title {
        overflow-wrap: anywhere;
    }

    .distribution-card,
    .project-detail-summary > div {
        border-radius: 14px;
    }

    .modal-dialog {
        margin: 12px;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 24px);
    }

    .kessai-modal {
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        border-radius: 18px;
    }

    .kessai-modal .modal-header,
    .kessai-modal .modal-footer {
        padding: 16px;
    }

    .kessai-modal .modal-body {
        padding: 16px;
    }

    .modal-footer .btn {
        flex: 1 1 0;
    }

    .app-sidebar {
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom));
        left: 8px;
        height: 68px;
        padding: 7px;
        border-radius: 20px;
    }

    .app-sidebar-top {
        display: none;
    }

    .app-sidebar.is-collapsed {
        width: auto;
        padding: 7px;
    }

    .app-sidebar.is-collapsed .app-sidebar-top {
        display: none;
    }

    .app-sidebar-nav {
        justify-content: flex-start;
        gap: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 4px;
        scrollbar-width: none;
    }

    .app-sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .app-sidebar-link,
    .app-sidebar-button {
        flex: 0 0 44px;
        width: 44px;
        min-width: 44px;
        min-height: 44px;
        height: 44px;
        padding: 0;
    }

    .app-sidebar.is-collapsed .app-sidebar-link {
        flex: 0 0 44px;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        margin: 0;
        padding: 0;
    }

    .app-sidebar.is-collapsed .app-sidebar-section-body,
    .app-sidebar.is-collapsed .app-sidebar-section.is-section-collapsed .app-sidebar-section-body {
        display: contents;
    }

    .app-sidebar-logout {
        flex: 0 0 44px;
    }

    .app-sidebar-button {
        width: 44px;
        height: 44px;
    }

    /* The royalties list becomes a card list, avoiding a six-column scroll on phones. */
    .projects-table,
    .projects-table tbody,
    .projects-table tr,
    .projects-table td {
        display: block;
        width: 100%;
    }

    .projects-table thead {
        display: none;
    }

    .projects-table tbody {
        display: grid;
        gap: 12px;
    }

    .projects-table tr {
        padding: 12px 14px;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(31, 41, 55, .06);
    }

    .projects-table > tbody > tr > td {
        display: grid;
        grid-template-columns: minmax(104px, 42%) minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        padding: 8px 0;
        border: 0;
        text-align: right !important;
        overflow-wrap: anywhere;
    }

    .projects-table > tbody > tr > td::before {
        content: attr(data-label);
        color: #6b7280;
        font-size: .76rem;
        font-weight: 800;
        letter-spacing: .04em;
        text-align: left;
        text-transform: uppercase;
    }

    .projects-table > tbody > tr > td:first-child {
        padding-top: 2px;
        font-size: 1rem;
        font-weight: 700;
    }

    .projects-table .table-actions {
        display: block !important;
        width: 100% !important;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid #eef0f3;
        overflow: visible;
    }

    .projects-table .table-actions::before {
        display: none;
    }

    .projects-table .project-actions {
        display: flex;
        justify-content: flex-end;
        width: 100%;
        gap: 8px;
    }

    .projects-table .project-actions > .btn,
    .projects-table .project-actions > form {
        flex: 0 0 44px;
        margin: 0;
    }

    .projects-table .project-actions .btn-icon {
        width: 44px;
        height: 44px;
    }
}
