:root {
    --accounting-border: color-mix(in srgb, var(--apf-border, #d8dee7) 80%, #fff 20%);
    --accounting-soft: var(--apf-text-secondary, #667085);
}

.accounting-main {
    gap: 18px;
}

.accounting-header {
    align-items: flex-start;
    gap: 16px;
}

.accounting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.accounting-search {
    min-width: 280px;
    flex: 1;
}

.accounting-inline-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(0,94,184,0.08), rgba(0,94,184,0.02));
    border: 1px solid rgba(0,94,184,0.14);
    border-radius: 16px;
    padding: 14px 16px;
}

.accounting-kpi-grid,
.accounting-action-grid,
.accounting-workspace-grid,
.accounting-lower-grid,
.accounting-stat-grid {
    display: grid;
    gap: 16px;
}

.accounting-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.accounting-kpi-card,
.accounting-action-card,
.accounting-list-item,
.accounting-compact-item,
.accounting-table-card {
    border: 1px solid var(--accounting-border);
    background: var(--apf-surface, #fff);
    border-radius: 16px;
}

.accounting-kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.accounting-kpi-icon,
.accounting-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255,255,255,0.75);
}

.accounting-kpi-body {
    display: grid;
    gap: 4px;
}

.accounting-kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.accounting-kpi-label,
.accounting-action-text,
.accounting-list-meta,
.accounting-compact-meta,
.accounting-empty-note,
.accounting-upload-note {
    font-size: 13px;
    color: var(--accounting-soft);
}

.accounting-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.accounting-action-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    text-align: left;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.accounting-action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.accounting-action-title,
.accounting-list-title,
.accounting-compact-title {
    font-size: 18px;
    font-weight: 700;
}

.accounting-workspace-grid,
.accounting-lower-grid {
    grid-template-columns: 1.1fr 1fr 1fr;
}

.accounting-card {
    background: transparent;
}

.accounting-list-grid,
.accounting-upload-center,
.accounting-compact-list {
    display: grid;
    gap: 12px;
}

.accounting-list-item,
.accounting-compact-item {
    padding: 14px 16px;
}

.accounting-list-top,
.accounting-compact-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 4px;
}

.accounting-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.accounting-tag.is-blue { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.accounting-tag.is-green { background: rgba(34,197,94,0.12); color: #15803d; }
.accounting-tag.is-orange { background: rgba(245,158,11,0.14); color: #b45309; }
.accounting-tag.is-red { background: rgba(239,68,68,0.12); color: #b91c1c; }
.accounting-tag.is-slate { background: rgba(100,116,139,0.12); color: #475569; }
.accounting-tag.is-purple { background: rgba(168,85,247,0.14); color: #7e22ce; }

.accounting-stat-grid {
    grid-template-columns: repeat(2, 1fr);
}

.accounting-mini-stat {
    border: 1px solid var(--accounting-border);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--apf-surface, #fff) 92%, #eff4fb 8%);
}

.accounting-mini-stat-label {
    font-size: 12px;
    color: var(--accounting-soft);
    margin-bottom: 6px;
}

.accounting-mini-stat-value {
    font-size: 24px;
    font-weight: 700;
}

.accounting-upload-help {
    border: 1px dashed rgba(0,94,184,0.22);
    border-radius: 16px;
    padding: 16px;
    background: color-mix(in srgb, var(--apf-surface, #fff) 96%, #eef5ff 4%);
}

.accounting-upload-help code {
    display: inline-block;
    margin: 4px 6px 0 0;
}

.accounting-table-card {
    padding-bottom: 2px;
}

.accounting-table-wrap {
    overflow: auto;
}

.accounting-table {
    width: 100%;
    border-collapse: collapse;
}

.accounting-table th,
.accounting-table td {
    padding: 12px 14px;
    border-top: 1px solid var(--accounting-border);
    text-align: left;
    vertical-align: top;
}

.accounting-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accounting-soft);
    background: color-mix(in srgb, var(--apf-surface, #fff) 92%, #eff4fb 8%);
}

.accounting-expense-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.accounting-expense-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(0,94,184,0.12);
    color: #005EB8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.accounting-expense-title {
    font-weight: 700;
}

.accounting-expense-sub {
    font-size: 12px;
    color: var(--accounting-soft);
}

.accounting-row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.accounting-statusbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--accounting-border);
    background: color-mix(in srgb, var(--apf-surface, #fff) 90%, #eaf2fb 10%);
    color: var(--accounting-soft);
    font-size: 12px;
}

.tone-blue { border-top: 4px solid #3b82f6; }
.tone-green { border-top: 4px solid #22c55e; }
.tone-orange { border-top: 4px solid #f59e0b; }
.tone-purple { border-top: 4px solid #a855f7; }
.tone-sky { border-top: 4px solid #38bdf8; }
.tone-red { border-top: 4px solid #ef4444; }
.tone-dark { border-top: 4px solid #334155; }

@media (max-width: 1200px) {
    .accounting-workspace-grid,
    .accounting-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .accounting-actions {
        justify-content: stretch;
    }

    .accounting-search {
        min-width: 100%;
    }
}

@media (max-width: 640px) {
    .accounting-kpi-grid,
    .accounting-action-grid,
    .accounting-stat-grid {
        grid-template-columns: 1fr;
    }

    .accounting-statusbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
