/* NextFin Application Styles */

:root {
    --sidebar-width: 252px;
    --primary-color: #0d6efd;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f6f9;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* App layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #fff;
    color: #4b5563;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eef0f3;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1.15rem 1.15rem 0.35rem;
}

.sidebar-brand a {
    color: #111827;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.sidebar-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #4f46e5;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    overflow: hidden;
}
.sidebar-mark img { width: 18px; height: 18px; object-fit: contain; }
.sidebar-logo { display: block; max-height: 40px; max-width: 168px; width: auto; height: auto; object-fit: contain; }
.login-logo { display: block; max-height: 72px; max-width: 220px; margin: 0 auto; object-fit: contain; }
.login-mark { width: 48px; height: 48px; object-fit: contain; }
.brand-preview { display: block; max-height: 64px; max-width: 180px; margin-bottom: 0.5rem; object-fit: contain; }
.brand-preview.is-icon { max-height: 32px; max-width: 32px; }
.pnl-logo { display: block; max-height: 56px; max-width: 180px; margin: 0 auto 0.35rem; object-fit: contain; }

.sidebar-close {
    border: 0;
    background: transparent;
    color: #9ca3af;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover { background: #f3f4f6; color: #374151; }

.sidebar-open {
    position: fixed;
    top: 0.7rem;
    left: 0.7rem;
    z-index: 998;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.sidebar-account {
    padding: 0.85rem 0.9rem 0.35rem;
}

.sidebar-account-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    background: #f3f4f6;
    color: #111827;
    border-radius: 999px;
    padding: 0.28rem 0.7rem 0.28rem 0.28rem;
    font-weight: 600;
    font-size: 0.92rem;
    text-align: left;
}

.sidebar-account-btn:hover { background: #eceff3; }

.sidebar-account-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    font-size: 0.9rem;
}

.sidebar-account-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-account-btn .bi-chevron-down {
    color: #9ca3af;
    font-size: 0.75rem;
}

.sidebar-account-menu {
    width: calc(100% - 0.2rem);
    margin-top: 0.35rem !important;
    border: 1px solid #eef0f3;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
    padding: 0.3rem;
}

.sidebar-account-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    color: #374151;
    font-size: 0.9rem;
}

.sidebar-account-menu .dropdown-item i { width: 1rem; text-align: center; color: #6b7280; }
.sidebar-account-menu .dropdown-item.is-danger,
.sidebar-account-menu .dropdown-item.is-danger i { color: #ef4444; }
.sidebar-account-menu .dropdown-item:hover { background: #f3f4f6; }

.sidebar-nav {
    padding: 0.35rem 0 1rem;
    flex: 1 1 auto;
    overflow-y: auto;
}

.sidebar-nav .nav-header {
    padding: 1.05rem 1.35rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.sidebar-nav .nav-link {
    color: #4b5563;
    margin: 1px 0.7rem;
    padding: 0.48rem 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border-radius: 8px;
    border-left: 0;
    font-size: 0.92rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link:hover {
    color: #111827;
    background: #f3f4f6;
}

.sidebar-nav .nav-link.active {
    color: #111827;
    background: #eceff3;
    font-weight: 600;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
    width: 1.15rem;
    text-align: center;
    color: #6b7280;
}

.sidebar-nav .nav-link:hover i,
.sidebar-nav .nav-link.active i {
    color: #111827;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Dashboard overview */
.dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.dash-head h1 {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #111827;
}
.dash-head-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.dash-range,
.dash-export {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}
.dash-range { color: #374151; }
.dash-range .bi-chevron-down,
.dash-range .bi-calendar3,
.dash-export .bi { color: #6b7280; }
.dash-range:hover,
.dash-export:hover { background: #f9fafb; color: #111827; }
.dash-preset-menu { min-width: 180px; border-radius: 12px; border-color: #eef0f3; padding: 0.35rem; }
.dash-preset-menu .dropdown-item { border-radius: 8px; }
.dash-preset-menu .dropdown-item.active { background: #f3f4f6; color: #111827; }
.dash-cards {
    margin-bottom: 1.25rem;
}
.dash-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    padding: 1.15rem 1.25rem 1.05rem;
    min-width: 0;
}
.dash-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.dash-card h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.dash-period {
    margin: 0.2rem 0 0.85rem;
    color: #9ca3af;
    font-size: 0.82rem;
}
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.dash-metric-value {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #111827;
}
.dash-metric.is-focus .dash-metric-value {
    display: inline-block;
    border-bottom: 2px solid #22c55e;
    padding-bottom: 0.2rem;
}
.dash-metric-label {
    margin-top: 0.35rem;
    color: #6b7280;
    font-size: 0.8rem;
}
@media (max-width: 991.98px) {
    .dash-head { align-items: flex-start; flex-direction: column; }
    .dash-head-actions { flex-wrap: wrap; }
}
@media (max-width: 575.98px) {
    .dash-range span { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
}

/* Stat cards */
.stat-card .card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Journal form */
#journalLines .form-select-sm,
#journalLines .form-control-sm {
    font-size: 0.875rem;
}

/* Mobile responsive */
@media (max-width: 991.98px) {
    .sidebar-open {
        display: inline-flex;
    }

    .main-content .container-fluid {
        padding-top: 3.4rem;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .page-header h1 {
        font-size: 1.25rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }
}

/* Chart of accounts */
.coa-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.coa-head h1 {
    margin: 0 0 0.85rem;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #1f2937;
}
.coa-stats { display: flex; gap: 2rem; }
.coa-stat-label { color: #6b8bb5; font-size: 0.82rem; margin-bottom: 0.15rem; }
.coa-stat-value { font-size: 1.35rem; font-weight: 700; color: #1e3a8a; letter-spacing: -0.03em; line-height: 1.1; }
.coa-head .btn-primary { background: #2563eb; border-color: #2563eb; }
.coa-head .btn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.coa-board {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    overflow: hidden;
}
.coa-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.9rem 1rem;
    padding: 0 0.85rem;
    height: 40px;
    border: 1px solid #dbe7fb;
    border-radius: 10px;
    background: #fff;
    color: #60a5fa;
}
.coa-search:focus-within { border-color: #93c5fd; }
.coa-search input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    color: #111827;
    font-size: 0.92rem;
}
.coa-table { width: 100%; border-collapse: collapse; margin: 0; }
.coa-table th {
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3b5f8a;
    background: #e8f1fe;
    padding: 0.75rem 0.85rem;
    white-space: nowrap;
}
.coa-table th.is-sortable { cursor: pointer; }
.coa-table th .bi { font-size: 0.68rem; margin-left: 0.2rem; color: #60a5fa; }
.coa-table tbody tr.coa-row:hover td { background: #f5f8ff; }
.coa-table td {
    padding: 0.72rem 0.85rem;
    border-top: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.92rem;
    vertical-align: middle;
    background: #fff;
}
.coa-name {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.coa-twist {
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: #60a5fa;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
}
.coa-twist.is-leaf { visibility: hidden; }
.coa-name a { color: #1f2937; text-decoration: none; font-weight: 500; }
.coa-name a.is-parent { font-weight: 600; }
.coa-table th.coa-action-col,
.coa-table td.coa-action-col { text-align: right; width: 88px; }
.coa-actions { display: inline-flex; align-items: center; gap: 0.15rem; }
.coa-actions form { display: inline-flex; margin: 0; }
.coa-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #60a5fa;
    padding: 0;
    font-size: 0.95rem;
    text-decoration: none;
}
.coa-action:hover { color: #2563eb; }
.coa-action.is-danger:hover { color: #ef4444; }
.coa-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
}
.coa-pagesize {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #e8eaee;
    border-radius: 8px;
    padding: 0.15rem 0.45rem;
    background: #fff;
    color: #374151;
}
.coa-pagesize select { border: 0; background: transparent; color: #374151; font-size: 0.85rem; }
.coa-new-modal { border: 0; border-radius: 18px; overflow: hidden; }
.coa-new-modal .modal-header { border: 0; padding: 1.2rem 1.35rem 0.35rem; }
.coa-new-modal .modal-title { font-weight: 700; letter-spacing: -0.02em; color: #111827; }
.coa-new-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 1.35rem 0.9rem;
    padding: 0.9rem 1rem;
    background: #e8f1fe;
    border-radius: 12px;
    color: #3b5f8a;
    font-size: 0.88rem;
}
.coa-new-banner p { margin: 0; }
.coa-new-banner i { font-size: 1.8rem; color: #2563eb; }
.coa-subcheck {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1.35rem 0.35rem;
    font-weight: 600;
    color: #1f2937;
}
.coa-subcheck input { width: 16px; height: 16px; accent-color: #2563eb; }
.coa-new-modal .modal-body { padding: 0.75rem 1.35rem 0.25rem; }
.coa-new-modal .form-label { font-size: 0.82rem; color: #6b7280; font-weight: 500; margin-bottom: 0.3rem; }
.coa-new-modal .form-control,
.coa-new-modal .form-select {
    border-radius: 10px;
    border-color: #e5e7eb;
    min-height: 42px;
}
.coa-modal-foot { border: 0; padding: 0.85rem 1.35rem 1.15rem; }
.coa-cancel { border: 0; background: transparent; color: #4b5563; font-weight: 600; padding: 0.4rem 0.2rem; }
.coa-cancel:hover { color: #111827; }
.coa-create {
    border: 0;
    background: #2563eb;
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 1.15rem;
    font-weight: 600;
}
.coa-create:hover { background: #1d4ed8; color: #fff; }
.coa-modal-mark { color: #2563eb; font-size: 1.35rem; }
@media (max-width: 991.98px) {
    .coa-head { flex-direction: column; }
}
@media (max-width: 575.98px) {
    .coa-stats { gap: 1.1rem; }
    .coa-table .coa-type { display: none; }
}

/* Journal register */
.jreg-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.15rem; }
.jreg-filter { position: relative; display: flex; flex-wrap: nowrap; gap: 0.5rem; }
.jreg-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    width: 220px;
    max-width: 100%;
    padding: 0 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #9ca3af;
}
.jreg-search:focus-within { border-color: #2563eb; color: #6b7280; }
.jreg-search input {
    border: 0;
    outline: none;
    width: 100%;
    padding: 0;
    background: transparent;
    color: #111827;
    font-size: 0.92rem;
}
.jreg-search input::placeholder { color: #9ca3af; }
.jreg-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 40px;
    padding: 0 0.85rem;
    border: 1px solid #e6e8ee;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    font-size: 0.92rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    white-space: nowrap;
}
.jreg-chip i { color: #6b7280; font-size: 0.85rem; }
.jreg-picker {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    width: min(760px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    padding: 0.75rem;
}
.jreg-picker.is-open { display: block; }
.jreg-picker-body { display: flex; gap: 0.25rem; }
.jreg-presets {
    width: 148px;
    flex: 0 0 148px;
    padding: 0.35rem 0.35rem 0.35rem 0.15rem;
    border-right: 1px solid #f1f3f6;
}
.jreg-preset {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: #374151;
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    font-size: 0.92rem;
}
.jreg-preset:hover, .jreg-preset.is-active { background: #f3f4f6; }
.jreg-cal { flex: 1; min-width: 0; padding: 0.25rem 0.5rem 0.5rem; }
.jreg-cal-head {
    display: grid;
    grid-template-columns: 32px 1fr 32px;
    align-items: center;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: #111827;
}
.jreg-cal-head span { text-align: center; }
.jreg-nav {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 1.15rem;
    line-height: 1;
}
.jreg-nav:hover { background: #f3f4f6; }
.jreg-weekdays, .jreg-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.jreg-weekdays span {
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    padding: 0.2rem 0 0.35rem;
}
.jreg-day {
    position: relative;
    height: 36px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #111827;
    font-size: 0.9rem;
}
.jreg-day.is-outside { color: #c5cad3; }
.jreg-day.is-inrange::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    bottom: 4px;
    background: #e7f0ff;
}
.jreg-day.is-start::before { left: 50%; }
.jreg-day.is-end::before { right: 50%; }
.jreg-day.is-start.is-end::before { display: none; }
.jreg-day > span {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.jreg-day.is-start > span, .jreg-day.is-end > span { background: #3b6cff; color: #fff; }
.jreg-picker-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.35rem 0.25rem;
    border-top: 1px solid #f1f3f6;
    margin-top: 0.25rem;
}
.jreg-picker-dates { display: flex; align-items: center; gap: 0.5rem; }
.jreg-date-pill {
    display: inline-flex;
    align-items: center;
    min-width: 92px;
    height: 36px;
    padding: 0 0.75rem;
    border: 1px solid #e6e8ee;
    border-radius: 10px;
    color: #111827;
    background: #fff;
}
.jreg-date-dash { color: #9ca3af; }
.jreg-picker-actions { display: flex; align-items: center; gap: 0.35rem; }
.jreg-cancel {
    border: 0;
    background: transparent;
    color: #4b5563;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: 8px;
}
.jreg-cancel:hover { background: #f3f4f6; }
.jreg-apply {
    border: 0;
    background: #3b6cff;
    color: #fff;
    height: 36px;
    padding: 0 1rem;
    border-radius: 999px;
    font-weight: 600;
}
.jreg-apply:hover { background: #2f5ef0; }
@media (max-width: 900px) {
    .jreg-search { width: 100%; }
    .jreg-toolbar { align-items: stretch; }
    .jreg-filter { width: 100%; }
    .jreg-picker {
        position: fixed;
        top: 4.25rem;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 5rem);
        overflow: auto;
    }
    .jreg-picker-body { flex-direction: column; }
    .jreg-presets {
        width: auto;
        flex: none;
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        border-right: 0;
        border-bottom: 1px solid #f1f3f6;
        padding-bottom: 0.5rem;
    }
    .jreg-preset { width: auto; }
    .jreg-picker-foot { flex-wrap: wrap; }
}
.jreg-range {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 0.75rem;
}
.jreg-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.86rem; }
.jreg-table th {
    text-align: left;
    font-weight: 600;
    color: #9ca3af;
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.jreg-table td {
    padding: 0.35rem 0.6rem;
    color: #374151;
    vertical-align: top;
}
.jreg-table th.num,
.jreg-table td.num { text-align: right; white-space: nowrap; }
.jreg-table th.jreg-action-col,
.jreg-table td.jreg-action-col { width: 40px; text-align: right; }
.jreg-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #9ca3af;
    padding: 0;
    font-size: 0.95rem;
    text-decoration: none;
}
.jreg-edit:hover { color: #2563eb; }
.jreg-table a { color: #374151; text-decoration: none; }
.jreg-table a:hover { color: #2563eb; }
.jreg-sub td { border-top: 1px solid #e5e7eb; color: #111827; font-weight: 600; padding-top: 0.45rem; padding-bottom: 0.7rem; }
.jreg-entry + .jreg-entry td { padding-top: 0.7rem; }
.jreg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem 1rem;
    color: #9ca3af;
    font-size: 0.85rem;
}
.jreg-pagesize {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    border: 1px solid #e8eaee;
    border-radius: 8px;
    padding: 0.15rem 0.45rem;
    background: #fff;
    color: #374151;
}
.jreg-pagesize select { border: 0; background: transparent; color: #374151; font-size: 0.85rem; }
.jreg-pager { display: flex; align-items: center; gap: 0.2rem; margin-left: auto; }
.jreg-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.35rem;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
}
.jreg-page:hover { background: #f3f4f6; color: #111827; }
.jreg-page.is-current { background: #e8f1fe; color: #1e3a8a; font-weight: 600; }
.jreg-page.is-disabled { color: #d1d5db; pointer-events: none; }
@media (max-width: 575.98px) {
    .jreg-foot { flex-wrap: wrap; }
}

/* Manual journal form */
.jform-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.jform-back {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.92rem;
}
.jform-back:hover { color: #111827; }
.jform-crumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    color: #9ca3af;
    font-size: 0.95rem;
}
.jform-crumb a { color: #6b7280; text-decoration: none; }
.jform-crumb a:hover { color: #111827; }
.jform-crumb strong { color: #111827; font-weight: 600; }
.jform-top-actions { display: flex; align-items: center; gap: 0.5rem; }
.jform-more {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #fff;
    color: #6b7280;
}
.jform-more:hover { background: #f3f4f6; color: #111827; }
.jform-submit {
    border: 0;
    background: #f5b400;
    color: #fff;
    font-weight: 700;
    height: 40px;
    padding: 0 1.15rem;
    border-radius: 10px;
}
.jform-submit:hover { background: #e0a500; color: #fff; }
.jform-alert {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    background: #fff6d8;
    color: #92610a;
    font-size: 0.92rem;
}
.jform-card {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.jform-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.95rem 1.15rem;
    font-weight: 600;
    color: #111827;
}
.jform-toggle i { color: #9ca3af; }
.jform-body { padding: 0.15rem 1.15rem 1.15rem; }
.jform-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.jform-grid-extra { grid-template-columns: 1fr 1fr; }
.jform-grid label, .jform-attach-wrap { display: flex; flex-direction: column; gap: 0.35rem; }
.jform-grid label > span, .jform-attach-wrap > span {
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 500;
}
.jform-grid .bi-info-circle { color: #c5cad3; font-size: 0.75rem; }
.jform-input {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    color: #111827;
    padding: 0 0.75rem;
}
.jform-input:focus { outline: 2px solid #e7eefc; background: #fff; }
.jform-lines {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1.25rem;
    align-items: start;
}
.jform-table { width: 100%; border-collapse: collapse; }
.jform-table th {
    text-align: left;
    color: #9ca3af;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.35rem 0.4rem 0.55rem;
}
.jform-table td { padding: 0.3rem 0.35rem; vertical-align: middle; }
.jform-table th.num, .jform-money { text-align: right; }
.jform-no-col, .jform-no { width: 36px; color: #9ca3af; text-align: center; }
.jform-add {
    border: 0;
    background: transparent;
    color: #6d5efc;
    font-weight: 600;
    padding: 0.65rem 0.2rem 0;
}
.jform-add:hover { color: #4f46e5; }
.jform-remove {
    border: 0;
    background: transparent;
    color: #d1d5db;
    width: 28px;
    height: 28px;
    padding: 0;
}
.jform-remove:hover { color: #ef4444; }
.jform-totals { display: flex; flex-direction: column; gap: 0.85rem; padding-top: 1.6rem; }
.jform-totals div { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.jform-totals span { color: #6b7280; font-size: 0.86rem; }
.jform-totals strong { color: #111827; font-size: 0.95rem; }
#totalDiff.is-off { color: #ef4444; }
.jform-diff-btn {
    border: 0;
    background: #fde8e8;
    color: #e11d48;
    border-radius: 10px;
    min-height: 40px;
    font-weight: 600;
}
.jform-diff-btn:hover { background: #fcd5d5; }
.jform-file { color: #6d5efc; font-size: 0.85rem; text-decoration: none; }
.jform-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 0.9rem;
    border-radius: 10px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
}
.jform-attach input { display: none; }
.jform-attach:hover { background: #e8eaee; }
@media (max-width: 991.98px) {
    .jform-grid, .jform-lines { grid-template-columns: 1fr; }
    .jform-grid-extra { grid-template-columns: 1fr; }
}

/* General ledger report */
.gl-page h1 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
}
.gl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.gl-search {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 240px;
    max-width: 100%;
    height: 40px;
    padding: 0 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #9ca3af;
}
.gl-search input {
    border: 0;
    outline: none;
    width: 100%;
    background: transparent;
    color: #111827;
}
.gl-tools { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.gl-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 40px;
    padding: 0 0.9rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
}
.gl-outline:hover { background: #f9fafb; color: #111827; }
.gl-filter {
    width: 280px;
    padding: 0.85rem;
    border: 1px solid #eef0f3;
    border-radius: 12px;
}
.gl-filter form { display: flex; flex-direction: column; gap: 0.65rem; }
.gl-filter label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: #6b7280; }
.gl-filter input, .gl-filter select {
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 0.55rem;
    color: #111827;
}
.gl-apply {
    border: 0;
    background: #4f46e5;
    color: #fff;
    border-radius: 8px;
    height: 36px;
    font-weight: 600;
}
.gl-board {
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 16px;
    overflow: hidden;
}
.gl-head, .gl-toggle, .gl-detail-grid {
    display: grid;
    grid-template-columns: minmax(140px, 1.4fr) 110px minmax(120px, 1fr) minmax(120px, 1fr);
    gap: 0.75rem;
    align-items: center;
}
.gl-head {
    padding: 0.85rem 1rem;
    color: #9ca3af;
    font-size: 0.82rem;
    border-bottom: 1px solid #f3f4f6;
}
.gl-item { border-top: 1px solid #f3f4f6; }
.gl-item:first-of-type { border-top: 0; }
.gl-main { display: flex; align-items: center; }
.gl-toggle {
    flex: 1;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 0.95rem 0.5rem 0.95rem 1rem;
    color: #111827;
}
.gl-item.is-open .gl-toggle,
.gl-item.is-open { background: #fafafa; }
.gl-name { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; min-width: 0; }
.gl-name i { color: #9ca3af; font-size: 0.8rem; transition: transform 0.15s; }
.gl-item.is-open .gl-name i { transform: rotate(180deg); }
.gl-balance { color: #374151; }
.gl-account {
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gl-detail { padding: 0.35rem 1rem 1rem; background: #fafafa; }
.gl-meta { grid-column: 1 / 3; display: flex; flex-direction: column; gap: 0.35rem; color: #374151; font-size: 0.9rem; }
.gl-meta span { display: inline-block; min-width: 5.5rem; color: #9ca3af; }
.gl-side-label { color: #9ca3af; font-size: 0.78rem; margin-bottom: 0.35rem; }
.gl-side-line {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0;
    color: #374151;
    font-size: 0.88rem;
}
.gl-side-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-total {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    color: #6b7280;
}
.gl-total strong { color: #111827; }
.gl-none { margin: 0; padding: 1.5rem 1rem; text-align: center; color: #9ca3af; }
@media (max-width: 767.98px) {
    .gl-toolbar { flex-direction: column; align-items: stretch; }
    .gl-search { width: 100%; }
    .gl-head { display: none; }
    .gl-toggle, .gl-detail-grid { grid-template-columns: 1fr 1fr; }
    .gl-meta { grid-column: 1 / -1; margin-bottom: 0.5rem; }
    .gl-balance { grid-column: 1 / -1; }
}

/* Profit and loss statement */
.pnl-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}
.pnl-mode {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.pnl-mode:hover { background: #f9fafb; color: #111827; }
.pnl-mode.is-active { background: #111827; border-color: #111827; color: #fff; }
.pnl-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem 0.7rem; width: 100%; }
.pnl-year {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}
.pnl-years input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; padding: 0; }
.pnl-field { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 0.88rem; font-weight: 600; color: #374151; }
.pnl-custom input {
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0 0.45rem;
    color: #111827;
    background: #fff;
}
.pnl-custom button {
    height: 36px;
    border: 0;
    border-radius: 8px;
    padding: 0 0.85rem;
    background: #111827;
    color: #fff;
    font-weight: 600;
}
.pnl {
    max-width: 920px;
    margin: 0 auto 2rem;
    color: #111827;
}
.pnl-org, .pnl h1, .pnl-heading { text-align: center; margin: 0; }
.pnl-org { font-weight: 600; }
.pnl h1 { font-size: 1.15rem; font-weight: 600; margin-top: 0.15rem; }
.pnl-heading { margin: 0.15rem 0 1rem; }
.pnl-scroll { overflow-x: auto; }
.pnl-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.pnl-table th, .pnl-table td { padding: 0.18rem 0.65rem; vertical-align: baseline; }
.pnl-table th.num, .pnl-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 5.5rem; }
.pnl-table thead th { font-weight: 600; border-bottom: 1px solid #111827; padding-bottom: 0.35rem; }
.pnl-section td { padding-top: 0.85rem; }
.pnl-indent td:first-child { padding-left: 1.75rem; }
.pnl-total td { border-top: 1px solid #111827; font-weight: 600; padding-top: 0.28rem; }
.pnl-net td {
    border-top: 1px solid #111827;
    border-bottom: 3px double #111827;
    font-weight: 700;
    padding-top: 0.45rem;
    padding-bottom: 0.2rem;
}

/* Print */
@media print {
    .sidebar, .sidebar-open, .btn, .jreg-edit, .gl-toolbar, .pnl-toolbar, form, .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }
}
