/* Accounts module widgets — used inside main admin .bk shell (same as Operations) */

:root {
    --ac-accent: #2563eb;
    --ac-success: #059669;
    --ac-warn: #d97706;
    --ac-danger: #e11d48;
    --ac-card: #ffffff;
    --ac-border: #e2e8f0;
    --ac-text: #0f172a;
    --ac-muted: #64748b;
}

.ac-page-head {
    margin-bottom: 1rem;
}

.ac-page-head h1 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--ac-text);
}

.ac-page-head p {
    margin: 0.25rem 0 0;
    color: var(--ac-muted);
    font-size: 0.92rem;
}

.bk-shell__body > .ac-stats,
.bk-shell__body > .ac-toolbar,
.bk-shell__body > .ac-panel,
.bk-shell__body > .ac-charts,
.bk-shell__body > .ac-note,
.bk-shell__body > .ac-form-card {
    margin-left: 0;
    margin-right: 0;
}

.ac-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.ac-stat {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--ac-card);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ac-stat__icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.ac-stat__icon--slate { background: #e2e8f0; color: #334155; }
.ac-stat__icon--blue { background: #dbeafe; color: #1d4ed8; }
.ac-stat__icon--teal { background: #ccfbf1; color: #0f766e; }
.ac-stat__icon--amber { background: #fef3c7; color: #b45309; }
.ac-stat__icon--rose { background: #ffe4e6; color: #be123c; }
.ac-stat__icon--emerald { background: #d1fae5; color: #047857; }
.ac-stat__icon--indigo { background: #e0e7ff; color: #4338ca; }
.ac-stat__icon--purple { background: #f3e8ff; color: #7e22ce; }
.ac-stat__icon--orange { background: #ffedd5; color: #c2410c; }

.ac-stat__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--ac-muted);
    margin: 0;
}

.ac-stat__value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--ac-text);
    line-height: 1.2;
    margin: 0.1rem 0 0;
}

.ac-stat__sub {
    font-size: 0.68rem;
    color: #94a3b8;
    margin: 0.12rem 0 0;
}

.ac-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    background: var(--ac-card);
    border: 1px solid var(--ac-border);
    border-radius: 12px;
    padding: 0.75rem 0.9rem;
    margin-bottom: 0.9rem;
}

.ac-toolbar .form-select,
.ac-toolbar .form-control {
    min-width: 140px;
    max-width: 240px;
    font-size: 0.875rem;
}

.ac-toolbar__search {
    flex: 1 1 200px;
    min-width: 180px;
    max-width: none !important;
}

.ac-toolbar__spacer {
    flex: 1;
}

.ac-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.ac-btn--primary {
    background: var(--ac-success);
    color: #fff;
}

.ac-btn--primary:hover { background: #047857; color: #fff; }

.ac-btn--ghost {
    background: #e2e8f0;
    color: #334155;
}

.ac-btn--ghost:hover { background: #cbd5e1; }

.ac-btn--outline {
    background: transparent;
    border: 1px solid #93c5fd;
    color: #1d4ed8;
}

.ac-btn--sm {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
}

.ac-btn--pay {
    background: #059669;
    color: #fff;
}

.ac-panel {
    background: var(--ac-card);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.ac-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--ac-border);
}

.ac-panel__head h2 {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ac-muted);
    font-weight: 700;
}

.ac-panel__meta {
    font-size: 0.78rem;
    color: #94a3b8;
}

.ac-table-wrap {
    overflow-x: auto;
}

.ac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ac-table th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ac-muted);
    font-weight: 700;
    border-bottom: 1px solid var(--ac-border);
    background: #f8fafc;
    white-space: nowrap;
}

.ac-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--ac-text);
    vertical-align: middle;
}

.ac-table tr:last-child td { border-bottom: none; }
.ac-table tr:hover td { background: #f8fafc; }

.ac-link {
    color: var(--ac-accent);
    font-weight: 600;
    text-decoration: none;
}

.ac-link:hover { text-decoration: underline; }

.ac-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
}

.ac-badge--pending { background: #ffedd5; color: #c2410c; }
.ac-badge--approved,
.ac-badge--confirmed,
.ac-badge--paid,
.ac-badge--completed,
.ac-badge--processed { background: #d1fae5; color: #047857; }
.ac-badge--rejected { background: #ffe4e6; color: #be123c; }
.ac-badge--overdue { background: #fecdd3; color: #9f1239; }
.ac-badge--updated { background: #dbeafe; color: #1d4ed8; }

.ac-actions {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.ac-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--ac-border);
    background: #fff;
    color: #475569;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
}

.ac-icon-btn:hover { background: #f1f5f9; color: var(--ac-accent); }
.ac-icon-btn--danger:hover { color: var(--ac-danger); background: #fff1f2; }
.ac-icon-btn--success { color: #059669; border-color: #a7f3d0; }
.ac-icon-btn--success:hover { background: #ecfdf5; }

.ac-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--ac-muted);
}

.ac-form-card {
    background: var(--ac-card);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
    max-width: 820px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ac-form-card h1 {
    margin: 0 0 0.15rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.ac-form-card .ac-form-sub {
    margin: 0 0 1.15rem;
    color: var(--ac-muted);
    font-size: 0.9rem;
}

.ac-form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.15rem;
}

.ac-note {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
    border: 1px solid var(--ac-border);
    border-radius: 10px;
    color: var(--ac-muted);
    font-size: 0.82rem;
}

.ac-note i { color: #64748b; margin-top: 0.1rem; }

.ac-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ac-chart-card {
    background: var(--ac-card);
    border: 1px solid var(--ac-border);
    border-radius: 14px;
    padding: 1rem 1.15rem;
}

.ac-chart-card h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-chart-card h3 i {
    margin-right: 0.35rem;
    color: #0f766e;
}

.ac-chart-placeholder {
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ac-bar-row {
    display: grid;
    grid-template-columns: 48px 1fr 56px;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #64748b;
}

.ac-bar-track {
    height: 10px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}

.ac-bar-track span { display: block; height: 100%; }
.ac-bar-track .rev { background: #0f766e; }
.ac-bar-track .exp { background: #d97706; }

.ac-pie {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 160px;
}

.ac-pie__ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(
        #0f766e 0 35%,
        #059669 35% 60%,
        #d97706 60% 80%,
        #6366f1 80% 95%,
        #94a3b8 95% 100%
    );
    position: relative;
    flex-shrink: 0;
}

.ac-pie__ring::after {
    content: "";
    position: absolute;
    inset: 28px;
    background: #fff;
    border-radius: 50%;
}

.ac-pie__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    color: #475569;
}

.ac-pie__legend li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.ac-pie__swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.ac-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ac-modal {
    background: #fff;
    border-radius: 16px;
    width: min(520px, 100%);
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.ac-modal--lg { width: min(720px, 100%); }
.ac-modal--xl { width: min(920px, 100%); }

.ac-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--ac-primary, #1d4ed8);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.ac-link:hover { text-decoration: underline; }

.ac-form-dialog .ac-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.ac-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--ac-border);
}

.ac-modal__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ac-modal__body {
    padding: 1.15rem 1.25rem;
    display: grid;
    gap: 0.85rem;
}

.ac-modal__foot {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--ac-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.ac-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ac-muted);
    margin-bottom: 0.3rem;
}

.ac-receipt {
    background: #0f172a;
    color: #fff;
    border-radius: 14px;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.ac-receipt__amount {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.ac-receipt__paid-to {
    font-size: 0.85rem;
    color: #94a3b8;
}

.ac-receipt__company {
    font-weight: 700;
    color: #fff;
    margin-top: 0.15rem;
}

.ac-receipt__ok {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #34d399;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

@media (max-width: 900px) {
    .ac-charts { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .ac-stats { grid-template-columns: 1fr 1fr; }
}
