/* Accounting module design layer.
   EVERY rule here MUST start with .module-accounting — MainLayout adds that class to its
   content wrapper only for /accounting/* routes. An unscoped rule leaks into the school
   module and is a defect. Shipped as an RCL static asset; linked from index.html. */

/* ── Tables ─────────────────────────────────────────────────────
   Targets every table in the module regardless of which Bootstrap class
   combination the page happens to use (11 different combos exist). */
.module-accounting table {
    inline-size: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.module-accounting table thead th {
    background: var(--brand-wash);
    color: var(--brand-ink);
    font-weight: 600;
    font-size: 12.5px;
    padding: 10px 12px;
    border-block-end: 1px solid var(--brand-soft);
    white-space: nowrap;
    text-align: start;
}

.module-accounting table tbody td {
    padding: 9px 12px;
    border-block-end: 1px solid #f1f5f9;
    color: #0f172a;
    vertical-align: middle;
    /* Digits share one advance width so decimal points stack down a column —
       the thing an accountant actually reads a balance column by. */
    font-variant-numeric: tabular-nums;
}

.module-accounting table tbody tr:last-child td { border-block-end: 0; }

/* Replaces Bootstrap's heavy grey zebra banding with a quiet hover. */
.module-accounting table.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: transparent;
    box-shadow: none;
}
.module-accounting table tbody tr:hover td { background: #f8fafc; }

/* Totals / footer rows read as a summary, not another data row. */
.module-accounting table tfoot td,
.module-accounting table tbody tr.total-row td {
    background: var(--brand-wash);
    font-weight: 700;
    color: var(--brand-ink);
    border-block-start: 2px solid var(--brand-soft);
}

/* ── Buttons ────────────────────────────────────────────────────
   The module inherited Bootstrap primary blue inside a green product. */
.module-accounting .btn-primary,
.module-accounting .btn-success {
    background: var(--brand-grad-accent);
    border: 0;
    color: #fff;
    font-weight: 600;
    transition: transform .15s var(--launcher-ease), box-shadow .15s var(--launcher-ease);
}
.module-accounting .btn-primary:hover,
.module-accounting .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(45, 106, 79, .32);
    color: #fff;
}
.module-accounting .btn-danger {
    background: #b91c1c;
    border: 0;
    font-weight: 600;
}
.module-accounting .btn-danger:hover { background: #991b1b; }
.module-accounting .btn-sm { font-size: 12px; padding: 5px 12px; }
.module-accounting .btn:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; box-shadow: none; }

/* ── In-page sub-tabs (e.g. Chart of Accounts: مخطط/نوع/نوع فرعي) ──
   These render a nested XTabs strip inside the page. They were bare text with
   only bold marking the active one. Scoped to the SECOND strip so the workspace
   tab bar (styled in xtabs-theme.css) is untouched. */
.module-accounting .xtabs .xtabs .xtabs-header {
    border-block-end: 1px solid #e2e8f0;
    gap: 2px;
    padding-inline: 4px;
}
.module-accounting .xtabs .xtabs .xtabs-header .xtabs-link {
    padding: 8px 16px;
    border-radius: 8px 8px 0 0;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    transition: color .15s var(--launcher-ease), background-color .15s var(--launcher-ease);
}
.module-accounting .xtabs .xtabs .xtabs-header .xtabs-link:hover {
    background: #f8fafc;
    color: var(--brand-deep);
}
.module-accounting .xtabs .xtabs .xtabs-header .xtabs-link.active {
    color: var(--brand-ink);
    font-weight: 700;
    background: #fff;
}
.module-accounting .xtabs .xtabs .xtabs-header .xtabs-link.active::after {
    content: "";
    position: absolute;
    inset-inline: 10px;
    bottom: -1px;
    block-size: 2px;
    background: var(--brand-grad-accent);
    border-radius: 2px 2px 0 0;
}

/* ── Cards / panels ─────────────────────────────────────────────
   Softens the flat bordered boxes the ported pages use for filter panels. */
.module-accounting .card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.module-accounting .card-header {
    background: var(--brand-wash);
    color: var(--brand-ink);
    font-weight: 600;
    border-block-end: 1px solid var(--brand-soft);
}

/* ── Form controls ──────────────────────────────────────────────
   Consistent height/rounding so filter bars stop looking mismatched. */
.module-accounting .form-control,
.module-accounting .form-select {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
}
.module-accounting .form-control:focus,
.module-accounting .form-select:focus {
    border-color: var(--brand-mid);
    box-shadow: 0 0 0 3px rgba(64, 145, 108, .16);
}

@media (prefers-reduced-motion: reduce) {
    .module-accounting .btn-primary,
    .module-accounting .btn-success { transition: none; }
    .module-accounting .btn-primary:hover,
    .module-accounting .btn-success:hover { transform: none; }
}

/* ── Busy states ────────────────────────────────────────────────
   Shared "working on it" indicator for report searches — replaces a
   blank results area while a report/search request is in flight. */
.module-accounting .acct-busy {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding-block: 32px; color: #64748b; font-size: 13px;
}
.module-accounting .acct-busy .spinner-border { inline-size: 18px; block-size: 18px; border-width: 2px; color: var(--brand-mid); }
