/* ==========================================================================
   محاسب عام — Design System
   All styles live here. No inline styles or <style> tags in Blade.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
    background: var(--ac-bg);
    color: var(--ac-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

svg { display: block; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   2. Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand */
    --ac-primary:        #2563eb;
    --ac-primary-hover:  #1d4ed8;
    --ac-primary-light:  #eff6ff;

    /* Semantic */
    --ac-success:        #16a34a;
    --ac-danger:         #dc2626;
    --ac-warning:        #d97706;

    /* Text */
    --ac-text:           #111827;
    --ac-text-muted:     #6b7280;
    --ac-text-light:     #9ca3af;

    /* Surface */
    --ac-bg:             #f3f4f6;
    --ac-bg-white:       #ffffff;
    --ac-border:         #e5e7eb;
    --ac-border-dark:    #d1d5db;

    /* Sidebar */
    --sidebar-bg:        #0f172a;
    --sidebar-border:    #1e293b;
    --sidebar-text:      #94a3b8;
    --sidebar-text-hover:#e2e8f0;
    --sidebar-active-bg: #1e3a5f;
    --sidebar-active:    #60a5fa;
    --sidebar-section:   #475569;
    --sidebar-width:     260px;
    --sidebar-collapsed-width: 80px;

    /* Misc */
    --ac-radius:         6px;
    --ac-radius-lg:      10px;
    --ac-shadow:         0 1px 3px rgba(0,0,0,.08);
    --ac-shadow-md:      0 4px 12px rgba(0,0,0,.10);
    --topbar-height:     60px;
}

/* --------------------------------------------------------------------------
   3. App Shell — Sidebar + Main (RTL)
   -------------------------------------------------------------------------- */
.ac-app {
    display: flex;
    flex-direction: row-reverse;   /* sidebar on the right in RTL */
    min-height: 100vh;
}

.ac-app.ac-no-scroll {
    overflow: hidden;
}

.ac-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, .54);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
    backdrop-filter: blur(2px);
}

/* ── Sidebar ── */
.ac-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    box-shadow: -18px 0 42px rgba(15, 23, 42, .12);
    transition: width .3s ease, transform .3s ease, box-shadow .3s ease;
    will-change: width, transform;
}

/* Brand / Logo */
.ac-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    height: var(--topbar-height);
    border-bottom: 1px solid var(--sidebar-border);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.3px;
    flex-shrink: 0;
    overflow: hidden;
}

.ac-sidebar__brand-icon {
    width: 28px;
    height: 28px;
    color: var(--sidebar-active);
}

.ac-sidebar__brand span,
.ac-sidebar__section-title,
.ac-sidebar__link,
.ac-sidebar__user-info {
    transition: opacity .22s ease, transform .22s ease, color .15s ease, background .15s ease;
}

.ac-sidebar__close {
    display: none;
    width: 34px;
    height: 34px;
    margin-inline-start: auto;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: var(--ac-radius-lg);
    color: #cbd5e1;
    background: rgba(255, 255, 255, .06);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.ac-sidebar__close svg {
    width: 18px;
    height: 18px;
}

.ac-sidebar__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, .12);
}

/* Scrollable nav area */
.ac-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: #1e293b transparent;
}

.ac-sidebar__nav::-webkit-scrollbar { width: 4px; }
.ac-sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.ac-sidebar__nav::-webkit-scrollbar-thumb { background: var(--sidebar-border); border-radius: 4px; }

/* Section group */
.ac-sidebar__section { margin-bottom: 4px; }

.ac-sidebar__section-title {
    display: block;
    padding: 8px 20px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-section);
    user-select: none;
}

/* Nav link */
.ac-sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sidebar-text);
    transition: background 0.15s, color 0.15s;
    border-radius: 0;
    cursor: pointer;
    position: relative;
    min-height: 38px;
    white-space: nowrap;
}

.ac-sidebar__link svg {
    width: 17px;
    height: 17px;
    opacity: 0.7;
    flex-shrink: 0;
}

.ac-sidebar__link:hover {
    background: rgba(255,255,255,.05);
    color: var(--sidebar-text-hover);
    padding-inline-start: 22px;
}

.ac-sidebar__link:hover svg { opacity: 1; }

.ac-sidebar__link--active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-weight: 600;
}

.ac-sidebar__link--active::before {
    content: "";
    position: absolute;
    top: 9px;
    bottom: 9px;
    right: 0;
    width: 3px;
    border-radius: 999px 0 0 999px;
    background: var(--sidebar-active);
}

.ac-sidebar__link--active svg { opacity: 1; color: var(--sidebar-active); }

/* Footer (user info + logout) */
.ac-sidebar__footer {
    border-top: 1px solid var(--sidebar-border);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.ac-sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ac-sidebar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--sidebar-border);
}

.ac-sidebar__user-info { min-width: 0; }

.ac-sidebar__user-name {
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-sidebar__user-role {
    font-size: 11px;
    color: var(--sidebar-section);
    white-space: nowrap;
}

.ac-sidebar__logout {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--sidebar-section);
    border-radius: var(--ac-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.ac-sidebar__logout svg { width: 17px; height: 17px; }

.ac-sidebar__logout:hover {
    color: #f87171;
    background: rgba(248,113,113,.1);
}

/* ── Main content ── */
.ac-main {
    flex: 1;
    margin-right: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-right .3s ease;
}

/* Top bar */
.ac-topbar {
    height: var(--topbar-height);
    background: var(--ac-bg-white);
    border-bottom: 1px solid var(--ac-border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 16px;
}

.ac-sidebar-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    color: var(--ac-text);
    background: var(--ac-bg-white);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .15s;
}

.ac-sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

.ac-sidebar-toggle:hover {
    color: var(--ac-primary);
    border-color: #bfdbfe;
    background: var(--ac-primary-light);
    transform: translateY(-1px);
}

.ac-sidebar-toggle__menu {
    display: none;
}

.ac-sidebar-toggle__collapse {
    display: block;
    transition: transform .3s ease;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar {
    width: var(--sidebar-collapsed-width);
}

.ac-app.ac-sidebar-collapsed .ac-main {
    margin-right: var(--sidebar-collapsed-width);
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__brand {
    justify-content: center;
    padding-inline: 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__brand span,
.ac-app.ac-sidebar-collapsed .ac-sidebar__section-title,
.ac-app.ac-sidebar-collapsed .ac-sidebar__user-info {
    width: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(8px);
    overflow: hidden;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__section-title {
    height: 10px;
    padding: 6px 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__link {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
    font-size: 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__link:hover {
    padding-inline: 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__link svg {
    width: 20px;
    height: 20px;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__link::after {
    content: attr(data-sidebar-label);
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    z-index: 120;
    min-width: max-content;
    padding: 6px 10px;
    color: #fff;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    box-shadow: var(--ac-shadow-md);
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    visibility: hidden;
    transform: translate(6px, -50%);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    pointer-events: none;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__link:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__footer {
    justify-content: center;
    padding-inline: 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__user {
    min-width: 0;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar__logout {
    display: none;
}

.ac-app.ac-sidebar-collapsed .ac-sidebar-toggle__collapse {
    transform: rotate(180deg);
}

@media (max-width: 900px) {
    .ac-sidebar {
        width: min(var(--sidebar-width), calc(100vw - 28px));
        transform: translateX(105%);
        box-shadow: -24px 0 48px rgba(15, 23, 42, .28);
    }

    .ac-main,
    .ac-app.ac-sidebar-collapsed .ac-main {
        margin-right: 0;
    }

    .ac-topbar {
        padding-inline: 14px;
    }

    .ac-topbar__title {
        font-size: 15px;
    }

    .ac-page {
        padding: 18px 14px;
    }

    .ac-sidebar__close {
        display: inline-flex;
    }

    .ac-sidebar-toggle__menu {
        display: block;
    }

    .ac-sidebar-toggle__collapse {
        display: none;
    }

    .ac-app.ac-sidebar-mobile-open .ac-sidebar {
        transform: translateX(0);
    }

    .ac-app.ac-sidebar-mobile-open .ac-sidebar-overlay {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar {
        width: min(var(--sidebar-width), calc(100vw - 28px));
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__brand {
        justify-content: flex-start;
        padding-inline: 20px;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__brand span,
    .ac-app.ac-sidebar-collapsed .ac-sidebar__section-title,
    .ac-app.ac-sidebar-collapsed .ac-sidebar__user-info {
        width: auto;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        overflow: visible;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__section-title {
        height: auto;
        padding: 8px 20px 4px;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__link {
        justify-content: flex-start;
        gap: 10px;
        padding: 9px 20px;
        font-size: 13px;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__link::after {
        display: none;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__link svg {
        width: 17px;
        height: 17px;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__footer {
        justify-content: space-between;
        padding: 14px 16px;
    }

    .ac-app.ac-sidebar-collapsed .ac-sidebar__logout {
        display: flex;
    }
}

@media (max-width: 560px) {
    .ac-topbar {
        gap: 10px;
    }

    .ac-topbar > div {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
    }

    .ac-sidebar-toggle {
        width: 36px;
        height: 36px;
    }
}

.ac-topbar__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ac-text);
    flex: 1;
}

/* Page content area */
.ac-page {
    padding: 28px;
    flex: 1;
}

/* --------------------------------------------------------------------------
   4. Dashboard
   -------------------------------------------------------------------------- */

/* Section label */
.ac-dash-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin: 0 0 10px;
}

/* Grid variants */
.ac-dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.ac-dash-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--ac-shadow);
}

.ac-dash-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ac-dash-card__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ac-dash-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ac-dash-card__icon svg { width: 18px; height: 18px; }

.ac-dash-card__icon--blue    { background: #dbeafe; color: #2563eb; }
.ac-dash-card__icon--green   { background: #dcfce7; color: #16a34a; }
.ac-dash-card__icon--red     { background: #fee2e2; color: #dc2626; }
.ac-dash-card__icon--amber   { background: #fef3c7; color: #d97706; }

.ac-dash-card__amount {
    font-size: 26px;
    font-weight: 800;
    color: var(--ac-text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.ac-dash-card__footer {
    font-size: 12px;
    color: var(--ac-text-muted);
    border-top: 1px solid var(--ac-border);
    padding-top: 10px;
}

.ac-dash-card__trend--up      { color: var(--ac-success);    font-weight: 600; }
.ac-dash-card__trend--down    { color: var(--ac-danger);     font-weight: 600; }
.ac-dash-card__trend--neutral { color: var(--ac-text-muted); font-weight: 500; }

/* Grid column variants */
.ac-dash-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ac-dash-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
    .ac-dash-grid--2,
    .ac-dash-grid--3 { grid-template-columns: 1fr; }
}

/* Total card variant */
.ac-dash-card--total { border: 2px solid var(--ac-border-dark); }

/* Success amount color */
.ac-text-success { color: var(--ac-success); }

/* Spacer between dashboard sections */
.ac-dash-grid,
.ac-period-grid { margin-bottom: 24px; }

/* ── Period panel (revenue / expense breakdown) ─────────────────────── */
.ac-period-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 768px) {
    .ac-period-grid { grid-template-columns: 1fr; }
}

.ac-period-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
}

.ac-period-card__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.ac-period-card__head--green { background: var(--ac-success); }
.ac-period-card__head--red   { background: var(--ac-danger); }

.ac-period-card__body { padding: 4px 0; }

.ac-period-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ac-border);
    font-size: 13px;
}

.ac-period-row:last-child { border-bottom: none; }

.ac-period-row--bold { background: #fafafa; }
.ac-period-row--bold .ac-period-row__label,
.ac-period-row--bold .ac-period-row__value { font-weight: 700; }

.ac-period-row__label { color: var(--ac-text-muted); }

.ac-period-row__value {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-period-row__value--green { color: var(--ac-success); }
.ac-period-row__value--red   { color: var(--ac-danger); }

/* ── Monthly report cards ──────────────────────────────────────────── */
.ac-monthly-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border-radius: var(--ac-radius) var(--ac-radius) 0 0;
}

.ac-monthly-head--green { background: var(--ac-success); }
.ac-monthly-head--red   { background: var(--ac-danger); }

.ac-monthly-list { padding: 4px 0; }

.ac-monthly-empty {
    padding: 20px 16px;
    font-size: 13px;
    color: var(--ac-text-muted);
    text-align: center;
}

.ac-monthly-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid var(--ac-border);
    font-size: 13px;
}

.ac-monthly-row:last-child { border-bottom: none; }

.ac-monthly-row__period {
    width: 110px;
    flex-shrink: 0;
    color: var(--ac-text-muted);
    font-size: 12px;
}

.ac-monthly-row__bar-wrap {
    flex: 1;
    height: 6px;
    background: var(--ac-bg);
    border-radius: 99px;
    overflow: hidden;
}

.ac-monthly-bar {
    height: 100%;
    border-radius: 99px;
    min-width: 3px;
    transition: width .3s ease;
}

.ac-monthly-bar--green { background: #86efac; }
.ac-monthly-bar--red   { background: #fca5a5; }

.ac-monthly-row__amount {
    width: 90px;
    flex-shrink: 0;
    text-align: left;
    direction: ltr;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 12px;
    color: var(--ac-text);
}

/* "View all" link at bottom */
.ac-dash-more {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    margin-bottom: 4px;
}

/* Table empty cell */
.ac-table__empty {
    text-align: center;
    padding: 24px;
    color: var(--ac-text-muted);
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   5. Page Header
   -------------------------------------------------------------------------- */
.ac-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ac-page-header__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.ac-page-header__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   6. Flash Alerts
   -------------------------------------------------------------------------- */
.ac-alert {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--ac-radius);
    border: 1px solid transparent;
    margin-bottom: 16px;
    font-size: 13px;
}

.ac-alert--success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.ac-alert--error   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.ac-alert--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.ac-alert__dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    padding: 0;
    flex-shrink: 0;
}

.ac-alert__dismiss:hover { opacity: 1; }

.ac-alert__list { margin: 0; padding-right: 16px; }

/* --------------------------------------------------------------------------
   7. Card
   -------------------------------------------------------------------------- */
.ac-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow);
}

.ac-card__body { padding: 20px 24px; }

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */
.ac-table-wrap {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    box-shadow: var(--ac-shadow);
    overflow-x: auto;
}

.ac-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ac-table thead {
    background: var(--ac-bg);
    border-bottom: 1px solid var(--ac-border);
}

.ac-table th {
    padding: 10px 16px;
    text-align: right;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ac-text-muted);
    white-space: nowrap;
}

.ac-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--ac-border);
    vertical-align: middle;
    text-align: right;
}

.ac-table tbody tr:last-child td { border-bottom: none; }
.ac-table tbody tr:hover { background: #f8fafc; }

.ac-table .ac-col-num {
    text-align: left;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, monospace;
    direction: ltr;
}

/* --------------------------------------------------------------------------
   9. Account Tree
   -------------------------------------------------------------------------- */
.ac-tree { list-style: none; padding: 0; margin: 0; }
.ac-tree__children { list-style: none; padding: 0; margin: 0; }

.ac-tree__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-tree__row:hover { background: #f8fafc; }
.ac-tree__row--inactive { opacity: 0.5; }

.ac-tree__indent { display: inline-block; flex-shrink: 0; }
.ac-tree__indent[data-depth="0"] { width: 0; }
.ac-tree__indent[data-depth="1"] { width: 20px; }
.ac-tree__indent[data-depth="2"] { width: 40px; }
.ac-tree__indent[data-depth="3"] { width: 60px; }

.ac-tree__code {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: var(--ac-text-muted);
    min-width: 60px;
    flex-shrink: 0;
}

.ac-tree__name { flex: 1; font-weight: 500; }

.ac-tree__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ac-tree__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.ac-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ac-badge--draft    { background: #f3f4f6; color: #374151; }
.ac-badge--posted   { background: #dcfce7; color: #166534; }
.ac-badge--reversed { background: #fee2e2; color: #991b1b; }

.ac-badge--asset     { background: #eff6ff; color: #1d4ed8; }
.ac-badge--liability { background: #fdf4ff; color: #7e22ce; }
.ac-badge--equity    { background: #fff7ed; color: #c2410c; }
.ac-badge--revenue   { background: #f0fdf4; color: #15803d; }
.ac-badge--expense   { background: #fef2f2; color: #b91c1c; }

.ac-badge--asset-active            { background: #dcfce7; color: #166534; }
.ac-badge--asset-fully_depreciated { background: #f3f4f6; color: #374151; }
.ac-badge--asset-disposed          { background: #fee2e2; color: #991b1b; }

/* --------------------------------------------------------------------------
   11. Buttons
   -------------------------------------------------------------------------- */
.ac-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--ac-radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
    white-space: nowrap;
    line-height: 1.4;
    font-family: inherit;
}

.ac-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ac-btn--primary  { background: var(--ac-primary); color: #fff; }
.ac-btn--primary:hover:not(:disabled) { background: var(--ac-primary-hover); }

.ac-btn--secondary { background: var(--ac-bg-white); color: var(--ac-text); border-color: var(--ac-border); }
.ac-btn--secondary:hover:not(:disabled) { background: var(--ac-bg); }

.ac-btn--danger { background: var(--ac-danger); color: #fff; }
.ac-btn--danger:hover:not(:disabled) { background: #b91c1c; }

.ac-btn--ghost { background: transparent; color: var(--ac-primary); border-color: transparent; }
.ac-btn--ghost:hover { background: var(--ac-primary-light); }

.ac-btn--sm  { padding: 4px 10px; font-size: 12px; }
.ac-btn--full { width: 100%; justify-content: center; }

/* --------------------------------------------------------------------------
   12. Forms
   -------------------------------------------------------------------------- */
.ac-form-group { margin-bottom: 18px; }

.ac-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ac-text);
}

.ac-label--required::after { content: ' *'; color: var(--ac-danger); }

.ac-control,
.ac-select,
.ac-textarea {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    font-size: 13px;
    color: var(--ac-text);
    background: var(--ac-bg-white);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    text-align: right;
}

.ac-control:focus,
.ac-select:focus,
.ac-textarea:focus {
    outline: none;
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.ac-control.ac-control--error,
.ac-select.ac-select--error { border-color: var(--ac-danger); }

.ac-control--num { text-align: left; direction: ltr; }

.ac-textarea { resize: vertical; min-height: 80px; }

.ac-hint       { font-size: 12px; color: var(--ac-text-muted); margin-top: 4px; }
.ac-field-error { font-size: 12px; color: var(--ac-danger); margin-top: 4px; }

.ac-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.ac-form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--ac-border);
}

/* --------------------------------------------------------------------------
   13. Journal Entry Lines
   -------------------------------------------------------------------------- */
.ac-lines-section { margin-top: 28px; }

.ac-lines-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.ac-lines-header__title { font-size: 14px; font-weight: 700; margin: 0; }

.ac-lines-table-wrap {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.ac-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ac-lines-table th {
    background: var(--ac-bg);
    padding: 9px 12px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ac-text-muted);
    border-bottom: 1px solid var(--ac-border);
}

.ac-lines-table th.ac-col-num,
.ac-lines-table td.ac-col-num { text-align: left; }

.ac-lines-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ac-border);
    vertical-align: middle;
}

.ac-lines-table tbody tr:last-child td { border-bottom: none; }
.ac-lines-table .ac-control, .ac-lines-table .ac-select { margin: 0; }
.ac-lines-table .ac-col-remove { width: 40px; text-align: center; }

.ac-lines-table tfoot td {
    padding: 10px 12px;
    background: var(--ac-bg);
    border-top: 2px solid var(--ac-border);
}

/* Balance bar */
.ac-balance-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--ac-radius);
    border: 1px solid var(--ac-border);
    background: var(--ac-bg);
    font-size: 13px;
    margin-top: 8px;
}

.ac-balance-bar--ok    { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
.ac-balance-bar--error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }

.ac-balance-bar__status  { font-weight: 600; }
.ac-balance-bar__amounts { opacity: 0.85; }

/* --------------------------------------------------------------------------
   14. Entry Detail (show page)
   -------------------------------------------------------------------------- */
.ac-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 16px 24px;
    background: var(--ac-bg);
    border-bottom: 1px solid var(--ac-border);
}

.ac-entry-meta__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ac-text-muted);
    margin-bottom: 2px;
}

.ac-entry-meta__value { font-size: 14px; font-weight: 500; }

.ac-inline-form { display: inline; }

/* --------------------------------------------------------------------------
   15. Pagination
   -------------------------------------------------------------------------- */
.ac-pagination {
    display: flex;
    justify-content: flex-start;
    margin-top: 16px;
}

.ac-pagination .pagination {
    display: flex;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ac-pagination .page-link {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    font-size: 13px;
    color: var(--ac-text);
    text-decoration: none;
    background: var(--ac-bg-white);
}

.ac-pagination .page-item.active .page-link {
    background: var(--ac-primary);
    border-color: var(--ac-primary);
    color: #fff;
}

.ac-pagination .page-item.disabled .page-link { opacity: 0.45; cursor: default; }

/* --------------------------------------------------------------------------
   16. Reports
   -------------------------------------------------------------------------- */
.ac-report-filter .ac-form-group--align-end { display: flex; align-items: flex-end; }

.ac-report-section-header {
    padding: 10px 20px;
    font-size: 13px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-report-section-header--revenue { background: #f0fdf4; color: #15803d; }
.ac-report-section-header--expense { background: #fef2f2; color: #b91c1c; }

.ac-table-totals td {
    background: var(--ac-bg);
    border-top: 2px solid var(--ac-border);
}

.ac-net-profit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-radius: var(--ac-radius);
    border: 2px solid transparent;
}

.ac-net-profit--positive { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.ac-net-profit--negative { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.ac-net-profit__label  { font-size: 16px; font-weight: 700; }
.ac-net-profit__amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.ac-empty-state--sm { padding: 20px 24px; }

/* --------------------------------------------------------------------------
   17. Assets
   -------------------------------------------------------------------------- */
.ac-progress-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ac-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--ac-border);
    border-radius: 99px;
    overflow: hidden;
    min-width: 60px;
}

.ac-progress-bar--lg { height: 10px; }

.ac-progress-fill {
    height: 100%;
    background: var(--ac-primary);
    border-radius: 99px;
    width: 0%;
    transition: width 0.4s ease;
}

.ac-progress-section { margin: 20px 0; }

.ac-progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--ac-text-muted);
    margin-bottom: 6px;
}

.ac-asset-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1px;
    background: var(--ac-border);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.ac-asset-summary__item {
    background: var(--ac-bg-white);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-asset-summary__item--highlight { background: #eff6ff; }

.ac-asset-summary__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ac-text-muted);
}

.ac-asset-summary__value {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ac-asset-accounts { margin-top: 20px; }

.ac-asset-accounts__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    font-size: 13px;
}

/* --------------------------------------------------------------------------
   18. Misc / Utilities
   -------------------------------------------------------------------------- */
.ac-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ac-text-muted);
    margin: 0 0 10px;
}

.ac-section-title { font-size: 16px; font-weight: 700; margin: 0 0 12px; }

.ac-divider { border: none; border-top: 1px solid var(--ac-border); margin: 20px 0; }

.ac-text-danger { color: var(--ac-danger); }
.ac-text-muted  { color: var(--ac-text-muted); }
.ac-text-right  { text-align: right; }
.ac-text-left   { text-align: left; }
.ac-text-mono   { font-family: ui-monospace, monospace; font-size: 12px; }
.ac-text-sm     { font-size: 12px; }
.ac-font-bold   { font-weight: 600; }
.ac-mt-4        { margin-top: 16px; }

.ac-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--ac-text-muted);
}

/* --------------------------------------------------------------------------
   19. Accounts — Category Cards
   -------------------------------------------------------------------------- */
.ac-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
    align-items: start;
}

/* Card shell */
.ac-accounts-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    box-shadow: var(--ac-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Card header strip */
.ac-accounts-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
}

.ac-accounts-card__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-accounts-card__icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255,255,255,.2);
}

.ac-accounts-card__icon svg { width: 17px; height: 17px; }

.ac-accounts-card__title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.ac-accounts-card__total {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

/* Color themes */
.ac-accounts-card__header--blue   { background: #2563eb; }
.ac-accounts-card__header--red    { background: #dc2626; }
.ac-accounts-card__header--amber  { background: #d97706; }
.ac-accounts-card__header--green  { background: #16a34a; }
.ac-accounts-card__header--purple { background: #7c3aed; }

/* Collapse / expand */
.ac-accounts-card__collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
}
.ac-accounts-card__collapse-btn:hover { background: rgba(255,255,255,.25); }

.ac-chevron {
    color: #fff;
    transition: transform .2s ease;
}
.ac-accounts-card--collapsed .ac-chevron { transform: rotate(-90deg); }

.ac-accounts-card--collapsed .ac-accounts-list,
.ac-accounts-card--collapsed .ac-accounts-card__footer { display: none; }

/* Inactive badge in header */
.ac-card-inactive-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(0,0,0,.25);
    color: #fff;
    flex-shrink: 0;
}

/* Account list */
.ac-accounts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.ac-accounts-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--ac-border);
    transition: background 0.1s;
}

.ac-accounts-list__row:last-child { border-bottom: none; }

.ac-accounts-list__row:hover { background: #f8fafc; }

/* Child account: indented + subtle left border */
.ac-accounts-list__row--child {
    padding-right: 32px;
    border-right: 3px solid var(--ac-border);
}

.ac-accounts-list__row--inactive {
    opacity: 0.45;
}

/* Child indent arrow */
.ac-child-arrow {
    color: var(--ac-text-light);
    flex-shrink: 0;
}

.ac-accounts-list__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ac-accounts-list__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--ac-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-accounts-list__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ac-accounts-list__meta-item {
    font-size: 11px;
    color: var(--ac-text-muted);
    display: flex;
    align-items: center;
    gap: 2px;
}

.ac-accounts-list__meta-item + .ac-accounts-list__meta-item::before {
    content: '·';
    margin-left: 4px;
    color: var(--ac-border-dark);
}

.ac-accounts-list__meta-item--debit  { color: #2563eb; font-weight: 600; }
.ac-accounts-list__meta-item--credit { color: #16a34a; font-weight: 600; }

.ac-accounts-list__sys-badge {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}

.ac-accounts-list__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ac-accounts-list__balance {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    min-width: 90px;
    text-align: left;
}

.ac-accounts-list__actions {
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.15s;
}

.ac-accounts-list__row:hover .ac-accounts-list__actions { opacity: 1; }

/* Icon action buttons (edit / add-child / toggle) */
.ac-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    color: var(--ac-text-muted);
    transition: background .12s, color .12s, border-color .12s;
    text-decoration: none;
    padding: 0;
    font: inherit;
}
.ac-icon-btn:hover             { background: var(--ac-bg); border-color: var(--ac-border); color: var(--ac-text); }
.ac-icon-btn--add:hover        { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.ac-icon-btn--deactivate:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.ac-icon-btn--activate:hover   { background: #f0fdf4; border-color: #bbf7d0; color: #16a34a; }
.ac-icon-btn--delete:hover     { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* Small code tag (account code display) */
.ac-code-tag {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: 4px;
    color: var(--ac-text-muted);
    direction: ltr;
    display: inline-block;
}

/* Generic small badges */
.ac-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.ac-badge--off  { background: #fef2f2; color: #dc2626; }
.ac-badge--sys  { background: #f1f5f9; color: #64748b; }

/* Parent info panel (used on create child + edit pages) */
.ac-parent-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
    margin-bottom: 20px;
    background: var(--ac-bg-white);
}
.ac-parent-info--readonly { background: #fafafa; }

.ac-parent-info__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--ac-border);
    font-size: 13px;
}
.ac-parent-info__row:last-child { border-bottom: none; }

.ac-parent-info__label {
    width: 120px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--ac-text-muted);
    font-size: 12px;
}
.ac-parent-info__value {
    color: var(--ac-text);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Page header sub-label */
.ac-page-header__sub {
    font-weight: 400;
    color: var(--ac-text-muted);
    font-size: 0.9em;
}

/* Card footer */
.ac-accounts-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--ac-bg);
    border-top: 1px solid var(--ac-border);
}

/* Button variants used in accounts */
.ac-btn--muted   { color: var(--ac-text-muted); }
.ac-btn--success { color: var(--ac-success); }

/* --------------------------------------------------------------------------
   20. Partners
   -------------------------------------------------------------------------- */
.ac-partner-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .ac-partner-actions { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   20. Asset info note
   -------------------------------------------------------------------------- */
.ac-asset-info-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--ac-radius);
    color: #1d4ed8;
    font-size: 13px;
    margin-bottom: 20px;
}

.ac-asset-info-note svg { flex-shrink: 0; margin-top: 1px; }

/* --------------------------------------------------------------------------
   21. Reports — Trial Balance & Account Ledger
   -------------------------------------------------------------------------- */

/* Filter card */
.ac-report-filter-card { margin-bottom: 20px; }

.ac-report-filter .ac-form-row { align-items: flex-end; flex-wrap: wrap; gap: 12px; }

.ac-form-group--end {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

/* Summary grid 4-col */
.ac-dash-grid--4 {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 24px;
}

@media (max-width: 900px) { .ac-dash-grid--4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px) { .ac-dash-grid--4 { grid-template-columns: 1fr; } }

/* Unbalanced card highlight */
.ac-dash-card--unbalanced { border: 2px solid var(--ac-danger); }

/* Insights strip */
.ac-insights-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.ac-insight {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--ac-radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.ac-insight--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ac-insight--warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ac-insight--success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.ac-insight--info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.ac-insight svg { flex-shrink: 0; margin-top: 1px; }

/* Trial balance groups */
.ac-tb-groups { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.ac-tb-group {
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    overflow: hidden;
}

/* Group header */
.ac-tb-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: #fff;
    cursor: default;
}

.ac-tb-group__header--blue   { background: #2563eb; }
.ac-tb-group__header--red    { background: #dc2626; }
.ac-tb-group__header--amber  { background: #d97706; }
.ac-tb-group__header--green  { background: #16a34a; }
.ac-tb-group__header--purple { background: #7c3aed; }

.ac-tb-group__header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-tb-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(255,255,255,.18);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
    color: #fff;
}
.ac-tb-collapse-btn:hover { background: rgba(255,255,255,.3); }

.ac-tb-group--collapsed .ac-chevron  { transform: rotate(-90deg); }
.ac-tb-group--collapsed .ac-tb-rows  { display: none; }

.ac-tb-group__title {
    font-size: 13px;
    font-weight: 700;
}

.ac-tb-group__count {
    font-size: 11px;
    background: rgba(0,0,0,.2);
    padding: 2px 8px;
    border-radius: 99px;
}

.ac-tb-group__totals { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Column header row */
.ac-tb-col-head {
    display: grid;
    grid-template-columns: 1fr 130px 80px 40px;
    padding: 6px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--ac-border);
    font-size: 11px;
    font-weight: 600;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ac-tb-col-head__balance,
.ac-tb-col-head__indicator { text-align: center; }

/* Account row */
.ac-tb-row {
    display: grid;
    grid-template-columns: 1fr 130px 80px 40px;
    align-items: center;
    padding: 9px 16px;
    border-bottom: 1px solid var(--ac-border);
    font-size: 13px;
    transition: background .1s;
}

.ac-tb-row:last-of-type { border-bottom: none; }
.ac-tb-row:hover        { background: #f8fafc; }

.ac-tb-row--inactive  { opacity: .45; }
.ac-tb-row--abnormal  { background: #fef9f0; }
.ac-tb-row--abnormal:hover { background: #fef3c7; }

.ac-tb-row__name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ac-tb-row__balance {
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.ac-tb-row__indicator { display: flex; justify-content: center; }

.ac-tb-row__action {
    display: flex;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s;
}
.ac-tb-row:hover .ac-tb-row__action { opacity: 1; }

/* Dr / Cr badge */
.ac-dr-cr-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.ac-dr-cr-badge--debit  { background: #dbeafe; color: #1d4ed8; }
.ac-dr-cr-badge--credit { background: #dcfce7; color: #15803d; }

/* Abnormal warning badge */
.ac-badge--warn {
    background: #fef3c7;
    color: #92400e;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 600;
}

/* Group subtotal row */
.ac-tb-subtotal {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background: #f1f5f9;
    border-top: 1px solid var(--ac-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--ac-text-muted);
}

.ac-tb-subtotal__value {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    color: var(--ac-text);
}

/* Grand total bar */
.ac-tb-grand-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border: 2px solid #16a34a;
    border-radius: var(--ac-radius);
    background: #f0fdf4;
    font-size: 13px;
    font-weight: 700;
    color: #14532d;
    margin-bottom: 8px;
}

.ac-tb-grand-total--error {
    border-color: var(--ac-danger);
    background: #fef2f2;
    color: #991b1b;
}

.ac-tb-grand-total__figures {
    display: flex;
    gap: 24px;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

/* ── Account Ledger ──────────────────────────────────────────────────── */

.ac-ledger-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ac-ledger-header__info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-ledger-header__name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-ledger-header__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--ac-text-muted);
    margin-top: 2px;
}

.ac-dot { color: var(--ac-border-dark); }

.ac-ledger-header__balance {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ac-ledger-header__balance-label {
    font-size: 12px;
    color: var(--ac-text-muted);
}

.ac-ledger-header__balance-value {
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

/* Large code tag variant */
.ac-code-tag--lg {
    font-size: 14px;
    padding: 4px 10px;
}

/* Ledger debit / credit colored values */
.ac-ledger__debit  { color: #1d4ed8; font-weight: 600; }
.ac-ledger__credit { color: #15803d; font-weight: 600; }

/* Table totals footer row */
.ac-table__totals-row { background: #f8fafc; font-weight: 700; }
.ac-table__totals-label { color: var(--ac-text-muted); font-size: 12px; padding: 10px 16px; }

/* --------------------------------------------------------------------------
   22. Dev Login (local only)
   -------------------------------------------------------------------------- */
.ac-dev-login {
    max-width: 400px;
    margin: 80px auto 0;
    padding: 0 16px;
}

.ac-dev-login__note {
    font-size: 12px;
    color: var(--ac-text-muted);
    margin: 4px 0 20px;
}

/* --------------------------------------------------------------------------
   22. Transactions
   -------------------------------------------------------------------------- */

/* Type card picker grid */
.ac-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .ac-type-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
    .ac-type-grid { grid-template-columns: repeat(2, 1fr); }
}

.ac-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    border: 2px solid var(--ac-border);
    border-radius: var(--ac-radius-lg, 10px);
    background: var(--ac-bg-white);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    user-select: none;
    text-align: center;
}

.ac-type-card input[type="radio"] { display: none; }

.ac-type-card:hover {
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.ac-type-card--active {
    border-color: var(--ac-primary);
    background: var(--ac-primary-light);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.ac-type-card__icon {
    font-size: 22px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin-bottom: 2px;
}

.ac-type-card__icon--red    { background: #fef2f2; }
.ac-type-card__icon--green  { background: #f0fdf4; }
.ac-type-card__icon--blue   { background: #eff6ff; }
.ac-type-card__icon--purple { background: #faf5ff; }
.ac-type-card__icon--amber  { background: #fffbeb; }

.ac-type-card__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ac-text);
    line-height: 1.2;
}

.ac-type-card__sub {
    font-size: 11px;
    color: var(--ac-text-muted);
    line-height: 1.2;
}

/* Type badges */
.ac-txn-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ac-txn-badge--expense          { background: #fef2f2; color: #dc2626; }
.ac-txn-badge--income           { background: #f0fdf4; color: #16a34a; }
.ac-txn-badge--transfer         { background: #eff6ff; color: #2563eb; }
.ac-txn-badge--capital_addition { background: #faf5ff; color: #7c3aed; }
.ac-txn-badge--withdrawal       { background: #fffbeb; color: #d97706; }

/* Account chip in table cells */
.ac-account-chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: 6px;
    font-size: 12px;
    color: var(--ac-text-muted);
}

/* Hint panel shown below type select */
.ac-txn-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8faff;
    border: 1px solid #bfdbfe;
    border-radius: var(--ac-radius);
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 4px;
}

/* Empty state */
.ac-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 16px;
    color: var(--ac-text-muted);
    text-align: center;
}

.ac-empty svg { color: var(--ac-border-dark); }

/* Pagination wrapper */
.ac-pagination {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.ac-pagination nav { display: flex; gap: 4px; align-items: center; }

/* Table amount column */
.ac-table__amount {
    font-weight: 600;
    color: var(--ac-text);
}

/* --------------------------------------------------------------------------
   23. AR Aging Report
   -------------------------------------------------------------------------- */

/* Hero banner */
.ac-aging-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: var(--ac-radius);
    color: #fff;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ac-aging-hero__eyebrow {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .75;
    margin-bottom: 4px;
}

.ac-aging-hero__title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
}

.ac-aging-hero__text {
    font-size: 13px;
    opacity: .85;
    margin: 0;
    max-width: 480px;
}

.ac-aging-hero__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.ac-aging-hero__label {
    font-size: 11px;
    opacity: .75;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ac-aging-hero__date {
    font-size: 18px;
    font-weight: 700;
}

/* Stacked bar + legend */
.ac-aging-bar-wrap { display: flex; flex-direction: column; gap: 10px; }

.ac-aging-bar {
    display: flex;
    height: 18px;
    border-radius: 99px;
    overflow: hidden;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
}

.ac-aging-bar__seg {
    height: 100%;
    min-width: 2px;
    transition: width .4s ease;
}

/* Bucket color palette */
.ac-aging-bar__seg--current,
.ac-aging-legend__dot.ac-aging-bar__seg--current { background: #16a34a; }

.ac-aging-bar__seg--30,
.ac-aging-legend__dot.ac-aging-bar__seg--30      { background: #f59e0b; }

.ac-aging-bar__seg--60,
.ac-aging-legend__dot.ac-aging-bar__seg--60      { background: #f97316; }

.ac-aging-bar__seg--90,
.ac-aging-legend__dot.ac-aging-bar__seg--90      { background: #dc2626; }

.ac-aging-bar__seg--91plus,
.ac-aging-legend__dot.ac-aging-bar__seg--91plus  { background: #7f1d1d; }

/* Legend row */
.ac-aging-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.ac-aging-legend__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--ac-text-muted);
}

.ac-aging-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ac-aging-legend__val {
    color: var(--ac-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

/* Aging table */
.ac-aging-table { width: 100%; min-width: 700px; }

.ac-aging-table__col-name   { width: 28%; min-width: 180px; }
.ac-aging-table__col-bucket { width: 12%; text-align: center; white-space: nowrap; }
.ac-aging-table__col-total  { width: 12%; text-align: center; white-space: nowrap; }

/* Column header tints */
.ac-aging-th--current { background: #f0fdf4; color: #15803d; }
.ac-aging-th--30      { background: #fffbeb; color: #b45309; }
.ac-aging-th--60      { background: #fff7ed; color: #c2410c; }
.ac-aging-th--90      { background: #fef2f2; color: #b91c1c; }
.ac-aging-th--91plus  { background: #450a0a; color: #fca5a5; }

/* Body cells */
.ac-aging-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    color: var(--ac-text-muted);
    font-size: 13px;
    padding: 10px 12px;
}

.ac-aging-cell--total {
    color: var(--ac-text);
    font-size: 13px;
}

/* Customer name cell */
.ac-aging-row__name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px;
}

.ac-aging-customer-link {
    font-weight: 600;
    color: var(--ac-primary);
    text-decoration: none;
    font-size: 13px;
}

.ac-aging-customer-link:hover { text-decoration: underline; }

.ac-aging-inv-count {
    font-size: 11px;
    color: var(--ac-text-muted);
}

/* Colored amount spans */
.ac-aging-amount--30     { color: #b45309; font-weight: 600; }
.ac-aging-amount--60     { color: #c2410c; font-weight: 600; }
.ac-aging-amount--90     { color: #b91c1c; font-weight: 600; }
.ac-aging-amount--91plus { color: #7f1d1d; font-weight: 700; }

/* Worst-days badge inline */
.ac-aging-worst {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 6px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
}

/* Totals footer row */
.ac-aging-totals-row {
    background: #f1f5f9;
    font-weight: 700;
}

.ac-aging-totals-label {
    padding: 10px 16px;
    font-size: 12px;
    color: var(--ac-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Utility: warning text color */
.ac-text-warning { color: #b45309; }

/* --------------------------------------------------------------------------
   24. Customer Statement
   -------------------------------------------------------------------------- */

/* Statement page header (customer info + period) */
.ac-stmt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ac-stmt-header__customer {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ac-stmt-header__name {
    font-size: 20px;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0 0 6px;
}

.ac-stmt-header__meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--ac-text-muted);
    flex-wrap: wrap;
}

.ac-stmt-header__period {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    font-size: 14px;
    color: var(--ac-text);
}

.ac-stmt-header__period-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--ac-text-muted);
    font-weight: 600;
}

.ac-stmt-header__period-sep {
    color: var(--ac-text-muted);
    margin: 0 2px;
}

/* Statement table wrapper */
.ac-stmt-table-wrap { overflow-x: auto; }

.ac-stmt-table { width: 100%; min-width: 640px; }

/* Column widths */
.ac-stmt-col-date    { width: 110px; white-space: nowrap; }
.ac-stmt-col-ref     { width: 150px; white-space: nowrap; }
.ac-stmt-col-desc    { width: auto; }
.ac-stmt-col-num     { width: 130px; text-align: left; white-space: nowrap; }
.ac-stmt-col-balance { width: 140px; text-align: left; white-space: nowrap; font-weight: 700; }

/* Cell styles */
.ac-stmt-cell-date {
    font-size: 12px;
    color: var(--ac-text-muted);
    white-space: nowrap;
}

.ac-stmt-cell-ref {
    font-size: 13px;
    font-weight: 600;
}

.ac-stmt-cell-desc {
    font-size: 13px;
    color: var(--ac-text-muted);
}

.ac-stmt-cell-num {
    text-align: left;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    font-size: 13px;
    padding: 10px 14px;
}

.ac-stmt-cell-balance {
    text-align: left;
    font-variant-numeric: tabular-nums;
    direction: ltr;
    font-weight: 700;
    font-size: 13px;
    padding: 10px 14px;
}

/* Row types */
.ac-stmt-opening-row {
    background: #f8fafc;
    font-style: italic;
}

.ac-stmt-row--invoice { background: #fffdf7; }
.ac-stmt-row--payment { background: #f8fff8; }
.ac-stmt-row--invoice:hover { background: #fef9ec; }
.ac-stmt-row--payment:hover { background: #ecfdf5; }

/* Debit / credit amount spans */
.ac-stmt-debit  { color: #b91c1c; font-weight: 600; }
.ac-stmt-credit { color: #15803d; font-weight: 600; }

/* Reference links */
.ac-stmt-ref-link {
    color: var(--ac-primary);
    text-decoration: none;
    font-family: monospace;
    font-size: 12px;
}
.ac-stmt-ref-link:hover { text-decoration: underline; }

.ac-stmt-payment-ref {
    color: var(--ac-text-muted);
    font-size: 12px;
}

/* Empty cell */
.ac-stmt-empty {
    text-align: center;
    color: var(--ac-text-muted);
    font-size: 13px;
    padding: 32px 16px;
}

/* Totals row */
.ac-stmt-totals-row {
    background: #f1f5f9;
}

.ac-stmt-totals-label {
    padding: 10px 16px;
    font-weight: 700;
    font-size: 12px;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Closing balance row */
.ac-stmt-closing-row {
    background: #1e3a5f;
    color: #fff;
}

.ac-stmt-closing-label {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,.85);
}

.ac-stmt-closing-val {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #fff !important;
    padding: 12px 14px;
}

.ac-stmt-closing-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.ac-stmt-closing-badge--debit  { background: #fca5a5; color: #7f1d1d; }
.ac-stmt-closing-badge--credit { background: #86efac; color: #14532d; }
.ac-stmt-closing-badge--zero   { background: rgba(255,255,255,.25); color: #fff; }

/* Print styles — hide non-printable elements */
@media print {
    .ac-print-hide { display: none !important; }
    .ac-sidebar,
    .ac-topbar { display: none !important; }
    .ac-main { margin: 0 !important; padding: 0 !important; }
    .ac-page  { padding: 0 !important; }
    .ac-stmt-closing-row { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --------------------------------------------------------------------------
   23. Profit & Loss Report
   -------------------------------------------------------------------------- */

/* ── Enhanced Insight Card (P&L-specific sub-elements) ── */
.ac-insight__icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.ac-insight__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ac-insight__message {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.ac-insight__suggestion {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.85;
    line-height: 1.4;
}

.ac-insight__cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 5px 12px;
    border-radius: var(--ac-radius);
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid currentColor;
    opacity: 0.9;
    transition: opacity 0.15s;
    white-space: nowrap;
    color: inherit;
}

.ac-insight__cta:hover { opacity: 1; }

/* ── P&L Section ── */
.ac-pl-section {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--ac-shadow);
}

.ac-pl-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-pl-section__header--revenue { background: #f0fdf4; border-bottom-color: #bbf7d0; }
.ac-pl-section__header--expense { background: #fef2f2; border-bottom-color: #fecaca; }

.ac-pl-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
    color: var(--ac-text);
}

.ac-pl-section__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ac-pl-section__dot--revenue { background: var(--ac-success); }
.ac-pl-section__dot--expense { background: var(--ac-danger); }

.ac-pl-section__count {
    font-size: 11px;
    font-weight: 500;
    color: var(--ac-text-muted);
    background: rgba(0,0,0,.06);
    padding: 2px 7px;
    border-radius: 20px;
}

.ac-pl-section__total {
    font-weight: 700;
    font-size: 16px;
}

/* ── Column head ── */
.ac-pl-col-head {
    display: grid;
    grid-template-columns: 1fr 160px 48px 120px;
    gap: 12px;
    padding: 6px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--ac-border);
    background: var(--ac-bg);
}

/* ── P&L Rows ── */
.ac-pl-rows { padding: 4px 0; }

.ac-pl-row {
    display: grid;
    grid-template-columns: 1fr 160px 48px 120px;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    transition: background 0.12s;
}

.ac-pl-row:hover { background: #fafafa; }

/* Row name — supports single-line or stacked (with activity label) */
.ac-pl-row__name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ac-text);
    min-width: 0;
}

.ac-pl-row__name-stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.ac-pl-row__name-stack > span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-pl-row__activity-label {
    font-size: 11px;
    color: var(--ac-text-muted);
    font-weight: 400;
}

/* Progress bar */
.ac-pl-row__bar-wrap {
    height: 6px;
    background: var(--ac-border);
    border-radius: 99px;
    overflow: hidden;
}

.ac-pl-row__bar {
    height: 100%;
    border-radius: 99px;
    width: 0;
    transition: width 0.55s cubic-bezier(.4,0,.2,1);
}

.ac-pl-row__bar--revenue { background: var(--ac-success); }
.ac-pl-row__bar--expense { background: var(--ac-danger); }

.ac-pl-row__pct {
    font-size: 12px;
    text-align: center;
}

.ac-pl-row__amount {
    font-weight: 600;
    font-size: 14px;
    text-align: left;
}

/* Section subtotal row */
.ac-pl-rows__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 2px solid var(--ac-border);
    font-weight: 700;
    font-size: 14px;
    background: var(--ac-bg);
}

/* ── Improved Empty State ── */
.ac-pl-empty {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 28px 24px;
}

.ac-pl-empty__icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-pl-empty__icon--revenue {
    background: #f0fdf4;
    color: var(--ac-success);
}

.ac-pl-empty__icon--expense {
    background: #fef2f2;
    color: var(--ac-danger);
}

.ac-pl-empty__body {
    flex: 1;
}

.ac-pl-empty__title {
    font-weight: 700;
    font-size: 14px;
    color: var(--ac-text);
    margin-bottom: 4px;
}

.ac-pl-empty__sub {
    font-size: 13px;
    color: var(--ac-text-muted);
    line-height: 1.5;
}

/* ── Net Result Banner ── */
.ac-pl-net {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 28px;
    border-radius: var(--ac-radius-lg);
    margin-bottom: 16px;
    box-shadow: var(--ac-shadow-md);
}

.ac-pl-net--profit {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
}

.ac-pl-net--loss {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
}

.ac-pl-net__left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-pl-net__label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
}

.ac-pl-net__reason {
    font-size: 13px;
    opacity: 0.80;
    line-height: 1.4;
    max-width: 440px;
}

.ac-pl-net__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
}

.ac-pl-net__amount {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.ac-pl-net__margin {
    font-size: 13px;
    opacity: 0.82;
}

/* ── Change Badge ── */
.ac-pl-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.ac-pl-change--up      { background: #f0fdf4; color: #16a34a; }
.ac-pl-change--down    { background: #fef2f2; color: #dc2626; }
.ac-pl-change--neutral { background: var(--ac-bg); color: var(--ac-text-muted); }

.ac-pl-change--lg {
    font-size: 13px;
    padding: 4px 10px;
}

/* ── Comparison Card ── */
.ac-pl-compare-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--ac-shadow);
}

.ac-pl-compare-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    color: var(--ac-text);
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-pl-compare-card__period {
    font-size: 12px;
    color: var(--ac-text-muted);
    font-weight: 400;
    margin-right: 4px;
}

.ac-pl-compare-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.ac-pl-compare-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    background: var(--ac-bg);
    border-radius: var(--ac-radius);
    border: 1px solid var(--ac-border);
}

.ac-pl-compare-item__label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ac-pl-compare-item__value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-pl-compare-item__current {
    font-size: 12px;
    color: var(--ac-text-muted);
}

.ac-pl-compare-item__current strong {
    font-weight: 700;
    color: var(--ac-text);
}

/* ── Utility ── */
.ac-font-bold { font-weight: 700; }

/* --------------------------------------------------------------------------
   24. Roles, Users & Audit System
   -------------------------------------------------------------------------- */

/* ── Role Badge ── */
.ac-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: .01em;
}

/* Size variants */
.ac-role-badge--sm { font-size: 11px; padding: 2px 7px; }
.ac-role-badge--xs { font-size: 10px; padding: 1px 5px; }

/* Color variants */
.ac-role-badge--admin       { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ac-role-badge--accountant  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.ac-role-badge--viewer      { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* ── Avatar with role colour ── */
.ac-sidebar__avatar--admin      { background: #1d4ed8 !important; }
.ac-sidebar__avatar--accountant { background: #15803d !important; }
.ac-sidebar__avatar--viewer     { background: #6b7280 !important; }

/* ── Table row highlight (current user) ── */
.ac-table__row--highlight { background: #fefce8; }
.ac-table__row--highlight:hover { background: #fef9c3; }

/* ── User Cell (name + avatar in table) ── */
.ac-user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-user-cell__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ac-user-cell__avatar--admin       { background: #1d4ed8; }
.ac-user-cell__avatar--accountant  { background: #15803d; }
.ac-user-cell__avatar--viewer      { background: #6b7280; }

.ac-user-cell__name  { font-size: 13px; font-weight: 600; color: var(--ac-text); }
.ac-user-cell__you   { font-size: 11px; color: var(--ac-primary); font-weight: 500; }

/* ── Permissions list ── */
.ac-permissions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ac-perm {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
}

.ac-perm--yes { background: #f0fdf4; color: #15803d; }
.ac-perm--no  { background: #f9fafb; color: #9ca3af; }

/* ── Role Picker (radio cards in create/edit) ── */
.ac-role-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.ac-role-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    background: var(--ac-bg-white);
}

.ac-role-option input[type="radio"] { display: none; }

.ac-role-option:hover { border-color: var(--ac-primary); background: var(--ac-primary-light); }

.ac-role-option--selected { border-color: var(--ac-primary); background: var(--ac-primary-light); }

.ac-role-option__icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-role-option__icon--admin       { background: #eff6ff; color: #1d4ed8; }
.ac-role-option__icon--accountant  { background: #f0fdf4; color: #15803d; }
.ac-role-option__icon--viewer      { background: #f9fafb; color: #6b7280; }

.ac-role-option__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ac-role-option__name { font-size: 14px; font-weight: 700; color: var(--ac-text); }
.ac-role-option__desc { font-size: 11px; color: var(--ac-text-muted); line-height: 1.4; }

/* ── Role Legend ── */
.ac-role-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    margin-top: 16px;
}

.ac-role-legend__item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--ac-text-muted);
}

/* ── "Created by" cell in tables ── */
.ac-created-by {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ac-created-by__avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.ac-created-by__avatar--admin      { background: #1d4ed8; }
.ac-created-by__avatar--accountant { background: #15803d; }
.ac-created-by__avatar--viewer     { background: #6b7280; }

.ac-created-by__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-created-by__name {
    font-size: 12px;
    font-weight: 600;
    color: var(--ac-text);
    white-space: nowrap;
}

/* ── Form Card (used in users/create and users/edit) ── */
.ac-form-card {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    box-shadow: var(--ac-shadow);
    max-width: 680px;
}

.ac-form-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--ac-border);
    font-size: 15px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-form-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Required star ── */
.ac-required { color: var(--ac-danger); font-size: 13px; }

/* ── Form Actions row ── */
.ac-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--ac-border);
}

/* ── Field error ── */
.ac-field-error {
    display: block;
    font-size: 12px;
    color: var(--ac-danger);
    margin-top: 4px;
}

.ac-control--error {
    border-color: var(--ac-danger) !important;
    background: #fff5f5;
}

/* ── Row actions group ── */
.ac-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Recurring Entries Create
   -------------------------------------------------------------------------- */
.ac-rec-create {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ac-rec-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-radius: 26px;
    color: #fff;
    background:
        radial-gradient(circle at 10% 20%, rgba(45, 212, 191, .2), transparent 32%),
        linear-gradient(135deg, #102033 0%, #0f766e 54%, #22c55e 100%);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
    position: relative;
    overflow: hidden;
}

.ac-rec-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -52px;
    bottom: -86px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
}

.ac-rec-hero__copy {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.ac-rec-hero__eyebrow {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #dcfce7;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.ac-rec-hero__title {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.25;
    font-weight: 800;
}

.ac-rec-hero__text {
    margin: 10px 0 0;
    max-width: 680px;
    color: #dcfce7;
    line-height: 1.8;
}

.ac-rec-hero__card {
    position: relative;
    z-index: 1;
    min-width: 220px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.ac-rec-hero__card span {
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
}

.ac-rec-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.ac-rec-main,
.ac-rec-side {
    min-width: 0;
}

.ac-rec-card {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.ac-rec-card > form {
    padding: 24px;
}

.ac-rec-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.ac-rec-field-hint {
    margin: .35rem 0 0;
    color: var(--ac-muted);
    font-size: .8rem;
}

.ac-rec-lines-section {
    margin-bottom: 1.25rem;
    padding: 16px;
    border-radius: 18px;
    background: #f8fbff;
    border: 1px solid #dbe5f1;
}

.ac-rec-lines-title {
    display: block;
    margin-bottom: .75rem;
}

.ac-rec-lines-error {
    margin-bottom: .75rem;
}

.ac-rec-line-head,
.ac-rec-line-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr auto;
    gap: .75rem;
    align-items: center;
}

.ac-rec-line-head {
    padding: 0 0 .6rem;
    color: var(--ac-muted);
    font-size: .78rem;
    font-weight: 700;
}

.ac-rec-line-row {
    margin-bottom: .6rem;
    padding: .7rem;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
}

.ac-rec-line-spacer {
    width: 32px;
}

.ac-rec-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 1.25rem;
    margin-top: .85rem;
    padding-top: .9rem;
    border-top: 1px dashed #cbd5e1;
    font-size: .9rem;
}

.ac-rec-balance-status {
    font-weight: 800;
}

.ac-rec-balance-status.is-balanced {
    color: var(--ac-success);
}

.ac-rec-balance-status.is-unbalanced {
    color: var(--ac-danger);
}

.ac-rec-add-line {
    margin-top: .85rem;
}

.ac-rec-actions {
    display: flex;
    gap: .8rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--ac-border);
    padding-top: 1.5rem;
}

.ac-rec-summary-card {
    position: sticky;
    top: 18px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe5f1;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.ac-rec-summary-card__icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #0f766e;
    background: #ccfbf1;
    margin-bottom: 14px;
}

.ac-rec-summary-card h3 {
    margin: 0;
    color: var(--ac-text);
    font-size: 20px;
    font-weight: 800;
}

.ac-rec-summary-card p {
    margin: 8px 0 0;
    color: var(--ac-text-muted);
    line-height: 1.8;
}

.ac-rec-summary-card__tips {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.ac-rec-summary-card__tips span {
    padding: 10px 12px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1180px) {
    .ac-rec-layout {
        grid-template-columns: 1fr;
    }

    .ac-rec-summary-card {
        position: static;
    }
}

@media (max-width: 820px) {
    .ac-rec-hero {
        flex-direction: column;
        padding: 20px;
    }

    .ac-rec-hero__card {
        min-width: 0;
    }

    .ac-rec-meta-grid,
    .ac-rec-line-head,
    .ac-rec-line-row {
        grid-template-columns: 1fr;
    }

    .ac-rec-line-head {
        display: none;
    }

    .ac-rec-actions {
        flex-direction: column;
    }
}


/* ==========================================================================
   §25 — Attachments  (upload zone · file list · badges · table column)
   ========================================================================== */

/* ── Upload Zone ── */
.ac-upload-zone {
    position: relative;
    border: 2px dashed var(--ac-border);
    border-radius: var(--ac-radius-lg);
    background: var(--ac-bg);
    transition: border-color .15s, background .15s;
    cursor: pointer;
    overflow: hidden;
}

.ac-upload-zone:hover,
.ac-upload-zone.ac-upload-zone--drag {
    border-color: var(--ac-primary);
    background: #f0f7ff;
}

.ac-upload-zone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.ac-upload-zone__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 28px 20px;
    text-align: center;
    pointer-events: none;
}

.ac-upload-zone__icon {
    font-size: 28px;
    line-height: 1;
}

.ac-upload-zone__text {
    font-size: 14px;
    color: var(--ac-text);
    font-weight: 500;
}

.ac-upload-zone__browse {
    color: var(--ac-primary);
    font-weight: 700;
    text-decoration: underline;
}

.ac-upload-zone__hint {
    font-size: 12px;
    color: var(--ac-text-muted);
}

/* ── Selected Files List ── */
.ac-upload-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
}

.ac-upload-item__thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: var(--ac-radius);
    border: 1px solid var(--ac-border);
    flex-shrink: 0;
    display: block;
}

.ac-upload-item__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
}

.ac-upload-item__meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-upload-item__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ac-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-upload-item__size {
    font-size: 11px;
    color: var(--ac-text-muted);
}

.ac-upload-item__remove {
    background: none;
    border: 1px solid var(--ac-border);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 11px;
    color: var(--ac-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s, color .15s;
}

.ac-upload-item__remove:hover {
    border-color: var(--ac-danger);
    color: var(--ac-danger);
}

/* ── Attachment badges in the table ── */
.ac-table__att { width: 100px; }

.ac-att-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.ac-att-cell--stack {
    justify-content: flex-start;
}

.ac-att-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    transition: opacity .15s, transform .1s;
    flex-shrink: 0;
}

.ac-att-badge:hover {
    opacity: .8;
    transform: scale(1.1);
}

.ac-att-badge__icon { line-height: 1; }
.ac-att-badge__label { display: none; }   /* icon-only in table */

.ac-att-badge--image { background: #dcfce7; }
.ac-att-badge--pdf   { background: #fee2e2; }
.ac-att-badge--excel { background: #fef9c3; }

/* count pill — "+3" next to badges */
.ac-att-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: var(--ac-border);
    color: var(--ac-text-muted);
}

/* ==========================================================================
   §26 — Reports Refresh
   ========================================================================== */

.ac-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ac-card__body--flush {
    padding: 0;
}

.ac-report-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 18px;
    margin-bottom: 14px;
    color: #fff;
    box-shadow: var(--ac-shadow-md);
}

.ac-report-hero--profit {
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
}

.ac-report-hero--trial {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

.ac-report-hero--income-expense {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.ac-report-hero__content {
    flex: 1;
    min-width: 0;
}

.ac-report-hero__eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.82;
    margin-bottom: 8px;
}

.ac-report-hero__title {
    font-size: 24px;
    line-height: 1.3;
    margin: 0 0 8px;
}

.ac-report-hero__text {
    margin: 0;
    max-width: 680px;
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.88;
}

.ac-report-hero__meta {
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
}

.ac-report-hero__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.16);
    font-size: 12px;
    font-weight: 700;
}

.ac-report-presets {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ac-report-presets__pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--ac-border);
    background: var(--ac-bg-white);
    color: var(--ac-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.ac-report-presets__pill--active {
    background: var(--ac-primary);
    border-color: var(--ac-primary);
    color: #fff;
}

.ac-report-signal-card__amount {
    font-size: 18px;
}

.ac-report-signal-card__divider {
    display: inline-block;
    margin: 0 6px;
}

.ac-report-signal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ac-report-panel {
    background: var(--ac-bg-white);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    box-shadow: var(--ac-shadow);
    overflow: hidden;
}

.ac-report-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-report-panel__header h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.ac-report-panel__header p {
    margin: 0;
    font-size: 12px;
    color: var(--ac-text-muted);
}

.ac-report-panel__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--ac-primary-light);
    color: var(--ac-primary);
    font-size: 12px;
    font-weight: 700;
}

.ac-report-timeline {
    display: flex;
    flex-direction: column;
}

.ac-report-timeline__row {
    display: grid;
    grid-template-columns: 190px 1fr 220px;
    gap: 14px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-report-timeline__row:last-child {
    border-bottom: none;
}

.ac-report-timeline__period {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-report-timeline__period strong {
    font-size: 13px;
}

.ac-report-timeline__period span {
    font-size: 11px;
    color: var(--ac-text-muted);
}

.ac-report-timeline__bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ac-report-timeline__bar-wrap {
    height: 8px;
    background: var(--ac-bg);
    border-radius: 999px;
    overflow: hidden;
}

.ac-report-timeline__bar {
    height: 100%;
    border-radius: 999px;
}

.ac-report-timeline__bar--income {
    background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.ac-report-timeline__bar--expense {
    background: linear-gradient(90deg, #fb7185 0%, #dc2626 100%);
}

.ac-report-timeline__values {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    font-size: 12px;
}

@media (max-width: 980px) {
    .ac-report-hero {
        flex-direction: column;
    }

    .ac-report-hero__meta {
        min-width: 0;
        align-items: flex-start;
        text-align: right;
    }

    .ac-report-timeline__row {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   §26 — Customers  (avatar · profile header · invoice status · hints)
   ========================================================================== */

/* ── Customer avatar ── */
.ac-cust-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ac-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-cust-avatar--lg {
    width: 52px;
    height: 52px;
    font-size: 22px;
}

/* ── Customer cell in table ── */
.ac-cust-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-cust-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-cust-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-cust-sub {
    font-size: 12px;
    color: var(--ac-text-muted);
}

/* ── Profile header ── */
.ac-cust-profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ac-cust-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
    font-size: 13px;
    color: var(--ac-text-muted);
}

.ac-cust-profile-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Invoice status cell ── */
.ac-cust-inv-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
}

/* ── Progress bar (xs variant) ── */
.ac-progress-bar--xs {
    height: 4px;
    width: 60px;
}

/* ── Success colour utility ── */
.ac-text-success { color: #15803d; }

/* ── Field hint ── */
.ac-field-hint {
    display: block;
    font-size: 12px;
    color: var(--ac-text-muted);
    margin-top: 3px;
}

/* ── Table foot total row ── */
.ac-table__foot-total td {
    background: var(--ac-bg);
    border-top: 2px solid var(--ac-border);
    padding-top: 10px;
    padding-bottom: 10px;
}

/* ── Section title ── */
.ac-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0;
}

.ac-mt-4 { margin-top: 20px; }

/* ── Success btn variant ── */
.ac-btn--success {
    background: #15803d;
    color: #fff;
    border: 1px solid transparent;
}

.ac-btn--success:hover {
    background: #166534;
}

/* ==========================================================================
   §27 — Invoices  (tabs · create grid · document card · print)
   ========================================================================== */

/* ── Status filter tabs ── */
.ac-inv-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--ac-border);
}

.ac-inv-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ac-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
}

.ac-inv-tab:hover { color: var(--ac-text); }

.ac-inv-tab--active {
    color: var(--ac-primary);
    border-bottom-color: var(--ac-primary);
}

.ac-inv-tab__count {
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--ac-border);
    color: var(--ac-text-muted);
}

.ac-inv-tab__count--pending { background: #fef9c3; color: #a16207; }
.ac-inv-tab__count--partial { background: #dbeafe; color: #1d4ed8; }
.ac-inv-tab__count--paid    { background: #dcfce7; color: #15803d; }

/* ── Warning row ── */
.ac-table__row--warn td { background: #fff5f5; }

/* ── Customer avatar sm ── */
.ac-cust-avatar--sm { width: 26px; height: 26px; font-size: 11px; }

/* ── Invoice create grid ── */
.ac-inv-create-grid {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 16px;
    align-items: start;
}

@media (max-width: 768px) {
    .ac-inv-create-grid { grid-template-columns: 1fr; }
}

.ac-inv-create-main { display: flex; flex-direction: column; gap: 12px; }
.ac-card--compact .ac-card__body { padding: 14px 18px; }

/* ── Invoice number preview ── */
.ac-inv-number-preview { display: flex; align-items: center; justify-content: space-between; }
.ac-inv-number-preview__label { font-size: 13px; color: var(--ac-text-muted); }
.ac-inv-number-preview__value { font-size: 18px; font-weight: 800; color: var(--ac-text); font-family: monospace; letter-spacing: .05em; }

/* ── Line items editor ── */
.ac-inv-items { display: flex; flex-direction: column; gap: 6px; }

.ac-inv-items__head {
    display: grid;
    grid-template-columns: 1fr 80px 110px 90px 36px;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    padding: 0 2px;
}

.ac-inv-item-row {
    display: grid;
    grid-template-columns: 1fr 80px 110px 90px 36px;
    gap: 6px;
    align-items: center;
}

.ac-inv-item__total { font-size: 13px; font-weight: 700; color: var(--ac-text); text-align: left; padding: 0 6px; }
.ac-inv-item__remove { padding: 0 !important; width: 30px; height: 30px; justify-content: center; }

/* ── Summary sidebar ── */
.ac-inv-summary { margin-bottom: 16px; }

.ac-inv-summary__row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 5px 0;
    color: var(--ac-text-muted);
    border-bottom: 1px solid var(--ac-border);
}

.ac-inv-summary__row--total {
    font-size: 16px;
    font-weight: 800;
    color: var(--ac-text);
    border-bottom: none;
    margin-top: 4px;
}

.ac-inv-create-actions { display: flex; flex-direction: column; gap: 8px; }
.ac-btn--full { width: 100%; justify-content: center; }
.ac-mt-2 { margin-top: 8px; }

/* ── Invoice document card ── */
.ac-inv-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .ac-inv-layout { grid-template-columns: 1fr; }
}

.ac-inv-doc {
    background: #fff;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    padding: 32px 36px;
    box-shadow: var(--ac-shadow);
}

.ac-inv-doc__header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }

.ac-inv-doc__brand { display: flex; align-items: center; gap: 12px; }

.ac-inv-doc__brand-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: var(--ac-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
}

.ac-inv-doc__company     { font-size: 16px; font-weight: 800; color: var(--ac-text); }
.ac-inv-doc__company-sub { font-size: 11px; color: var(--ac-text-muted); }
.ac-inv-doc__number      { font-size: 22px; font-weight: 800; color: var(--ac-text); font-family: monospace; text-align: left; }
.ac-inv-doc__status      { display: flex; gap: 6px; margin-top: 6px; justify-content: flex-end; }

.ac-badge--lg { padding: 4px 12px; font-size: 12px; }

.ac-inv-doc__divider { height: 1px; background: var(--ac-border); margin: 0 0 20px; }

.ac-inv-doc__info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.ac-inv-doc__info-label    { font-size: 11px; text-transform: uppercase; color: var(--ac-text-muted); font-weight: 700; margin-bottom: 6px; }
.ac-inv-doc__customer-name { font-size: 16px; font-weight: 700; color: var(--ac-text); }
.ac-inv-doc__customer-detail { font-size: 13px; color: var(--ac-text-muted); margin-top: 2px; }
.ac-inv-doc__dates         { text-align: left; }

.ac-inv-doc__date-row { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; padding: 4px 0; }
.ac-inv-doc__date-label { color: var(--ac-text-muted); }
.ac-inv-doc__date-value { font-weight: 600; color: var(--ac-text); }

/* Items table inside doc */
.ac-inv-doc__items { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 13px; }

.ac-inv-doc__items thead th {
    background: var(--ac-bg);
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--ac-text-muted);
    border-bottom: 2px solid var(--ac-border);
}

.ac-inv-doc__items tbody td { padding: 10px 12px; border-bottom: 1px solid var(--ac-border); color: var(--ac-text); }
.ac-inv-doc__items tbody tr:last-child td { border-bottom: none; }
.ac-inv-doc__col-num { text-align: left; width: 90px; }

/* Footer: QR + Totals */
.ac-inv-doc__footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 16px;
    border-top: 2px solid var(--ac-border);
    gap: 20px;
}

.ac-inv-doc__qr       { text-align: center; }
.ac-inv-doc__qr canvas { display: block; }
.ac-inv-doc__qr-label  { font-size: 10px; color: var(--ac-text-muted); margin-top: 4px; }

.ac-inv-doc__totals { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }

.ac-inv-doc__total-row {
    display: flex; justify-content: space-between;
    font-size: 14px; color: var(--ac-text-muted); gap: 24px;
}

.ac-inv-doc__total-row--grand {
    font-size: 18px; font-weight: 800; color: var(--ac-text);
    padding-top: 8px; border-top: 2px solid var(--ac-border);
}

.ac-inv-doc__progress { display: flex; align-items: center; gap: 8px; margin-top: 6px; }

.ac-inv-doc__notes { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--ac-border); font-size: 13px; }
.ac-inv-doc__notes-label { font-weight: 700; color: var(--ac-text-muted); margin-bottom: 4px; font-size: 11px; text-transform: uppercase; }
.ac-inv-doc__notes-text  { color: var(--ac-text); line-height: 1.6; }

/* ── Payment panel ── */
.ac-inv-pay-hint { font-size: 13px; margin-bottom: 10px; color: var(--ac-text-muted); }
.ac-inv-pay-btn-wrap { display: flex; gap: 8px; align-items: flex-end; }
.ac-inv-topbar-actions { display: flex; gap: 8px; }

/* ── Print ── */
@media print {
    .ac-no-print,
    .ac-sidebar,
    .ac-topbar,
    .ac-inv-pay-panel,
    .ac-inv-topbar-actions,
    .ac-alert { display: none !important; }

    .ac-main, .ac-page { margin: 0 !important; padding: 0 !important; }

    .ac-inv-layout { grid-template-columns: 1fr !important; }

    .ac-inv-doc {
        border: none !important;
        box-shadow: none !important;
        padding: 20px !important;
        border-radius: 0 !important;
    }

    body { background: #fff !important; }
}

/* ==========================================================================
   §28 — Payments  (method picker · history · filter · pills)
   ========================================================================== */

/* ── Payment remaining hint ── */
.ac-pay-remaining {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--ac-radius);
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--ac-text-muted);
}

.ac-pay-amount-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ac-pay-amount-row .ac-control { flex: 1; }

/* ── Payment method picker grid ── */
.ac-pay-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.ac-pay-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 1.5px solid var(--ac-border);
    border-radius: var(--ac-radius);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    background: var(--ac-bg);
}

.ac-pay-method-card input[type="radio"] { display: none; }

.ac-pay-method-card:hover {
    border-color: var(--ac-primary);
    background: #f0f7ff;
}

.ac-pay-method-card--active,
.ac-pay-method-card:has(input:checked) {
    border-color: var(--ac-primary);
    background: #eff6ff;
}

.ac-pay-method-card__icon  { font-size: 20px; line-height: 1; }
.ac-pay-method-card__label { font-size: 11px; font-weight: 600; color: var(--ac-text); text-align: center; }

/* ── Payment history list ── */
.ac-pay-history {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-pay-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--ac-border);
}

.ac-pay-history-item:last-child { border-bottom: none; }

.ac-pay-history-item__method {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 100px;
}

.ac-pay-method-icon { font-size: 16px; }
.ac-pay-method-name { font-size: 12px; font-weight: 600; color: var(--ac-text); }

.ac-pay-history-item__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ac-pay-history-item__date  { font-size: 12px; color: var(--ac-text-muted); }
.ac-pay-history-item__notes { font-size: 11px; color: var(--ac-text-muted); font-style: italic; }

.ac-pay-history-item__amount {
    font-size: 14px;
    font-weight: 700;
    color: #15803d;
    font-family: monospace;
    white-space: nowrap;
}

/* ── Method pill (in payments table) ── */
.ac-pay-method-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.ac-pay-method-pill--cash     { background: #dcfce7; color: #15803d; }
.ac-pay-method-pill--bank     { background: #dbeafe; color: #1d4ed8; }
.ac-pay-method-pill--wallet   { background: #f3e8ff; color: #7c3aed; }
.ac-pay-method-pill--instapay { background: #fef9c3; color: #a16207; }
.ac-pay-method-pill--cheque   { background: #f1f5f9; color: #475569; }
.ac-pay-method-pill--card     { background: #fee2e2; color: #b91c1c; }
.ac-pay-method-pill--settlement { background: #fff7ed; color: #c2410c; }
.ac-pay-method-pill--other    { background: var(--ac-border); color: var(--ac-text-muted); }

/* ── Filter bar ── */
.ac-pay-filter { margin-bottom: 16px; }
.ac-pay-filter__actions { display: flex; gap: 8px; align-items: flex-end; }

/* ── Link utility ── */
.ac-link {
    color: var(--ac-primary);
    text-decoration: none;
    font-weight: 600;
}
.ac-link:hover { text-decoration: underline; }


/* ==========================================================================
   §29 — Customer Balance Logic
   (balance banner · overdue banner · row highlighting · count pills ·
    balance amounts · card variants · avatar debt state · filter bar)
   ========================================================================== */

/* ── Outstanding balance banner ── */
.ac-balance-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    border-radius: var(--ac-radius);
    margin-bottom: 16px;
}

.ac-balance-banner__icon {
    color: #dc2626;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.ac-balance-banner__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: var(--ac-text);
}

.ac-balance-banner__body strong { font-weight: 700; color: #b91c1c; }

/* ── Overdue warning banner ── */
.ac-overdue-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: var(--ac-radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.ac-overdue-banner svg { color: #d97706; flex-shrink: 0; }

/* ── Table row states ── */
.ac-row--overdue { background: #fff5f5; }
.ac-row--overdue:hover { background: #fee2e2 !important; }

.ac-row--unpaid  { background: #fffbeb; }
.ac-row--unpaid:hover  { background: #fef3c7 !important; }

.ac-row--has-balance td:first-child { border-right: 3px solid #f87171; }

/* ── Overdue inline tag ── */
.ac-overdue-tag {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 6px;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    vertical-align: middle;
    letter-spacing: 0.02em;
}

/* ── Count pills (inline next to section titles) ── */
.ac-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: var(--ac-border);
    color: var(--ac-text-muted);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    vertical-align: middle;
    margin-right: 6px;
}

.ac-count-pill--danger { background: #fee2e2; color: #b91c1c; }
.ac-count-pill--green  { background: #dcfce7; color: #15803d; }

/* ── Section title — enhanced with icon support ── */
.ac-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0 0 10px;
}

.ac-section-title svg { color: var(--ac-text-muted); flex-shrink: 0; }

/* ── Card variant with danger left border ── */
.ac-card--bordered-danger {
    border-color: #fecaca;
    border-left: 3px solid #dc2626;
}

/* ── Dash card alert state ── */
.ac-dash-card--alert {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 60%);
}

/* ── Balance amount display (index table) ── */
.ac-balance-amount {
    display: inline-block;
    font-weight: 700;
    font-family: monospace;
    font-size: 13px;
}

.ac-balance-amount--debt   { color: #dc2626; }
.ac-balance-amount--credit { color: #16a34a; }

/* ── Customer avatar — debt state ── */
.ac-cust-avatar--debt {
    background: #fee2e2;
    color: #b91c1c;
    border: 1.5px solid #fca5a5;
}

/* ── Customer index filter bar ── */
.ac-cust-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
}

/* ── Customer profile: name + info layout ── */
.ac-cust-profile-info    { display: flex; flex-direction: column; gap: 4px; }
.ac-cust-profile-name    { font-size: 22px; font-weight: 800; color: var(--ac-text); margin: 0; }
.ac-cust-profile-meta    { display: flex; flex-wrap: wrap; gap: 12px; }
.ac-cust-profile-meta__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--ac-text-muted);
}
.ac-cust-profile-meta__item svg { flex-shrink: 0; }

/* ==========================================================================
   §30 — Modal  +  Settlement pill  +  Info alert
   ========================================================================== */

/* ── Modal overlay ── */
.ac-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ac-modal[hidden] { display: none; }

/* Scroll lock when a modal is open */
body.ac-modal-open { overflow: hidden; }

/* Semi-transparent backdrop */
.ac-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

/* Dialog card */
.ac-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 460px;
    z-index: 1;
    animation: ac-modal-in .18s ease;
}

@keyframes ac-modal-in {
    from { opacity: 0; transform: translateY(-12px) scale(.97); }
    to   { opacity: 1; transform: translateY(0)      scale(1);  }
}

/* Header */
.ac-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 0;
}

.ac-modal__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ac-modal__icon--warning { background: #fef3c7; color: #d97706; }
.ac-modal__icon--danger  { background: #fee2e2; color: #dc2626; }
.ac-modal__icon--success { background: #dcfce7; color: #16a34a; }

.ac-modal__title {
    font-size: 17px;
    font-weight: 800;
    color: var(--ac-text);
    margin: 0 0 2px;
}

.ac-modal__subtitle {
    font-size: 13px;
    color: var(--ac-text-muted);
    margin: 0;
}

.ac-modal__close {
    margin-right: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ac-text-muted);
    padding: 4px;
    border-radius: 6px;
    line-height: 0;
    transition: background .12s, color .12s;
}

.ac-modal__close:hover { background: var(--ac-border); color: var(--ac-text); }

/* Body */
.ac-modal__body {
    padding: 16px 20px;
}

.ac-modal__message {
    font-size: 14px;
    color: var(--ac-text);
    line-height: 1.6;
    margin: 0 0 14px;
}

/* Summary block */
.ac-modal__summary {
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 10px 14px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-modal__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--ac-text);
}

.ac-modal__summary-row span  { color: var(--ac-text-muted); }
.ac-modal__summary-row strong { font-weight: 700; }

/* Warning note */
.ac-modal__warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #92400e;
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 0;
}

.ac-modal__warning svg { flex-shrink: 0; color: #d97706; }

/* Footer */
.ac-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--ac-border);
}

/* ── Settlement method pill ── */
.ac-pay-method-pill--settlement { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* ── Info alert ── */
.ac-alert--info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* ==========================================================================
   §31 — Balance Sheet  (الميزانية العمومية)
   ========================================================================== */

/* ── Hero variant ── */
.ac-report-hero--bs { background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%); }

/* ── Two-column layout ── */
.ac-bs-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .ac-bs-layout { grid-template-columns: 1fr; }
}

/* ── Section card ── */
.ac-bs-section {
    background: #fff;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    overflow: hidden;
}

.ac-bs-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ac-border);
    background: var(--ac-bg);
}

.ac-bs-section__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ac-bs-section__dot--blue  { background: #3b82f6; }
.ac-bs-section__dot--red   { background: #ef4444; }
.ac-bs-section__dot--amber { background: #f59e0b; }

.ac-bs-section__title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0;
    flex: 1;
}

.ac-bs-section__total {
    font-size: 14px;
    font-weight: 700;
    color: var(--ac-text);
    font-variant-numeric: tabular-nums;
}

/* ── Rows ── */
.ac-bs-rows {
    padding: 4px 0;
}

.ac-bs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 18px;
    gap: 12px;
    border-bottom: 1px solid var(--ac-border);
    transition: background .1s;
}

.ac-bs-row:last-child  { border-bottom: none; }
.ac-bs-row:hover       { background: var(--ac-bg); }
.ac-bs-row--abnormal   { background: #fff5f5; }

.ac-bs-row__info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ac-bs-row__code {
    font-family: var(--ac-font-mono, monospace);
    font-size: 11px;
    color: var(--ac-text-muted);
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}

.ac-bs-row__name {
    font-size: 13px;
    color: var(--ac-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ac-bs-row__abnormal-tag {
    font-size: 10px;
    font-weight: 700;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 4px;
    padding: 1px 5px;
    flex-shrink: 0;
}

.ac-bs-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 100px;
}

.ac-bs-row__amount {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ac-text);
}

/* Mini progress bar */
.ac-bs-row__bar {
    width: 80px;
    height: 3px;
    background: var(--ac-border);
    border-radius: 2px;
    overflow: hidden;
}

.ac-bs-row__bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width .3s ease;
}

.ac-bs-row__bar-fill--blue  { background: #3b82f6; }
.ac-bs-row__bar-fill--red   { background: #ef4444; }
.ac-bs-row__bar-fill--amber { background: #f59e0b; }

/* ── Section subtotal row ── */
.ac-bs-section__subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-top: 2px solid var(--ac-border);
    background: var(--ac-bg);
    font-size: 13px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-bs-section__subtotal--combined {
    border-top: 2px solid var(--ac-text);
    background: #f0f9ff;
    font-size: 13px;
}

.ac-bs-section__subtotal-amt {
    font-variant-numeric: tabular-nums;
}

/* ── Empty placeholder ── */
.ac-bs-empty {
    font-size: 13px;
    color: var(--ac-text-muted);
    text-align: center;
    padding: 20px 18px;
    margin: 0;
}

/* ── Equation footer ── */
.ac-bs-equation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
    padding: 18px 24px;
    border-radius: var(--ac-radius-lg);
    border: 2px solid;
    text-align: center;
}

.ac-bs-equation--balanced   { border-color: #bbf7d0; background: #f0fdf4; }
.ac-bs-equation--unbalanced { border-color: #fecaca; background: #fff5f5; }

.ac-bs-equation__side {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-bs-equation__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ac-text-muted);
    letter-spacing: .04em;
}

.ac-bs-equation__value {
    font-size: 22px;
    font-weight: 800;
    color: var(--ac-text);
    font-variant-numeric: tabular-nums;
}

.ac-bs-equation__op {
    font-size: 28px;
    font-weight: 800;
    color: var(--ac-text-muted);
    padding: 0 4px;
}

.ac-bs-equation__badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
}

.ac-bs-equation__badge--ok  { background: #dcfce7; color: #15803d; }
.ac-bs-equation__badge--err { background: #fee2e2; color: #dc2626; }

@media (max-width: 600px) {
    .ac-bs-equation {
        flex-direction: column;
        gap: 12px;
    }
    .ac-bs-equation__op { transform: rotate(90deg); }
}

/* ==========================================================================
   §32 — Balance Sheet 3-column layout extensions
   ========================================================================== */

/* 3-column grid */
.ac-bs-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .ac-bs-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    .ac-bs-grid-3 { grid-template-columns: 1fr; }
}

/* ── Section header colour variants ── */
.ac-bs-section__header--green  {
    background: #f0fdf4;
    border-bottom-color: #bbf7d0;
}
.ac-bs-section__header--red    {
    background: #fff5f5;
    border-bottom-color: #fecaca;
}
.ac-bs-section__header--orange {
    background: #fff7ed;
    border-bottom-color: #fed7aa;
}

/* Section title colour per type */
.ac-bs-section--asset     .ac-bs-section__title { color: #15803d; }
.ac-bs-section--liability .ac-bs-section__title { color: #dc2626; }
.ac-bs-section--equity    .ac-bs-section__title { color: #d97706; }

/* ── Dot colour for green / orange ── */
.ac-bs-section__dot--green  { background: #22c55e; }
.ac-bs-section__dot--orange { background: #f97316; }

/* ── Account count badge on section header ── */
.ac-bs-section__badge {
    font-size: 11px;
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 8px;
    margin-right: auto;   /* push to the end in RTL */
    margin-left: 0;
}

.ac-bs-section__badge--green  { background: #dcfce7; color: #15803d; }
.ac-bs-section__badge--red    { background: #fee2e2; color: #dc2626; }
.ac-bs-section__badge--orange { background: #ffedd5; color: #d97706; }

/* ── Name + abnormal tag wrapper ── */
.ac-bs-row__name-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

/* ── Progress bar colour variants ── */
.ac-progress-fill--green  { background: #22c55e; }
.ac-progress-fill--red    { background: #ef4444; }
.ac-progress-fill--orange { background: #f97316; }

/* ── Section subtotal border accent ── */
.ac-bs-section__subtotal--green  { border-top-color: #22c55e; }
.ac-bs-section__subtotal--red    { border-top-color: #ef4444; }
.ac-bs-section__subtotal--orange { border-top-color: #f97316; }

/* Amount colour aliases */
.ac-text-warning { color: #d97706; }

/* Status text on summary card */
.ac-bs-status-text { font-size: 18px; }

/* ── Dashboard card green icon variant ── */
.ac-dash-card__icon--green { background: #dcfce7; color: #15803d; }

/* ==========================================================================
   §33 — Balance Sheet tree rows, depth indentation, toggle
   ========================================================================== */

/* ── Column header row (name | balance | %) ── */
.ac-bs-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px 6px 10px;
    border-bottom: 1px solid var(--ac-border);
    background: #f8fafc;
    font-size: 11px;
    font-weight: 700;
    color: var(--ac-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ac-bs-col-header__right {
    display: flex;
    gap: 32px;
}

/* ── Legend bar above the grid ── */
.ac-bs-col-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0 6px;
    flex-wrap: wrap;
}

.ac-bs-col-legend__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ac-text-muted);
}

.ac-bs-col-legend__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ac-bs-col-legend__sep { flex: 1; }

.ac-bs-col-legend__hint {
    font-size: 11px;
    color: var(--ac-text-muted);
    font-style: italic;
}

/* ── Depth indentation (RTL — indent on the right side) ── */
.ac-bs-row--depth-1 .ac-bs-row__info { padding-right: 18px; }
.ac-bs-row--depth-2 .ac-bs-row__info { padding-right: 36px; }
.ac-bs-row--depth-3 .ac-bs-row__info { padding-right: 54px; }
.ac-bs-row--depth-4 .ac-bs-row__info { padding-right: 72px; }

/* Connector line for children */
.ac-bs-row--depth-1, .ac-bs-row--depth-2,
.ac-bs-row--depth-3, .ac-bs-row--depth-4 {
    border-right: 2px solid var(--ac-border);
}

/* ── Parent row styling ── */
.ac-bs-row--parent {
    background: var(--ac-bg);
}

.ac-bs-row--parent .ac-bs-row__name {
    font-weight: 700;
    color: var(--ac-text);
}

/* ── Toggle button ── */
.ac-bs-toggle {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 1px solid var(--ac-border);
    background: #fff;
    cursor: pointer;
    color: var(--ac-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background .12s, color .12s, transform .18s;
}

.ac-bs-toggle:hover {
    background: var(--ac-border);
    color: var(--ac-text);
}

.ac-bs-toggle--collapsed {
    transform: rotate(-90deg);
}

/* Placeholder so leaf rows align with parent rows */
.ac-bs-toggle-spacer {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
}

/* ── Own-balance note on parent rows ── */
.ac-bs-row__own-note {
    font-size: 10px;
    color: var(--ac-text-muted);
    font-style: italic;
}

/* ── Percentage column on each row ── */
.ac-bs-row__pct {
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: start;
}

/* ── Row right side gets 3-part layout: amount | pct | bar ── */
.ac-bs-row__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
    min-width: 110px;
}

/* ============================================================
   §34 — Company Settings Page
   ============================================================ */

.ac-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .ac-settings-grid { grid-template-columns: 1fr; }
}

.ac-settings-toggle-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0 16px;
    border-bottom: 1px solid var(--ac-border);
    margin-bottom: 4px;
}

.ac-settings-toggle-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--ac-text);
}

.ac-settings-toggle-hint {
    font-size: .8rem;
    color: var(--ac-muted);
    margin-top: 3px;
    max-width: 360px;
}

/* Toggle switch */
.ac-toggle { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.ac-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-toggle__track {
    width: 44px; height: 24px;
    background: var(--ac-border);
    border-radius: 12px;
    transition: background .2s;
    position: relative;
}
.ac-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px; right: 3px;
    width: 18px; height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ac-toggle input:checked + .ac-toggle__track { background: var(--ac-primary); }
.ac-toggle input:checked + .ac-toggle__track::after { transform: translateX(-20px); }

.ac-settings-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.ac-page-header__subtitle {
    margin-top: 4px;
    color: var(--ac-text-muted);
    font-size: .9rem;
}

.ac-modules-settings {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ac-module-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius-lg);
    background: var(--ac-bg-white);
    box-shadow: var(--ac-shadow);
    transition: border-color .15s, box-shadow .15s, opacity .15s;
}

.ac-module-card:hover {
    border-color: #bfdbfe;
    box-shadow: var(--ac-shadow-md);
}

.ac-module-card--disabled {
    opacity: .72;
    background: #f8fafc;
}

.ac-module-card__icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ac-primary);
    background: var(--ac-primary-light);
    border-radius: 14px;
}

.ac-module-card--disabled .ac-module-card__icon {
    color: var(--ac-text-muted);
    background: #e5e7eb;
}

.ac-module-card__icon svg {
    width: 21px;
    height: 21px;
}

.ac-module-card__body {
    min-width: 0;
}

.ac-module-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.ac-module-card__head h2 {
    margin: 0;
    color: var(--ac-text);
    font-size: 1rem;
    font-weight: 800;
}

.ac-module-card__head span {
    display: inline-flex;
    margin-top: 3px;
    color: var(--ac-text-muted);
    font-size: .78rem;
    font-weight: 700;
    direction: ltr;
}

@media (max-width: 900px) {
    .ac-modules-settings {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .ac-module-card {
        grid-template-columns: 1fr;
    }

    .ac-module-card__head {
        align-items: center;
    }
}

/* Inline input inside text (tax rate in invoice summary) */
.ac-control--inline {
    display: inline-block;
    padding: 2px 6px;
    height: auto;
    font-size: .85rem;
    border-radius: 4px;
    vertical-align: baseline;
}

.ac-field-hint {
    display: block;
    font-size: .78rem;
    color: var(--ac-muted);
    margin-top: 3px;
}

.ac-hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   Section 25 — AP Module: Vendors
   ═══════════════════════════════════════════════════════════════════════════ */

/* Vendor filter bar quick links */
.ac-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ac-filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--ac-muted);
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    text-decoration: none;
    transition: all .15s;
    cursor: pointer;
}

.ac-filter-tag:hover {
    border-color: var(--ac-primary);
    color: var(--ac-primary);
}

.ac-filter-tag--active {
    background: var(--ac-primary);
    color: #fff;
    border-color: var(--ac-primary);
}

/* Vendor create page */
.ac-vendor-create {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ac-vendor-create .ac-page-header {
    display: none;
}

.ac-vendor-create-hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border: 1px solid #dbe5f1;
    border-radius: 26px;
    background:
        radial-gradient(circle at 12% 18%, rgba(37, 99, 235, .16), transparent 30%),
        linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #38bdf8 100%);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .12);
    color: #fff;
    overflow: hidden;
    position: relative;
}

.ac-vendor-create-hero::after {
    content: "";
    position: absolute;
    inset-inline-end: -40px;
    bottom: -70px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
}

.ac-vendor-create-hero__content {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

.ac-vendor-create-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 10px;
}

.ac-vendor-create-hero__title {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.25;
    font-weight: 800;
}

.ac-vendor-create-hero__text {
    margin: 10px 0 0;
    max-width: 620px;
    color: #dbeafe;
    line-height: 1.8;
}

.ac-vendor-create-hero__badge {
    position: relative;
    z-index: 1;
    min-width: 190px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 22px;
    background: rgba(255, 255, 255, .13);
    backdrop-filter: blur(8px);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.ac-vendor-create-hero__badge span {
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 900;
}

.ac-vendor-create-hero__badge strong {
    color: #fff;
    font-size: 16px;
}

.ac-vendor-create-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.ac-vendor-create-main,
.ac-vendor-create-side {
    min-width: 0;
}

.ac-form-card--wide,
.ac-vendor-create-card {
    max-width: none;
}

.ac-vendor-create-card {
    border: 0;
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.ac-vendor-create-card__header {
    align-items: flex-start;
    background: #fff;
    font-size: 0;
}

.ac-vendor-create-card__copy {
    font-size: 14px;
}

.ac-vendor-create-card__copy h3,
.ac-vendor-create-card__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.ac-vendor-create-card__copy p,
.ac-vendor-create-card__header p {
    margin: 4px 0 0;
    color: var(--ac-text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.ac-vendor-create-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: grid;
    place-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    flex: 0 0 auto;
}

.ac-vendor-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ac-vendor-opening-field {
    max-width: 360px;
}

.ac-vendor-create-summary {
    position: sticky;
    top: 18px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe5f1;
    box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
}

.ac-vendor-create-summary__icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    color: #0f766e;
    background: #ccfbf1;
    margin-bottom: 14px;
}

.ac-vendor-create-summary h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--ac-text);
}

.ac-vendor-create-summary p {
    margin: 8px 0 0;
    color: var(--ac-text-muted);
    line-height: 1.8;
}

.ac-vendor-create-summary__steps {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}

.ac-vendor-create-summary__steps span {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .ac-vendor-create-layout {
        grid-template-columns: 1fr;
    }

    .ac-vendor-create-summary {
        position: static;
    }
}

@media (max-width: 720px) {
    .ac-vendor-create-hero {
        flex-direction: column;
        padding: 20px;
    }

    .ac-vendor-create-hero__badge {
        min-width: 0;
    }

    .ac-vendor-create-grid {
        grid-template-columns: 1fr;
    }

    .ac-vendor-opening-field {
        max-width: none;
    }

    .ac-form-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Vendor show: payment sign (outgoing = red minus) */
.ac-inv-payment-row__amount {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* AP purchase invoices index — overdue row variant */
.ac-row--unpaid  { background: rgba(251, 191, 36, .04); }
.ac-row--overdue { background: rgba(239, 68,  68, .05); }

/* ═══════════════════════════════════════════════════════════════════════════
   Section 26 — AP Module: Purchase Invoices
   ═══════════════════════════════════════════════════════════════════════════ */

/* Purchase invoice "from vendor" label in the doc */
.ac-inv-doc__to .ac-inv-doc__info-label {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--ac-muted);
    margin-bottom: 4px;
}

/* Vendor number badge inside invoice doc */
.ac-inv-doc__vendor-num {
    font-size: .8rem;
    color: var(--ac-muted);
    margin-top: 2px;
}

/* Purchase payment outgoing indicator */
.ac-pp-outgoing {
    color: var(--ac-danger);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 27 — AP Module: Purchase Payments
   ═══════════════════════════════════════════════════════════════════════════ */

/* Method total cards in purchase-payments index */
.ac-dash-grid--wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ac-dash-card--sm {
    min-width: 140px;
    flex: 1 1 140px;
    padding: 14px 16px;
}

.ac-dash-card--total {
    border-color: var(--ac-primary);
    border-width: 2px;
}

.ac-dash-card--total .ac-dash-card__amount {
    font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 28 — AP Reports: AP Aging
   ═══════════════════════════════════════════════════════════════════════════ */

/* AP aging hero uses the same .ac-aging-hero classes as AR aging */
/* Colour override for AP context (amber instead of blue) */
.ac-aging-hero {
    background: linear-gradient(135deg, var(--ac-primary) 0%, #b45309 100%);
}

/* Vendor link in aging table */
.ac-aging-customer-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

.ac-aging-customer-link:hover {
    text-decoration: underline;
    color: var(--ac-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 29 — AP Reports: Vendor Statement
   ═══════════════════════════════════════════════════════════════════════════ */

/* Vendor statement reuses all .ac-stmt-* classes from customer statement */
/* Additional badge variant for "مستحق للمورد" */
.ac-stmt-closing-badge--debit {
    background: rgba(185, 28, 28, .15);
    color: #b91c1c;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
    font-weight: 600;
}

.ac-stmt-closing-badge--credit {
    background: rgba(21, 128, 61, .15);
    color: #15803d;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
    font-weight: 600;
}

.ac-stmt-closing-badge--zero {
    background: rgba(100, 116, 139, .15);
    color: var(--ac-muted);
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-right: 6px;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 30 — Fiscal Year Close
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hero banner ─────────────────────────────────────────────────────────── */
.ac-fy-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a4f 100%);
    border-radius: var(--ac-radius);
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    color: #fff;
    margin-bottom: 1.75rem;
}
.ac-fy-hero__icon {
    font-size: 3rem;
    opacity: .85;
    flex-shrink: 0;
}
.ac-fy-hero__content { flex: 1; }
.ac-fy-hero__eyebrow {
    font-size: .75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .7;
}
.ac-fy-hero__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: .25rem 0 .5rem;
}
.ac-fy-hero__text {
    font-size: .9rem;
    opacity: .8;
    max-width: 520px;
}

/* ── Open year card ──────────────────────────────────────────────────────── */
.ac-fy-open-card {
    border: 2px solid var(--ac-primary);
    border-radius: var(--ac-radius);
    overflow: hidden;
    margin-bottom: 2rem;
}
.ac-fy-open-header {
    background: var(--ac-primary);
    color: #fff;
    padding: .9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ac-fy-open-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.ac-fy-open-badge {
    background: rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: .75rem;
}
.ac-fy-open-body {
    background: var(--ac-surface);
    padding: 1.5rem;
}

/* ── P&L preview table ───────────────────────────────────────────────────── */
.ac-fy-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
@media (max-width: 640px) { .ac-fy-preview { grid-template-columns: 1fr; } }

.ac-fy-preview__section { }
.ac-fy-preview__section-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ac-muted);
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--ac-border);
}
.ac-fy-preview__section-title--revenue { color: #15803d; border-color: #bbf7d0; }
.ac-fy-preview__section-title--expense { color: #b91c1c; border-color: #fecaca; }

.ac-fy-acct-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .3rem 0;
    font-size: .875rem;
    border-bottom: 1px dashed var(--ac-border);
}
.ac-fy-acct-row:last-child { border-bottom: none; }
.ac-fy-acct-name { color: var(--ac-text); }
.ac-fy-acct-amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.ac-fy-acct-amount--revenue { color: #15803d; }
.ac-fy-acct-amount--expense { color: #b91c1c; }

.ac-fy-preview__empty {
    color: var(--ac-muted);
    font-size: .85rem;
    font-style: italic;
    padding: .5rem 0;
}

/* ── Net result banner ───────────────────────────────────────────────────── */
.ac-fy-net {
    border-radius: var(--ac-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.ac-fy-net--profit {
    background: rgba(21, 128, 61, .08);
    border: 1px solid #bbf7d0;
}
.ac-fy-net--loss {
    background: rgba(185, 28, 28, .08);
    border: 1px solid #fecaca;
}
.ac-fy-net--zero {
    background: rgba(100, 116, 139, .08);
    border: 1px solid var(--ac-border);
}
.ac-fy-net__label { font-size: .9rem; color: var(--ac-muted); }
.ac-fy-net__value {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.ac-fy-net--profit .ac-fy-net__value { color: #15803d; }
.ac-fy-net--loss   .ac-fy-net__value { color: #b91c1c; }
.ac-fy-net--zero   .ac-fy-net__value { color: var(--ac-muted); }

/* ── Close confirm modal ─────────────────────────────────────────────────── */
.ac-fy-confirm {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: var(--ac-radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: .875rem;
    color: #92400e;
}
.ac-fy-confirm ul { margin: .5rem 0 0 1.25rem; }
.ac-fy-confirm li { margin-bottom: .3rem; }

/* ── History table ───────────────────────────────────────────────────────── */
.ac-fy-history-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.ac-fy-history-table th {
    background: var(--ac-surface-2, #f8fafc);
    padding: .6rem 1rem;
    text-align: right;
    font-weight: 600;
    color: var(--ac-muted);
    font-size: .78rem;
    border-bottom: 2px solid var(--ac-border);
}
.ac-fy-history-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--ac-border);
    color: var(--ac-text);
}
.ac-fy-history-table tr:last-child td { border-bottom: none; }
.ac-fy-profit { color: #15803d; font-weight: 600; }
.ac-fy-loss   { color: #b91c1c; font-weight: 600; }
.ac-fy-zero   { color: var(--ac-muted); }

/* ── Create year form card ───────────────────────────────────────────────── */
.ac-fy-create-card {
    background: var(--ac-surface);
    border: 1px dashed var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 31 — Dashboard Charts
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── AR / AP outstanding KPI row ─────────────────────────────────────────── */
.ac-dash-grid--4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .ac-dash-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .ac-dash-grid--4 { grid-template-columns: 1fr; } }

.ac-dash-card--ar { border-top: 3px solid #2563eb; }
.ac-dash-card--ap { border-top: 3px solid #d97706; }

/* ── Chart layout ────────────────────────────────────────────────────────── */
.ac-charts-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    align-items: start;
}
@media (max-width: 900px) { .ac-charts-row { grid-template-columns: 1fr; } }

.ac-chart-card {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 1.25rem 1.5rem 1.5rem;
}
.ac-chart-card__title {
    font-size: .85rem;
    font-weight: 700;
    color: var(--ac-muted);
    letter-spacing: .05em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.ac-chart-card__title span { font-size: 1rem; }

/* Canvas containers — fixed height so charts don't collapse */
.ac-chart-wrap          { position: relative; height: 280px; }
.ac-chart-wrap--doughnut{ position: relative; height: 260px; }

/* Doughnut legend */
.ac-chart-legend {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.ac-chart-legend-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--ac-text);
}
.ac-chart-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ac-chart-legend-name { flex: 1; }
.ac-chart-legend-val  { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Empty state inside chart area */
.ac-chart-empty {
    height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ac-muted);
    font-size: .875rem;
    gap: .5rem;
}
.ac-chart-empty__icon { font-size: 2rem; opacity: .4; }


/* ═══════════════════════════════════════════════════════════════════════════
   Section 32 — VAT Report
   ═══════════════════════════════════════════════════════════════════════════ */

/* Hero */
.ac-vat-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: #fff;
}
.ac-vat-hero__content { flex: 1; }
.ac-vat-hero__eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    padding: 3px 12px;
    margin-bottom: 10px;
}
.ac-vat-hero__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 8px;
}
.ac-vat-hero__text {
    font-size: .875rem;
    opacity: .85;
    margin: 0;
    line-height: 1.6;
}
.ac-vat-hero__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    white-space: nowrap;
}
.ac-vat-hero__label { font-size: .75rem; opacity: .7; }
.ac-vat-hero__date  { font-size: .875rem; font-weight: 700; }

/* Summary cards — 3 col grid */
.ac-dash-grid--3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .ac-dash-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .ac-dash-grid--3 { grid-template-columns: 1fr; }
}

/* VAT card accent border */
.ac-vat-card--output { border-top: 3px solid #3b82f6; }
.ac-vat-card--input  { border-top: 3px solid #f97316; }
.ac-vat-card--net    { border-top: 3px solid #22c55e; }

/* Horizontal bar comparison */
.ac-vat-bar-card { margin-bottom: 28px; }
.ac-vat-bar-wrap { display: flex; flex-direction: column; gap: 14px; }
.ac-vat-bar-row  {
    display: grid;
    grid-template-columns: 160px 1fr 120px;
    align-items: center;
    gap: 12px;
}
.ac-vat-bar-row--net { margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--ac-border); }
.ac-vat-bar-label { font-size: .8125rem; font-weight: 600; color: var(--ac-text-secondary); }
.ac-vat-bar-track {
    height: 10px;
    background: var(--ac-bg-subtle);
    border-radius: 6px;
    overflow: hidden;
}
.ac-vat-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width .4s ease;
}
.ac-vat-bar-fill--output  { background: #3b82f6; }
.ac-vat-bar-fill--input   { background: #f97316; }
.ac-vat-bar-fill--net-pos { background: #22c55e; }
.ac-vat-bar-fill--net-neg { background: #ef4444; }
.ac-vat-bar-val {
    font-size: .875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: left;
    direction: ltr;
}

/* Section headers */
.ac-vat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.ac-vat-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ac-text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ac-vat-section-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.ac-vat-section-dot--output { background: #3b82f6; }
.ac-vat-section-dot--input  { background: #f97316; }
.ac-vat-section-total {
    font-size: .875rem;
    font-weight: 700;
    color: var(--ac-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* VAT table */
.ac-vat-table th, .ac-vat-table td { white-space: nowrap; }
.ac-vat-col--output { background: rgba(59,130,246,.06) !important; color: #1d4ed8; }
.ac-vat-col--input  { background: rgba(249,115,22,.06) !important; color: #c2410c; }
.ac-vat-totals-row td {
    background: var(--ac-bg-subtle);
    font-weight: 700;
    border-top: 2px solid var(--ac-border);
}
.ac-vat-totals-label { color: var(--ac-text-secondary); }

/* Net summary box */
.ac-vat-net-box {
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 32px;
    background: #f0fdf4;
    border: 1px solid #86efac;
}
.ac-vat-net-box--refund {
    background: #fff7ed;
    border-color: #fdba74;
}
.ac-vat-net-box__label {
    font-size: .9375rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ac-text);
}
.ac-vat-net-box__calc {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: .9375rem;
}
.ac-vat-net-box__minus,
.ac-vat-net-box__eq { font-size: 1.25rem; color: var(--ac-text-muted); font-weight: 300; }
.ac-vat-net-box__result {
    font-size: 1.375rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.ac-vat-net-box__result small {
    font-size: .75rem;
    font-weight: 600;
    margin-right: 4px;
}

@media (max-width: 640px) {
    .ac-vat-hero { flex-direction: column; }
    .ac-vat-hero__meta { align-items: flex-start; }
    .ac-vat-bar-row { grid-template-columns: 100px 1fr 90px; }
    .ac-vat-net-box__calc { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Section 32 — Credit Notes (الإشعارات الدائنة)
   ============================================================ */

/* ── Create page layout ── */
.ac-cn-create-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

/* ── Calc summary box ── */
.ac-cn-calc-box {
    background: var(--ac-surface-2, #f8fafc);
    border: 1px solid var(--ac-border, #e2e8f0);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}
.ac-cn-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .35rem 0;
    font-size: .9rem;
    color: var(--ac-text-muted, #64748b);
    border-bottom: 1px dashed var(--ac-border, #e2e8f0);
}
.ac-cn-calc-row:last-child { border-bottom: none; }
.ac-cn-calc-row--total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--ac-danger, #ef4444);
    border-top: 2px solid var(--ac-border, #e2e8f0);
    margin-top: .25rem;
    padding-top: .5rem;
}
.ac-cn-calc-row--remaining {
    font-size: .85rem;
    color: var(--ac-text-muted, #64748b);
}

/* ── Invoice meta panel ── */
.ac-cn-inv-meta {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}
.ac-cn-inv-meta__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .9rem;
    padding: .3rem 0;
    border-bottom: 1px dashed var(--ac-border, #e2e8f0);
}
.ac-cn-inv-meta__row:last-child { border-bottom: none; }
.ac-cn-inv-meta__key { color: var(--ac-text-muted, #64748b); }
.ac-cn-inv-meta__val { font-weight: 600; }

/* ── Help list ── */
.ac-cn-help-list {
    margin: 0;
    padding-right: 1.25rem;
    color: var(--ac-text-muted, #64748b);
    font-size: .875rem;
    line-height: 1.75;
}

/* ── Show page layout ── */
.ac-cn-show-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}
.ac-cn-show-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* ── Credit note document card ── */
.ac-cn-doc { border-top: 4px solid var(--ac-danger, #ef4444); }
.ac-cn-doc__icon { background: #fee2e2; color: var(--ac-danger, #ef4444); }
.ac-cn-doc__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--ac-danger, #ef4444);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .25rem;
}

/* ── Reason block ── */
.ac-cn-doc__reason {
    background: #fef9c3;
    border-right: 3px solid #eab308;
    border-radius: 6px;
    padding: .65rem 1rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    display: flex;
    gap: .5rem;
    align-items: baseline;
}
.ac-cn-doc__reason-label { font-weight: 700; color: #854d0e; white-space: nowrap; }
.ac-cn-doc__reason-text  { color: #713f12; }

/* ── Warning button color ── */
.ac-btn--warning {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}
.ac-btn--warning:hover { background: #d97706; border-color: #d97706; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .ac-cn-create-layout,
    .ac-cn-show-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   Section 33 — الحركات المحاسبية (Journal Entries Read-Only)
   ============================================================ */

/* ── Page header ── */
.ac-je-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    gap: 1rem;
}
.ac-je-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--ac-text, #0f172a);
    margin: 0 0 .25rem;
}
.ac-je-page-sub {
    font-size: .875rem;
    color: var(--ac-text-muted, #64748b);
    margin: 0;
}
.ac-je-system-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: .8rem;
    font-weight: 600;
    padding: .4rem .75rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* ── Filters bar ── */
.ac-je-filters {
    background: var(--ac-surface, #fff);
    border: 1px solid var(--ac-border, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}
.ac-je-filters__grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: flex-end;
}
.ac-je-filters__grid .ac-form-group--sm { margin: 0; min-width: 140px; flex: 1; }
.ac-je-filters__actions {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
    padding-bottom: 0;
    flex-shrink: 0;
}

/* ── Count line ── */
.ac-je-count {
    font-size: .875rem;
    color: var(--ac-text-muted, #64748b);
    margin-bottom: .75rem;
}
.ac-je-count strong { color: var(--ac-text, #0f172a); }

/* ── Main table ── */
.ac-je-table .ac-je-number    { font-size: .8rem; }
.ac-je-table .ac-je-date      { white-space: nowrap; font-size: .875rem; }
.ac-je-table .ac-je-desc      { max-width: 280px; }
.ac-je-table .ac-je-desc__text{ display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .875rem; }
.ac-je-table .ac-je-amount    { font-weight: 600; }
.ac-je-table .ac-je-creator   { font-size: .85rem; color: var(--ac-text-muted, #64748b); }
.ac-je-row--reversed td       { opacity: .55; text-decoration: line-through; }
.ac-je-row--reversed td:last-child { text-decoration: none; opacity: 1; }

/* ── Type badges ── */
.ac-je-type-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid transparent;
}
.ac-je-type-badge--lg { font-size: .9rem; padding: .35rem .85rem; }
.ac-je-type-badge--posted   { background:#dcfce7; color:#15803d; border-color:#bbf7d0; }
.ac-je-type-badge--draft    { background:#dbeafe; color:#1d4ed8; border-color:#bfdbfe; }
.ac-je-type-badge--pending  { background:#fef9c3; color:#92400e; border-color:#fde68a; }
.ac-je-type-badge--reversed { background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.ac-je-type-badge__emoji    { font-size: 1em; }
.ac-je-type-badge__label    {}

/* ── Show page layout ── */
.ac-je-show-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}
.ac-je-show-main    { display: flex; flex-direction: column; gap: 1rem; }
.ac-je-show-sidebar { display: flex; flex-direction: column; gap: 1rem; }

/* ── Header card ── */
.ac-je-header-card__top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: .75rem;
    flex-wrap: wrap;
    gap: .5rem;
}
.ac-je-header-card__info { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.ac-je-entry-number { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--ac-text, #0f172a); }
.ac-je-description  { font-size: 1rem; color: var(--ac-text, #0f172a); margin: 0 0 1rem; }

/* ── Meta row ── */
.ac-je-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--ac-border, #e2e8f0);
}
.ac-je-meta-item { display: flex; flex-direction: column; gap: .15rem; }
.ac-je-meta-item__key { font-size: .75rem; color: var(--ac-text-muted, #64748b); }
.ac-je-meta-item__val { font-size: .9rem; font-weight: 600; }
.ac-je-auto-badge { font-size: .85rem; color: #6d28d9; }

/* ── Reversal links ── */
.ac-je-reversal-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: .75rem;
    font-size: .85rem;
    color: var(--ac-text-muted, #64748b);
    background: #f8fafc;
    border: 1px solid var(--ac-border, #e2e8f0);
    border-radius: 6px;
    padding: .35rem .65rem;
}
.ac-je-reversal-link--warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* ── Lines table ── */
.ac-je-lines-wrap { overflow-x: auto; }
.ac-je-lines-table .ac-je-line-code { font-size: .8rem; }
.ac-je-lines-table .ac-je-line-name { font-weight: 500; }
.ac-je-lines-table .ac-je-line-desc { max-width: 200px; font-size: .85rem; }
.ac-je-col-dr  { color: #15803d !important; }
.ac-je-col-cr  { color: #b91c1c !important; }
.ac-je-debit   { color: #15803d; font-weight: 600; }
.ac-je-credit  { color: #b91c1c; font-weight: 600; }

.ac-je-totals-row td {
    border-top: 2px solid var(--ac-border, #e2e8f0);
    padding-top: .65rem;
    font-weight: 700;
}
.ac-je-totals-row__label {
    color: var(--ac-text-muted, #64748b);
    font-size: .85rem;
}

/* ── Balance status ── */
.ac-je-balance-status {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .6rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
}
.ac-je-balance-status--ok    { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.ac-je-balance-status--error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Source box ── */
.ac-je-source-box {
    background: #f8fafc;
    border: 1px solid var(--ac-border, #e2e8f0);
    border-radius: 8px;
    padding: .85rem 1rem;
    text-align: center;
}
.ac-je-source-box__type   { font-size: .85rem; color: var(--ac-text-muted, #64748b); margin-bottom: .35rem; }
.ac-je-source-box__number { font-size: 1.1rem; font-weight: 700; color: var(--ac-text, #0f172a); }

/* ── Quick summary sidebar ── */
.ac-je-quick { display: flex; flex-direction: column; gap: .4rem; }
.ac-je-quick__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .875rem;
    padding: .3rem 0;
    border-bottom: 1px dashed var(--ac-border, #e2e8f0);
}
.ac-je-quick__row:last-child { border-bottom: none; }
.ac-je-quick__row--balance   { font-weight: 700; margin-top: .25rem; }
.ac-je-balanced-ok  { color: #15803d; font-weight: 700; }
.ac-je-balanced-err { color: #b91c1c; font-weight: 700; }

/* ── Immutability notice ── */
.ac-je-immutable-notice {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: .75rem 1rem;
    font-size: .82rem;
    color: #475569;
    line-height: 1.5;
}
.ac-je-immutable-notice svg { margin-top: .1rem; flex-shrink: 0; }
.ac-je-immutable-notice strong { color: #1e293b; }

/* ── Badge size variant ── */
.ac-badge--lg { font-size: .9rem; padding: .35rem .85rem; }

/* ── Responsive ── */
@media (max-width: 960px) {
    .ac-je-show-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .ac-je-filters__grid { flex-direction: column; }
    .ac-je-filters__grid .ac-form-group--sm { min-width: 100%; }
    .ac-je-page-header { flex-direction: column; }
}

/* ==========================================================================
   Section 32 — Bank Reconciliation
   ========================================================================== */

/* ── Summary bar ── */
.ac-br-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .9rem 1.25rem;
    margin-bottom: 1rem;
    align-items: center;
}
.ac-br-summary__item {
    display: flex;
    flex-direction: column;
    padding: .35rem .75rem;
    border-left: 1px solid #e2e8f0;
    min-width: 110px;
}
.ac-br-summary__item:first-child { border-left: none; }
.ac-br-summary__item--diff { margin-right: auto; }
.ac-br-summary__label {
    font-size: .72rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .15rem;
}
.ac-br-summary__value {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}
.ac-br-diff--ok  { color: #16a34a; }
.ac-br-diff--err { color: #dc2626; }

/* ── Hint strip ── */
.ac-br-hint {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .83rem;
    color: #1d4ed8;
    margin-bottom: 1rem;
}
.ac-br-hint svg { flex-shrink: 0; }
.ac-br-hint--error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

/* ── Two-column grid ── */
.ac-br-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

/* ── Column ── */
.ac-br-col {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}
.ac-br-col__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.ac-br-col__title {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}
.ac-br-col__body {
    max-height: 520px;
    overflow-y: auto;
}

/* ── Section labels inside columns ── */
.ac-br-section-label {
    padding: .3rem .9rem;
    font-size: .73rem;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.ac-br-section-label--matched { color: #16a34a; background: #f0fdf4; }

/* ── Bank line row ── */
.ac-br-bank-row,
.ac-br-journal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .55rem .9rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
    font-size: .83rem;
}
.ac-br-bank-row:last-child,
.ac-br-journal-row:last-child { border-bottom: none; }

.ac-br-bank-row--selectable { cursor: pointer; }
.ac-br-bank-row--selectable:hover { background: #f8fafc; }
.ac-br-bank-row--selected {
    background: #eff6ff !important;
    border-right: 3px solid #2563eb;
}
.ac-br-bank-row--matched { background: #f0fdf4; }
.ac-br-bank-row--matched:hover { background: #dcfce7; }

/* ── Row internals ── */
.ac-br-row__main {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}
.ac-br-row__date {
    font-size: .75rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}
.ac-br-row__desc {
    color: #1e293b;
    font-size: .82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.ac-br-row__linked {
    font-size: .72rem;
    color: #16a34a;
    font-weight: 600;
}
.ac-br-row__amounts {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}

/* ── Amount badges ── */
.ac-br-amount {
    font-size: .8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    padding: .15rem .4rem;
    border-radius: 4px;
}
.ac-br-amount--debit  { color: #dc2626; background: #fef2f2; }
.ac-br-amount--credit { color: #16a34a; background: #f0fdf4; }

/* ── Empty state ── */
.ac-br-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: .85rem;
}

/* ── Complete bar ── */
.ac-br-complete-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: .9rem 1.25rem;
    margin-bottom: 1.25rem;
}
.ac-br-complete-bar__msg {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 600;
    color: #15803d;
}

/* ── xs button variant ── */
.ac-btn--xs {
    padding: .2rem .5rem;
    font-size: .75rem;
    border-radius: 4px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .ac-br-grid { grid-template-columns: 1fr; }
    .ac-br-summary { gap: .15rem; }
    .ac-br-summary__item { min-width: 80px; }
}

/* ==========================================================================
   Section 33 — Products & Services Catalog
   ========================================================================== */

/* ── Product type badge ── */
.ac-prod-type-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.ac-prod-type-badge--service {
    background: #eff6ff;
    color: #1d4ed8;
}
.ac-prod-type-badge--product {
    background: #fef3c7;
    color: #92400e;
}

/* ── Muted table row ── */
.ac-table-row--muted td { opacity: .55; }

/* ── Index filter form ── */
.ac-prod-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.ac-prod-filter-form__search {
    flex: 1 1 200px;
    min-width: 160px;
}

/* ── Product create/edit two-column grid ── */
.ac-prod-form-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.25rem;
    align-items: start;
}
.ac-prod-form-main { display: flex; flex-direction: column; gap: 1rem; }
.ac-prod-form-side { position: sticky; top: 1rem; }

/* ── Toggle (active switch) ── */
.ac-prod-toggle-label {
    display: flex;
    align-items: center;
    gap: .65rem;
    cursor: pointer;
    font-weight: 600;
    font-size: .9rem;
    color: #1e293b;
    user-select: none;
}
.ac-prod-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.ac-prod-toggle-track {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    background: #cbd5e1;
    border-radius: 999px;
    flex-shrink: 0;
    transition: background .2s;
}
.ac-prod-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.ac-prod-toggle-input:checked + .ac-prod-toggle-track {
    background: #2563eb;
}
.ac-prod-toggle-input:checked + .ac-prod-toggle-track::after {
    transform: translateX(-18px);
}

/* ── Invoice item desc wrap (for catalog button) ── */
.ac-inv-item__desc-wrap {
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0;
}
.ac-inv-item__desc-wrap .ac-inv-item__desc {
    flex: 1;
    min-width: 0;
}
.ac-inv-item__catalog-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
    font-size: .72rem;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: .2rem .45rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background .15s;
}
.ac-inv-item__catalog-btn:hover {
    background: #dbeafe;
}

/* ── Catalog Modal overlay ── */
.ac-catalog-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ac-catalog-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,.45);
    backdrop-filter: blur(2px);
}
.ac-catalog-modal__inner {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0,0,0,.22);
    width: min(560px, 96vw);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── Modal header ── */
.ac-catalog-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid #e2e8f0;
}
.ac-catalog-modal__title {
    font-weight: 700;
    font-size: 1rem;
    color: #0f172a;
}
.ac-catalog-modal__close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #94a3b8;
    padding: .25rem .4rem;
    border-radius: 5px;
    line-height: 1;
    transition: color .15s, background .15s;
}
.ac-catalog-modal__close:hover { color: #1e293b; background: #f1f5f9; }

/* ── Modal search area ── */
.ac-catalog-modal__search {
    padding: .75rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.ac-catalog-modal__type-tabs {
    display: flex;
    gap: .4rem;
}
.ac-catalog-tab {
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    transition: all .15s;
}
.ac-catalog-tab:hover { background: #f1f5f9; }
.ac-catalog-tab--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* ── Modal results list ── */
.ac-catalog-results {
    overflow-y: auto;
    flex: 1;
}
.ac-catalog-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: .87rem;
}

/* ── Single catalog item row ── */
.ac-catalog-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1.25rem;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    transition: background .12s;
}
.ac-catalog-item:last-child { border-bottom: none; }
.ac-catalog-item:hover { background: #f0f7ff; }

.ac-catalog-item__info {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-width: 0;
    flex-wrap: wrap;
}
.ac-catalog-item__name {
    font-weight: 600;
    font-size: .88rem;
    color: #0f172a;
}
.ac-catalog-item__code {
    font-size: .75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: .1rem .4rem;
    border-radius: 4px;
}
.ac-catalog-item__unit {
    font-size: .75rem;
    color: #64748b;
    font-style: italic;
}
.ac-catalog-item__price {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .ac-prod-form-grid { grid-template-columns: 1fr; }
    .ac-prod-form-side { position: static; }
}

/* ══════════════════════════════════════════════════════════
   Section 34 — Badge Aliases (success / info / muted / warning / danger)
   ══════════════════════════════════════════════════════════ */
.ac-badge--success { background: #dcfce7; color: #166534; }
.ac-badge--info    { background: #dbeafe; color: #1e40af; }
.ac-badge--muted   { background: #f3f4f6; color: #374151; }
.ac-badge--warning { background: #fef9c3; color: #854d0e; }
.ac-badge--danger  { background: #fee2e2; color: #991b1b; }

/* ══════════════════════════════════════════════════════════
   Section 35 — Payroll & Employees
   ══════════════════════════════════════════════════════════ */
.ac-text-danger  { color: var(--ac-danger,  #dc2626) !important; }
.ac-text-warning { color: var(--ac-warning, #d97706) !important; }
.ac-text-success { color: var(--ac-success, #16a34a) !important; }

:root {
  --ac-danger:  #dc2626;
  --ac-warning: #d97706;
  --ac-success: #16a34a;
}

/* ── Section 36: Tabs ──────────────────────────────────────────────────────── */
.ac-tabs {
  display: flex;
  gap: .25rem;
  border-bottom: 2px solid var(--ac-border);
  margin-bottom: 1.5rem;
}

.ac-tab {
  background: none;
  border: none;
  padding: .6rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ac-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color .2s, border-color .2s;
  font-family: inherit;
}

.ac-tab:hover { color: var(--ac-text); }

.ac-tab--active {
  color: var(--ac-primary);
  border-bottom-color: var(--ac-primary);
  background: var(--ac-primary-faint, rgba(99,102,241,.07));
}

/* ── Section 37: Detail list ───────────────────────────────────────────────── */
.ac-detail-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ac-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: .65rem 0;
  border-bottom: 1px solid var(--ac-border);
  gap: 1rem;
}

.ac-detail-item:last-child { border-bottom: none; }

.ac-detail-label {
  color: var(--ac-muted);
  font-size: .875rem;
  flex-shrink: 0;
  min-width: 140px;
}

.ac-detail-value {
  font-weight: 500;
  text-align: left;
}

/* ── Section 38: Text color helpers ─────────────────────────────────────────── */
.ac-text--primary { color: var(--ac-primary); }
.ac-text--success { color: var(--ac-success); }
.ac-text--danger  { color: var(--ac-danger);  }
.ac-text--warning { color: var(--ac-warning); }
.ac-text--muted   { color: var(--ac-muted);   }

/* ── Section 39: Empty state ─────────────────────────────────────────────────── */
.ac-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--ac-muted);
  font-size: .9rem;
}

/* ── Section 40: Alert ───────────────────────────────────────────────────────── */
.ac-alert { padding: .85rem 1.1rem; border-radius: 8px; font-size: .875rem; margin-bottom: 1rem; }
.ac-alert--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.ac-alert--danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.ac-alert--warning { background: #fef9c3; color: #854d0e; border: 1px solid #fef08a; }
.ac-alert--info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Section 41: btn--success ────────────────────────────────────────────────── */
.ac-btn--success {
  background: var(--ac-success);
  color: #fff;
  border: 1px solid var(--ac-success);
}
.ac-btn--success:hover { background: #15803d; }

.ac-btn--warning {
  background: var(--ac-warning);
  color: #fff;
  border: 1px solid var(--ac-warning);
}
.ac-btn--warning:hover { background: #b45309; }

/* Employee leave details refresh */
.ac-leave-show {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ac-leave-show__hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem 1.75rem;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,.16), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #0f766e 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.ac-leave-show__hero-copy {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  max-width: 720px;
}

.ac-leave-show__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.2);
  font-size: .78rem;
  font-weight: 700;
}

.ac-leave-show__hero-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.ac-leave-show__hero-text {
  margin: 0;
  max-width: 58ch;
  color: rgba(255,255,255,.84);
  line-height: 1.8;
  font-size: .95rem;
}

.ac-leave-show__hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
}

.ac-leave-show__hero-meta span,
.ac-leave-show__hero-id {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem .85rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .83rem;
  font-weight: 700;
}

.ac-leave-show__hero-id {
  min-width: 88px;
  min-height: 88px;
  border-radius: 24px;
  font-size: 1.1rem;
}

.ac-leave-show__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.ac-leave-show__stat-card {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.15rem 1.2rem;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #dbe3ef;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .05);
}

.ac-leave-show__stat-label {
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.ac-leave-show__stat-value {
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 800;
}

.ac-leave-show__stat-note {
  color: #64748b;
  font-size: .82rem;
}

.ac-leave-show__grid {
  gap: 1.25rem;
}

.ac-leave-show__card {
  border: 1px solid #dbe3ef;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .05);
}

.ac-leave-show__card .ac-card__header {
  padding: 1.1rem 1.25rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7ff 100%);
  border-bottom: 1px solid #e6edf6;
}

.ac-leave-show__card .ac-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.ac-leave-show__card .ac-detail-list {
  padding: .25rem 1.25rem .5rem;
}

.ac-leave-show__card .ac-detail-item {
  padding: .95rem 0;
}

.ac-leave-show__card .ac-detail-label {
  min-width: 120px;
  font-weight: 700;
}

.ac-leave-show__card .ac-detail-value {
  max-width: min(100%, 420px);
  text-align: right;
  color: #0f172a;
}

.ac-leave-show__review-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  border: 1px solid #fcd34d;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  color: #854d0e;
}

.ac-leave-show__review-note strong {
  font-size: .92rem;
}

.ac-leave-show__review-note span {
  font-size: .86rem;
}

.ac-leave-show__footer {
  display: flex;
  justify-content: flex-start;
}

@media (max-width: 900px) {
  .ac-leave-show__hero {
    flex-direction: column;
    align-items: stretch;
  }

  .ac-leave-show__hero-id {
    min-width: auto;
    min-height: auto;
    width: fit-content;
    border-radius: 999px;
  }

  .ac-leave-show__stats {
    grid-template-columns: 1fr;
  }

  .ac-leave-show__review-note {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* POS */
.ac-pos-page {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ac-pos-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 48%, #0f766e 100%);
  box-shadow: 0 20px 45px rgba(15, 23, 42, .14);
}

.ac-pos-hero__copy {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.ac-pos-hero__eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .8rem;
  font-weight: 700;
}

.ac-pos-hero__title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1.1;
}

.ac-pos-hero__text {
  margin: 0;
  max-width: 60ch;
  color: rgba(255,255,255,.86);
  line-height: 1.8;
}

.ac-pos-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.ac-pos-hero__meta span {
  padding: .5rem .8rem;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: .82rem;
  font-weight: 700;
}

.ac-pos-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}

.ac-pos-stat {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}

.ac-pos-stat__label {
  font-size: .78rem;
  color: rgba(255,255,255,.78);
}

.ac-pos-stat__value {
  font-size: 1.45rem;
  font-weight: 800;
}

.ac-pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(330px, .85fr);
  gap: 1.25rem;
  align-items: start;
}

.ac-pos-panel {
  border: 1px solid #dbe3ef;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .05);
}

.ac-pos-panel--sticky {
  position: sticky;
  top: 1rem;
}

.ac-pos-panel__header {
  padding: 1.1rem 1.2rem;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fe 100%);
  border-bottom: 1px solid #e6edf6;
}

.ac-pos-panel__subtitle {
  margin: .25rem 0 0;
  color: #64748b;
  font-size: .85rem;
}

.ac-pos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem 0;
}

.ac-pos-filter-tabs {
  display: inline-flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.ac-pos-filter-tabs__btn {
  padding: .55rem .95rem;
  border: 1px solid #d7e0ee;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: .18s ease;
}

.ac-pos-filter-tabs__btn.is-active,
.ac-pos-filter-tabs__btn:hover {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.ac-pos-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .9rem;
  padding: 1rem 1.2rem 1.2rem;
}

.ac-pos-product {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1rem;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: #fff;
  text-align: right;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ac-pos-product:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 12px 28px rgba(59, 130, 246, .12);
}

.ac-pos-product.is-hidden {
  display: none;
}

.ac-pos-product--disabled,
.ac-pos-product:disabled {
  opacity: .55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.ac-pos-product__top,
.ac-pos-product__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
}

.ac-pos-product__type,
.ac-pos-product__stock {
  padding: .3rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 800;
}

.ac-pos-product__type--product {
  background: #e0f2fe;
  color: #075985;
}

.ac-pos-product__type--service {
  background: #ecfccb;
  color: #3f6212;
}

.ac-pos-product__stock {
  background: #f8fafc;
  color: #475569;
}

.ac-pos-product__stock.is-low {
  background: #fef3c7;
  color: #92400e;
}

.ac-pos-product__stock.is-out {
  background: #fee2e2;
  color: #991b1b;
}

.ac-pos-product__name {
  font-size: .98rem;
  font-weight: 800;
  color: #0f172a;
}

.ac-pos-product__meta {
  color: #64748b;
  font-size: .78rem;
}

.ac-pos-product__price {
  font-size: 1.12rem;
  font-weight: 800;
  color: #1d4ed8;
}

.ac-pos-cart {
  min-width: 0;
}

.ac-pos-cart__section {
  padding: 1rem 1.2rem 0;
}

.ac-pos-field-note {
  margin: .45rem 0 0;
  color: #64748b;
  font-size: .78rem;
}

.ac-pos-choice-grid,
.ac-pos-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.ac-pos-choice,
.ac-pos-method {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 46px;
  padding: .75rem .9rem;
  border-radius: 14px;
  border: 1px solid #dbe3ef;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  color: #334155;
  transition: .18s ease;
}

.ac-pos-choice input,
.ac-pos-method input {
  display: none;
}

.ac-pos-choice.is-selected,
.ac-pos-method.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.ac-pos-methods {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ac-pos-methods .ac-pos-method {
  min-height: 42px;
  padding: .65rem .5rem;
  font-size: .84rem;
}

.ac-pos-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.ac-pos-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  font-weight: 800;
  color: #0f172a;
}

.ac-pos-cart__rows {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  margin-top: .75rem;
}

.ac-pos-cart__empty {
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  color: #64748b;
  text-align: center;
  background: #f8fafc;
}

.ac-pos-cart-item {
  padding: .9rem;
  border-radius: 18px;
  border: 1px solid #dbe3ef;
  background: #fff;
}

.ac-pos-cart-item__head,
.ac-pos-cart-item__meta,
.ac-pos-summary__row,
.ac-pos-cart-item__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.ac-pos-cart-item__name {
  font-weight: 800;
  color: #0f172a;
}

.ac-pos-cart-item__meta {
  margin-top: .25rem;
  justify-content: flex-start;
  flex-wrap: wrap;
  color: #64748b;
  font-size: .76rem;
}

.ac-pos-cart-item__stock {
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.ac-pos-cart-item__remove {
  border: 0;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ac-pos-cart-item__controls {
  margin-top: .85rem;
  align-items: flex-end;
}

.ac-pos-cart-item__controls label {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
  font-size: .75rem;
  color: #64748b;
}

.ac-pos-cart-item__controls input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 0 .75rem;
  font: inherit;
}

.ac-pos-cart-item__total {
  min-width: 90px;
  text-align: left;
}

.ac-pos-cart-item__total span {
  display: block;
  color: #64748b;
  font-size: .75rem;
}

.ac-pos-cart-item__total strong {
  font-size: 1rem;
  color: #0f172a;
}

.ac-pos-summary {
  margin: 1rem 1.2rem 0;
  padding: .85rem 1rem;
  border-radius: 18px;
  background: #f8fbff;
  border: 1px solid #dbe3ef;
}

.ac-pos-summary__row {
  padding: .45rem 0;
  color: #475569;
}

.ac-pos-summary__row strong {
  color: #0f172a;
}

.ac-pos-summary__row--total {
  margin-top: .35rem;
  padding-top: .8rem;
  border-top: 1px dashed #cbd5e1;
  font-size: 1rem;
  font-weight: 800;
}

.ac-pos-submit {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  padding: 1rem 1.2rem 1.2rem;
}

.is-hidden {
  display: none !important;
}

.is-disabled {
  opacity: .55;
}

@media (max-width: 1100px) {
  .ac-pos-hero,
  .ac-pos-layout {
    grid-template-columns: 1fr;
  }

  .ac-pos-panel--sticky {
    position: static;
  }
}

@media (max-width: 720px) {
  .ac-pos-toolbar,
  .ac-pos-dates,
  .ac-pos-choice-grid,
  .ac-pos-methods,
  .ac-pos-stats {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .ac-pos-toolbar {
    display: flex;
  }

  .ac-pos-products {
    grid-template-columns: 1fr;
  }

  .ac-pos-cart-item__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .ac-pos-cart-item__total {
    min-width: 0;
    text-align: right;
  }
}

.ac-pos-toolbar__barcode {
  max-width: 220px;
  direction: ltr;
  text-align: left;
}

.ac-pos-summary__label {
  font-weight: 600;
}

.ac-pos-discount-tools {
  display: grid;
  gap: .75rem;
}

.ac-pos-discount-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

.ac-pos-discount-btn {
  min-width: 58px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 700;
  padding: .45rem .8rem;
  cursor: pointer;
  transition: .2s ease;
}

.ac-pos-discount-btn:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
}

.ac-report-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 1rem;
  margin-top: 1rem;
}

.ac-report-mix-list {
  display: grid;
  gap: .85rem;
}

.ac-report-mix-card {
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  padding: 1rem 1.1rem;
}

.ac-report-mix-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  color: #475569;
  font-size: .92rem;
}

.ac-report-mix-card__amount {
  margin-top: .8rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
}

.ac-report-stack {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.ac-report-inline-badge {
  width: fit-content;
  padding: .18rem .55rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  font-size: .72rem;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .ac-report-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Section 52 — Modern Accounting Dashboard
   ========================================================================== */
.ac-db {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ac-db-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .55fr);
    gap: 18px;
    align-items: stretch;
    padding: 24px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 18% 12%, rgba(96, 165, 250, .32), transparent 28rem),
        linear-gradient(135deg, #0f172a 0%, #1e3a8a 58%, #0f766e 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
    overflow: hidden;
}

.ac-db-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 170px;
}

.ac-db-hero__content h2 {
    margin: 12px 0 8px;
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    font-weight: 900;
    letter-spacing: -.04em;
}

.ac-db-hero__content p {
    max-width: 640px;
    margin: 0;
    color: rgba(255, 255, 255, .76);
    font-size: 1rem;
    font-weight: 600;
}

.ac-db-hero__panel {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(18px);
}

.ac-db-hero__panel > span,
.ac-db-hero__panel small {
    display: block;
    color: rgba(255, 255, 255, .72);
    font-weight: 700;
}

.ac-db-amount {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.15;
}

.ac-db-amount--positive {
    color: #86efac;
}

.ac-db-amount--negative {
    color: #fca5a5;
}

.ac-db-ratio {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.ac-db-ratio div {
    padding: 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, .12);
}

.ac-db-ratio b,
.ac-db-ratio span {
    display: block;
}

.ac-db-ratio span {
    color: rgba(255, 255, 255, .66);
    font-size: .78rem;
}

.ac-db-eyebrow {
    display: inline-flex;
    width: fit-content;
    padding: 4px 10px;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
}

.ac-db-hero .ac-db-eyebrow {
    color: #dbeafe;
    background: rgba(255, 255, 255, .12);
}

.ac-db-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, .22);
}

.ac-db-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa, #34d399);
    transition: width .7s ease;
}

.ac-db-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.ac-db-kpi {
    position: relative;
    min-height: 132px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.ac-db-kpi::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: var(--db-color, #2563eb);
}

.ac-db-kpi__label,
.ac-db-kpi small,
.ac-db-kpi strong {
    display: block;
}

.ac-db-kpi__label {
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
}

.ac-db-kpi strong {
    margin: 12px 0 7px;
    color: #0f172a;
    font-size: 1.55rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.03em;
}

.ac-db-kpi small {
    color: #94a3b8;
    font-size: .78rem;
    font-weight: 600;
}

.ac-db-kpi--blue { --db-color: #2563eb; }
.ac-db-kpi--green { --db-color: #16a34a; }
.ac-db-kpi--red { --db-color: #dc2626; }
.ac-db-kpi--amber { --db-color: #d97706; }
.ac-db-kpi--cyan { --db-color: #0891b2; }
.ac-db-kpi--violet { --db-color: #7c3aed; }

.ac-db-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.ac-db-main,
.ac-db-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.ac-db-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.ac-db-card--chart {
    padding: 20px;
}

.ac-db-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ac-db-card__head h3 {
    margin: 8px 0 0;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
}

.ac-db-link {
    color: #2563eb;
    font-size: .82rem;
    font-weight: 800;
    white-space: nowrap;
}

.ac-db-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.ac-db-chart {
    height: 330px;
}

.ac-db-chart--small {
    height: 240px;
}

.ac-db-donut {
    height: 210px;
}

.ac-db-two-col {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    gap: 18px;
}

.ac-db-legend {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.ac-db-legend div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: .82rem;
}

.ac-db-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2563eb;
}

.ac-db-legend-dot--2 { background: #0f766e; }
.ac-db-legend-dot--3 { background: #f59e0b; }
.ac-db-legend-dot--4 { background: #dc2626; }
.ac-db-legend-dot--5 { background: #7c3aed; }
.ac-db-legend-dot--6 { background: #0891b2; }

.ac-db-legend strong {
    font-weight: 800;
}

.ac-db-legend b {
    color: #94a3b8;
    font-size: .76rem;
}

.ac-db-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.ac-db-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.ac-db-table th,
.ac-db-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eef2f7;
    text-align: right;
    vertical-align: middle;
}

.ac-db-table th {
    color: #64748b;
    background: #f8fafc;
    font-size: .75rem;
    font-weight: 900;
}

.ac-db-table td {
    color: #334155;
    font-size: .84rem;
    font-weight: 600;
}

.ac-db-table tr:last-child td {
    border-bottom: 0;
}

.ac-db-num {
    direction: ltr;
    text-align: left !important;
    color: #0f172a !important;
    font-variant-numeric: tabular-nums;
    font-weight: 900 !important;
}

.ac-db-num.is-green { color: #16a34a !important; }
.ac-db-num.is-red { color: #dc2626 !important; }

.ac-db-badge {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 900;
    white-space: nowrap;
}

.ac-db-badge--income {
    color: #15803d;
    background: #dcfce7;
}

.ac-db-badge--expense {
    color: #b91c1c;
    background: #fee2e2;
}

.ac-db-badge--transfer {
    color: #1d4ed8;
    background: #dbeafe;
}

.ac-db-badge--muted {
    color: #475569;
    background: #f1f5f9;
}

.ac-db-person {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.ac-db-person span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    font-size: .82rem;
    font-weight: 900;
}

.ac-db-person b {
    color: #0f172a;
}

.ac-db-empty {
    padding: 22px;
    color: #94a3b8;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    font-weight: 700;
}

.ac-db-alert-list,
.ac-db-actions,
.ac-db-cash-split,
.ac-db-report-links,
.ac-db-activity {
    display: grid;
    gap: 10px;
}

.ac-db-alert {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.ac-db-alert strong {
    color: #0f172a;
    font-size: .88rem;
}

.ac-db-alert span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 700;
}

.ac-db-alert em {
    color: #2563eb;
    font-size: .75rem;
    font-style: normal;
    font-weight: 900;
}

.ac-db-alert--danger {
    border-color: #fecaca;
    background: #fff5f5;
}

.ac-db-alert--warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.ac-db-alert--info {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.ac-db-actions {
    grid-template-columns: repeat(2, 1fr);
}

.ac-db-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px;
    color: #334155;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: #f8fafc;
    font-size: .82rem;
    font-weight: 900;
    transition: background .15s, color .15s, border-color .15s;
}

.ac-db-actions a:hover {
    color: #fff;
    border-color: #2563eb;
    background: #2563eb;
}

.ac-db-cash-split > div {
    display: grid;
    gap: 7px;
}

.ac-db-cash-split span {
    color: #64748b;
    font-size: .78rem;
    font-weight: 800;
}

.ac-db-cash-split b {
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 900;
}

.ac-db-report-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.ac-db-report-links span {
    color: #334155;
    font-size: .82rem;
    font-weight: 900;
}

.ac-db-report-links b {
    color: #2563eb;
    font-size: .8rem;
}

.ac-db-activity__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.ac-db-activity__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.ac-db-activity__item > span {
    width: 9px;
    height: 9px;
    margin-top: 7px;
    border-radius: 50%;
    background: #94a3b8;
}

.ac-db-activity__item--created > span { background: #16a34a; }
.ac-db-activity__item--updated > span { background: #2563eb; }
.ac-db-activity__item--deleted > span { background: #dc2626; }
.ac-db-activity__item--settled > span { background: #7c3aed; }

.ac-db-activity strong {
    display: block;
    color: #334155;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.5;
}

.ac-db-activity small {
    display: block;
    margin-top: 2px;
    color: #94a3b8;
    font-size: .72rem;
    font-weight: 700;
}

@media (max-width: 1280px) {
    .ac-db-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .ac-db-hero,
    .ac-db-main-grid,
    .ac-db-two-col {
        grid-template-columns: 1fr;
    }

    .ac-db-side {
        order: -1;
    }
}

@media (max-width: 760px) {
    .ac-db-hero {
        padding: 18px;
        border-radius: 18px;
    }

    .ac-db-kpi-grid {
        grid-template-columns: 1fr;
    }

    .ac-db-ratio,
    .ac-db-actions {
        grid-template-columns: 1fr;
    }

    .ac-db-card__head {
        flex-direction: column;
        align-items: stretch;
    }

    .ac-db-chart {
        height: 280px;
    }
}

@media (max-width: 720px) {
  .ac-pos-toolbar__barcode {
    max-width: none;
  }

  .ac-pos-discount-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ac-report-mix-card__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Purchase Payments Page
   ========================================================================== */
.ac-pp-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ac-pp-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px;
    align-items: stretch;
    padding: 24px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at 12% 18%, rgba(251, 146, 60, .38), transparent 32%),
        linear-gradient(135deg, #0f172a 0%, #17355f 58%, #b45309 100%);
    box-shadow: 0 20px 45px rgba(15, 23, 42, .16);
}

.ac-pp-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.ac-pp-hero__eyebrow {
    width: max-content;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    color: rgba(255, 255, 255, .78);
    font-size: .78rem;
    font-weight: 800;
}

.ac-pp-hero h1 {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 2.2rem);
    font-weight: 900;
}

.ac-pp-hero p {
    max-width: 680px;
    margin: 0;
    color: rgba(255, 255, 255, .76);
    line-height: 1.8;
}

.ac-pp-hero__summary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 20px;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(14px);
}

.ac-pp-hero__summary span,
.ac-pp-hero__summary small {
    color: rgba(255, 255, 255, .72);
    font-size: .82rem;
}

.ac-pp-hero__summary strong {
    font-size: 2rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ac-pp-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ac-pp-stat,
.ac-pp-method {
    padding: 18px;
    border: 1px solid var(--ac-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--ac-shadow-sm);
}

.ac-pp-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ac-pp-stat__label,
.ac-pp-stat small,
.ac-pp-method small {
    color: var(--ac-text-muted);
    font-size: .82rem;
}

.ac-pp-stat strong,
.ac-pp-method strong {
    color: var(--ac-text);
    font-size: 1.45rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.ac-pp-stat--danger {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 68%);
}

.ac-pp-stat--danger strong,
.ac-pp-amount {
    color: #dc2626;
}

.ac-pp-filter {
    padding: 18px;
    border: 1px solid var(--ac-border);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--ac-shadow-sm);
}

.ac-pp-filter__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.ac-pp-filter__head h2,
.ac-pp-filter__head p {
    margin: 0;
}

.ac-pp-filter__head h2 {
    color: var(--ac-text);
    font-size: 1rem;
    font-weight: 900;
}

.ac-pp-filter__head p {
    margin-top: 4px;
    color: var(--ac-text-muted);
    font-size: .86rem;
}

.ac-pp-filter__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
    gap: 12px;
    align-items: end;
}

.ac-pp-filter__actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ac-pp-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
}

.ac-pp-method {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ac-pp-method span {
    color: var(--ac-text-muted);
    font-size: .82rem;
    font-weight: 800;
}

.ac-pp-empty {
    display: flex;
    min-height: 320px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 24px;
    border: 1px dashed #cbd5e1;
    border-radius: 24px;
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
    text-align: center;
}

.ac-pp-empty__icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 20px;
    color: #64748b;
    background: #eef2f7;
}

.ac-pp-empty__icon svg {
    width: 34px;
    height: 34px;
}

.ac-pp-empty h2 {
    margin: 0;
    color: var(--ac-text);
    font-size: 1.15rem;
    font-weight: 900;
}

.ac-pp-empty p {
    max-width: 520px;
    margin: 0;
    color: var(--ac-text-muted);
    line-height: 1.8;
}

.ac-pp-table-card {
    overflow: hidden;
}

.ac-pp-table tfoot td {
    border-top: 1px solid var(--ac-border);
    background: #f8fafc;
    font-weight: 900;
}

.ac-table-wrap {
    overflow-x: auto;
}

@media (max-width: 1100px) {
    .ac-pp-filter__grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
}

@media (max-width: 820px) {
    .ac-pp-hero,
    .ac-pp-stats,
    .ac-pp-filter__grid {
        grid-template-columns: 1fr;
    }

    .ac-pp-filter__head,
    .ac-pp-filter__actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Section 53 — Price Lists & Governorates
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Two-column page layout ────────────────────────────────────────────── */
.ac-pl-layout {
    display: grid;
    grid-template-columns: 1fr 270px;
    gap: 1.25rem;
    align-items: start;
}

.ac-pl-main { display: flex; flex-direction: column; gap: 1rem; position: relative; z-index: 2; }
.ac-pl-side  { display: flex; flex-direction: column; gap: 1rem; position: relative; z-index: 1; }

.ac-pl-create-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}

.ac-pl-create-summary__item {
    background: var(--ac-surface);
    border: 1px solid var(--ac-border);
    border-radius: .65rem;
    padding: .8rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.ac-pl-create-summary__label {
    font-size: .75rem;
    color: var(--ac-text-muted);
}

.ac-pl-create-summary__value {
    font-size: .92rem;
    color: var(--ac-text);
    line-height: 1.45;
}

.ac-pl-create-hero {
    background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
    border: 1px solid #bfdbfe;
}

.ac-pl-create-hero__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .7rem;
}

.ac-pl-create-hero__title {
    margin: .2rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.ac-pl-create-hero__badge {
    font-size: .72rem;
    font-weight: 700;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 999px;
    padding: .25rem .6rem;
    white-space: nowrap;
}

.ac-pl-create-hero__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

.ac-pl-create-hero__step {
    font-size: .8rem;
    color: var(--ac-text);
    background: rgba(255,255,255,.8);
    border: 1px solid #dbeafe;
    border-radius: .45rem;
    padding: .45rem .55rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ac-pl-create-hero__step span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
}

.ac-pl-create-muted {
    margin: .25rem 0 0;
    font-size: .8rem;
    color: var(--ac-text-muted);
}

/* ── Info row (name + description side by side) ────────────────────────── */
.ac-pl-info-row {
    display: flex;
    gap: 1rem;
}

.ac-pl-create-tools {
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    flex-wrap: wrap;
}

.ac-pl-create-tools__meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}

.ac-pl-create-check {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    color: var(--ac-text-muted);
    cursor: pointer;
}

.ac-pl-inline-alert {
    margin-bottom: .75rem;
}

.ac-pl-create-search-wrap {
    width: min(360px, 100%);
}

.ac-pl-create-search {
    width: 100%;
}

.ac-pl-create-counter {
    font-size: .78rem;
    color: var(--ac-text-muted);
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: 999px;
    padding: .2rem .55rem;
    white-space: nowrap;
}

/* ── Table header bar ──────────────────────────────────────────────────── */
.ac-pl-tbl-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .65rem;
    gap: .5rem;
    flex-wrap: wrap;
}

.ac-pl-tbl-header__actions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

/* ── Bulk price bar ────────────────────────────────────────────────────── */
.ac-pl-bulk-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: .5rem;
    padding: .6rem 1rem;
    margin-bottom: .75rem;
    flex-wrap: wrap;
}

.ac-pl-bulk-bar__count {
    font-size: .82rem;
    font-weight: 700;
    color: var(--ac-primary);
    white-space: nowrap;
    min-width: 80px;
}

.ac-pl-bulk-bar__fields {
    display: flex;
    align-items: flex-end;
    gap: .75rem;
    flex: 1;
    flex-wrap: wrap;
}

.ac-pl-bulk-bar__hint {
    font-size: .78rem;
    color: #1d4ed8;
}

.ac-pl-bulk-bar__field {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.ac-pl-bulk-bar__lbl {
    font-size: .75rem;
    color: var(--ac-text-muted);
    display: flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.ac-pl-bulk-inp {
    width: 120px;
}

/* ── Governorates table ────────────────────────────────────────────────── */
.ac-pl-tbl-wrap {
    overflow-x: auto;
    border: 1px solid var(--ac-border);
    border-radius: .5rem;
}

.ac-pl-tbl {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: .875rem;
    table-layout: fixed;
}

.ac-pl-tbl thead tr {
    background: var(--ac-bg);
    border-bottom: 1px solid var(--ac-border);
}

.ac-pl-tbl thead th {
    padding: .6rem .85rem;
    text-align: right;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ac-text-muted);
    white-space: nowrap;
}

.ac-pl-tbl tbody tr {
    border-bottom: 1px solid var(--ac-border);
    transition: background .12s;
}

.ac-pl-tbl tbody tr:last-child {
    border-bottom: none;
}

.ac-pl-tbl tbody td {
    padding: .45rem .85rem;
    vertical-align: middle;
}

/* ── Row states ────────────────────────────────────────────────────────── */
.ac-pl-row {
    opacity: .65;
    transition: opacity .15s, background .15s;
}

.ac-pl-row--active {
    opacity: 1;
    background: #f8fbff;
}

.ac-pl-row--missing {
    background: #fff7ed;
}

.ac-pl-row--missing .ac-pl-delivery-inp {
    border-color: #fb923c;
    box-shadow: 0 0 0 2px rgba(251, 146, 60, .12);
}

.ac-pl-row--active .ac-pl-tbl__name {
    font-weight: 600;
    color: var(--ac-text);
}

/* ── Table column specifics ────────────────────────────────────────────── */
.ac-pl-tbl__check-col {
    width: 36px;
    text-align: center !important;
}

.ac-pl-tbl__name {
    font-size: .875rem;
    color: var(--ac-text);
}

.ac-pl-tbl__prices-col {
    width: 300px;
    padding: .35rem .65rem;
}

/* ── Two prices in one cell ────────────────────────────────────────────── */
.ac-pl-two-prices {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ac-pl-two-prices__sep {
    flex-shrink: 0;
    width: 1px;
    height: 24px;
    background: var(--ac-border);
}

.ac-pl-two-prices .ac-control {
    flex: 1;
    min-width: 0;
    font-size: .82rem;
    padding: 6px 8px;
}

.ac-pl-two-prices .ac-control:disabled {
    opacity: .45;
}

/* ── Prices header (two labels in one th) ──────────────────────────────── */
.ac-pl-prices-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
}

/* ── Table header badges ───────────────────────────────────────────────── */
.ac-pl-th-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .75rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: .3rem;
}

.ac-pl-th-badge--delivery {
    background: #dbeafe;
    color: #1d4ed8;
}

.ac-pl-th-badge--return {
    background: #fef3c7;
    color: #92400e;
}

.ac-pl-th-required {
    color: #ef4444;
    font-size: .8rem;
    margin-right: .15rem;
}

.ac-pl-th-optional {
    font-size: .72rem;
    color: var(--ac-text-muted);
    margin-right: .25rem;
}

/* ── Price inputs in table ─────────────────────────────────────────────── */
.ac-pl-price-inp {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.ac-pl-price-inp:disabled {
    opacity: .35;
    cursor: not-allowed;
}

/* ── Show page: price values ───────────────────────────────────────────── */
.ac-pl-show-price {
    display: inline-flex;
    align-items: baseline;
    gap: .2rem;
    font-weight: 700;
    font-size: .9rem;
}

.ac-pl-show-price--delivery { color: #1d4ed8; }
.ac-pl-show-price--return   { color: #92400e; }

.ac-pl-show-currency {
    font-size: .72rem;
    font-weight: 400;
    color: var(--ac-text-muted);
}

/* ── Show-only table (no checkbox col) ─────────────────────────────────── */
.ac-pl-tbl--show thead th,
.ac-pl-tbl--show tbody td {
    padding: .5rem 1rem;
}

/* ── Side panel stats ──────────────────────────────────────────────────── */
.ac-pl-side-stats {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: var(--ac-bg);
    border-radius: .45rem;
    padding: .65rem .75rem;
    margin-top: .4rem;
}

.ac-pl-side-stat {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: .5rem;
}

.ac-pl-side-stat__label {
    font-size: .79rem;
    color: var(--ac-text-muted);
    min-width: 0;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
}

.ac-pl-side-stat__val {
    font-size: .9rem;
    font-weight: 700;
    color: var(--ac-text);
    white-space: nowrap;
}

.ac-pl-readiness {
    margin-top: 1rem;
    border: 1px solid var(--ac-border);
    border-radius: .6rem;
    padding: .8rem;
    background: #fcfcfd;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.ac-pl-readiness__title {
    margin: 0;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-pl-readiness__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--ac-text-muted);
}

.ac-pl-readiness__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.ac-pl-readiness__item.is-ready {
    color: #166534;
}

.ac-pl-readiness__item.is-ready .ac-pl-readiness__dot {
    background: #22c55e;
}

.ac-pl-readiness__item.is-pending .ac-pl-readiness__dot {
    background: #f59e0b;
}

/* ── Customer multi-select box ─────────────────────────────────────────── */
.ac-pl-cust-box {
    border: 1.5px solid var(--ac-border);
    border-radius: .5rem;
    background: var(--ac-surface);
    position: relative;
    transition: border-color .15s;
    overflow: hidden;
}

.ac-pl-cust-box:focus-within {
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.ac-pl-cust-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    padding: .55rem .75rem .35rem;
    min-height: 2.6rem;
}

.ac-pl-cust-placeholder {
    font-size: .82rem;
    color: var(--ac-text-muted);
    align-self: center;
}

.ac-pl-cust-head {
    display: flex;
    justify-content: flex-start;
    margin-bottom: .7rem;
}

/* ── Chip ──────────────────────────────────────────────────────────────── */
.ac-pl-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 99px;
    padding: .18rem .5rem .18rem .65rem;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.4;
}

.ac-pl-chip__rm {
    background: none;
    border: none;
    cursor: pointer;
    color: #3b82f6;
    font-size: 1rem;
    line-height: 1;
    padding: 0 .1rem;
    border-radius: 50%;
    transition: background .1s, color .1s;
}

.ac-pl-chip__rm:hover {
    background: #bfdbfe;
    color: #1e3a8a;
}

/* ── Search row inside the box ─────────────────────────────────────────── */
.ac-pl-cust-search-wrap {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .75rem .5rem;
    border-top: 1px solid var(--ac-border);
}

.ac-pl-cust-search-icon {
    color: var(--ac-text-muted);
    flex-shrink: 0;
}

.ac-pl-cust-search {
    border: none;
    outline: none;
    background: transparent;
    font-size: .85rem;
    width: 100%;
    color: var(--ac-text);
}

.ac-pl-cust-search::placeholder { color: var(--ac-text-muted); }

/* ── Dropdown ──────────────────────────────────────────────────────────── */
.ac-pl-cust-dropdown {
    position: static;
    background: var(--ac-surface);
    border-top: 1px solid var(--ac-border);
    border-radius: 0;
    box-shadow: none;
    max-height: 220px;
    overflow-y: auto;
}

.ac-pl-cust-opt {
    padding: .55rem .85rem;
    font-size: .855rem;
    cursor: pointer;
    transition: background .1s;
}

.ac-pl-cust-opt:hover { background: var(--ac-bg); }

.ac-pl-cust-empty {
    padding: .75rem .85rem;
    font-size: .82rem;
    color: var(--ac-text-muted);
    text-align: center;
}

/* ── Customer tags (show page) ─────────────────────────────────────────── */
.ac-pl-cust-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .25rem;
}

.ac-pl-cust-tag {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--ac-bg);
    border: 1px solid var(--ac-border);
    border-radius: 99px;
    padding: .25rem .75rem;
    font-size: .82rem;
    color: var(--ac-text);
    text-decoration: none;
    transition: border-color .15s, background .15s;
}

.ac-pl-cust-tag:hover {
    border-color: var(--ac-primary);
    background: #eff6ff;
    color: var(--ac-primary);
}

/* ── Custom checkbox ───────────────────────────────────────────────────── */
.ac-checkbox {
    width: 15px;
    height: 15px;
    accent-color: var(--ac-primary);
    cursor: pointer;
}

/* ── Governorates page layout ──────────────────────────────────────────── */
.ac-gov-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    align-items: start;
}

.ac-gov-add-card { position: sticky; top: 1rem; }

.ac-gov-add-form {
    display: flex;
    gap: .5rem;
}

.ac-gov-add-form__input { flex: 1; min-width: 0; }

/* ── btn--success-ghost ────────────────────────────────────────────────── */
.ac-btn--success-ghost {
    color: #16a34a;
    border-color: #16a34a;
}
.ac-btn--success-ghost:hover { background: #f0fdf4; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ac-pl-layout {
        grid-template-columns: 1fr;
    }
    .ac-pl-side { order: -1; }
    .ac-pl-info-row { flex-direction: column; gap: 0; }
    .ac-pl-create-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ac-pl-create-hero__steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .ac-pl-create-summary { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .ac-gov-layout { grid-template-columns: 1fr; }
    .ac-gov-add-card { position: static; }
    .ac-pl-tbl { min-width: 680px; }
    .ac-pl-tbl__price-col {
        width: 160px;
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .ac-pl-bulk-bar { flex-direction: column; align-items: flex-start; }
    .ac-pl-bulk-bar__fields { width: 100%; }
    .ac-pl-bulk-inp { width: 100%; }
}

/* Section 54 - Customer Shipments */
.ac-sh-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.25rem;
    align-items: start;
}

.ac-sh-main,
.ac-sh-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ac-sh-hero {
    background: linear-gradient(135deg, #ecfeff 0%, #f8fafc 100%);
    border: 1px solid #a5f3fc;
}

.ac-sh-hero__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: .75rem;
}

.ac-sh-hero__title {
    margin: .2rem 0 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.ac-sh-hero__badge {
    font-size: .72rem;
    font-weight: 700;
    color: #0f766e;
    background: #ccfbf1;
    border-radius: 999px;
    padding: .25rem .6rem;
}

.ac-sh-hero__steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .55rem;
}

.ac-sh-hero__step {
    background: rgba(255, 255, 255, .82);
    border: 1px solid #bae6fd;
    border-radius: .45rem;
    padding: .45rem .55rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
}

.ac-sh-hero__step span {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0891b2;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 700;
}

.ac-sh-top-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.ac-sh-table-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .8rem;
    flex-wrap: wrap;
}

.ac-sh-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--ac-border);
    border-radius: .5rem;
}

.ac-sh-table {
    width: 100%;
    min-width: 1150px;
    border-collapse: collapse;
    font-size: .85rem;
}

.ac-sh-table thead tr {
    background: var(--ac-bg);
    border-bottom: 1px solid var(--ac-border);
}

.ac-sh-table th,
.ac-sh-table td {
    padding: .6rem .7rem;
    text-align: right;
    vertical-align: top;
    border-bottom: 1px solid #eef2f7;
}

.ac-sh-table th {
    font-size: .78rem;
    color: var(--ac-text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.ac-sh-row__num {
    font-weight: 700;
    color: var(--ac-text-muted);
    text-align: center !important;
}

.ac-sh-source {
    margin-top: .3rem;
    font-size: .72rem;
    color: var(--ac-text-muted);
    line-height: 1.4;
}

.ac-sh-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .75rem;
    font-weight: 700;
}

.ac-sh-stats {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: var(--ac-bg);
    border-radius: .45rem;
    padding: .65rem .75rem;
}

.ac-sh-stat {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .5rem;
    align-items: center;
}

.ac-sh-stat__label {
    font-size: .79rem;
    color: var(--ac-text-muted);
}

.ac-sh-stat__value {
    font-size: .92rem;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-sh-readiness {
    margin-top: 1rem;
    border: 1px solid var(--ac-border);
    border-radius: .6rem;
    padding: .8rem;
    background: #fcfcfd;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.ac-sh-readiness__title {
    margin: 0;
    font-size: .82rem;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-sh-readiness__item {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    color: var(--ac-text-muted);
}

.ac-sh-readiness__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0;
}

.ac-sh-readiness__item.is-ready {
    color: #166534;
}

.ac-sh-readiness__item.is-ready .ac-sh-readiness__dot {
    background: #22c55e;
}

.ac-sh-readiness__item.is-pending .ac-sh-readiness__dot {
    background: #f59e0b;
}

@media (max-width: 960px) {
    .ac-sh-layout {
        grid-template-columns: 1fr;
    }

    .ac-sh-side {
        order: -1;
    }

    .ac-sh-hero__steps,
    .ac-sh-top-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Price list badge in customers table ───────────────────────────────── */
.ac-pl-cust-badge {
    display: inline-flex;
    align-items: center;
    background: #dbeafe;
    color: #1e40af;
    border-radius: .35rem;
    padding: .2rem .6rem;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .15s;
}
.ac-pl-cust-badge:hover { background: #bfdbfe; }
.ac-pl-cust-badge--inactive {
    background: var(--ac-bg);
    color: var(--ac-text-muted);
    text-decoration: line-through;
}

/* ── Price list card link in customer show page ────────────────────────── */
.ac-pl-card-link {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: .5rem;
    padding: .45rem .85rem;
    font-size: .875rem;
    font-weight: 600;
    color: #1d4ed8;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.ac-pl-card-link:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.ac-pl-card-link--inactive {
    background: var(--ac-bg);
    border-color: var(--ac-border);
    color: var(--ac-text-muted);
}
.ac-pl-card-link__badge {
    font-size: .72rem;
    background: var(--ac-border);
    color: var(--ac-text-muted);
    border-radius: .25rem;
    padding: .08rem .35rem;
    font-weight: 400;
}

/* ── Default price list badge (star) ───────────────────────────────────── */
.ac-pl-default-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .72rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: .9rem;
    padding: .15rem .55rem;
    line-height: 1;
}
.ac-pl-default-badge svg {
    color: #d97706;
    flex-shrink: 0;
}

/* ── Warning ghost button (for "افتراضية" state) ───────────────────────── */
.ac-btn--warning-ghost {
    background: transparent;
    color: #d97706;
    border: 1px solid #fde68a;
}
.ac-btn--warning-ghost:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

/* ── Success ghost button (for "تفعيل" state) ──────────────────────────── */
.ac-btn--success-ghost {
    background: transparent;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.ac-btn--success-ghost:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}
