* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f4f6;
    color: #111827;
    font-family: Figtree, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

svg {
    display: block;
    width: 72px;
    max-width: 100%;
    fill: #2563eb;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.45rem;
    padding: 0.65rem 0.75rem;
    font: inherit;
}

textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 0.45rem;
    font: inherit;
    padding: 0.65rem 0.75rem;
    resize: vertical;
}

input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
}

button,
button[type="submit"] {
    border: 0;
    border-radius: 0.45rem;
    background: #1f2937;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0.65rem 1rem;
}

button:hover,
button[type="submit"]:hover {
    background: #111827;
}

button:disabled,
button[type="submit"]:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.btn {
    align-items: center;
    background: #1f2937;
    border: 1px solid #1f2937;
    border-radius: 0.45rem;
    color: #ffffff;
    display: inline-flex;
    font-size: 0.875rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1.2;
    padding: 0.62rem 0.9rem;
    text-decoration: none;
}

.btn:hover {
    background: #111827;
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background: #f9fafb;
    color: #111827;
}

.btn-danger {
    background: #dc2626;
    border-color: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.page-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.header-note {
    color: #6b7280;
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
}

.saldo-card {
    background: #111827;
    border-radius: 0.5rem;
    color: #ffffff;
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.saldo-card span {
    color: #d1d5db;
    font-size: 0.9rem;
}

.saldo-card strong {
    font-size: 1.8rem;
    line-height: 1.2;
}

.summary-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1rem;
}

.saldo-income {
    background: #065f46;
}

.saldo-expense {
    background: #991b1b;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
    margin-bottom: 1rem;
}

.chart-panel {
    min-height: 420px;
}

.chart-box {
    height: 320px;
    margin-top: 1rem;
    position: relative;
}

.quick-actions-panel {
    margin-top: 1rem;
}

.report-filter-panel {
    margin-bottom: 1rem;
}

.filter-form {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.chart-box-wide {
    height: 360px;
}

.report-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin-top: 1rem;
}

.panel {
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    padding: 1rem;
}

.form-panel {
    max-width: 42rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-actions,
.row-actions,
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-actions {
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.dashboard-actions {
    margin-top: 1rem;
}

.form-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    display: grid;
    gap: 0.25rem;
    margin-bottom: 1rem;
    padding: 1rem;
}

.form-summary span {
    color: #4b5563;
    font-size: 0.9rem;
}

.detail-panel {
    margin-bottom: 1rem;
}

.detail-list {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 0;
}

.detail-list dt {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
}

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

.installment-header {
    align-items: flex-start;
    margin-bottom: 1rem;
}

.installment-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.installment-legend span {
    align-items: center;
    color: #4b5563;
    display: inline-flex;
    font-size: 0.875rem;
    gap: 0.35rem;
}

.installment-dot {
    border: 1px solid #d1d5db;
    border-radius: 9999px;
    display: inline-flex;
    height: 0.8rem;
    width: 0.8rem;
}

.installment-dot-paid {
    background: #22c55e;
    border-color: #16a34a;
}

.installment-dot-unpaid {
    background: #ffffff;
}

.installment-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
}

.installment-grid form {
    margin: 0;
}

.installment-box {
    align-items: center;
    aspect-ratio: 1;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    display: inline-flex;
    font-size: 0.95rem;
    font-weight: 800;
    justify-content: center;
    padding: 0;
    width: 100%;
}

.installment-paid,
.installment-paid:disabled {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
    cursor: default;
}

.installment-unpaid {
    background: #ffffff;
    color: #111827;
}

.installment-unpaid:hover {
    background: #ecfdf5;
    border-color: #22c55e;
    color: #166534;
}

.field-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.35rem;
}

.alert {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    border-collapse: collapse;
    width: 100%;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.85rem;
    text-align: left;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table th {
    background: #f9fafb;
    color: #374151;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.text-right,
.data-table .text-right {
    text-align: right;
}

.empty-state {
    color: #6b7280;
    padding: 2rem;
    text-align: center;
}

.pagination-wrapper {
    margin-top: 1rem;
}

.badge {
    background: #dbeafe;
    border-radius: 9999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.35rem;
    padding: 0.2rem 0.5rem;
}

.status-badge {
    border-radius: 9999px;
    display: inline-flex;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.65rem;
    text-transform: uppercase;
}

.status-lunas {
    background: #dcfce7;
    color: #166534;
}

.status-belum {
    background: #fef3c7;
    color: #92400e;
}

.muted-text {
    color: #6b7280;
    font-size: 0.8rem;
    margin-top: 0.2rem;
}

.min-h-screen {
    min-height: 100vh;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

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

.justify-end {
    justify-content: flex-end;
}

.bg-gray-100 {
    background: #f3f4f6;
}

.bg-white {
    background: #ffffff;
}

.shadow,
.shadow-md {
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.w-full {
    width: 100%;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.ms-2 {
    margin-left: 0.5rem;
}

.ms-3 {
    margin-left: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.pt-6 {
    padding-top: 1.5rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-red-600 {
    color: #dc2626;
}

.block {
    display: block;
}

.inline-flex {
    display: inline-flex;
}

.hidden {
    display: none;
}

.rounded-md,
.rounded-lg {
    border-radius: 0.5rem;
}

.overflow-hidden {
    overflow: hidden;
}

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-semibold {
    font-weight: 700;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-widest {
    letter-spacing: 0.08em;
}

.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.sm\:max-w-md {
    max-width: 28rem;
}

.sm\:justify-center {
    justify-content: center;
}

.sm\:rounded-lg {
    border-radius: 0.5rem;
}

@media (max-width: 640px) {
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

    .saldo-card strong {
        font-size: 1.45rem;
    }
}

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

    .filter-form,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (min-width: 640px) {
    .sm\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .lg\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Modern application shell */
.app-body {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.11), transparent 34rem),
        linear-gradient(135deg, #eef2f7 0%, #f8fafc 46%, #ecfdf5 100%);
    color: #111827;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.app-sidebar {
    background: #0f172a;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    display: flex;
    flex: 0 0 18rem;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    overflow-y: auto;
    padding: 1.25rem;
    position: sticky;
    top: 0;
    width: 18rem;
    z-index: 40;
}

.sidebar-brand {
    align-items: center;
    display: flex;
    gap: 0.8rem;
    min-height: 3.25rem;
}

.sidebar-logo {
    align-items: center;
    background: linear-gradient(135deg, #2563eb, #16a34a);
    border-radius: 0.85rem;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.22);
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 2.75rem;
    font-size: 0.9rem;
    font-weight: 900;
    height: 2.75rem;
    justify-content: center;
    letter-spacing: 0;
    text-decoration: none;
}

.sidebar-logo:hover {
    color: #ffffff;
    text-decoration: none;
}

.sidebar-brand strong {
    color: #ffffff;
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.sidebar-brand small {
    color: #94a3b8;
    display: block;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.sidebar-user-card {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem;
}

.user-avatar {
    align-items: center;
    background: #dbeafe;
    border-radius: 9999px;
    color: #1d4ed8;
    display: inline-flex;
    flex: 0 0 2.35rem;
    font-weight: 900;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.user-meta {
    display: grid;
    line-height: 1.2;
    min-width: 0;
}

.user-meta strong,
.user-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta strong {
    color: inherit;
    font-size: 0.9rem;
}

.user-meta span {
    color: #94a3b8;
    font-size: 0.78rem;
    margin-top: 0.18rem;
}

.sidebar-nav {
    display: grid;
    gap: 1rem;
}

.sidebar-section {
    display: grid;
    gap: 0.35rem;
}

.sidebar-section-label {
    color: #94a3b8;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0 0.6rem;
    text-transform: uppercase;
}

.sidebar-link {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 0.75rem;
    color: #cbd5e1;
    display: flex;
    gap: 0.7rem;
    min-height: 2.8rem;
    padding: 0.68rem 0.75rem;
    text-align: left;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
    width: 100%;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    text-decoration: none;
    transform: translateX(2px);
}

.sidebar-link.active {
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.24);
    color: #0f172a;
}

.sidebar-icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 0.65rem;
    display: inline-flex;
    flex: 0 0 2rem;
    font-size: 0.78rem;
    font-weight: 900;
    height: 2rem;
    justify-content: center;
    width: 2rem;
}

.sidebar-link.active .sidebar-icon {
    background: #dbeafe;
    color: #1d4ed8;
}

.sidebar-footer {
    display: grid;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 1rem;
}

.sidebar-logout {
    font: inherit;
    font-weight: 700;
}

.sidebar-close {
    margin-left: auto;
}

.app-sidebar-backdrop {
    background: rgba(15, 23, 42, 0.48);
    display: none;
    inset: 0;
    position: fixed;
    z-index: 30;
}

.app-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.app-navbar {
    align-items: center;
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    backdrop-filter: blur(18px);
    display: flex;
    gap: 1rem;
    min-height: 4.75rem;
    padding: 0.9rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 25;
}

.app-navbar-title {
    display: grid;
    line-height: 1.2;
    min-width: 0;
}

.app-navbar-title span {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.app-navbar-title strong {
    color: #111827;
    font-size: 1.08rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-navbar-user {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    display: flex;
    gap: 0.65rem;
    margin-left: auto;
    min-width: 0;
    padding: 0.42rem 0.5rem;
}

.app-navbar-user .user-meta strong {
    color: #111827;
}

.app-navbar-user .user-meta span {
    color: #6b7280;
    max-width: 12rem;
}

.app-top-link {
    border-radius: 9999px;
    padding: 0.52rem 0.78rem;
}

.icon-button {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    color: #111827;
    display: inline-flex;
    flex: 0 0 2.65rem;
    gap: 0.22rem;
    height: 2.65rem;
    justify-content: center;
    padding: 0;
    width: 2.65rem;
}

.icon-button:hover {
    background: #f8fafc;
    color: #111827;
}

.icon-button span {
    background: currentColor;
    border-radius: 9999px;
    display: block;
    height: 2px;
    width: 1.05rem;
}

.sidebar-close {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.app-page-header {
    margin: 1.5rem auto 0;
    max-width: 80rem;
    padding: 0 1.5rem;
    width: 100%;
}

.app-page-header h2 {
    color: #0f172a;
    font-size: clamp(1.45rem, 2vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.app-main {
    flex: 1;
    padding: 1.5rem;
}

.app-main > .py-12 {
    padding-bottom: 0;
    padding-top: 0;
}

.app-main .max-w-7xl {
    max-width: 80rem;
}

.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 1rem;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    padding: 1.25rem;
}

.summary-grid {
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.saldo-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
    margin-bottom: 0;
    min-height: 8.25rem;
    overflow: hidden;
    padding: 1.3rem;
    position: relative;
}

.saldo-card::after {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    content: "";
    height: 7rem;
    position: absolute;
    right: -2.5rem;
    top: -2.5rem;
    width: 7rem;
}

.saldo-card span,
.saldo-card strong {
    position: relative;
    z-index: 1;
}

.saldo-card span {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 700;
}

.saldo-card strong {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
    word-break: break-word;
}

.saldo-card:not(.saldo-income):not(.saldo-expense) {
    background: linear-gradient(135deg, #0f172a, #334155);
}

.saldo-income {
    background: linear-gradient(135deg, #047857, #22c55e);
}

.saldo-expense {
    background: linear-gradient(135deg, #b91c1c, #f97316);
}

.dashboard-grid {
    gap: 1.25rem;
    grid-template-columns: minmax(19rem, 0.9fr) minmax(0, 1.35fr);
    margin-bottom: 1.25rem;
}

.chart-panel {
    min-height: 26rem;
}

.chart-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.9rem;
    padding: 1rem;
}

.page-header {
    border-bottom: 1px solid #e5e7eb;
    margin: -0.1rem 0 1rem;
    padding-bottom: 1rem;
}

.section-title {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    letter-spacing: 0.04em;
}

.data-table td,
.data-table th {
    padding: 0.95rem;
}

.dashboard-actions .btn,
.form-actions .btn,
.row-actions .btn,
.filter-actions .btn {
    border-radius: 0.75rem;
}

.d-lg-none {
    display: inline-flex;
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
}

@media (max-width: 991px) {
    .app-sidebar {
        box-shadow: 24px 0 60px rgba(15, 23, 42, 0.24);
        left: 0;
        max-width: calc(100vw - 2rem);
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-open .app-sidebar-backdrop {
        display: block;
    }

    .app-navbar {
        min-height: 4.25rem;
        padding: 0.75rem 1rem;
    }

    .app-page-header,
    .app-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

@media (max-width: 720px) {
    .app-navbar-title span {
        font-size: 0.7rem;
    }

    .app-navbar-title strong {
        font-size: 0.95rem;
    }

    .app-navbar-user {
        background: transparent;
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .app-navbar-user .user-meta,
    .app-navbar-user .app-top-link {
        display: none;
    }

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

    .panel {
        border-radius: 0.85rem;
        padding: 1rem;
    }
}

.note-timeline {
    display: grid;
    gap: 1rem;
}

.notes-layout {
    align-items: start;
    display: grid;
    gap: 1.25rem;
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
}

.notes-sidebar {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 6rem;
}

.notes-sidebar-panel {
    padding: 1rem;
}

.category-list {
    display: grid;
    gap: 0.45rem;
}

.category-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    color: #334155;
    display: flex;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
}

.category-item:hover,
.category-item.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
    text-decoration: none;
}

.category-item strong {
    background: #dbeafe;
    border-radius: 9999px;
    color: #1d4ed8;
    font-size: 0.76rem;
    padding: 0.18rem 0.48rem;
}

.mini-calendar {
    display: grid;
    gap: 0.55rem;
}

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

.mini-calendar-weekdays span {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.mini-calendar-days span {
    align-items: center;
    aspect-ratio: 1;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.55rem;
    color: #334155;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    justify-content: center;
    position: relative;
}

.mini-calendar-days span.is-muted {
    color: #cbd5e1;
}

.mini-calendar-days span.is-today {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.mini-calendar-days span.has-notes::after {
    background: #22c55e;
    border-radius: 9999px;
    bottom: 0.22rem;
    content: "";
    height: 0.32rem;
    position: absolute;
    width: 0.32rem;
}

.note-card {
    display: grid;
    gap: 0.9rem;
}

.note-filter-form {
    align-items: end;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(12rem, 1.4fr) minmax(10rem, 1fr) minmax(10rem, 1fr) auto;
    margin-bottom: 1rem;
}

.note-filter-form .form-group {
    margin-bottom: 0;
}

.note-card-header,
.note-footer {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.note-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0.3rem 0 0;
}

.note-title a {
    color: #0f172a;
}

.note-excerpt {
    color: #475569;
    line-height: 1.65;
    margin: 0;
}

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

.note-meta span {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.24rem 0.55rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.tag-chip {
    background: #dbeafe;
    border-radius: 9999px;
    color: #1d4ed8;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.28rem 0.62rem;
}

.tag-chip-button,
.tag-chip-button:hover {
    background: #dbeafe;
    border: 0;
    color: #1d4ed8;
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.28rem 0.62rem;
}

.tag-chip-button:hover {
    background: #bfdbfe;
}

.tag-input {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    min-height: 2.75rem;
    padding: 0.42rem 0.5rem;
}

.tag-input-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tag-input-field {
    border: 0 !important;
    flex: 1 1 9rem;
    min-width: 7rem;
    padding: 0.25rem !important;
}

.tag-input-field:focus {
    outline: 0;
}

.note-detail {
    display: grid;
    gap: 1rem;
}

.note-content {
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.75;
}

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

.note-gallery figure {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    margin: 0;
    overflow: hidden;
}

.note-gallery img {
    aspect-ratio: 4 / 3;
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.note-gallery figcaption {
    color: #475569;
    font-size: 0.82rem;
    padding: 0.65rem;
}

.note-gallery-small {
    grid-template-columns: repeat(auto-fit, minmax(110px, 150px));
    margin-bottom: 1rem;
}

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

.checkbox-row span {
    color: #374151;
    font-weight: 700;
}

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

.permission-option {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    display: flex;
    gap: 0.65rem;
    margin: 0;
    padding: 0.75rem;
}

.permission-option span {
    color: #334155;
    font-size: 0.9rem;
    font-weight: 800;
}

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

.savings-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.saving-stat-card {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.saving-stat-card > div {
    display: grid;
    gap: 0.2rem;
}

.saving-stat-card span:not(.saving-stat-icon) {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 800;
}

.saving-stat-card strong {
    color: #0f172a;
    font-size: 1.45rem;
    line-height: 1.2;
}

.saving-stat-card small {
    color: #64748b;
    font-size: 0.8rem;
}

.saving-stat-icon {
    align-items: center;
    border-radius: 9999px;
    display: inline-flex;
    flex: 0 0 3.35rem;
    font-size: 1.2rem;
    font-weight: 900;
    height: 3.35rem;
    justify-content: center;
    width: 3.35rem;
}

.saving-stat-wallet {
    background: #ffedd5;
    color: #f97316;
}

.saving-stat-balance {
    background: #dcfce7;
    color: #16a34a;
}

.saving-stat-active {
    background: #dbeafe;
    color: #2563eb;
}

.saving-detail-card {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.saving-bank-info {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.bank-logo {
    align-items: center;
    background: #2563eb;
    border-radius: 0.9rem;
    color: #ffffff;
    display: inline-flex;
    font-weight: 900;
    height: 3.2rem;
    justify-content: center;
    width: 3.2rem;
}

.bank-logo-detail,
.bank-logo-thumb,
.bank-logo-preview img {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: block;
    object-fit: contain;
}

.bank-logo-detail {
    border-radius: 0.9rem;
    height: 3.2rem;
    padding: 0.35rem;
    width: 3.2rem;
}

.bank-logo-thumb {
    border-radius: 0.7rem;
    height: 2.45rem;
    padding: 0.28rem;
    width: 2.45rem;
}

.bank-logo-fallback {
    align-items: center;
    background: #dbeafe;
    color: #1d4ed8;
    display: inline-flex;
    font-weight: 900;
    justify-content: center;
    padding: 0;
}

.bank-logo-preview img {
    border-radius: 0.9rem;
    height: 5rem;
    padding: 0.5rem;
    width: 5rem;
}

.saving-bank-info strong,
.saving-bank-info span,
.saving-current-balance span,
.saving-current-balance strong {
    display: block;
}

.saving-bank-info strong {
    color: #0f172a;
}

.saving-bank-info span,
.saving-current-balance span {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
}

.saving-current-balance {
    text-align: right;
}

.saving-current-balance strong {
    color: #16a34a;
    font-size: 1.55rem;
    font-weight: 900;
}

.saving-filter-form {
    grid-template-columns: minmax(10rem, 1fr) minmax(10rem, 1fr) auto minmax(12rem, 1.2fr);
}

.transaction-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.transaction-type-options label {
    align-items: center;
    display: inline-flex;
    gap: 0.45rem;
    margin: 0;
}

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

.bank-logo-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    color: #0f172a;
    display: grid;
    gap: 0.45rem;
    justify-items: center;
    min-height: 11rem;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
}

.bank-logo-card:hover,
.bank-logo-card.active {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.13);
    color: #0f172a;
    text-decoration: none;
}

.bank-logo-card img,
.bank-logo-card > span {
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    display: inline-flex;
    height: 4rem;
    justify-content: center;
    object-fit: contain;
    padding: 0.45rem;
    width: 4rem;
}

.bank-logo-card > span {
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 1.4rem;
    font-weight: 900;
}

.bank-logo-card strong,
.bank-logo-card small,
.bank-logo-card em {
    display: block;
}

.bank-logo-card strong {
    font-size: 0.98rem;
}

.bank-logo-card small {
    color: #64748b;
    font-size: 0.8rem;
}

.bank-logo-card em {
    color: #2563eb;
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 800;
}

.journal-create-layout {
    margin: 0 auto;
    max-width: 58rem;
}

.vehicle-card-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
}

.vehicle-service-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 1rem;
    grid-template-columns: 13rem minmax(0, 1fr);
    overflow: hidden;
    padding: 1rem;
}

.vehicle-photo-wrap img,
.vehicle-photo-fallback {
    aspect-ratio: 4 / 5;
    border-radius: 0.85rem;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.vehicle-photo-fallback {
    align-items: center;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    font-weight: 900;
    justify-content: center;
}

.vehicle-card-body {
    display: grid;
    gap: 0.9rem;
}

.vehicle-card-title {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.vehicle-card-title span {
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 900;
}

.vehicle-card-title h3 {
    color: #0f172a;
    font-size: 1.25rem;
    margin: 0.15rem 0 0;
}

.vehicle-card-title strong {
    color: #0f172a;
    white-space: nowrap;
}

.service-reminder-card {
    background: #facc15;
    border-radius: 0.85rem;
    box-shadow: inset 0 0 0 2px rgba(146, 64, 14, 0.12);
    color: #422006;
    display: grid;
    gap: 0.4rem;
    padding: 0.9rem;
}

.service-reminder-head {
    align-items: center;
    display: flex;
    font-size: 0.82rem;
    justify-content: space-between;
    text-transform: uppercase;
}

.service-reminder-row {
    background: rgba(255, 255, 255, 0.62);
    border-radius: 0.25rem;
    display: grid;
    gap: 0.5rem;
    grid-template-columns: 9rem 1fr;
    padding: 0.35rem 0.5rem;
}

.service-reminder-row span,
.service-reminder-section,
.service-oil-list span {
    font-size: 0.78rem;
    font-weight: 900;
}

.service-reminder-section {
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.service-oil-list {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 0.35rem;
    display: grid;
    gap: 0.25rem;
    padding: 0.5rem;
}

.vehicle-form-preview {
    border-radius: 0.85rem;
    display: block;
    max-height: 12rem;
    object-fit: cover;
    width: 100%;
}

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

.password-vault-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.password-vault-head,
.password-detail-header {
    align-items: center;
    display: flex;
    gap: 0.8rem;
}

.password-app-icon {
    align-items: center;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    border-radius: 0.9rem;
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 3rem;
    font-size: 0.9rem;
    font-weight: 900;
    height: 3rem;
    justify-content: center;
    width: 3rem;
}

.password-app-icon-lg {
    flex-basis: 4rem;
    height: 4rem;
    width: 4rem;
}

.password-vault-head h3,
.password-detail-header h3 {
    color: #0f172a;
    font-size: 1.05rem;
    margin: 0;
}

.password-vault-head span,
.password-detail-header span {
    color: #64748b;
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    margin-top: 0.15rem;
}

.password-vault-meta {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    display: grid;
    gap: 0.4rem;
    padding: 0.8rem;
}

.password-vault-meta span {
    color: #475569;
    font-size: 0.86rem;
    overflow-wrap: anywhere;
}

.password-vault-meta strong {
    color: #0f172a;
    letter-spacing: 0.08em;
}

.password-form-panel {
    max-width: 58rem;
}

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

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

.password-copy-row {
    align-items: stretch;
    display: flex;
    gap: 0.5rem;
}

.password-copy-row input {
    min-width: 0;
}

.password-detail-panel {
    display: grid;
    gap: 1.25rem;
}

.password-secret-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    padding: 1rem;
}

.password-notes {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 0.9rem;
    padding: 1rem;
}

.password-notes strong {
    color: #9a3412;
    display: block;
    margin-bottom: 0.35rem;
}

.password-notes p {
    color: #431407;
    margin: 0;
    white-space: pre-wrap;
}

.password-color-dot {
    border-radius: 9999px;
    display: inline-flex;
    height: 0.85rem;
    margin-right: 0.45rem;
    vertical-align: -0.1rem;
    width: 0.85rem;
}

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

.backup-info-list {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 1rem 0 0;
}

.backup-info-list dt {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.backup-info-list dd {
    color: #0f172a;
    font-weight: 800;
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

.status-pending {
    background: #dbeafe;
    color: #1d4ed8;
}

@media (max-width: 760px) {
    .vehicle-service-card {
        grid-template-columns: 1fr;
    }

    .password-copy-row,
    .password-form-grid {
        grid-template-columns: 1fr;
    }

    .password-copy-row {
        flex-direction: column;
    }

    .password-form-wide {
        grid-column: auto;
    }

    .backup-grid,
    .backup-info-list {
        grid-template-columns: 1fr;
    }
}

.journal-editor-panel {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.92);
    border-radius: 1rem;
    box-shadow: 0 20px 46px rgba(15, 23, 42, 0.08);
    max-width: none;
    overflow: hidden;
    padding: 0;
}

.journal-form {
    display: grid;
}

.journal-editor-header {
    border-bottom: 1px solid #eef2f7;
    padding: 1.35rem 1.7rem 1rem;
}

.journal-date-label {
    color: #64748b;
    display: block;
    font-size: 0.92rem;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.journal-date-input {
    background: #f8fafc;
    border-color: #e2e8f0 !important;
    border-radius: 9999px !important;
    color: #334155;
    max-width: 12rem;
    padding: 0.5rem 0.8rem !important;
}

.journal-title-section {
    padding: 1.45rem 1.7rem 0;
}

.journal-title-input {
    border: 0 !important;
    border-radius: 0 !important;
    color: #0f172a;
    font-size: clamp(1.8rem, 3vw, 2.65rem);
    font-weight: 900;
    line-height: 1.15;
    padding: 0 !important;
}

.journal-title-input:focus,
.journal-content-input:focus {
    box-shadow: none;
    outline: 0;
}

.journal-date-input:focus,
.journal-select:focus,
.journal-tag-input:focus-within {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.journal-title-input::placeholder,
.journal-content-input::placeholder {
    color: #94a3b8;
}

.journal-content-section {
    padding: 1rem 1.7rem 1.65rem;
}

.journal-content-input {
    border: 0 !important;
    border-radius: 0 !important;
    color: #1f2937;
    line-height: 1.85;
    min-height: 24rem;
    padding: 0 !important;
    resize: vertical;
}

.journal-metadata {
    background: #fbfdff;
    border-top: 1px solid #eef2f7;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(13rem, 0.8fr) minmax(0, 1.2fr);
    padding: 1.35rem 1.7rem;
}

.journal-meta-field {
    display: grid;
    gap: 0.5rem;
}

.journal-meta-wide {
    grid-column: span 2;
}

.journal-meta-label {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.journal-select,
.journal-tag-input {
    background: #ffffff;
    border-color: #e2e8f0 !important;
    border-radius: 0.85rem !important;
    min-height: 3rem;
}

.journal-tag-input {
    padding: 0.5rem 0.65rem;
}

.journal-upload-box {
    align-items: center;
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 0.9rem;
    color: #334155;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    margin: 0;
    min-height: 3.25rem;
    padding: 0.85rem 1rem;
}

.journal-upload-box:hover {
    background: #f8fafc;
    border-color: #93c5fd;
}

.journal-upload-box span {
    font-weight: 900;
}

.journal-upload-box small {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.journal-file-input {
    height: 1px;
    opacity: 0;
    position: absolute;
    width: 1px;
}

.journal-image-preview {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.journal-image-preview figure {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    margin: 0;
    overflow: hidden;
}

.journal-image-preview img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.journal-image-preview figcaption {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    overflow: hidden;
    padding: 0.55rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.journal-pin-row {
    align-self: center;
}

.journal-actions {
    background: #ffffff;
    border-top: 1px solid #eef2f7;
    margin-top: 0;
    padding: 1rem 1.7rem;
}

@media (max-width: 640px) {
    .note-card-header,
    .note-footer {
        flex-direction: column;
    }

    .form-grid,
    .journal-metadata,
    .savings-summary-grid {
        grid-template-columns: 1fr;
    }

    .saving-detail-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .saving-current-balance {
        text-align: left;
    }

    .journal-editor-header,
    .journal-title-section,
    .journal-content-section,
    .journal-metadata,
    .journal-actions {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .journal-meta-wide {
        grid-column: auto;
    }

    .journal-upload-box {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media (max-width: 991px) {
    .notes-layout {
        grid-template-columns: 1fr;
    }

    .notes-sidebar {
        position: static;
    }

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