:root {
    --mobile-topbar-offset: 5.6rem;
    --bg-main: rgba(248, 250, 252, 0.8);
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --bg-body: #f1f5f9;
    --bg-panel: #ffffff;
    --text-main: #0f172a;
    --text-sub: #475569;
    --brand: #4f46e5;
    --brand-strong: #4338ca;
    --brand-soft: rgba(79, 70, 229, 0.1);
    --accent: #0ea5e9;
    --accent-soft: rgba(14, 165, 233, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --border: rgba(15, 23, 42, 0.08);
    --gloss: rgba(255, 255, 255, 0.9);
    --glass-blur: blur(24px) saturate(150%);
    --shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.1);
    --shadow-soft: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
}

[data-bs-theme="dark"] {
    --bg-main: #000000;
    --bg-body: #0f172a;
    --bg-elevated: #121212;
    --bg-panel: #1e293b;
    --text-main: #f8fafc;
    --text-sub: #a1a1aa;
    --brand: #818cf8;
    --brand-strong: #6366f1;
    --brand-soft: rgba(129, 140, 248, 0.15);
    --accent: #38bdf8;
    --accent-soft: rgba(56, 189, 248, 0.15);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.15);
    --info: #60a5fa;
    --info-soft: rgba(96, 165, 250, 0.15);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, 0.15);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --border: rgba(255, 255, 255, 0.08);
    --gloss: rgba(255, 255, 255, 0.03);
    --glass-blur: blur(24px) saturate(150%);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scrollbar-color: rgba(13, 148, 136, 0.72) rgba(104, 115, 134, 0.14);
    scrollbar-width: thin;
    touch-action: pan-x pan-y;
}

@media (max-width: 767.98px) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-user-drag: none;
        -webkit-touch-callout: none;
    }
    a, img {
        -webkit-user-drag: none;
    }
    /* Keep inputs selectable on mobile */
    input, textarea, [contenteditable="true"] {
        -webkit-user-select: auto;
        user-select: auto;
    }
    /* Disable heavy GPU blur on mobile to fix typing lag in modals */
    :root {
        --glass-blur: none !important;
    }
    .modal-content, .modal-backdrop {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

* {
    scrollbar-color: rgba(13, 148, 136, 0.72) rgba(104, 115, 134, 0.14);
    scrollbar-width: thin;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(104, 115, 134, 0.12);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background:
        linear-gradient(180deg, rgba(13, 148, 136, 0.86), rgba(79, 70, 229, 0.72));
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(180deg, rgba(15, 118, 110, 0.96), rgba(79, 70, 229, 0.86));
    background-clip: padding-box;
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

html[data-bs-theme="dark"],
[data-bs-theme="dark"] * {
    scrollbar-color: rgba(45, 212, 191, 0.72) rgba(226, 232, 240, 0.1);
}

[data-bs-theme="dark"] *::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.08);
}

[data-bs-theme="dark"] *::-webkit-scrollbar-thumb {
    background:
        linear-gradient(180deg, rgba(45, 212, 191, 0.82), rgba(167, 139, 250, 0.68));
    background-clip: padding-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', sans-serif;
    background: 
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.05), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(14, 165, 233, 0.05), transparent 40%),
        var(--bg-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    animation: pageFadeIn 0.4s ease-out;
}

html[data-bs-theme="dark"] body {
    background: 
        radial-gradient(circle at 10% 20%, rgba(129, 140, 248, 0.06), transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.04), transparent 40%),
        #000000;
}

@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Omnibar Styles */
#omnibarModal {
    backdrop-filter: blur(8px);
    background-color: rgba(0, 0, 0, 0.2);
}
#omnibarModal .modal-dialog {
    margin-top: 15vh;
}
#omnibarModal .modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}
[data-bs-theme="dark"] #omnibarModal .modal-content {
    background: rgba(30, 41, 59, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
#omnibarInput {
    border: none;
    background-color: transparent !important;
    font-size: 1.25rem;
    box-shadow: none !important;
    padding: 1.5rem 1.2rem;
    color: var(--text-main);
}
#omnibarInput::placeholder {
    color: #94a3b8;
    font-weight: 400;
}
#omnibarResults {
    max-height: 400px;
    overflow-y: auto;
    padding-bottom: 0.5rem;
}
#omnibarResults .list-group-item {
    background: transparent;
    border: none;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0.2rem 0.5rem;
    display: flex;
    flex-direction: column;
}
#omnibarResults .list-group-item:hover {
    background: rgba(0, 0, 0, 0.04);
    transform: translateX(4px);
}
[data-bs-theme="dark"] #omnibarResults .list-group-item:hover {
    background: rgba(255, 255, 255, 0.05);
}


img,
svg,
canvas,
video {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
.brand-title {
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0;
}

.agreement-page,
.agreement-panel,
.agreement-terms {
    font-family: 'Inter', sans-serif;
}

.agreement-terms {
    line-height: 1.75;
}

.agreement-terms h2,
.agreement-terms h3,
.agreement-terms h4,
.agreement-terms strong,
.agreement-terms .form-label,
.agreement-terms .badge {
    font-family: 'Outfit', sans-serif;
}

.agreement-terms p,
.agreement-terms li,
.agreement-terms .small,
.agreement-terms .form-text {
    font-family: 'Outfit', serif;
}

.agreement-payment-gate {
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(248, 250, 252, 0.58));
}

[data-bs-theme="dark"] .agreement-payment-gate {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.82), rgba(15, 23, 42, 0.64));
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-strong);
}

.text-muted,
.small,
small {
    color: var(--text-sub) !important;
}

.app-shell {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
    min-height: 100vh;
}

.app-shell.guest-shell {
    grid-template-columns: 1fr;
}

.sidebar {
    background:
        linear-gradient(180deg, rgb(17, 24, 39), rgb(26, 33, 52)),
        linear-gradient(135deg, rgba(45, 212, 191, 0.12), rgba(167, 139, 250, 0.08));
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    padding: 1.1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 24px 0 70px rgba(24, 32, 51, 0.2);
    backdrop-filter: var(--glass-blur);
}

.sidebar-backdrop {
    display: none;
}

.brand-block {
    margin-bottom: 1.1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-title {
    margin-bottom: 0.15rem;
}

.brand-sub {
    margin: 0;
    opacity: 0.78;
    font-size: 0.84rem;
}

.side-nav {
    display: grid;
    gap: 0.25rem;
}

.side-link {
    color: rgba(239, 246, 255, 0.82);
    text-decoration: none;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.side-link:hover,
.side-link.active {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
        linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(167, 139, 250, 0.12));
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateX(2px);
}

.content-area {
    position: relative;
    padding: 1.5rem 2rem;
    min-width: 0;
}

.page-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4), transparent);
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

[data-bs-theme="dark"] .page-header {
    background: linear-gradient(135deg, rgba(31, 41, 59, 0.3), transparent);
}

.page-title {
    background: linear-gradient(90deg, var(--brand-strong), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.topbar {
    position: sticky;
    top: 1rem;
    z-index: 1020;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.40)),
        var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-radius: 20px;
    padding: 0.85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .topbar {
    background:
        linear-gradient(180deg, rgba(31, 41, 59, 0.85), rgba(15, 23, 42, 0.70)),
        var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-right {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 0.65rem !important;
    min-width: 0;
    margin-left: auto;
}

.workspace-switcher {
    min-width: 0;
}

.profile-menu,
.notification-menu {
    position: relative;
    z-index: 90;
}

.notification-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: none;
}

.notification-trigger:hover:not(:disabled),
.notification-trigger:focus-visible:not(:disabled),
.notification-trigger[aria-expanded="true"] {
    background: rgba(15, 118, 110, 0.16);
    color: var(--brand-strong);
    box-shadow: var(--shadow-soft);
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -2px;
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.3rem;
    border: 2px solid var(--bg-panel);
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
}

.qr-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: none;
}

.qr-icon-button:hover:not(:disabled),
.qr-icon-button:focus-visible:not(:disabled) {
    background: rgba(16, 185, 129, 0.16);
    color: var(--brand-strong);
    box-shadow: var(--shadow-soft);
}

.calculator-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: var(--brand-soft);
    color: var(--brand);
    box-shadow: none;
}

.calculator-icon-button:hover:not(:disabled),
.calculator-icon-button:focus-visible:not(:disabled) {
    background: rgba(20, 184, 166, 0.16);
    color: var(--brand);
    box-shadow: var(--shadow-soft);
}

.qr-icon-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(15, 118, 110, 0.28);
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
    background: rgba(15, 118, 110, 0.16);
    color: var(--brand-strong);
    box-shadow: var(--shadow-soft);
}

.profile-avatar {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 50%;
    background: currentColor;
    color: var(--bg-elevated);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 0;
}

.profile-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-trigger .profile-avatar {
    background: transparent;
    color: currentColor;
}

.profile-avatar-lg {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: var(--brand);
    color: #ffffff;
}

.profile-panel,
.notification-panel {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    z-index: 100;
    display: grid;
    gap: 0.85rem;
    width: min(330px, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

[data-bs-theme="dark"] .profile-panel,
[data-bs-theme="dark"] .notification-panel {
    background: #111827;
}

.profile-panel.show,
.notification-panel.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.notification-panel {
    width: min(420px, calc(100vw - 2rem));
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.notification-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.notification-panel-head div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.notification-panel-head strong {
    color: var(--text);
}

.notification-panel-head span,
.notification-empty span,
.notification-text,
.notification-title-row small {
    color: var(--muted);
}

.notification-panel-head a {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.notification-list {
    display: grid;
    max-height: 430px;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.notification-item:last-child {
    border-bottom: 0;
}

.notification-item:hover,
.notification-item:focus-visible {
    background: rgba(20, 184, 166, 0.08);
}

.notification-dot {
    width: 10px;
    height: 10px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: var(--brand);
}

.notification-item-warning .notification-dot {
    background: #f59e0b;
}

.notification-item-danger .notification-dot {
    background: #dc2626;
}

.notification-item-success .notification-dot {
    background: #16a34a;
}

.notification-item-info .notification-dot {
    background: #0ea5e9;
}

.notification-body {
    display: grid;
    gap: 0.18rem;
    min-width: 0;
}

.notification-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.notification-title-row strong,
.notification-person,
.notification-text,
.notification-money {
    overflow-wrap: anywhere;
}

.notification-person {
    font-weight: 700;
}

.notification-text {
    font-size: 0.84rem;
}

.notification-money {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
}

.notification-actions a,
.notification-actions button {
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--brand);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}

.notification-actions button:hover,
.notification-actions a:hover {
    color: var(--brand-strong);
    text-decoration: underline;
}

.notification-empty {
    display: grid;
    gap: 0.25rem;
    padding: 1rem;
}

.profile-panel-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.profile-panel-head div {
    display: grid;
    min-width: 0;
}

.profile-panel-head strong,
.profile-panel-head a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-panel-head a {
    font-size: 0.82rem;
    text-decoration: none;
}

.profile-control {
    width: 100%;
}

.profile-control .workspace-select {
    flex: 1 1 auto;
    width: auto;
}

.due-action-menu {
    display: inline-flex;
    justify-content: flex-end;
}

.due-action-toggle {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
}

.due-action-dropdown {
    min-width: 190px;
    max-height: min(420px, calc(100vh - 7rem));
    overflow-y: auto;
}

.due-action-dropdown form {
    margin: 0;
}

.due-action-list {
    display: grid;
    gap: 0.65rem;
}

.due-action-list .btn {
    width: 100%;
    text-align: left;
}

.due-management-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

.due-summary-card {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 1.25rem 1.1rem;
    border: 1px solid var(--border);
    border-top: 4px solid var(--brand);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), transparent);
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.due-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), transparent);
}

[data-bs-theme="dark"] .due-summary-card {
    background: linear-gradient(135deg, rgba(31, 41, 59, 0.4), transparent);
}

[data-bs-theme="dark"] .due-summary-card:hover {
    background: linear-gradient(135deg, rgba(31, 41, 59, 0.6), transparent);
}

.due-summary-primary {
    border-top-color: var(--info);
}

.due-summary-danger {
    border-top-color: var(--danger);
}

.due-summary-card span {
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.due-summary-card strong {
    color: var(--text-main);
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.due-summary-card small {
    overflow-wrap: anywhere;
}

.due-outstanding-amount {
    color: var(--danger);
}

.due-date-cell {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.due-analytics-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.due-analytics-summary > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

[data-bs-theme="dark"] .due-analytics-summary > div {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.due-analytics-summary span {
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.due-analytics-summary strong {
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.dues-table-responsive {
    overflow-x: auto;
    overflow-y: visible;
}

.page-content {
    margin-top: 1rem;
}

.page-content > .d-flex.justify-content-between {
    min-width: 0;
    gap: 0.75rem;
}

.page-content > .d-flex.justify-content-between > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    min-width: 0;
}

.hero-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    background:
        linear-gradient(180deg, var(--gloss), rgba(255, 255, 255, 0.38)),
        linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(79, 70, 229, 0.06)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
    animation: enterUp 0.5s ease;
    backdrop-filter: var(--glass-blur);
}

[data-bs-theme="dark"] .hero-panel {
    background: var(--bg-panel);
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dashboard-hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.75rem;
    min-width: min(360px, 100%);
}

.dashboard-hero-stats > div {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.62);
}

[data-bs-theme="dark"] .dashboard-hero-stats > div {
    background: rgba(15, 23, 42, 0.46);
}

.dashboard-hero-stats span {
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-hero-stats strong {
    color: var(--text-main);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.import-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.balance-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-icon-button {
    width: 42px;
    height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    gap: 4px;
    border-color: transparent;
    background: transparent;
    color: var(--text-main);
    box-shadow: none;
    -webkit-tap-highlight-color: transparent;
}

.menu-icon-button:hover,
.menu-icon-button:focus,
.menu-icon-button:active,
.menu-icon-button.show,
.menu-icon-button:first-child:active {
    border-color: transparent;
    background: transparent;
    color: var(--text-main);
    box-shadow: none;
    transform: none;
}

.menu-icon-button:focus-visible {
    box-shadow: 0 0 0 0.18rem var(--brand-soft);
}

.menu-icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.metric-balance-toggle {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
}

.metric-balance-toggle:hover {
    transform: translateY(-1px);
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: 0.65rem;
}

.quick-action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.75rem 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.quick-action:hover {
    transform: translateY(-1px);
}

.dashboard-chart-grid .card {
    min-height: 330px;
}

.chart-card {
    overflow: hidden;
}

.chart-card-header {
    min-height: 66px;
}

.chart-card-header > div {
    display: grid;
    gap: 0.1rem;
}

.chart-card-header small {
    color: var(--text-sub);
    font-size: 0.78rem;
    font-weight: 600;
}

.activity-summary-grid {
    display: grid;
    gap: 0.65rem;
}

.activity-summary-item {
    display: grid;
    gap: 0.1rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--activity-color, var(--brand));
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

[data-bs-theme="dark"] .activity-summary-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.activity-summary-item span {
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.activity-summary-item strong {
    color: var(--text-main);
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.activity-summary-item small {
    color: var(--text-sub);
}

.activity-income {
    --activity-color: var(--success);
}

.activity-expense {
    --activity-color: var(--danger);
}

.activity-transfer {
    --activity-color: var(--info);
}

.chart-card-body {
    position: relative;
    min-height: 260px;
    padding: 1.1rem 1.2rem 1.25rem;
}

.chart-card-body canvas {
    /* removed forced dimensions to fix oval stretched charts */
}

#balanceDistributionChart {
    /* removed forced height */
}

.chart-empty {
    display: grid;
    min-height: 220px;
    place-items: center;
    text-align: center;
}

.money-value.is-hidden {
    letter-spacing: 0.04em;
}

.card,
.glass-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, var(--gloss), rgba(255, 255, 255, 0.32)),
        linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(79, 70, 229, 0.04)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
    min-width: 0;
    backdrop-filter: var(--glass-blur);
}

.card-header {
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1));
}

[data-bs-theme="dark"] .hero-panel,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .glass-panel {
    background:
        linear-gradient(180deg, var(--gloss), rgba(255, 255, 255, 0.04)),
        linear-gradient(135deg, rgba(45, 212, 191, 0.07), rgba(167, 139, 250, 0.07)),
        var(--bg-panel);
}

[data-bs-theme="dark"] .card-header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
}

.widget-card {
    animation: enterUp 0.35s ease;
}

.metric-card {
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 42%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent);
    pointer-events: none;
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--metric-color, var(--brand));
}

.metric-card .card-body {
    padding-left: 1.15rem;
}

.metric-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.metric-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-value {
    color: var(--text-main);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.metric-positive {
    --metric-color: var(--brand);
    --metric-accent: var(--success);
    background: var(--bg-panel);
}

.metric-warning {
    --metric-color: var(--warning);
    --metric-accent: var(--accent);
    background: var(--bg-panel);
}

.metric-danger {
    --metric-color: var(--danger);
    --metric-accent: var(--warning);
    background: var(--bg-panel);
}

.metric-info {
    --metric-color: var(--info);
    --metric-accent: var(--brand);
    background: var(--bg-panel);
}

.workspace-select {
    width: min(220px, 100%);
    min-width: 0;
}

.landing-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(13, 148, 136, 0.13), transparent 30%),
        #f4f0ea;
}

.landing-page {
    min-height: 100vh;
    overflow: hidden;
}

.landing-hero-stage {
    position: relative;
    display: grid;
    align-items: center;
    min-height: min(760px, 86vh);
    padding: clamp(2rem, 6vw, 6rem);
    color: #ffffff;
    background:
        radial-gradient(circle at 20% 20%, rgba(45, 212, 191, 0.2), transparent 30%),
        radial-gradient(circle at 82% 30%, rgba(167, 139, 250, 0.2), transparent 32%),
        linear-gradient(135deg, #111827, #182033 48%, #211f35);
}

.landing-hero-stage::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.landing-preview {
    position: absolute;
    inset: 3rem clamp(1rem, 4vw, 4rem) 2rem auto;
    width: min(760px, 58vw);
    opacity: 0.44;
    pointer-events: none;
}

.preview-shell {
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: 430px;
    border: 1px solid rgba(226, 232, 240, 0.24);
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
    overflow: hidden;
}

.preview-side {
    display: grid;
    align-content: start;
    gap: 0.9rem;
    padding: 1.25rem;
    border-right: 1px solid rgba(226, 232, 240, 0.12);
    background: #0b1220;
}

.preview-side span {
    margin-bottom: 0.5rem;
    color: #eff6ff;
    font-weight: 800;
}

.preview-side i,
.preview-top span,
.preview-top strong,
.preview-metrics i,
.preview-list i {
    display: block;
    border-radius: 8px;
    background: rgba(226, 232, 240, 0.16);
}

.preview-side i {
    height: 28px;
}

.preview-main {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
}

.preview-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.preview-top span {
    width: 180px;
    height: 38px;
}

.preview-top strong {
    width: 86px;
    height: 38px;
}

.preview-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.preview-metrics i {
    height: 88px;
    border-left: 4px solid var(--brand);
}

.preview-board {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1rem;
}

.preview-chart,
.preview-list {
    min-height: 220px;
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.14);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.84);
}

.preview-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
}

.preview-chart b {
    display: block;
    flex: 1;
    border-radius: 8px 8px 0 0;
    background: var(--brand);
}

.preview-chart b:nth-child(1) {
    height: 72%;
}

.preview-chart b:nth-child(2) {
    height: 46%;
    background: var(--accent);
}

.preview-chart b:nth-child(3) {
    height: 86%;
    background: #34d399;
}

.preview-chart b:nth-child(4) {
    height: 58%;
    background: #22c55e;
}

.preview-list {
    display: grid;
    align-content: start;
    gap: 0.8rem;
}

.preview-list i {
    height: 34px;
}

.landing-hero-copy {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
}

.landing-hero-copy h1 {
    margin: 0;
    font-size: clamp(3.5rem, 9vw, 7.5rem);
    font-weight: 800;
    line-height: 0.95;
}

.landing-hero-copy p:not(.hero-kicker) {
    width: min(560px, 100%);
    margin: 1.1rem 0 1.6rem;
    color: rgba(239, 246, 255, 0.84);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-kicker {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 800;
}

.landing-hero-stage .hero-kicker {
    color: #99f6e4;
}

.landing-section {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 2.2rem 0 4rem;
}

.landing-section-head {
    display: grid;
    gap: 0.2rem;
    margin-bottom: 1rem;
}

.landing-section-head h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
}

.landing-feature-grid article {
    display: grid;
    gap: 0.45rem;
    min-height: 150px;
    padding: 1rem;
    border: 1px solid rgba(16, 24, 40, 0.1);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.landing-feature-grid strong {
    color: #172033;
    font-size: 1rem;
}

.landing-feature-grid span {
    color: #667085;
}

.feature-tile .glass-panel {
    border-top: 3px solid var(--brand);
}

.feature-tile:nth-child(2) .glass-panel {
    border-top-color: var(--accent);
}

.feature-tile:nth-child(3) .glass-panel {
    border-top-color: var(--info);
}

.auth-wrap {
    min-height: 80vh;
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(460px, 95%);
}

.table-responsive {
    max-width: 100%;
}

.table-filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
    align-items: end;
}

.btn {
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary,
.btn-success {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.15), transparent),
        linear-gradient(135deg, var(--brand), var(--accent));
    border-color: transparent;
    color: #fffdf8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 20px -5px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent),
        linear-gradient(135deg, var(--brand-strong), var(--accent));
    color: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.4);
}

.btn-outline-primary {
    border-color: rgba(13, 148, 136, 0.4);
    color: var(--brand);
    background: rgba(255, 255, 255, 0.28);
}

.btn-outline-primary:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.btn-outline-light {
    border-color: rgba(15, 118, 110, 0.38);
    color: var(--brand);
}

.btn-outline-light:hover {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.btn-outline-danger {
    border-color: rgba(194, 65, 75, 0.42);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.calculator-card,
.calculator-history-card {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--gloss), var(--bg-panel));
    box-shadow: var(--shadow-soft);
}

.calculator-window-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

#calculatorModal .modal-header {
    flex-wrap: wrap;
}

.calculator-display {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.calculator-mini-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.calculator-mini-action {
    width: 100%;
}

.calculator-keypad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.calculator-key {
    min-height: 52px;
    border-radius: 14px;
    font-weight: 800;
}

.calculator-key-wide {
    grid-column: span 2;
}

.calculator-result {
    min-height: 52px;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--bg-elevated);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.calculator-desktop-mode .calculator-mini-row,
.calculator-desktop-mode .calculator-keypad,
.calculator-desktop-mode .calculator-submit-row {
    display: none !important;
}

.calculator-desktop-mode .calculator-card,
.calculator-desktop-mode .calculator-history-card {
    min-height: auto;
}

.calculator-desktop-mode .calculator-card .card-body {
    display: grid;
    align-content: start;
}

.calculator-phone-mode .calculator-display {
    caret-color: transparent;
    cursor: default;
}

.calculator-history-list {
    display: grid;
    gap: 0.65rem;
    max-height: 540px;
    overflow: auto;
}

.calculator-history-empty {
    display: grid;
    place-items: center;
    min-height: 240px;
    padding: 1rem;
    border: 1px dashed var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.48));
    color: var(--text-sub);
    text-align: center;
}

.calculator-history-item {
    display: grid;
    gap: 0.3rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    color: inherit;
}

[data-bs-theme="dark"] .calculator-history-item,
[data-bs-theme="dark"] .calculator-history-empty {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.calculator-history-item strong {
    color: var(--text-main);
    font-size: 1rem;
    overflow-wrap: anywhere;
}

.calculator-history-item small {
    color: var(--text-sub);
}

.form-control,
.form-select,
.input-group-text {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 14px;
    backdrop-filter: var(--glass-blur);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.48);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
    background: var(--bg-elevated);
    color: var(--text-main);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(37, 99, 235, 0.02);
    --bs-table-striped-color: var(--text-main);
    --bs-table-hover-bg: var(--brand-soft);
    --bs-table-hover-color: var(--text-main);
    border-collapse: separate;
    border-spacing: 0 0.4rem;
}

.table td,
.table th {
    white-space: nowrap;
    vertical-align: middle;
    border: none !important;
}

.table thead th {
    color: var(--text-sub);
    background: transparent !important;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 0.2rem;
}

.table tbody tr {
    background: linear-gradient(180deg, var(--gloss), rgba(255, 255, 255, 0.4));
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
    border-radius: 8px;
    transition: all 0.2s ease;
}

[data-bs-theme="dark"] .table tbody tr {
    background: linear-gradient(180deg, rgba(31, 41, 59, 0.4), rgba(15, 23, 42, 0.2));
}

.table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.08);
}

.table td:first-child,
.table th:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table td:last-child,
.table th:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.modal-content,
.dropdown-menu,
.list-group-item,
.offcanvas {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text-main);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
}

.modal-backdrop {
    z-index: 1040;
}

.modal {
    z-index: 1060;
}

.modal.fade .modal-dialog {
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    will-change: transform;
    transform: translate3d(0, -20px, 0);
}

.modal.show .modal-dialog {
    transform: translate3d(0, 0, 0);
}

.modal-dialog {
    position: relative;
    z-index: 1061;
}

.modal-content {
    pointer-events: auto;
}

.alert {
    border-radius: 8px;
    border: 1px solid var(--border);
}

.alert-success {
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.alert-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.toast-stack {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: grid;
    gap: 0.65rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-panel);
    color: var(--text-main);
    box-shadow: var(--shadow);
    backdrop-filter: var(--glass-blur);
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast-success {
    border-color: rgba(15, 118, 110, 0.28);
    background: var(--brand-soft);
    color: var(--brand-strong);
}

.app-toast-danger {
    border-color: rgba(194, 65, 75, 0.28);
    background: var(--danger-soft);
    color: var(--danger);
}

.offline-queue-status {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1081;
    max-width: min(300px, calc(100vw - 2rem));
    border: 1px solid rgba(15, 118, 110, 0.26);
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    box-shadow: var(--shadow);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pagination .page-link {
    background: var(--bg-panel);
    border-color: var(--border);
    color: var(--text-main);
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0.35rem 0.55rem;
}

.dataTables_wrapper {
    width: 100%;
    overflow-x: auto;
}

.dataTables_wrapper .row {
    row-gap: 0.75rem;
}

.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    max-width: 100%;
}

.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
    max-width: 100%;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
}

.settings-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    min-height: 54px;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), var(--bg-panel));
    color: var(--text-main);
    text-decoration: none;
    min-width: 0;
}

.settings-link span,
.settings-link small,
.mini-row span,
.category-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.settings-link:hover {
    border-color: rgba(37, 99, 235, 0.38);
    color: var(--brand-strong);
    transform: translateY(-1px);
}

.settings-link span {
    font-weight: 700;
}

.settings-link small {
    color: var(--text-sub);
}

.settings-category-box {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.workspace-list {
    display: grid;
    gap: 0.65rem;
}

.workspace-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.workspace-list-item > div {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.workspace-list-item strong,
.workspace-list-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.workspace-list-item strong {
    color: var(--text-main);
}

.workspace-list-item span:not(.badge) {
    color: var(--text-sub);
    font-size: 0.84rem;
}

[data-bs-theme="dark"] .settings-category-box {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(16, 29, 49, 0.52));
}

[data-bs-theme="dark"] .settings-link,
[data-bs-theme="dark"] .activity-summary-item,
[data-bs-theme="dark"] .workspace-list-item,
[data-bs-theme="dark"] .import-dropzone,
[data-bs-theme="dark"] .import-steps div,
[data-bs-theme="dark"] .record-detail-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.import-dropzone {
    display: grid;
    gap: 0.35rem;
    min-height: 132px;
    place-content: center;
    text-align: center;
    padding: 1.25rem;
    border: 1px dashed rgba(31, 111, 235, 0.42);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.import-dropzone span {
    color: var(--text-sub);
}

.import-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.import-steps div {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.import-steps strong {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: #ffffff;
    font-size: 0.85rem;
}

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 220px;
}

.compact-empty {
    min-height: 150px;
}

.record-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 0.75rem;
}

.record-detail-item {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

[data-bs-theme="dark"] .record-detail-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.record-detail-item strong {
    color: var(--text-sub);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.record-detail-item span,
.record-detail-item pre {
    margin: 0;
    color: var(--text-main);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.record-detail-item pre {
    max-height: 220px;
    overflow: auto;
    font-size: 0.82rem;
}

.monthly-khata-header {
    gap: 0.75rem;
}

.monthly-khata-header > div:first-child {
    min-width: 0;
}

.khata-header-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 0.65rem;
    min-width: 0;
}

.khata-average-pill {
    display: grid;
    min-width: 150px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.khata-average-pill span {
    color: var(--text-sub);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.khata-average-pill strong {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.15;
}

.khata-average-pill small {
    color: var(--text-sub);
    font-size: 0.72rem;
}

.khata-simple-summary {
    display: grid;
    grid-template-columns: minmax(160px, 1.3fr) repeat(2, minmax(100px, 0.7fr)) auto;
    gap: 0.75rem;
    align-items: stretch;
}

.khata-simple-summary > div,
.khata-total-button {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
    color: var(--text-main);
    text-align: left;
}

.khata-total-button {
    appearance: none;
    -webkit-appearance: none;
}

.khata-simple-summary span {
    color: var(--text-sub);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.khata-simple-summary strong {
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.khata-simple-summary small {
    color: var(--text-sub);
    font-size: 0.72rem;
}

.khata-simple-actions {
    align-content: center;
}

.khata-total-amount {
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.8rem, 7vw, 3rem);
    font-weight: 800;
    line-height: 1;
}

.khata-breakdown {
    display: grid;
    gap: 0.2rem;
}

[data-bs-theme="dark"] .khata-simple-summary > div,
[data-bs-theme="dark"] .khata-total-button,
[data-bs-theme="dark"] .khata-average-pill {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.khata-record-list {
    display: none;
}

.khata-record-item {
    display: grid;
    gap: 0.55rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
}

.khata-record-main {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.khata-record-main > div {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.khata-record-main strong,
.khata-record-item p {
    overflow-wrap: anywhere;
}

.khata-record-main span,
.khata-record-item p {
    color: var(--text-sub);
    font-size: 0.84rem;
}

.khata-record-item p {
    margin: 0;
}

.khata-record-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.khata-record-actions .btn,
.khata-record-actions form {
    width: 100%;
}

[data-bs-theme="dark"] .khata-record-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.upi-qr-preview {
    width: 112px;
    height: 112px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.35rem;
}

.agreement-page {
    display: grid;
    place-items: start center;
    min-height: calc(100vh - 7rem);
    padding: 1rem 0;
}

.agreement-panel {
    width: min(920px, 100%);
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
    padding: clamp(1.2rem, 3vw, 2.4rem);
    color: #111827;
}

[data-bs-theme="dark"] .agreement-panel {
    background: #f8fafc;
    color: #111827;
}

.agreement-terms {
    border: 1px solid #94a3b8;
    border-radius: 2px;
    background: #fff;
    padding: clamp(1rem, 2.2vw, 1.4rem);
    color: #111827;
    font-size: 0.98rem;
    text-align: justify;
    text-justify: inter-word;
}

.agreement-terms p:last-child {
    margin-bottom: 0;
}

.agreement-terms p {
    margin-bottom: 1rem;
}

.agreement-panel .record-detail-item {
    border-radius: 2px;
    background: #f8fafc;
}

.agreement-panel h1,
.agreement-panel h2,
.agreement-panel h3 {
    color: #0f172a;
}

.agreement-panel,
.agreement-panel .card,
.agreement-panel .modal-content {
    --text-main: #111827;
    --text-sub: #64748b;
    --bg-elevated: #ffffff;
    --bg-panel: #ffffff;
    color: #111827;
}

.agreement-panel .text-muted,
.agreement-panel .small,
.agreement-panel small,
.agreement-panel .form-text,
.agreement-terms .text-muted,
.agreement-terms .small,
.agreement-terms small {
    color: #64748b !important;
}

.agreement-panel .record-detail-item strong {
    color: #64748b;
}

.agreement-panel .record-detail-item span,
.agreement-panel .record-detail-item pre,
.agreement-panel .record-detail-item div,
.agreement-panel .card-body,
.agreement-panel .form-label,
.agreement-panel .form-check-label {
    color: #111827;
}

.agreement-panel .bg-light,
.agreement-panel .bg-white {
    background-color: #ffffff !important;
    color: #111827 !important;
}

.agreement-identity-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
}

.agreement-acceptance {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: rgba(15, 118, 110, 0.16);
}

.agreement-acceptance-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.agreement-acceptance-text {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1 1 auto;
    color: #111827;
    line-height: 1.45;
    cursor: pointer;
}

.agreement-acceptance-text::before {
    content: "";
    display: inline-grid;
    place-items: center;
    flex: 0 0 1.4rem;
    width: 1.4rem;
    height: 1.4rem;
    margin-top: 0.05rem;
    border: 2px solid #64748b;
    border-radius: 6px;
    background: #ffffff;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}

.agreement-acceptance-input:checked + .agreement-acceptance-text::before {
    content: "\2713";
    border-color: #0f766e;
    background: #0f766e;
}

.agreement-acceptance-input:focus-visible + .agreement-acceptance-text::before {
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.18);
}

.category-row,
.mini-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

.account-balance-row,
.recent-activity-row {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: 8px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.58));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

[data-bs-theme="dark"] .account-balance-row,
[data-bs-theme="dark"] .recent-activity-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

.recent-income {
    border-left-color: var(--success);
}

.recent-expense {
    border-left-color: var(--danger);
}

.recent-transfer {
    border-left-color: var(--info);
}

.category-row:last-child,
.mini-row:last-child {
    border-bottom: 0;
}

.mini-row span {
    display: grid;
    gap: 0.1rem;
}

.mini-row small {
    font-size: 0.78rem;
}

.category-dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.4rem;
    vertical-align: middle;
}

.finance-progress {
    height: 0.55rem;
    background: rgba(31, 111, 235, 0.1);
    border-radius: 99px;
}

.finance-progress .progress-bar {
    background: var(--brand);
    border-radius: 99px;
}

.cheque-tool {
    max-width: 1240px;
}

.cheque-control-card {
    position: sticky;
    top: 1rem;
}

.cheque-preview-wrap {
    overflow: auto;
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.44));
    box-shadow: var(--shadow-soft);
}

.cheque-sheet {
    position: relative;
    width: 202mm;
    height: 92mm;
    min-width: 202mm;
    overflow: hidden;
    border: 1px solid rgba(13, 148, 136, 0.28);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(13, 148, 136, 0.08), transparent 30%),
        linear-gradient(180deg, #fbfffc, #eef8f4);
    color: #111827;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
}

.cheque-sheet.has-template-image {
    background: #ffffff;
}

.cheque-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.cheque-sheet.has-template-image .cheque-bg {
    display: none;
}

.cheque-sample-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    pointer-events: none;
    z-index: 1;
}

.cheque-bg,
.cheque-layer {
    z-index: 2;
}

.cheque-bank-name {
    position: absolute;
    left: 11mm;
    top: 7mm;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    color: rgba(15, 118, 110, 0.85);
}

.cheque-bg::before,
.cheque-bg::after {
    content: '';
    position: absolute;
    border: 1px solid rgba(15, 118, 110, 0.16);
    border-radius: 999px;
}

.cheque-bg::before {
    width: 90mm;
    height: 90mm;
    right: -25mm;
    top: -28mm;
}

.cheque-bg::after {
    width: 74mm;
    height: 74mm;
    left: -30mm;
    bottom: -34mm;
}

.cheque-micro-row {
    position: absolute;
    left: 12mm;
    right: 12mm;
    bottom: 8mm;
    height: 8mm;
    border-top: 1px solid rgba(15, 23, 42, 0.35);
    border-bottom: 1px solid rgba(15, 23, 42, 0.16);
}

.cheque-layer {
    position: absolute;
    inset: 0;
    font-family: 'Inter', Arial, sans-serif;
    z-index: 3;
}

.cheque-field {
    position: absolute;
    min-height: 6mm;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: move;
    user-select: none;
    touch-action: none;
    transform-origin: left center;
}

.cheque-field-active {
    outline: 1px dashed rgba(13, 148, 136, 0.78);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.notes-page {
    display: grid;
    gap: 1rem;
}

.notes-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
}

.notes-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.notes-list-panel,
.note-editor-panel,
.note-actions-panel,
.shared-note-wrap {
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(180deg, var(--gloss), rgba(248, 250, 252, 0.48)),
        var(--bg-panel);
    box-shadow: var(--shadow-soft);
    backdrop-filter: var(--glass-blur);
}

[data-bs-theme="dark"] .notes-list-panel,
[data-bs-theme="dark"] .note-editor-panel,
[data-bs-theme="dark"] .note-actions-panel,
[data-bs-theme="dark"] .shared-note-wrap {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5)),
        var(--bg-panel);
}

.notes-list-panel {
    position: sticky;
    top: 1rem;
    overflow: hidden;
}

.notes-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notes-list-head span {
    display: inline-grid;
    place-items: center;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 800;
    font-size: 0.78rem;
}

.notes-list {
    display: grid;
    max-height: calc(100vh - 13rem);
    overflow-y: auto;
}

.notes-empty {
    padding: 1rem;
    color: var(--text-sub);
}

.note-list-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
}

.note-list-item:last-child {
    border-bottom: 0;
}

.note-list-item:hover,
.note-list-item.active {
    background: rgba(20, 184, 166, 0.09);
    color: inherit;
}

.note-list-item strong,
.note-list-item span,
.note-list-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-list-item span {
    color: var(--text-sub);
    font-size: 0.86rem;
}

.note-list-item small {
    color: var(--text-sub);
    font-size: 0.74rem;
}

.note-editor-panel {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    min-width: 0;
}

.note-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.note-title-input {
    min-height: 44px;
    font-weight: 800;
}

.note-actions-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.75rem;
    box-shadow: none;
}

.note-actions-panel form {
    margin: 0;
}

.note-editor-panel .tox-tinymce {
    border-color: var(--border);
    border-radius: 8px;
}

.shared-note-page .app-shell {
    grid-template-columns: 1fr;
}

.shared-note-page .content-area {
    width: min(980px, 100%);
    margin: 0 auto;
}

.shared-note-wrap {
    display: grid;
    gap: 1rem;
    padding: clamp(1rem, 3vw, 2rem);
}

.shared-note-head {
    display: grid;
    gap: 0.35rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.shared-note-head a {
    width: fit-content;
    text-decoration: none;
    font-weight: 800;
}

.shared-note-head h1 {
    margin: 0;
    overflow-wrap: anywhere;
}

.shared-note-content {
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.shared-note-content table {
    width: 100%;
    border-collapse: collapse;
}

.shared-note-content th,
.shared-note-content td {
    padding: 0.55rem;
    border: 1px solid var(--border);
}

.shared-note-content blockquote {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-left: 4px solid var(--brand);
    background: var(--brand-soft);
}

.cheque-date {
    font-family: 'Outfit', monospace;
    letter-spacing: 0.18em;
}

.cheque-payee {
    width: 112mm;
}

.cheque-words {
    width: 128mm;
    white-space: nowrap;
    line-height: 1.45;
}

.cheque-amount {
    width: 42mm;
    text-align: left;
}

.cheque-acpayee {
    padding: 0.8mm 3.2mm;
    border-top: 1px solid #111827;
    border-bottom: 1px solid #111827;
    transform: rotate(-24deg);
    font-size: 10px;
    letter-spacing: 0.08em;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select,
[data-bs-theme="dark"] .pagination .page-link {
    background: rgba(23, 32, 43, 0.76);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .form-control::placeholder {
    color: #94a3b8;
}

[data-bs-theme="dark"] .agreement-panel .form-control,
[data-bs-theme="dark"] .agreement-panel .form-select,
[data-bs-theme="dark"] .agreement-panel .input-group-text,
[data-bs-theme="dark"] .agreement-panel textarea,
[data-bs-theme="dark"] .agreement-panel input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #111827;
    -webkit-text-fill-color: #111827;
}

[data-bs-theme="dark"] .agreement-panel .form-control:focus,
[data-bs-theme="dark"] .agreement-panel .form-select:focus,
[data-bs-theme="dark"] .agreement-panel textarea:focus,
[data-bs-theme="dark"] .agreement-panel input:focus {
    background: #ffffff;
    color: #111827;
    -webkit-text-fill-color: #111827;
    border-color: #0f766e;
}

[data-bs-theme="dark"] .agreement-panel .card,
[data-bs-theme="dark"] .agreement-panel .record-detail-item {
    background: #ffffff;
    color: #111827;
}

[data-bs-theme="dark"] .cheque-preview-wrap {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(15, 23, 42, 0.5));
}

@media print {
    @page {
        size: 202mm 92mm;
        margin: 0;
    }

    body.cheque-print-page {
        width: 202mm;
        height: 92mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

    body.cheque-print-page * {
        visibility: hidden !important;
    }

    body.cheque-print-page .cheque-preview-wrap,
    body.cheque-print-page .cheque-preview-wrap *,
    body.cheque-print-page .cheque-sheet,
    body.cheque-print-page .cheque-sheet * {
        visibility: visible !important;
    }

    body.cheque-print-page .no-print,
    body.cheque-print-page .sidebar,
    body.cheque-print-page .topbar,
    body.cheque-print-page .toast-stack,
    body.cheque-print-page .modal {
        display: none !important;
    }

    body.cheque-print-page .app-shell,
    body.cheque-print-page .content-area,
    body.cheque-print-page .page-content,
    body.cheque-print-page .cheque-tool,
    body.cheque-print-page .cheque-preview-wrap {
        display: block !important;
        width: 202mm !important;
        min-width: 202mm !important;
        height: 92mm !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    body.cheque-print-page .cheque-sheet {
        position: fixed !important;
        inset: 0 auto auto 0 !important;
        width: 202mm !important;
        height: 92mm !important;
        min-width: 202mm !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    body.cheque-print-page .cheque-bg,
    body.cheque-print-page .cheque-bg *,
    body.cheque-print-page .cheque-sample-bg {
        visibility: hidden !important;
    }

    body.cheque-print-page .cheque-field {
        cursor: default !important;
        outline: 0 !important;
        background: transparent !important;
    }
}

@keyframes enterUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 992px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .content-area {
        padding-top: calc(var(--mobile-topbar-offset) + 0.4rem);
    }

    .sidebar {
        position: fixed;
        z-index: 70;
        top: var(--mobile-topbar-offset);
        left: -100%;
        width: 280px;
        max-width: calc(100vw - 2rem);
        height: calc(100dvh - var(--mobile-topbar-offset));
        transition: left 0.25s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: var(--mobile-topbar-offset) 0 0;
        z-index: 60;
        display: block;
        width: 100%;
        height: auto;
        border: 0;
        background: rgba(8, 17, 31, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 0.75rem);
        right: 1rem;
        left: 1rem;
        z-index: 120;
        align-items: center;
    }

    .topbar-right {
        flex: 1 1 auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .workspace-select {
        width: min(210px, 48vw);
    }

    .landing-preview {
        inset: auto 1rem 1rem;
        width: auto;
        opacity: 0.22;
    }

    .landing-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .card-header.d-flex,
    .card-body > .d-flex.justify-content-between,
    .card-body > .d-flex.justify-content-between.align-items-start {
        align-items: stretch !important;
        flex-direction: column;
    }

    .card-header.d-flex .btn,
    .card-body > .d-flex.justify-content-between .btn {
        width: 100%;
    }

    .hero-panel {
        padding: 1rem;
    }

    .dashboard-hero,
    .import-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-hero-stats {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .due-analytics-summary {
        grid-template-columns: 1fr;
    }

    .due-management-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notes-layout {
        grid-template-columns: 1fr;
    }

    .notes-list-panel {
        position: static;
    }

    .notes-list {
        max-height: 280px;
    }

    .khata-simple-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .khata-simple-actions {
        grid-column: 1 / -1;
    }

    .khata-simple-actions .btn {
        width: 100%;
    }

    .khata-record-table {
        display: none !important;
    }

    .khata-record-table.table-responsive {
        display: none !important;
    }

    .khata-record-list {
        display: grid;
        gap: 0.65rem;
    }

    .dashboard-hero .btn,
    .import-hero .btn {
        width: 100%;
    }

    .dashboard-chart-grid .card {
        min-height: 300px;
    }

    .chart-card-body {
        min-height: 230px;
    }

    .chart-card-body canvas {
        /* removed height override */
    }

    .modal-dialog {
        margin: 0.75rem;
    }

    .modal-body,
    .modal-header,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .calculator-window-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .calculator-window-actions .btn {
        flex: 1 1 auto;
    }

    .modal-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    :root {
        --mobile-topbar-offset: 5.85rem;
    }

    .content-area {
        padding: calc(var(--mobile-topbar-offset) + 0.55rem) 0.8rem 0.8rem;
    }

    .topbar {
        align-items: center;
        flex-direction: row;
        padding: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
    }

    .topbar > .btn,
    .topbar-right {
        width: auto;
    }

    .topbar-right {
        gap: 0.45rem !important;
    }

    .notification-trigger,
    .qr-icon-button,
    .calculator-icon-button,
    .profile-trigger {
        width: 38px;
        height: 38px;
    }

    .workspace-select {
        width: 100%;
    }

    .profile-panel,
    .notification-panel {
        position: fixed;
        top: 4.75rem;
        right: 0.8rem;
        left: 0.8rem;
        width: auto;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
    }

    .profile-control .d-flex {
        flex-direction: column;
    }

    .profile-control .btn {
        width: 100%;
    }

    .hero-panel {
        padding: 0.9rem;
    }

    .hero-panel h1 {
        font-size: 1.25rem;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .quick-action {
        min-height: 44px;
    }

    .page-content > .d-flex.justify-content-between {
        align-items: stretch !important;
        flex-direction: column;
    }

    .page-content > .d-flex.justify-content-between > div {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .page-content > .d-flex.justify-content-between .btn {
        width: 100%;
    }

    .notes-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .notes-toolbar .btn,
    .note-title-row .btn,
    .note-actions-panel .btn {
        width: 100%;
    }

    .note-title-row {
        grid-template-columns: 1fr;
    }

    .note-actions-panel {
        display: grid;
        grid-template-columns: 1fr;
    }

    .monthly-khata-header {
        align-items: stretch !important;
        flex-direction: column;
        margin-top: 0.25rem;
    }

    .khata-header-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .khata-average-pill {
        min-width: 0;
    }

    .khata-simple-summary {
        gap: 0.55rem;
    }

    .khata-simple-summary > div,
    .khata-total-button {
        padding: 0.65rem;
    }

    .khata-record-item {
        gap: 0.45rem;
        padding: 0.8rem;
    }

    .khata-record-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .khata-record-main > strong {
        font-size: 1rem;
    }

    .khata-record-actions {
        grid-template-columns: 1fr;
    }

    .table-filter-bar {
        grid-template-columns: 1fr;
    }

    .dataTables_wrapper .row > [class*="col-"] {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: flex-start;
    }

    .input-group {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .input-group-text,
    .input-group > .btn {
        flex: 1 0 100%;
        width: 100%;
        margin-left: 0 !important;
        border-radius: 14px !important;
    }

    .input-group > * + * {
        margin-top: 0.5rem;
    }

    form .col-12 > .btn + .btn,
    form .col-12 > .btn + a.btn,
    form .col-12 > a.btn + .btn,
    form .col-12 > a.btn + a.btn {
        margin-top: 0.5rem;
        margin-left: 0 !important;
    }

    form .col-12 > .btn,
    form .col-12 > a.btn {
        width: 100%;
    }

    .import-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .import-steps {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 0.9rem;
    }

    .card-header {
        padding: 0.75rem 0.9rem;
    }

    .metric-card .card-body {
        padding-left: 1rem;
    }

    .metric-value {
        font-size: 1.05rem;
    }

    .metric-label {
        font-size: 0.66rem;
    }

    .due-management-summary {
        grid-template-columns: 1fr;
    }

    .mini-row,
    .category-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .workspace-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-list-item .btn {
        width: 100%;
    }

    .agreement-panel #signaturePad,
    .agreement-panel #agreementVideo,
    .agreement-panel #agreementCanvas {
        width: 100% !important;
        max-width: 100%;
    }

    .agreement-panel #cameraContainer .mt-2,
    .agreement-panel .d-flex.flex-column.gap-2 {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .agreement-panel #cameraContainer .mt-2 .btn,
    .agreement-panel .d-flex.flex-column.gap-2 .btn {
        width: 100%;
    }

    .auth-wrap {
        min-height: auto;
        padding: 1rem 0;
    }

    .landing-hero {
        min-height: auto;
        padding: 1.25rem !important;
    }

    .landing-hero-stage {
        min-height: 82vh;
        padding: 2rem 1rem;
    }

    .landing-hero-copy h1 {
        font-size: clamp(3rem, 18vw, 4.8rem);
    }

    .preview-shell {
        grid-template-columns: 1fr;
        min-height: 360px;
    }

    .preview-side {
        display: none;
    }

    .preview-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .preview-board {
        grid-template-columns: 1fr;
    }

    .preview-list {
        display: none;
    }

    .landing-section {
        padding-top: 1.4rem;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .toast-stack {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}

@media (max-width: 400px) {
    .content-area {
        padding: calc(var(--mobile-topbar-offset) + 0.35rem) 0.6rem 0.6rem;
    }

    .col-6 {
        width: 100%;
    }

    .dataTables_wrapper .row > [class*="col-"] {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left;
    }

    .dataTables_wrapper .dataTables_filter label,
    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter input,
    .dataTables_wrapper .dataTables_length select {
        width: 100%;
    }

    .dataTables_wrapper .dataTables_paginate .pagination {
        justify-content: flex-start;
    }

    .input-group {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .input-group > .form-control,
    .input-group > .form-select,
    .input-group > .input-group-text,
    .input-group > .btn {
        flex: 1 0 100%;
        width: 100%;
        margin-left: 0 !important;
        border-radius: 14px !important;
    }

    .input-group > * + * {
        margin-top: 0.5rem;
    }

    form .col-12 > .btn + .btn,
    form .col-12 > .btn + a.btn,
    form .col-12 > a.btn + .btn,
    form .col-12 > a.btn + a.btn {
        margin-top: 0.5rem;
        margin-left: 0 !important;
    }

    form .col-12 > .btn,
    form .col-12 > a.btn {
        width: 100%;
    }

    .import-hero {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .card-body {
        padding: 0.9rem;
    }

    .card-header {
        padding: 0.75rem 0.9rem;
    }

    .metric-card .card-body {
        padding-left: 1rem;
    }

    .metric-value {
        font-size: 1.05rem;
    }

    .metric-label {
        font-size: 0.66rem;
    }

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

    .mini-row,
    .category-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .workspace-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .workspace-list-item .btn {
        width: 100%;
    }

    .agreement-panel #signaturePad,
    .agreement-panel #agreementVideo,
    .agreement-panel #agreementCanvas {
        width: 100% !important;
        max-width: 100%;
    }

    .agreement-panel #cameraContainer .mt-2,
    .agreement-panel .d-flex.flex-column.gap-2 {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .agreement-panel #cameraContainer .mt-2 .btn,
    .agreement-panel .d-flex.flex-column.gap-2 .btn {
        width: 100%;
    }

    .auth-wrap {
        min-height: auto;
        padding: 1rem 0;
    }

    .landing-hero {
        min-height: auto;
        padding: 1.25rem !important;
    }

    .landing-hero-stage {
        min-height: 82vh;
        padding: 2rem 1rem;
    }

    .landing-hero-copy h1 {
        font-size: clamp(3rem, 18vw, 4.8rem);
    }

    .preview-shell {
        grid-template-columns: 1fr;
        min-height: 360px;
    }

    .preview-side {
        display: none;
    }

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

    .preview-board {
        grid-template-columns: 1fr;
    }

    .preview-list {
        display: none;
    }

    .landing-section {
        padding-top: 1.4rem;
    }

    .landing-feature-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .toast-stack {
        right: 0.75rem;
        bottom: 0.75rem;
        width: calc(100vw - 1.5rem);
    }
}

@media (max-width: 400px) {
    .content-area {
        padding: calc(var(--mobile-topbar-offset) + 0.35rem) 0.6rem 0.6rem;
    }

    .col-6 {
        width: 100%;
    }

    .chart-card-body canvas {
        /* removed height override */
    }
}

/* --- Floating Labels Fixes --- */
[data-bs-theme="dark"] .form-floating > .form-control::placeholder {
    color: transparent !important;
}
.form-floating > .form-select {
    padding-top: 1.625rem !important;
    padding-bottom: 0.625rem !important;
}
.form-floating > .form-control {
    padding-top: 1.625rem !important;
    padding-bottom: 0.625rem !important;
}

/* --- Global Theme Overrides (Premium Dashboard Theme) --- */
/* Upgrade all cards site-wide to use the smooth dashboard style */
.card {
    border: none !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    border-radius: 0.75rem !important;
}
[data-bs-theme="dark"] .card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.25) !important;
    background-color: var(--bs-gray-900);
}
.card-header {
    background-color: transparent !important;
    border-bottom: none !important;
    padding-top: 1.25rem !important;
    padding-bottom: 0.5rem !important;
    font-weight: 700;
}

/* Upgrade tables to clean borderless layout */
.table {
    border-collapse: separate !important;
    border-spacing: 0 0.25rem !important;
}
.table > :not(caption) > * > * {
    border-bottom-width: 0 !important;
    padding: 0.75rem 1rem !important;
    background-color: transparent;
}
.table tbody tr:hover > * {
    background-color: rgba(0,0,0,0.02) !important;
}
[data-bs-theme="dark"] .table tbody tr:hover > * {
    background-color: rgba(255,255,255,0.02) !important;
}

/* Enhance form elements */
.form-control, .form-select {
    border-radius: 0.5rem;
    box-shadow: none !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.1) !important;
}

/* --- Premium Dark Mode Overhaul --- */
[data-bs-theme="dark"] {
    --bs-body-bg: #000000;
    --bs-body-color: rgba(255, 255, 255, 0.85);
    --bg-main: #000000;
}

[data-bs-theme="dark"] body {
    background-color: var(--bs-body-bg) !important;
    color: var(--bs-body-color) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #0a0a0a !important;
}

[data-bs-theme="dark"] .card, 
[data-bs-theme="dark"] .glass-panel,
[data-bs-theme="dark"] .dropdown-menu,
[data-bs-theme="dark"] .modal-content {
    background-color: #111111 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -1px rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .table tbody tr:hover > * {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .text-dark,
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3, 
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #a3a3a3 !important;
}

[data-bs-theme="dark"] .form-control, 
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
    background-color: #050505 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

[data-bs-theme="dark"] .form-control:focus, 
[data-bs-theme="dark"] .form-select:focus {
    border-color: var(--bs-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.3) !important;
    background-color: #000000 !important;
}

[data-bs-theme="dark"] .hero-panel,
[data-bs-theme="dark"] .dashboard-hero {
    background: linear-gradient(145deg, #1a1a1a, #000000) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-bs-theme="dark"] .sidebar {
    background-color: #050505 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
}
[data-bs-theme="dark"] .side-link {
    color: #a3a3a3 !important;
}
[data-bs-theme="dark"] .side-link:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}
[data-bs-theme="dark"] .side-link.active {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

[data-bs-theme="dark"] .topbar {
    background: rgba(0, 0, 0, 0.8) !important;
}

/* SweetAlert2 Theme Adjustments */
.swal2-popup {
    background: var(--bg-panel) !important;
    color: var(--text-main) !important;
    border-radius: 16px !important;
    border: 1px solid var(--border) !important;
}
.swal2-title {
    color: var(--text-main) !important;
}
.swal2-html-container {
    color: var(--text-sub) !important;
}
.swal2-icon.swal2-warning {
    border-color: var(--warning) !important;
    color: var(--warning) !important;
}
.swal2-icon.swal2-error {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}
.swal2-icon.swal2-success {
    border-color: var(--success) !important;
    color: var(--success) !important;
}
.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: var(--success) !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}
.swal2-icon.swal2-info {
    border-color: var(--info) !important;
    color: var(--info) !important;
}
.swal2-icon.swal2-question {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
}
.swal2-confirm {
    background-color: var(--brand) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
}
.swal2-cancel {
    background-color: transparent !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}
