/* ===========================================================
   ACCOUNTING — CoA, Journal, Trial Balance, Dashboard
   =========================================================== */

.acc-tabs {
    display: flex; gap: 4px;
    background: var(--c-surface);
    border-radius: 14px;
    padding: 6px;
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
    overflow-x: auto;
}
.acc-tab {
    padding: 10px 18px;
    border-radius: 10px;
    color: var(--c-text-muted);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.acc-tab.active {
    background: linear-gradient(135deg, var(--c-primary), var(--c-primary-2));
    color: #fff;
    box-shadow: 0 6px 14px rgba(107,91,255,0.32);
}

/* Chart of Accounts tree */
.coa-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 14px;
}
@media (max-width: 1280px) { .coa-grid { grid-template-columns: 1fr; } }

.coa-tree {
    background: var(--c-surface);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 14px;
    max-height: 720px;
    overflow-y: auto;
}
.coa-tree h4 {
    margin: 0 0 10px;
    font-size: 14px; font-weight: 800;
    color: var(--c-text);
    display: flex; align-items: center; gap: 8px;
}
.coa-tree-node {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--c-text);
    font-size: 12.5px;
}
.coa-tree-node:hover { background: var(--c-bg-soft); }
.coa-tree-node.active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; }
.coa-tree-node .num { color: var(--c-text-muted); font-weight: 700; }
.coa-tree-node .nm { flex: 1; text-align: end; }

/* Account number badge */
.acc-number {
    display: inline-block;
    background: var(--c-bg-soft);
    color: var(--c-text);
    padding: 2px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: 700;
    font-size: 11.5px;
}

/* JE debit / credit columns */
.je-debit { color: var(--c-red); font-weight: 700; font-family: monospace; }
.je-credit { color: var(--c-green); font-weight: 700; font-family: monospace; }
.je-zero { color: var(--c-text-faint); }

/* JE balance badge in form */
.je-balance-badge {
    background: var(--c-surface-2);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}
.je-balance-badge .col { text-align: center; }
.je-balance-badge .col .l { color: var(--c-text-muted); font-size: 11.5px; }
.je-balance-badge .col .v { font-size: 18px; font-weight: 800; margin-top: 4px; }
.je-balance-badge .col.debit .v { color: var(--c-red); }
.je-balance-badge .col.credit .v { color: var(--c-green); }
.je-balance-badge .col.diff .v.zero { color: var(--c-green); }
.je-balance-badge .col.diff .v.bad { color: var(--c-red); }

/* TB grouped headers */
.tb-table thead th {
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    font-weight: 700;
    font-size: 11.5px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--c-border);
    text-align: end;
}
.tb-table thead th.group-header {
    text-align: center;
    background: var(--c-bg-soft);
    color: var(--c-text);
    font-weight: 800;
    font-size: 12.5px;
    padding-top: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--c-border);
}

.tb-table tfoot td {
    background: var(--c-surface-2);
    font-weight: 800;
    color: var(--c-text);
    padding: 14px 8px;
    border-top: 2px solid var(--c-border);
}

/* Auto-source rows on dashboard */
.auto-source-list { display: flex; flex-direction: column; gap: 10px; }
.auto-source-row {
    display: flex; align-items: center; gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--c-border);
    font-size: 12.5px;
}
.auto-source-row:last-child { border: 0; padding-bottom: 0; }
.auto-source-row .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.auto-source-row .name { flex: 1; color: var(--c-text); font-weight: 600; }
.auto-source-row .count { background: var(--c-bg-soft); padding: 3px 10px; border-radius: 8px; font-weight: 800; color: var(--c-text); font-size: 12px; }

/* Quick accounts list */
.quick-acc-list { display: flex; flex-direction: column; gap: 8px; }
.quick-acc-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
}
.quick-acc-row .ico {
    width: 28px; height: 28px;
    border-radius: 7px;
    background: var(--c-primary-soft); color: var(--c-primary);
    display: grid; place-items: center;
}
.quick-acc-row .num { font-family: monospace; font-weight: 800; color: var(--c-text); font-size: 12.5px; }
.quick-acc-row .nm { flex: 1; text-align: end; font-weight: 600; color: var(--c-text); font-size: 12.5px; }
