.ia-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid rgb(0 0 0 / 0.06);
    padding: 1rem;
    overflow-x: auto;
}
.dark .ia-card {
    background: #18181b;
    border-color: rgb(255 255 255 / 0.1);
}

.ia-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}
.ia-filter-field label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #0f0f11;
}
.dark .ia-filter-field label {
    color: #fff;
}
.ia-filter-field input[type="date"],
.ia-filter-field select {
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
}
.dark .ia-filter-field input[type="date"],
.dark .ia-filter-field select {
    border-color: #4b5563;
    background: #27272a;
    color: #fff;
}

.ia-table {
    width: 100%;
    border-collapse: collapse;
    text-align: start;
}
.ia-table th {
    padding: 0.75rem 1rem;
    text-align: start;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 1px solid rgb(0 0 0 / 0.08);
}
.dark .ia-table th {
    border-color: rgb(255 255 255 / 0.1);
}
.ia-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgb(0 0 0 / 0.04);
}
.dark .ia-table td {
    border-color: rgb(255 255 255 / 0.05);
    color: #e5e7eb;
}
.ia-table tr.ia-row-group {
    background: rgb(0 0 0 / 0.03);
}
.dark .ia-table tr.ia-row-group {
    background: rgb(255 255 255 / 0.04);
}
.ia-table tr.ia-row-total td {
    border-top: 2px solid #d1d5db;
    font-weight: 600;
}
.dark .ia-table tr.ia-row-total td {
    border-color: rgb(255 255 255 / 0.15);
}
.ia-text-end { text-align: end; }
.ia-empty {
    padding: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

.ia-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 0.375rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.ia-badge-asset       { background: #eff6ff; color: #1d4ed8; }
.dark .ia-badge-asset  { background: rgb(59 130 246 / 0.15); color: #60a5fa; }
.ia-badge-liability      { background: #fffbeb; color: #b45309; }
.dark .ia-badge-liability{ background: rgb(245 158 11 / 0.15); color: #fbbf24; }
.ia-badge-equity      { background: #f5f3ff; color: #6d28d9; }
.dark .ia-badge-equity{ background: rgb(139 92 246 / 0.15); color: #a78bfa; }
.ia-badge-revenue      { background: #ecfdf5; color: #047857; }
.dark .ia-badge-revenue{ background: rgb(16 185 129 / 0.15); color: #34d399; }
.ia-badge-expense      { background: #fef2f2; color: #b91c1c; }
.dark .ia-badge-expense{ background: rgb(239 68 68 / 0.15); color: #f87171; }

.ia-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 640px) {
    .ia-stat-grid { grid-template-columns: 1fr; }
}
.ia-stat {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid rgb(0 0 0 / 0.06);
    padding: 1.5rem;
}
.dark .ia-stat {
    background: #18181b;
    border-color: rgb(255 255 255 / 0.1);
}
.ia-stat-label { font-size: 0.75rem; font-weight: 600; color: #6b7280; }
.ia-stat-value { margin-top: 0.5rem; font-size: 1.5rem; font-weight: 700; }
.ia-stat-value.ia-positive { color: #047857; }
.dark .ia-stat-value.ia-positive { color: #34d399; }
.ia-stat-value.ia-negative { color: #b91c1c; }
.dark .ia-stat-value.ia-negative { color: #f87171; }

/* Chart of accounts tree */
.ia-tree-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem 0.5rem;
    border-bottom: 1px solid rgb(0 0 0 / 0.06);
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}
.dark .ia-tree-header { border-color: rgb(255 255 255 / 0.08); }
.ia-tree-col-name { flex: 1; }
.ia-tree-col-type { width: 7rem; flex-shrink: 0; }
.ia-tree-col-balance { width: 5rem; flex-shrink: 0; }
.ia-tree-col-system { width: 2rem; flex-shrink: 0; text-align: center; }

.ia-tree-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.5rem;
    padding: 0.375rem 0.5rem;
}
.ia-tree-row:hover { background: rgb(0 0 0 / 0.03); }
.dark .ia-tree-row:hover { background: rgb(255 255 255 / 0.04); }
.ia-tree-name-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.ia-toggle-btn {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    border: 1px solid #9ca3af;
    background: #f3f4f6;
    color: #374151;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.ia-toggle-btn:hover {
    background: #d1fae5;
    border-color: #39B54A;
    color: #15803d;
}
.dark .ia-toggle-btn {
    background: rgb(255 255 255 / 0.06);
    border-color: rgb(255 255 255 / 0.25);
    color: #e5e7eb;
}
.dark .ia-toggle-btn:hover {
    background: rgb(57 181 74 / 0.2);
    border-color: #39B54A;
    color: #4ade80;
}
.ia-toggle-spacer { display: inline-block; flex-shrink: 0; width: 1.5rem; height: 1.5rem; }

.ia-tree-code {
    width: 4rem;
    flex-shrink: 0;
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: #6b7280;
}
.dark .ia-tree-code { color: #9ca3af; }
.ia-tree-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}
.ia-tree-name.ia-strong { font-weight: 600; }
.ia-tree-children {
    border-inline-start: 1px solid rgb(0 0 0 / 0.1);
}
.dark .ia-tree-children { border-color: rgb(255 255 255 / 0.1); }
.ia-tree-check { color: #39B54A; font-weight: 700; }
