#nmco-portal-app {
    --nmco-bg: #f5f7fb;
    --nmco-surface: #ffffff;
    --nmco-soft: #f8fafc;
    --nmco-line: #dbe3ee;
    --nmco-line-soft: #edf2f7;
    --nmco-text: #111827;
    --nmco-muted: #64748b;
    --nmco-heading: #0f172a;
    --nmco-primary: #2563eb;
    --nmco-primary-dark: #1d4ed8;
    --nmco-primary-soft: #eef5ff;
    --nmco-success: #12805c;
    --nmco-success-soft: #eefaf2;
    --nmco-danger: #dc2626;
    --nmco-warning: #d97706;
    --nmco-radius: 12px;
    --nmco-sidebar-width: 315px;
    --nmco-shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    direction: rtl;
    display: grid;
    grid-template-columns: var(--nmco-sidebar-width) minmax(0, 1fr);
    min-height: calc(100vh - 40px);
    overflow: hidden;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 22px;
    background: var(--nmco-bg);
    color: var(--nmco-text);
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    box-shadow: var(--nmco-shadow);
    isolation: isolate;
    max-width: 100%;
}

#nmco-portal-app.dark-mode {
    --nmco-bg: #0f141b;
    --nmco-surface: #171e27;
    --nmco-soft: #202a35;
    --nmco-line: #334155;
    --nmco-line-soft: #243041;
    --nmco-text: #e6edf5;
    --nmco-muted: #9aa9bb;
    --nmco-heading: #f8fafc;
    --nmco-primary: #38bdf8;
    --nmco-primary-dark: #7dd3fc;
    --nmco-primary-soft: #123044;
    --nmco-success: #34d399;
    --nmco-success-soft: #123427;
    --nmco-danger: #fb7185;
    --nmco-warning: #f59e0b;
    --nmco-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
}

#nmco-portal-app,
#nmco-portal-app *,
#nmco-portal-app *::before,
#nmco-portal-app *::after {
    box-sizing: border-box;
}

#nmco-portal-app :where(section, form, div, article, aside, main, header, .nmco-card) {
    min-width: 0;
}

html.nmco-menu-lock {
    overflow: hidden;
}

#nmco-portal-app :where(h1, h2, h3, p) {
    margin: 0;
}

#nmco-portal-app :where(button, input, textarea, select) {
    font: inherit;
    letter-spacing: 0;
}

#nmco-portal-app .nmco-sidebar {
    min-height: calc(100vh - 42px);
    padding: 14px 12px;
    overflow-y: auto;
    border-inline-start: 1px solid var(--nmco-line-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#nmco-portal-app.dark-mode .nmco-sidebar {
    background: linear-gradient(180deg, #18212c 0%, #101720 100%);
}

#nmco-portal-app .nmco-brand {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 6px 12px;
    border-bottom: 1px solid var(--nmco-line-soft);
}

#nmco-portal-app .nmco-logo {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f2f7ff;
    color: var(--nmco-primary);
    font-weight: 900;
}

#nmco-portal-app .nmco-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#nmco-portal-app .nmco-brand strong {
    display: block;
    color: var(--nmco-heading);
    font-size: 14px;
    font-weight: 900;
}

#nmco-portal-app .nmco-brand small {
    display: block;
    overflow: hidden;
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nmco-portal-app .nmco-menu {
    display: grid;
    gap: 5px;
    margin: 12px 0;
}

#nmco-portal-app .nmco-menu [data-view="payments"] {
    display: none;
}

#nmco-portal-app .nmco-menu button,
#nmco-portal-app .nmco-customer-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #243244;
    cursor: pointer;
    padding: 10px;
    text-align: right;
}

#nmco-portal-app .nmco-menu button {
    justify-content: flex-start;
    font-weight: 900;
}

#nmco-portal-app .nmco-menu button:hover,
#nmco-portal-app .nmco-menu button.active,
#nmco-portal-app .nmco-customer-item:hover,
#nmco-portal-app .nmco-customer-item.active {
    background: var(--nmco-primary-soft);
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-customer-panel {
    display: none;
}

#nmco-portal-app .nmco-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

#nmco-portal-app .nmco-panel-title h2 {
    color: var(--nmco-heading);
    font-size: 16px;
    font-weight: 900;
}

#nmco-portal-app input,
#nmco-portal-app textarea,
#nmco-portal-app select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: #fff;
    color: var(--nmco-text);
    outline: 0;
    padding: 8px 10px;
}

#nmco-portal-app input:focus,
#nmco-portal-app textarea:focus,
#nmco-portal-app select:focus {
    border-color: var(--nmco-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

#nmco-portal-app .nmco-customer-list {
    display: grid;
    gap: 5px;
    margin-top: 8px;
}

#nmco-portal-app .nmco-pill {
    min-width: 88px;
    border-radius: 999px;
    background: #eef3f8;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
    padding: 3px 8px;
    text-align: center;
    white-space: nowrap;
}

#nmco-portal-app .nmco-main {
    min-width: 0;
    overflow: hidden;
}

#nmco-portal-app .nmco-topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 16px 0;
    padding: 14px 16px;
    border: 1px solid rgba(219, 227, 238, 0.82);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.9)),
        radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.12), transparent 32%);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

#nmco-portal-app.dark-mode .nmco-topbar {
    border-color: rgba(51, 65, 85, 0.9);
    background:
        linear-gradient(135deg, rgba(19, 27, 36, 0.96), rgba(15, 23, 42, 0.92)),
        radial-gradient(circle at 10% 20%, rgba(96, 165, 250, 0.14), transparent 32%);
}

#nmco-portal-app .nmco-topbar h1 {
    color: var(--nmco-heading);
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
}

#nmco-portal-app .nmco-topbar p {
    color: var(--nmco-muted);
    font-weight: 800;
}

#nmco-portal-app .nmco-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #94a3b8;
}

#nmco-portal-app .online .nmco-status-dot {
    background: #16a34a;
}

#nmco-portal-app .offline .nmco-status-dot {
    background: #94a3b8;
}

@keyframes nmco-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Gallery zoom, floating suggestions, and export/import polish v0.5.2 */
#nmco-portal-app .nmco-field.customer,
#nmco-portal-app .nmco-field.description {
    z-index: 6;
}

#nmco-portal-app .nmco-suggestions {
    position: absolute;
    inset-block-start: calc(100% + 5px);
    inset-inline: 0;
    z-index: 60;
    margin-top: 0;
}

#nmco-portal-app .nmco-field:has(.nmco-suggestions.open) {
    z-index: 80;
}

.nmco-gallery-feature {
    place-items: center;
}

.nmco-gallery-feature img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.nmco-gallery-rail a,
.nmco-gallery-rail button {
    min-height: 56px;
    overflow: hidden;
    border: 1px solid #e5edf6;
    border-radius: 9px;
    background: #f8fafc;
}

.nmco-gallery-rail button {
    display: grid;
    cursor: pointer;
    padding: 0;
}

.nmco-gallery-rail button.active {
    border-color: var(--nmco-primary);
    box-shadow: 0 0 0 2px var(--nmco-focus);
}

.nmco-gallery-rail button img {
    object-fit: cover;
}

html.nmco-dark-ui .nmco-gallery-rail button {
    border-color: #253446;
    background: #151f2b;
}

.nmco-import-progress {
    display: grid;
    gap: 6px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

.nmco-import-progress strong {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--nmco-line-soft);
}

.nmco-import-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--nmco-primary), var(--nmco-accent));
    transition: width 180ms ease;
}

.nmco-import-progress-log {
    display: grid;
    gap: 4px;
    max-height: 96px;
    overflow: auto;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 9px;
    background: var(--nmco-soft);
    padding: 7px;
}

.nmco-import-progress-log span {
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
}

.nmco-import-progress-log span.done {
    color: var(--nmco-success);
}

.nmco-import-progress-log span.warning {
    color: var(--nmco-warning);
}

.nmco-import-progress-log span.error {
    color: var(--nmco-danger);
}

@media (max-width: 520px) {
    .nmco-gallery-rail a,
    .nmco-gallery-rail button {
        min-height: 44px;
        border-radius: 8px;
    }
}

@media (max-width: 700px) {
    #nmco-portal-app .nmco-entry-layout > .nmco-card:not(.nmco-entry-form) .nmco-table-wrap {
        overflow: visible;
        margin: 0;
    }

    #nmco-portal-app .nmco-movements-table {
        display: block;
        min-width: 0;
    }

    #nmco-portal-app .nmco-movements-table thead {
        display: none;
    }

    #nmco-portal-app .nmco-movements-table tbody {
        display: grid;
        gap: 8px;
    }

    #nmco-portal-app .nmco-movements-table tbody tr {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 8px;
        overflow: visible;
        border: 1px solid var(--nmco-line-soft);
        border-radius: 12px;
        background: #fff;
        padding: 9px 10px;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    #nmco-portal-app .nmco-movements-table tbody tr.payment-row {
        background: var(--nmco-success-soft);
    }

    #nmco-portal-app .nmco-movements-table tbody tr.expense-row {
        background: #fff1f2;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td {
        display: block;
        border: 0;
        padding: 0;
        white-space: normal;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(1) {
        position: absolute;
        inset-block-start: 10px;
        inset-inline-end: 10px;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(2) {
        grid-column: 1;
        min-width: 0;
        padding-inline-start: 22px;
        color: var(--nmco-muted);
        font-size: 11px;
        font-weight: 900;
        line-height: 1.25;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td.description {
        grid-column: 1 / -1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 7px;
        color: var(--nmco-heading);
        font-size: 14px;
        font-weight: 900;
        line-height: 1.35;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td.description > span {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(4),
    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(5),
    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(7) {
        display: inline-flex;
        align-items: center;
        grid-row: 3;
        color: var(--nmco-heading);
        font-size: 12px;
        font-weight: 900;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(4)::before {
        content: "السعر";
        margin-inline-end: 4px;
        color: var(--nmco-muted);
        font-size: 10px;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(5)::before {
        content: "الكمية";
        margin-inline-end: 4px;
        color: var(--nmco-muted);
        font-size: 10px;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(7)::before {
        content: "الإجمالي";
        margin-inline-end: 4px;
        color: var(--nmco-muted);
        font-size: 10px;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(6) {
        grid-column: 2;
        grid-row: 1;
        color: var(--nmco-muted);
        font-size: 11px;
        font-weight: 900;
        white-space: nowrap;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td:nth-child(8) {
        display: none;
    }

    #nmco-portal-app .nmco-movements-table tbody tr td.nmco-row-actions {
        position: absolute;
        inset-block-start: 27px;
        inset-inline-start: 8px;
        z-index: 4;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }

    #nmco-portal-app .nmco-row-menu-toggle {
        display: inline-grid;
    }

    #nmco-portal-app .nmco-row-actions > .nmco-action:not(.nmco-row-menu-toggle) {
        display: none;
        background: #fff;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.13);
    }

    #nmco-portal-app .nmco-row-actions.open > .nmco-action:not(.nmco-row-menu-toggle) {
        display: inline-grid;
    }

    #nmco-portal-app .nmco-movement-thumb,
    #nmco-portal-app .nmco-thumb-button {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    #nmco-portal-app .nmco-user-button {
        max-width: 120px;
    }
}

/* Movement detail modal redesign */
.nmco-detail-modal {
    width: min(1120px, 96vw);
    max-height: min(94vh, 920px);
    border-radius: 20px;
}

.nmco-detail-modal > header {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.nmco-detail-modal > header > .nmco-action {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.nmco-detail-modal .nmco-detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    min-width: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    padding: 0;
}

.nmco-detail-modal .nmco-detail-title-block {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.nmco-detail-modal .nmco-detail-title-block span,
.nmco-detail-modal .nmco-detail-title-block small {
    color: #64748b;
    font-size: 14px;
    font-weight: 900;
}

.nmco-detail-modal .nmco-detail-title-block strong {
    color: #10243b;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.25;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.nmco-detail-modal .nmco-detail-totals {
    display: grid;
    justify-items: center;
    gap: 8px;
    min-width: 140px;
}

.nmco-detail-modal .nmco-detail-totals span,
.nmco-detail-modal .nmco-detail-totals strong {
    border-radius: 999px;
    background: #eef8ff;
    color: #0f4772;
    padding: 8px 14px;
    box-shadow: none;
}

.nmco-detail-modal .nmco-detail-totals strong {
    background: #ffffff;
    font-size: 24px;
}

.nmco-detail-modal .nmco-dialog-body {
    gap: 16px;
    padding: 18px 20px 22px;
}

.nmco-detail-modal .nmco-detail-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.nmco-detail-modal .nmco-detail-meta {
    min-width: 0;
    border-radius: 14px;
    background: #ffffff;
}

.nmco-detail-modal .nmco-detail-section {
    display: grid;
    gap: 10px;
}

.nmco-detail-modal .nmco-detail-section h3 {
    margin: 0;
    color: #10243b;
    font-size: 18px;
    font-weight: 900;
}

.nmco-detail-modal .nmco-detail-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 12px;
    align-items: stretch;
}

.nmco-detail-modal .nmco-gallery-feature {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: min(68vh, 680px);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid #dce8f3;
    border-radius: 16px;
    background: #f8fafc;
    cursor: zoom-in;
    padding: 0;
}

.nmco-detail-modal .nmco-gallery-feature img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
}

.nmco-detail-modal .nmco-gallery-feature:hover img {
    transform: none;
}

.nmco-detail-modal .nmco-gallery-rail {
    display: grid;
    grid-auto-rows: 86px;
    gap: 8px;
    max-height: min(68vh, 680px);
    overflow: auto;
}

.nmco-detail-modal .nmco-gallery-rail button,
.nmco-detail-modal .nmco-gallery-rail a {
    width: 100%;
    min-height: 0;
    border: 1px solid #dce8f3;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
    padding: 0;
}

.nmco-detail-modal .nmco-gallery-rail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.nmco-image-fullscreen {
    position: fixed;
    z-index: 100002;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(3, 7, 18, 0.92);
    padding: 18px;
}

.nmco-image-fullscreen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    background: #0f172a;
}

.nmco-image-fullscreen-close {
    position: fixed;
    top: 16px;
    inset-inline-start: 16px;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    cursor: pointer;
}

.nmco-image-fullscreen-close .dashicons {
    width: 22px;
    height: 22px;
    font-size: 22px;
    line-height: 22px;
}

@media (max-width: 720px) {
    .nmco-modal-backdrop {
        padding: 0;
    }

    .nmco-detail-modal {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .nmco-detail-modal > header {
        grid-template-columns: 1fr auto;
        padding: 14px;
    }

    .nmco-detail-modal .nmco-detail-hero {
        grid-template-columns: 1fr;
    }

    .nmco-detail-modal .nmco-detail-totals {
        justify-items: start;
        grid-auto-flow: column;
        justify-content: start;
        min-width: 0;
    }

    .nmco-detail-modal .nmco-detail-strip {
        grid-template-columns: 1fr;
    }

    .nmco-detail-modal .nmco-detail-gallery {
        grid-template-columns: 1fr;
    }

    .nmco-detail-modal .nmco-gallery-feature {
        max-height: none;
    }

    .nmco-detail-modal .nmco-gallery-rail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 72px;
        max-height: none;
        overflow: visible;
    }
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-feature {
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: min(72vh, 620px);
    display: grid;
    place-items: center;
    background: #f8fafc;
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-feature img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-feature:hover img {
    transform: none;
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-rail button img,
#nmco-portal-app .nmco-detail-modal .nmco-gallery-rail a img {
    object-fit: contain;
    background: #f8fafc;
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-feature {
    min-height: 180px;
    max-height: min(46vh, 420px);
}

#nmco-portal-app .nmco-detail-modal .nmco-gallery-feature img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#nmco-portal-app .nmco-approval-warning {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #facc15;
    color: #713f12;
    font-weight: 800;
}

#nmco-portal-app .nmco-action.approve {
    color: #15803d;
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(34, 197, 94, 0.12);
}

#nmco-portal-app .nmco-login-screen,
#nmco-portal-app .nmco-account-layout {
    display: grid;
    gap: 14px;
}

#nmco-portal-app .nmco-login-form {
    max-width: 420px;
    width: 100%;
    margin: 10vh auto 0;
}

#nmco-portal-app .nmco-expense-form label,
#nmco-portal-app .nmco-inline-expense-editor label,
.nmco-expense-dialog .nmco-dialog-body label {
    padding: 10px;
    border: 1px solid var(--nmco-border);
    border-radius: 12px;
    background: var(--nmco-surface);
}

#nmco-portal-app .nmco-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
}

#nmco-portal-app.dark-mode .nmco-top-actions {
    background: rgba(15, 23, 42, 0.55);
}

#nmco-portal-app .nmco-user-button {
    display: inline-flex;
    align-items: center;
    max-width: 180px;
    min-height: 38px;
    gap: 7px;
    border: 1px solid var(--nmco-line);
    border-radius: 999px;
    background: #fff;
    color: var(--nmco-heading);
    cursor: pointer;
    padding: 6px 10px;
    font-weight: 900;
}

#nmco-portal-app .nmco-user-button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#nmco-portal-app .nmco-user-button:hover {
    border-color: #b8d9e8;
    background: var(--nmco-primary-soft);
}

#nmco-portal-app.dark-mode .nmco-user-button {
    border-color: #334155;
    background: #111923;
    color: var(--nmco-text);
}

#nmco-portal-app .nmco-icon-button,
#nmco-portal-app .nmco-action {
    position: relative;
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: #fff;
    color: var(--nmco-muted);
    cursor: pointer;
    font-weight: 900;
}

#nmco-portal-app.dark-mode .nmco-icon-button,
#nmco-portal-app.dark-mode .nmco-action,
#nmco-portal-app.dark-mode input,
#nmco-portal-app.dark-mode textarea,
#nmco-portal-app.dark-mode select,
#nmco-portal-app.dark-mode .nmco-directory-item,
#nmco-portal-app.dark-mode .nmco-segmented button,
#nmco-portal-app.dark-mode .nmco-note-preview {
    background: #131b24;
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode .nmco-card,
#nmco-portal-app.dark-mode .nmco-total-box,
#nmco-portal-app.dark-mode .nmco-detail-summary,
#nmco-portal-app.dark-mode .nmco-form-note {
    background: var(--nmco-surface);
}

#nmco-portal-app.dark-mode .nmco-menu button,
#nmco-portal-app.dark-mode .nmco-customer-item {
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode table,
#nmco-portal-app.dark-mode tbody td {
    background: var(--nmco-surface);
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode thead th,
#nmco-portal-app.dark-mode .nmco-table-tools,
#nmco-portal-app.dark-mode .nmco-empty,
#nmco-portal-app.dark-mode .nmco-suggestion {
    background: var(--nmco-soft);
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode .payment-row td,
#nmco-portal-app.dark-mode .expense-row td {
    background: #2a1d25;
}

#nmco-portal-app.dark-mode .nmco-logo,
#nmco-portal-app.dark-mode .nmco-pill,
#nmco-portal-app.dark-mode .nmco-dialog-summary span,
#nmco-portal-app.dark-mode .nmco-ledger-summary span {
    border-color: var(--nmco-line-soft);
    background: #111923;
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode .nmco-menu button:hover,
#nmco-portal-app.dark-mode .nmco-menu button.active,
#nmco-portal-app.dark-mode .nmco-customer-item:hover,
#nmco-portal-app.dark-mode .nmco-customer-item.active,
#nmco-portal-app.dark-mode .nmco-segmented button.active {
    border-color: rgba(56, 189, 248, 0.4);
    background: #123044;
    color: #bae6fd;
}

#nmco-portal-app.dark-mode .nmco-suggestions {
    border-color: #344256;
    background: #111923;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

#nmco-portal-app.dark-mode .nmco-suggestion {
    border-color: #243041;
    background: #111923;
}

#nmco-portal-app.dark-mode .nmco-suggestion:hover,
#nmco-portal-app.dark-mode .nmco-suggestion.active {
    background: #123044;
}

#nmco-portal-app.dark-mode .nmco-suggestion.own {
    background: #113326;
    color: #d1fae5;
}

#nmco-portal-app.dark-mode .nmco-suggestion.other {
    background: #302716;
    color: #fdecc8;
}

#nmco-portal-app.dark-mode .nmco-suggestion.expense {
    background: #351b25;
    color: #ffe4e6;
}

#nmco-portal-app.dark-mode .nmco-suggestion.payment {
    background: #102f25;
    color: #bbf7d0;
}

html.nmco-dark-ui .nmco-modal-backdrop {
    background: rgba(2, 6, 12, 0.72);
}

#nmco-portal-app.dark-mode .nmco-attachment-modal,
#nmco-portal-app.dark-mode .nmco-dialog-form,
html.nmco-dark-ui .nmco-attachment-modal,
html.nmco-dark-ui .nmco-dialog-form {
    border-color: #334155;
    background: #171e27;
    color: #e6edf5;
}

html.nmco-dark-ui .nmco-attachment-modal header,
html.nmco-dark-ui .nmco-dialog-body,
html.nmco-dark-ui .nmco-dialog-form label {
    color: #e6edf5;
}

html.nmco-dark-ui .nmco-attachment-modal input,
html.nmco-dark-ui .nmco-attachment-modal textarea,
html.nmco-dark-ui .nmco-attachment-modal select {
    border-color: #334155;
    background: #111923;
    color: #e6edf5;
}

#nmco-portal-app.dark-mode .nmco-button.secondary {
    border-color: var(--nmco-line);
    background: #111923;
    color: var(--nmco-text);
}

#nmco-portal-app .nmco-icon-button:hover,
#nmco-portal-app .nmco-action:hover {
    border-color: var(--nmco-primary);
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-icon-button.syncing .dashicons {
    animation: nmco-spin 0.85s linear infinite;
}

#nmco-portal-app .nmco-menu-toggle {
    display: none;
    place-items: center;
    width: 42px;
    min-width: 42px;
    height: 42px;
    border: 1px solid var(--nmco-line);
    border-radius: 12px;
    background: #fff;
    color: var(--nmco-heading);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.05);
}

#nmco-portal-app .nmco-menu-toggle:hover {
    border-color: #bfdbfe;
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-cache-pill {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    min-height: 28px;
    border-radius: 999px;
    background: var(--nmco-soft);
    padding: 0;
}

#nmco-portal-app .nmco-content {
    min-height: calc(100vh - 126px);
    padding: 22px;
}

#nmco-portal-app .nmco-entry-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 4px;
}

#nmco-portal-app .nmco-card {
    border: 1px solid var(--nmco-line);
    border-radius: var(--nmco-radius);
    background: var(--nmco-surface);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

#nmco-portal-app .nmco-entry-layout > .nmco-card:not(.nmco-entry-form),
#nmco-portal-app .nmco-customer-directory > .nmco-card {
    padding: 14px;
}

#nmco-portal-app .nmco-entry-layout > .nmco-card:not(.nmco-entry-form) .nmco-table-wrap {
    margin: -2px;
}

#nmco-portal-app .nmco-entry-form {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

#nmco-portal-app .nmco-field {
    position: relative;
}

#nmco-portal-app .nmco-field.customer,
#nmco-portal-app .nmco-field.description {
    grid-column: span 3;
}

#nmco-portal-app .nmco-field.attachments {
    grid-column: span 2;
}

#nmco-portal-app .nmco-field.attachments {
    display: none;
}

#nmco-portal-app .nmco-description-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 6px;
    align-items: center;
    border-radius: 10px;
}

#nmco-portal-app .nmco-description-tools.dragging input {
    border-color: var(--nmco-primary);
    background: var(--nmco-primary-soft);
}

#nmco-portal-app .nmco-inline-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: #fff;
    color: var(--nmco-primary-dark);
    cursor: pointer;
}

#nmco-portal-app .nmco-hidden-file {
    display: none;
}

#nmco-portal-app .nmco-image-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

#nmco-portal-app .nmco-image-chip {
    position: relative;
    width: 48px;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: var(--nmco-soft);
    cursor: pointer;
    padding: 0;
}

#nmco-portal-app .nmco-image-chip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#nmco-portal-app .nmco-image-chip .dashicons-no-alt {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.72);
    color: #fff;
    font-size: 14px;
    line-height: 16px;
}

#nmco-portal-app .nmco-existing-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 8px;
}

#nmco-portal-app .nmco-attachment-title {
    width: 100%;
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 900;
}

#nmco-portal-app .nmco-existing-attachment {
    position: relative;
    width: 54px;
    height: 54px;
    overflow: hidden;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: var(--nmco-soft);
    cursor: pointer;
    padding: 0;
}

#nmco-portal-app .nmco-existing-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#nmco-portal-app .nmco-existing-attachment .dashicons-trash {
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(220, 38, 38, 0.92);
    color: #fff;
    font-size: 13px;
    line-height: 18px;
}

#nmco-portal-app .nmco-field label {
    display: block;
    margin-bottom: 6px;
    color: #334155;
    font-weight: 900;
}

#nmco-portal-app .nmco-total-box {
    min-height: 40px;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 5px 10px;
}

#nmco-portal-app .nmco-total-box span {
    display: block;
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
}

#nmco-portal-app .nmco-total-box strong {
    display: block;
    color: var(--nmco-heading);
    font-size: 16px;
    font-weight: 900;
}

#nmco-portal-app .nmco-button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    background: var(--nmco-primary);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
    padding: 8px 14px;
}

#nmco-portal-app .nmco-button:hover {
    background: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-suggestions {
    position: static;
    z-index: 15;
    display: none;
    max-height: 260px;
    overflow: auto;
    margin-top: 5px;
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--nmco-shadow);
}

#nmco-portal-app .nmco-suggestions.open {
    display: block;
}

#nmco-portal-app .nmco-suggestion {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 0;
    border-bottom: 1px solid var(--nmco-line-soft);
    background: #fff;
    cursor: pointer;
    padding: 9px 10px;
    text-align: right;
}

#nmco-portal-app .nmco-suggestion:hover,
#nmco-portal-app .nmco-suggestion.active {
    background: var(--nmco-primary-soft);
}

#nmco-portal-app .nmco-suggestion.own {
    background: #f0faf6;
}

#nmco-portal-app .nmco-suggestion.other {
    background: #fff8ed;
}

#nmco-portal-app .nmco-suggestion.expense {
    background: #fff1f2;
}

#nmco-portal-app .nmco-suggestion.payment {
    background: #eefaf2;
}

#nmco-portal-app table {
    width: 100%;
    min-width: 940px;
    border-collapse: collapse;
}

#nmco-portal-app th,
#nmco-portal-app td {
    border-bottom: 1px solid var(--nmco-line-soft);
    padding: 10px 12px;
    text-align: right;
    vertical-align: middle;
    white-space: nowrap;
}

#nmco-portal-app td.description {
    min-width: 230px;
    white-space: normal;
}

#nmco-portal-app td.description {
    display: table-cell;
    vertical-align: middle;
    line-height: 1.45;
}

#nmco-portal-app td.description > span {
    display: inline-block;
    vertical-align: middle;
}

#nmco-portal-app td.description > button {
    vertical-align: middle;
    margin-inline-end: 7px;
}

#nmco-portal-app .nmco-movement-thumb {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 8px;
    object-fit: cover;
}

#nmco-portal-app .nmco-thumb-button {
    position: relative;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    vertical-align: middle;
    margin-inline-end: 8px;
}

#nmco-portal-app .nmco-thumb-button.stacked {
    margin-inline-start: 6px;
}

#nmco-portal-app .nmco-thumb-layer {
    position: absolute;
    inset: 0;
    border: 1px solid var(--nmco-line);
    border-radius: 8px;
    background: #fff;
}

#nmco-portal-app .nmco-thumb-layer.one {
    transform: translate(-4px, 4px);
    opacity: 0.62;
}

#nmco-portal-app .nmco-thumb-layer.two {
    transform: translate(-8px, 8px);
    opacity: 0.34;
}

#nmco-portal-app .nmco-thumb-count {
    position: absolute;
    z-index: 3;
    right: -6px;
    top: -6px;
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    background: var(--nmco-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 19px;
}

#nmco-portal-app .nmco-thumb-button img {
    position: relative;
    z-index: 2;
}

#nmco-portal-app .nmco-upload-progress {
    position: absolute;
    z-index: 4;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.68);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

#nmco-portal-app thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-table-wrap {
    overflow: auto;
}

#nmco-portal-app .nmco-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 1px solid var(--nmco-line-soft);
    padding: 10px;
}

#nmco-portal-app .nmco-pagination span {
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

#nmco-portal-app .nmco-movements-table th:nth-child(8) {
    display: none;
}

#nmco-portal-app .payment-row {
    background: var(--nmco-success-soft);
}

#nmco-portal-app .expense-row td {
    background: #fff1f2;
}

#nmco-portal-app .expense-row:hover td {
    background: #ffe4e6;
}

#nmco-portal-app .unsynced-row {
    box-shadow: inset 3px 0 0 var(--nmco-warning);
}

#nmco-portal-app .nmco-sync-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--nmco-warning);
}

#nmco-portal-app .nmco-row-sync {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
}

#nmco-portal-app .nmco-row-sync.syncing .dashicons {
    width: 22px;
    height: 22px;
    color: var(--nmco-primary);
    font-size: 18px;
    line-height: 22px;
    animation: nmco-spin 0.85s linear infinite;
}

#nmco-portal-app .payment-value {
    color: var(--nmco-success);
    font-weight: 900;
}

#nmco-portal-app .nmco-attachment-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--nmco-primary-soft);
    color: var(--nmco-primary-dark);
    font-size: 12px;
    font-weight: 900;
    padding: 3px 8px;
    cursor: pointer;
}

#nmco-portal-app .nmco-money-action.has-payment {
    border-color: #bbf7d0;
    background: var(--nmco-success-soft);
    color: var(--nmco-success);
}

#nmco-portal-app .nmco-money-action.has-payment::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    margin-top: -22px;
    margin-inline-start: -22px;
    border-radius: 999px;
    background: var(--nmco-success);
}

#nmco-portal-app .nmco-customer-directory {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 16px;
    align-items: start;
}

#nmco-portal-app .nmco-wallet-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 16px;
    align-items: start;
    padding: 4px;
}

#nmco-portal-app .nmco-wallet-layout > .nmco-card {
    padding: 14px;
}

#nmco-portal-app .nmco-wallet-layout > .nmco-card .nmco-table-wrap {
    margin: -2px;
}

#nmco-portal-app .nmco-wallet-layout .nmco-directory-item {
    padding: 8px 10px;
}

#nmco-portal-app .nmco-wallet-layout .nmco-directory-item .nmco-action {
    min-width: 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

#nmco-portal-app .nmco-expense-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.82fr) minmax(460px, 1.35fr);
    gap: 16px;
    align-items: start;
    padding: 4px;
}

#nmco-portal-app .nmco-expense-layout.modern {
    grid-template-columns: 1fr;
}

#nmco-portal-app .nmco-expense-report {
    display: grid;
    gap: 12px;
}

#nmco-portal-app .nmco-expense-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

#nmco-portal-app .nmco-expense-summary button {
    display: grid;
    gap: 4px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    color: var(--nmco-text);
    cursor: pointer;
    padding: 12px;
    text-align: right;
}

#nmco-portal-app .nmco-expense-summary button:hover {
    border-color: var(--nmco-primary);
    background: var(--nmco-primary-soft);
}

#nmco-portal-app .nmco-expense-summary button.active {
    border-color: var(--nmco-primary);
    background: var(--nmco-primary-soft);
    box-shadow: inset 0 0 0 1px var(--nmco-primary);
}

#nmco-portal-app .nmco-expense-summary span {
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-expense-summary strong {
    color: var(--nmco-heading);
    font-size: 18px;
    font-weight: 900;
}

#nmco-portal-app .nmco-expense-summary small {
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
}

#nmco-portal-app .nmco-expense-table-card .nmco-button {
    min-width: 132px;
}

.nmco-expense-dialog .nmco-dialog-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nmco-expense-dialog .nmco-dialog-body label:nth-of-type(5),
.nmco-expense-dialog .nmco-dialog-body > div,
.nmco-expense-dialog .nmco-dialog-body .nmco-button {
    grid-column: 1 / -1;
}

#nmco-portal-app .nmco-expense-form {
    display: grid;
    gap: 10px;
    padding: 14px;
}

#nmco-portal-app .nmco-inline-expense-editor {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 10px;
    padding: 14px;
}

#nmco-portal-app .nmco-inline-expense-editor[hidden] {
    display: none;
}

#nmco-portal-app .nmco-inline-expense-editor .nmco-section-head,
#nmco-portal-app .nmco-inline-expense-editor label:last-of-type,
#nmco-portal-app .nmco-inline-expense-editor .nmco-button {
    grid-column: 1 / -1;
}

#nmco-portal-app .nmco-inline-expense-editor label {
    display: grid;
    gap: 5px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-expense-form label {
    display: grid;
    gap: 5px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

#nmco-portal-app .nmco-wallet-select {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    text-align: right;
}

#nmco-portal-app .nmco-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

#nmco-portal-app .nmco-table-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nmco-line-soft);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#nmco-portal-app .nmco-table-tools input,
#nmco-portal-app .nmco-compact-select {
    max-width: 340px;
}

#nmco-portal-app .nmco-notes-box {
    margin-top: 8px;
}

#nmco-portal-app .nmco-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 5px;
}

#nmco-portal-app .nmco-segmented button {
    min-height: 34px;
    border: 1px solid var(--nmco-line);
    border-radius: 999px;
    background: #fff;
    color: var(--nmco-muted);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    padding: 6px 11px;
}

#nmco-portal-app .nmco-segmented button.active {
    border-color: #bfdbfe;
    background: var(--nmco-primary-soft);
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-segmented .nmco-clear-filter {
    min-width: 34px;
    width: 34px;
    padding: 6px;
}

#nmco-portal-app .nmco-segmented .nmco-clear-filter[hidden] {
    display: none;
}

#nmco-portal-app .nmco-note-badge {
    display: inline-grid;
    place-items: center;
    width: 22px;
    min-width: 22px;
    height: 22px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 7px;
    background: #f4f6f8;
    color: #94a3b8;
    cursor: pointer;
    opacity: 0.82;
}

#nmco-portal-app .nmco-note-badge .dashicons {
    width: 14px;
    height: 14px;
    font-size: 14px;
    line-height: 14px;
}

#nmco-portal-app .nmco-note-badge:hover {
    border-color: var(--nmco-line);
    color: var(--nmco-muted);
    opacity: 1;
}

#nmco-portal-app .nmco-detail-summary {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
}

#nmco-portal-app .nmco-detail-summary strong {
    color: var(--nmco-heading);
    font-size: 20px;
    font-weight: 900;
}

#nmco-portal-app .nmco-detail-summary span,
#nmco-portal-app .nmco-detail-summary small {
    color: var(--nmco-muted);
    font-weight: 800;
}

#nmco-portal-app .nmco-note-preview {
    display: grid;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: #fff;
}

#nmco-portal-app .nmco-note-preview strong {
    color: var(--nmco-heading);
}

#nmco-portal-app .nmco-note-preview p {
    color: var(--nmco-text);
    white-space: normal;
}

#nmco-portal-app .nmco-section-head.compact {
    margin-bottom: 8px;
}

#nmco-portal-app .nmco-section-head h2 {
    color: var(--nmco-heading);
    font-size: 18px;
    font-weight: 900;
}

#nmco-portal-app .nmco-section-head p {
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 800;
}

#nmco-portal-app .nmco-section-head > strong {
    min-width: 46px;
    border-radius: 999px;
    background: var(--nmco-primary-soft);
    color: var(--nmco-primary-dark);
    padding: 5px 10px;
    text-align: center;
}

#nmco-portal-app .nmco-directory-list {
    display: grid;
    gap: 6px;
    max-height: calc(100vh - 230px);
    overflow: auto;
}

#nmco-portal-app .nmco-directory-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: #fff;
    color: var(--nmco-text);
    cursor: pointer;
    padding: 10px 12px;
    text-align: right;
}

#nmco-portal-app .nmco-directory-item.readonly {
    cursor: default;
}

#nmco-portal-app .nmco-directory-item small {
    display: block;
    margin-top: 2px;
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
}

#nmco-portal-app .nmco-directory-item:hover,
#nmco-portal-app .nmco-directory-item.active {
    border-color: #bfdbfe;
    background: var(--nmco-primary-soft);
}

#nmco-portal-app .nmco-customer-directory.ledger {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
}

#nmco-portal-app .nmco-directory-search {
    margin: 10px 0;
}

#nmco-portal-app .nmco-customer-directory.ledger > .nmco-card:first-child {
    padding: 12px;
}

#nmco-portal-app .nmco-customer-directory.ledger > .nmco-card:first-child .nmco-section-head p {
    display: none;
}

#nmco-portal-app .nmco-customer-directory.ledger .nmco-directory-list {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    max-height: 260px;
    overflow: auto;
}

#nmco-portal-app .nmco-customer-directory.ledger .nmco-directory-list:not(.open) {
    display: none;
}

#nmco-portal-app .nmco-customer-directory.ledger .nmco-directory-list.open {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--nmco-border);
    border-radius: 12px;
    background: var(--nmco-surface);
    box-shadow: var(--nmco-shadow-soft);
}

#nmco-portal-app .nmco-customer-directory.ledger .nmco-directory-item {
    min-height: 42px;
    gap: 6px;
    padding: 7px 8px;
}

#nmco-portal-app .nmco-customer-directory.ledger .nmco-directory-item.filtered-out {
    display: none;
}

#nmco-portal-app .nmco-customer-ledger {
    display: grid;
    gap: 12px;
    padding: 14px;
}

#nmco-portal-app .nmco-ledger-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    justify-content: space-between;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 10px;
}

#nmco-portal-app .nmco-ledger-filters label {
    display: grid;
    flex: 1 1 150px;
    gap: 5px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-ledger-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

#nmco-portal-app .nmco-ledger-summary span {
    display: grid;
    gap: 3px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 10px;
    transition: transform 160ms ease, border-color 160ms ease;
}

#nmco-portal-app .nmco-ledger-summary span:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

#nmco-portal-app .nmco-ledger-summary small {
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 900;
}

#nmco-portal-app .nmco-ledger-summary strong {
    color: var(--nmco-heading);
    font-size: 16px;
    font-weight: 900;
}

#nmco-portal-app .nmco-customer-ledger td small {
    display: block;
    margin-top: 3px;
    color: var(--nmco-muted);
    font-size: 11px;
    font-weight: 800;
}

#nmco-portal-app .nmco-customer-ledger table {
    min-width: 840px;
}

#nmco-portal-app .nmco-import-modal {
    width: min(860px, 96vw);
}

#nmco-portal-app .nmco-import-picker {
    border: 1px dashed var(--nmco-line);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 12px;
}

#nmco-portal-app .nmco-import-preview {
    min-height: 92px;
}

#nmco-portal-app .nmco-import-list {
    display: grid;
    gap: 8px;
}

#nmco-portal-app .nmco-import-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 10px;
}

#nmco-portal-app .nmco-import-row span {
    display: grid;
    gap: 3px;
}

#nmco-portal-app .nmco-import-row strong {
    color: var(--nmco-heading);
    font-weight: 900;
}

#nmco-portal-app .nmco-import-row small {
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 800;
}

#nmco-portal-app .nmco-import-actions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

#nmco-portal-app .nmco-import-table-wrap {
    max-height: min(46vh, 420px);
    overflow: auto;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
}

#nmco-portal-app .nmco-import-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 12px;
}

#nmco-portal-app .nmco-import-table th,
#nmco-portal-app .nmco-import-table td {
    padding: 7px 8px;
    white-space: nowrap;
}

#nmco-portal-app .nmco-import-table th {
    position: sticky;
    z-index: 2;
    top: 0;
}

#nmco-portal-app .nmco-import-table td strong,
#nmco-portal-app .nmco-import-table td small {
    display: block;
}

#nmco-portal-app .nmco-import-table td small {
    color: var(--nmco-muted);
    font-size: 11px;
}

#nmco-portal-app .nmco-import-table select {
    min-height: 34px;
    border-radius: 9px;
    font-size: 12px;
    padding: 5px 8px;
}

#nmco-portal-app .nmco-import-actions[hidden] {
    display: none;
}

#nmco-portal-app .nmco-customer-form {
    display: grid;
    gap: 10px;
}

#nmco-portal-app .nmco-customer-form label {
    display: grid;
    gap: 5px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-form-note {
    padding: 9px 10px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 800;
}

#nmco-portal-app .nmco-check {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}

#nmco-portal-app .nmco-check input,
#nmco-portal-app .nmco-permission-grid input {
    width: auto;
    min-height: 0;
}

#nmco-portal-app .nmco-permission-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 10px;
}

#nmco-portal-app .nmco-settings-layout {
    display: grid;
    gap: 14px;
    padding: 4px;
}

#nmco-portal-app .nmco-settings-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

#nmco-portal-app .nmco-setting-row,
#nmco-portal-app .nmco-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--nmco-line-soft);
    border-radius: 10px;
    background: var(--nmco-soft);
    padding: 12px;
}

#nmco-portal-app .nmco-setting-row span,
#nmco-portal-app .nmco-danger-zone span {
    display: grid;
    gap: 2px;
}

#nmco-portal-app .nmco-setting-row strong,
#nmco-portal-app .nmco-danger-zone strong {
    color: var(--nmco-heading);
    font-weight: 900;
}

#nmco-portal-app .nmco-setting-row small,
#nmco-portal-app .nmco-danger-zone small {
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 800;
}

#nmco-portal-app .nmco-setting-row input[type="checkbox"] {
    width: 46px;
    min-width: 46px;
    height: 26px;
    min-height: 26px;
    accent-color: var(--nmco-primary);
    cursor: pointer;
}

#nmco-portal-app .nmco-danger-zone {
    align-items: end;
}

#nmco-portal-app .nmco-danger-zone label {
    display: grid;
    flex: 1;
    gap: 6px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

#nmco-portal-app .nmco-settings-card.danger {
    border-color: #fecdd3;
}

#nmco-portal-app .nmco-danger-zone:not(.soft) {
    border-color: #fecdd3;
    background: #fff1f2;
}

#nmco-portal-app.dark-mode .nmco-danger-zone:not(.soft) {
    border-color: #7f1d1d;
    background: #2d1820;
}

#nmco-portal-app .nmco-button.secondary {
    background: var(--nmco-soft);
    color: var(--nmco-heading);
}

#nmco-portal-app .nmco-button.danger {
    background: var(--nmco-danger);
    color: #fff;
}

#nmco-portal-app .nmco-permission-grid label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--nmco-text);
}

#nmco-portal-app .nmco-placeholder {
    display: grid;
    justify-items: center;
    gap: 10px;
    color: var(--nmco-muted);
    padding: 44px 20px;
    text-align: center;
}

#nmco-portal-app .nmco-placeholder .dashicons {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--nmco-primary-soft);
    color: var(--nmco-primary-dark);
    font-size: 26px;
    line-height: 46px;
}

#nmco-portal-app .nmco-placeholder h2 {
    color: var(--nmco-heading);
    font-size: 20px;
    font-weight: 900;
}

#nmco-portal-app .nmco-empty,
#nmco-portal-app .nmco-loading {
    padding: 28px;
    color: var(--nmco-muted);
    text-align: center;
}

#nmco-portal-app .nmco-toast-root {
    position: fixed;
    z-index: 9999;
    left: 18px;
    bottom: 18px;
    display: grid;
    gap: 8px;
}

#nmco-portal-app .nmco-toast {
    border: 1px solid var(--nmco-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--nmco-shadow);
    padding: 10px 12px;
    font-weight: 900;
}

.nmco-modal-backdrop {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.62);
    padding: 22px;
}

.nmco-attachment-modal {
    width: min(980px, 96vw);
    max-height: 92vh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
    direction: rtl;
    font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

.nmco-attachment-modal header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid #e5edf6;
    padding: 12px 14px;
}

.nmco-attachment-viewer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    overflow: auto;
    padding: 14px;
}

.nmco-attachment-viewer.compact {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    padding: 0;
}

.nmco-attachment-viewer.compact a {
    min-height: 120px;
}

.nmco-dialog-body {
    display: grid;
    gap: 10px;
    overflow: auto;
    padding: 14px;
}

.nmco-dialog-body label {
    display: grid;
    gap: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.nmco-entity-modal {
    width: min(720px, 96vw);
}

.nmco-entity-form-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.nmco-entity-form-body .wide,
.nmco-entity-form-body .nmco-form-note,
.nmco-entity-form-body .nmco-permission-grid,
.nmco-entity-form-body .nmco-dialog-summary {
    grid-column: 1 / -1;
}

.nmco-dialog-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #e5edf6;
    border-radius: 10px;
    background: #f8fafc;
    padding: 10px 12px;
}

.nmco-dialog-summary span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}

.nmco-dialog-summary strong {
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

.nmco-attachment-viewer a {
    display: grid;
    min-height: 150px;
    overflow: hidden;
    border: 1px solid #e5edf6;
    border-radius: 12px;
    background: #f8fafc;
    color: #111827;
    text-decoration: none;
}

.nmco-attachment-viewer img {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.nmco-file-preview {
    place-items: center;
    gap: 8px;
    padding: 18px;
    text-align: center;
    font-weight: 900;
}

@media (max-width: 980px) {
    #nmco-portal-app {
        grid-template-columns: 1fr;
        width: 100%;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #nmco-portal-app::before {
        content: "";
        position: fixed;
        z-index: 1000;
        inset: 0;
        pointer-events: none;
        background: rgba(15, 23, 42, 0);
        transition: background 180ms ease;
    }

    #nmco-portal-app.is-menu-open::before {
        pointer-events: auto;
        background: rgba(15, 23, 42, 0.48);
    }

    #nmco-portal-app .nmco-sidebar {
        position: fixed;
        z-index: 1001;
        inset: 0 0 0 auto;
        width: min(88vw, 340px);
        min-height: 100dvh;
        padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
        overscroll-behavior: contain;
        border-inline-start: 0;
        border-inline-end: 1px solid var(--nmco-line-soft);
        border-radius: 18px 0 0 18px;
        box-shadow: -18px 0 44px rgba(15, 23, 42, 0.18);
        transform: translateX(105%);
        transition: transform 200ms ease;
    }

    #nmco-portal-app.is-menu-open .nmco-sidebar {
        transform: translateX(0);
    }

    #nmco-portal-app .nmco-main {
        min-height: 100vh;
        background: var(--nmco-bg);
    }

    #nmco-portal-app .nmco-topbar {
        position: sticky;
        z-index: 20;
        top: 0;
        min-height: 72px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
        border-bottom: 1px solid var(--nmco-line-soft);
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(14px);
    }

    #nmco-portal-app .nmco-menu-toggle {
        display: inline-grid;
    }

    #nmco-portal-app .nmco-topbar h1 {
        overflow: hidden;
        font-size: 19px;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #nmco-portal-app .nmco-topbar p {
        overflow: hidden;
        font-size: 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #nmco-portal-app .nmco-top-actions {
        justify-self: end;
    }

    #nmco-portal-app .nmco-cache-pill {
        display: none;
    }

    #nmco-portal-app .nmco-content {
        min-height: calc(100vh - 72px);
        padding: 12px;
    }

    #nmco-portal-app .nmco-entry-layout {
        gap: 12px;
        padding: 0;
    }

    #nmco-portal-app .nmco-entry-form {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    #nmco-portal-app .nmco-customer-directory {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #nmco-portal-app .nmco-wallet-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }

    #nmco-portal-app .nmco-expense-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0;
    }

    #nmco-portal-app .nmco-customer-directory.ledger {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #nmco-portal-app .nmco-ledger-filters,
    #nmco-portal-app .nmco-ledger-summary {
        grid-template-columns: 1fr;
    }

    #nmco-portal-app .nmco-ledger-filters {
        display: grid;
        grid-template-columns: 1fr 1fr auto;
    }

    #nmco-portal-app .nmco-customer-ledger table {
        min-width: 620px;
    }

    #nmco-portal-app .nmco-import-row,
    #nmco-portal-app .nmco-import-actions {
        grid-template-columns: 1fr;
    }

    #nmco-portal-app .nmco-field.customer,
    #nmco-portal-app .nmco-field.description,
    #nmco-portal-app .nmco-field.attachments {
        grid-column: auto;
    }

    #nmco-portal-app input,
    #nmco-portal-app textarea,
    #nmco-portal-app select {
        min-height: 44px;
        border-radius: 12px;
        font-size: 16px;
    }

    #nmco-portal-app .nmco-button {
        width: 100%;
        min-height: 46px;
        border-radius: 12px;
    }

    #nmco-portal-app .nmco-setting-row,
    #nmco-portal-app .nmco-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    #nmco-portal-app .nmco-card {
        border-radius: 12px;
    }

    #nmco-portal-app .nmco-table-tools {
        padding: 10px;
    }

    #nmco-portal-app .nmco-table-tools input,
    #nmco-portal-app .nmco-compact-select {
        max-width: none;
    }

    #nmco-portal-app .nmco-table-wrap {
        margin-inline: -2px;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    #nmco-portal-app table {
        min-width: 760px;
    }

    #nmco-portal-app th,
    #nmco-portal-app td {
        padding: 9px 10px;
    }

    #nmco-portal-app .nmco-directory-list {
        max-height: none;
    }

    #nmco-portal-app .nmco-section-head {
        align-items: flex-start;
        gap: 8px;
    }

    #nmco-portal-app .nmco-section-head h2 {
        font-size: 16px;
    }

    #nmco-portal-app .nmco-toast-root {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    #nmco-portal-app .nmco-toast {
        width: 100%;
    }
}

@media (max-width: 520px) {
    #nmco-portal-app {
        font-size: 13px;
    }

    #nmco-portal-app .nmco-sidebar {
        width: min(90vw, 318px);
        border-radius: 16px 0 0 16px;
    }

    #nmco-portal-app .nmco-brand {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    #nmco-portal-app .nmco-logo {
        width: 38px;
        height: 38px;
    }

    #nmco-portal-app .nmco-menu button,
    #nmco-portal-app .nmco-customer-item {
        min-height: 44px;
        border-radius: 12px;
    }

    #nmco-portal-app .nmco-top-actions {
        gap: 6px;
    }

    #nmco-portal-app .nmco-icon-button,
    #nmco-portal-app .nmco-action {
        min-width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .nmco-modal-backdrop {
        padding: 10px;
    }

    .nmco-attachment-modal {
        width: 100%;
        max-height: calc(100dvh - 20px);
        border-radius: 12px;
    }

    .nmco-entity-form-body {
        grid-template-columns: 1fr;
    }

    #nmco-portal-app .nmco-ledger-filters {
        grid-template-columns: 1fr;
    }

    .nmco-attachment-viewer {
        grid-template-columns: 1fr;
        padding: 10px;
    }
}

/* NMCO design refresh v0.4.7 */
#nmco-portal-app {
    --nmco-bg: #f3f7fb;
    --nmco-surface: #ffffff;
    --nmco-surface-raised: #ffffff;
    --nmco-soft: #f6f9fc;
    --nmco-line: #d7e1ec;
    --nmco-line-soft: #e8eef5;
    --nmco-text: #152033;
    --nmco-muted: #637386;
    --nmco-heading: #0a2540;
    --nmco-primary: #0f7ea8;
    --nmco-primary-dark: #075c87;
    --nmco-primary-soft: #e6f6fb;
    --nmco-accent: #18a999;
    --nmco-accent-soft: #e9fbf7;
    --nmco-success: #12805c;
    --nmco-success-soft: #e9f8f1;
    --nmco-danger: #d63d55;
    --nmco-danger-soft: #fff0f2;
    --nmco-warning: #c98910;
    --nmco-warning-soft: #fff7e6;
    --nmco-focus: rgba(15, 126, 168, 0.18);
    --nmco-shadow: 0 18px 42px rgba(20, 44, 72, 0.1);
    --nmco-shadow-soft: 0 8px 24px rgba(20, 44, 72, 0.07);
    background:
        radial-gradient(circle at 78% 5%, rgba(24, 169, 153, 0.14), transparent 28%),
        linear-gradient(180deg, #f7fbff 0%, var(--nmco-bg) 44%, #eef5fa 100%);
}

#nmco-portal-app.dark-mode {
    --nmco-bg: #0d151d;
    --nmco-surface: #151f2b;
    --nmco-surface-raised: #192433;
    --nmco-soft: #1f2c3a;
    --nmco-line: #314357;
    --nmco-line-soft: #253446;
    --nmco-text: #e7eef7;
    --nmco-muted: #a5b4c5;
    --nmco-heading: #f7fbff;
    --nmco-primary: #4cc9e8;
    --nmco-primary-dark: #83e0f2;
    --nmco-primary-soft: #123747;
    --nmco-accent: #45d3b8;
    --nmco-accent-soft: #123b34;
    --nmco-success: #42d69f;
    --nmco-success-soft: #12372d;
    --nmco-danger: #ff7f93;
    --nmco-danger-soft: #3a1d28;
    --nmco-warning: #f4bd4f;
    --nmco-warning-soft: #3a2c12;
    --nmco-focus: rgba(76, 201, 232, 0.22);
    --nmco-shadow: 0 22px 48px rgba(0, 0, 0, 0.34);
    --nmco-shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.24);
    background:
        radial-gradient(circle at 75% 0%, rgba(69, 211, 184, 0.1), transparent 32%),
        linear-gradient(180deg, #101b25 0%, var(--nmco-bg) 100%);
}

#nmco-portal-app .nmco-sidebar {
    border-inline-start-color: rgba(215, 225, 236, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(243, 248, 252, 0.94)),
        radial-gradient(circle at 24% 10%, rgba(24, 169, 153, 0.14), transparent 28%);
}

#nmco-portal-app.dark-mode .nmco-sidebar {
    background:
        linear-gradient(180deg, rgba(25, 36, 51, 0.98), rgba(13, 21, 29, 0.98)),
        radial-gradient(circle at 24% 10%, rgba(69, 211, 184, 0.1), transparent 30%);
}

#nmco-portal-app .nmco-logo {
    border-color: rgba(15, 126, 168, 0.18);
    background: linear-gradient(135deg, #e6f6fb, #e9fbf7);
    color: var(--nmco-primary-dark);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

#nmco-portal-app .nmco-menu {
    gap: 6px;
}

#nmco-portal-app .nmco-menu button,
#nmco-portal-app .nmco-customer-item {
    min-height: 43px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #203148;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

#nmco-portal-app .nmco-menu button:hover,
#nmco-portal-app .nmco-menu button.active,
#nmco-portal-app .nmco-customer-item:hover,
#nmco-portal-app .nmco-customer-item.active {
    border-color: rgba(15, 126, 168, 0.16);
    background: linear-gradient(135deg, var(--nmco-primary-soft), var(--nmco-accent-soft));
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-main {
    background:
        radial-gradient(circle at 82% 12%, rgba(24, 169, 153, 0.12), transparent 30%),
        var(--nmco-bg);
}

#nmco-portal-app .nmco-topbar {
    border-color: rgba(215, 225, 236, 0.74);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 251, 255, 0.9)),
        radial-gradient(circle at 92% 20%, rgba(24, 169, 153, 0.18), transparent 34%),
        radial-gradient(circle at 10% 10%, rgba(15, 126, 168, 0.13), transparent 26%);
    box-shadow: var(--nmco-shadow-soft);
}

#nmco-portal-app.dark-mode .nmco-topbar {
    border-color: rgba(49, 67, 87, 0.88);
    background:
        linear-gradient(135deg, rgba(25, 36, 51, 0.96), rgba(14, 23, 32, 0.92)),
        radial-gradient(circle at 92% 20%, rgba(69, 211, 184, 0.13), transparent 34%),
        radial-gradient(circle at 10% 10%, rgba(76, 201, 232, 0.12), transparent 28%);
}

#nmco-portal-app input,
#nmco-portal-app textarea,
#nmco-portal-app select {
    min-height: 43px;
    border-color: var(--nmco-line);
    border-radius: 11px;
    background: var(--nmco-surface-raised);
    padding: 9px 11px;
}

#nmco-portal-app input:focus,
#nmco-portal-app textarea:focus,
#nmco-portal-app select:focus {
    border-color: var(--nmco-primary);
    box-shadow: 0 0 0 3px var(--nmco-focus);
}

#nmco-portal-app .nmco-card {
    border-color: rgba(215, 225, 236, 0.9);
    background: var(--nmco-surface);
    box-shadow: var(--nmco-shadow-soft);
}

#nmco-portal-app.dark-mode .nmco-card,
#nmco-portal-app.dark-mode .nmco-total-box,
#nmco-portal-app.dark-mode .nmco-detail-summary,
#nmco-portal-app.dark-mode .nmco-form-note,
#nmco-portal-app.dark-mode input,
#nmco-portal-app.dark-mode textarea,
#nmco-portal-app.dark-mode select,
#nmco-portal-app.dark-mode .nmco-directory-item,
#nmco-portal-app.dark-mode .nmco-segmented button,
#nmco-portal-app.dark-mode .nmco-note-preview {
    background: var(--nmco-surface-raised);
}

#nmco-portal-app .nmco-entry-layout {
    gap: 18px;
}

#nmco-portal-app .nmco-entry-form {
    gap: 14px;
    padding: 20px;
    border-color: rgba(15, 126, 168, 0.2);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.96)),
        radial-gradient(circle at 7% 0%, rgba(24, 169, 153, 0.12), transparent 34%);
    box-shadow: 0 18px 36px rgba(20, 44, 72, 0.1);
}

#nmco-portal-app.dark-mode .nmco-entry-form {
    border-color: rgba(76, 201, 232, 0.22);
    background:
        linear-gradient(180deg, rgba(25, 36, 51, 0.98), rgba(21, 31, 43, 0.96)),
        radial-gradient(circle at 7% 0%, rgba(69, 211, 184, 0.1), transparent 36%);
}

#nmco-portal-app .nmco-entry-form .nmco-field label {
    margin-bottom: 7px;
    color: var(--nmco-heading);
    font-size: 12px;
}

#nmco-portal-app .nmco-entry-form input,
#nmco-portal-app .nmco-entry-form textarea,
#nmco-portal-app .nmco-entry-form select {
    min-height: 48px;
    border-radius: 13px;
    font-size: 15px;
    padding: 10px 12px;
}

#nmco-portal-app .nmco-entry-form textarea {
    min-height: 94px;
    resize: vertical;
}

#nmco-portal-app .nmco-entry-form .nmco-description-tools {
    grid-template-columns: minmax(0, 1fr) 46px 46px;
    gap: 8px;
}

#nmco-portal-app .nmco-entry-form .nmco-inline-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--nmco-surface-raised);
    color: var(--nmco-primary-dark);
}

#nmco-portal-app .nmco-entry-form .nmco-total-box {
    min-height: 48px;
    border-color: rgba(15, 126, 168, 0.16);
    border-radius: 13px;
    background: linear-gradient(135deg, var(--nmco-soft), var(--nmco-primary-soft));
    padding: 7px 12px;
}

#nmco-portal-app .nmco-entry-form .nmco-total-box strong {
    font-size: 18px;
}

#nmco-portal-app .nmco-entry-form .nmco-button {
    min-height: 48px;
    border-radius: 13px;
    font-size: 15px;
}

#nmco-portal-app .nmco-button {
    background: linear-gradient(135deg, var(--nmco-primary), var(--nmco-accent));
    box-shadow: 0 8px 18px rgba(15, 126, 168, 0.2);
    transition: filter 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

#nmco-portal-app .nmco-button:hover {
    filter: saturate(1.06) brightness(0.98);
    transform: translateY(-1px);
}

#nmco-portal-app .nmco-button.secondary {
    background: var(--nmco-surface-raised);
    color: var(--nmco-primary-dark);
    box-shadow: none;
}

#nmco-portal-app .nmco-button.danger {
    background: linear-gradient(135deg, #d63d55, #b4233b);
}

#nmco-portal-app .nmco-icon-button,
#nmco-portal-app .nmco-action,
#nmco-portal-app .nmco-menu-toggle {
    border-color: var(--nmco-line);
    background: var(--nmco-surface-raised);
    color: var(--nmco-muted);
    transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

#nmco-portal-app .nmco-table-tools {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.96)),
        radial-gradient(circle at 88% 0%, rgba(24, 169, 153, 0.08), transparent 30%);
}

#nmco-portal-app.dark-mode .nmco-table-tools {
    background:
        linear-gradient(180deg, rgba(31, 44, 58, 0.96), rgba(25, 36, 51, 0.96)),
        radial-gradient(circle at 88% 0%, rgba(69, 211, 184, 0.08), transparent 30%);
}

#nmco-portal-app .nmco-segmented button.active {
    border-color: rgba(15, 126, 168, 0.22);
    background: linear-gradient(135deg, var(--nmco-primary-soft), var(--nmco-accent-soft));
    color: var(--nmco-primary-dark);
}

#nmco-portal-app thead th {
    background: linear-gradient(180deg, #f8fbfd, #eef5fa);
    color: #365066;
}

#nmco-portal-app tbody tr:hover td {
    background-color: #f8fbfd;
}

#nmco-portal-app .payment-row td,
#nmco-portal-app .payment-row:hover td {
    background: var(--nmco-success-soft);
}

#nmco-portal-app .expense-row td,
#nmco-portal-app .expense-row:hover td {
    background: var(--nmco-danger-soft);
}

#nmco-portal-app.dark-mode .payment-row td,
#nmco-portal-app.dark-mode .payment-row:hover td {
    background: var(--nmco-success-soft);
}

#nmco-portal-app.dark-mode .expense-row td,
#nmco-portal-app.dark-mode .expense-row:hover td {
    background: var(--nmco-danger-soft);
}

#nmco-portal-app .nmco-suggestions {
    border-color: rgba(15, 126, 168, 0.18);
    border-radius: 13px;
}

#nmco-portal-app .nmco-suggestion.own {
    background: var(--nmco-accent-soft);
}

#nmco-portal-app .nmco-suggestion.other {
    background: var(--nmco-warning-soft);
}

#nmco-portal-app .nmco-suggestion.expense {
    background: var(--nmco-danger-soft);
}

#nmco-portal-app .nmco-suggestion.payment {
    background: var(--nmco-success-soft);
}

#nmco-portal-app .nmco-movements-table tbody tr {
    cursor: pointer;
}

#nmco-portal-app .nmco-row-menu-toggle {
    display: none;
}

#nmco-portal-app .nmco-movements-table tbody tr:focus-visible {
    outline: 3px solid var(--nmco-focus);
    outline-offset: -3px;
}

.nmco-detail-modal {
    width: min(860px, 96vw);
}

.nmco-detail-modal header {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 252, 0.96)),
        radial-gradient(circle at 10% 0%, rgba(24, 169, 153, 0.12), transparent 34%);
}

.nmco-detail-title {
    display: grid;
    gap: 2px;
}

.nmco-detail-title span {
    color: #637386;
    font-size: 12px;
    font-weight: 900;
}

.nmco-detail-title strong {
    color: #0a2540;
    font-size: 20px;
    font-weight: 900;
}

.nmco-detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    overflow: hidden;
    border: 1px solid #d7e1ec;
    border-radius: 14px;
    background:
        linear-gradient(135deg, #f8fbfd, #e6f6fb),
        radial-gradient(circle at 8% 0%, rgba(24, 169, 153, 0.16), transparent 34%);
    padding: 16px;
}

.nmco-detail-hero.payment {
    background: linear-gradient(135deg, #f4fbf7, #e9f8f1);
}

.nmco-detail-hero.expense {
    background: linear-gradient(135deg, #fff7f8, #fff0f2);
}

.nmco-detail-hero div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.nmco-detail-hero span,
.nmco-detail-hero small {
    color: #637386;
    font-size: 12px;
    font-weight: 900;
}

.nmco-detail-hero div strong {
    overflow: hidden;
    color: #0a2540;
    font-size: 22px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nmco-detail-hero > strong {
    flex: 0 0 auto;
    border-radius: 999px;
    background: #ffffff;
    color: #075c87;
    font-size: 22px;
    font-weight: 900;
    padding: 8px 14px;
    box-shadow: 0 8px 20px rgba(20, 44, 72, 0.08);
}

.nmco-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.nmco-detail-item {
    display: grid;
    gap: 4px;
    min-height: 72px;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    background: #ffffff;
    padding: 11px 12px;
}

.nmco-detail-item span {
    color: #637386;
    font-size: 12px;
    font-weight: 900;
}

.nmco-detail-item strong {
    overflow-wrap: anywhere;
    color: #152033;
    font-size: 15px;
    font-weight: 900;
}

.nmco-detail-item.accent-total strong {
    color: #075c87;
}

.nmco-detail-item.accent-payment strong {
    color: #12805c;
}

.nmco-detail-item.accent-expense strong {
    color: #d63d55;
}

.nmco-detail-section {
    display: grid;
    gap: 8px;
}

.nmco-detail-section h3 {
    margin: 0;
    color: #0a2540;
    font-size: 14px;
    font-weight: 900;
}

html.nmco-dark-ui .nmco-detail-modal header {
    background:
        linear-gradient(135deg, rgba(25, 36, 51, 0.98), rgba(31, 44, 58, 0.96)),
        radial-gradient(circle at 10% 0%, rgba(69, 211, 184, 0.1), transparent 34%);
}

html.nmco-dark-ui .nmco-detail-title strong,
html.nmco-dark-ui .nmco-detail-hero div strong,
html.nmco-dark-ui .nmco-detail-section h3 {
    color: #f7fbff;
}

html.nmco-dark-ui .nmco-detail-title span,
html.nmco-dark-ui .nmco-detail-hero span,
html.nmco-dark-ui .nmco-detail-hero small,
html.nmco-dark-ui .nmco-detail-item span {
    color: #a5b4c5;
}

html.nmco-dark-ui .nmco-detail-hero,
html.nmco-dark-ui .nmco-detail-hero.payment,
html.nmco-dark-ui .nmco-detail-hero.expense {
    border-color: #314357;
    background: linear-gradient(135deg, #192433, #1f2c3a);
}

html.nmco-dark-ui .nmco-detail-hero > strong,
html.nmco-dark-ui .nmco-detail-item {
    border-color: #253446;
    background: #151f2b;
    color: #e7eef7;
}

html.nmco-dark-ui .nmco-detail-item strong {
    color: #e7eef7;
}

#nmco-portal-app .nmco-entry-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

#nmco-portal-app .nmco-entry-form .nmco-field.customer,
#nmco-portal-app .nmco-entry-form .nmco-field.description {
    grid-column: span 3;
}

#nmco-portal-app .nmco-entry-form .nmco-field.attachments {
    grid-column: span 2;
}

@media (max-width: 980px) {
    #nmco-portal-app {
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    #nmco-portal-app .nmco-sidebar {
        box-shadow: -14px 0 34px rgba(15, 23, 42, 0.2);
    }

    #nmco-portal-app .nmco-content {
        padding: 12px;
    }

    #nmco-portal-app .nmco-entry-layout {
        gap: 12px;
    }

    #nmco-portal-app .nmco-entry-form {
        gap: 12px;
        padding: 15px;
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(20, 44, 72, 0.08);
    }

    #nmco-portal-app .nmco-entry-form input,
    #nmco-portal-app .nmco-entry-form textarea,
    #nmco-portal-app .nmco-entry-form select {
        min-height: 48px;
        font-size: 16px;
    }

    #nmco-portal-app .nmco-card {
        box-shadow: 0 4px 14px rgba(20, 44, 72, 0.06);
    }
}

@media (max-width: 520px) {
    #nmco-portal-app .nmco-topbar {
        margin: 0;
        border-width: 0 0 1px;
        border-radius: 0;
        box-shadow: none;
    }

    #nmco-portal-app .nmco-entry-form {
        padding: 14px;
    }

    #nmco-portal-app .nmco-entry-form .nmco-description-tools {
        grid-template-columns: minmax(0, 1fr) 44px 44px;
    }

    #nmco-portal-app .nmco-entry-form .nmco-inline-icon {
        width: 44px;
        height: 44px;
    }

    #nmco-portal-app .nmco-button:hover {
        transform: none;
    }

    .nmco-detail-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .nmco-detail-hero div strong {
        white-space: normal;
    }

    .nmco-detail-hero > strong {
        width: fit-content;
    }

    .nmco-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    #nmco-portal-app *,
    #nmco-portal-app *::before,
    #nmco-portal-app *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* Detail and mobile entry refinements v0.5.0 */
#nmco-portal-app.dark-mode tbody tr:hover td {
    background-color: #223044;
    color: var(--nmco-text);
}

#nmco-portal-app.dark-mode .payment-row:hover td {
    background: #143b30;
}

#nmco-portal-app.dark-mode .expense-row:hover td {
    background: #45202c;
}

#nmco-portal-app .nmco-note-badge {
    width: 20px;
    min-width: 20px;
    height: 20px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--nmco-muted);
    opacity: 0.72;
    vertical-align: middle;
}

#nmco-portal-app .nmco-note-badge:hover {
    border-color: transparent;
    background: transparent;
    color: var(--nmco-primary-dark);
    opacity: 1;
}

.nmco-detail-modal .nmco-dialog-body {
    gap: 14px;
}

.nmco-detail-modal header {
    align-items: stretch;
}

.nmco-detail-modal header .nmco-detail-hero {
    flex: 1 1 auto;
    border: 0;
    box-shadow: none;
}

.nmco-detail-modal header > .nmco-action {
    flex: 0 0 auto;
    align-self: start;
}

.nmco-detail-hero {
    align-items: stretch;
}

.nmco-detail-hero > div:first-child {
    align-self: center;
}

.nmco-detail-totals {
    display: grid;
    align-content: center;
    justify-items: end;
    gap: 4px;
    flex: 0 0 auto;
}

.nmco-detail-totals span {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: #637386;
    font-size: 12px;
    font-weight: 900;
    padding: 4px 9px;
}

.nmco-detail-totals strong {
    border-radius: 999px;
    background: #ffffff;
    color: #075c87;
    font-size: 23px;
    font-weight: 900;
    padding: 8px 14px;
    box-shadow: 0 8px 20px rgba(20, 44, 72, 0.08);
}

.nmco-detail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.nmco-detail-meta {
    display: grid;
    gap: 3px;
    min-width: 160px;
    border: 1px solid #e8eef5;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 12px;
}

.nmco-detail-meta small {
    color: #637386;
    font-size: 12px;
    font-weight: 900;
}

.nmco-detail-meta strong {
    color: #152033;
    font-size: 15px;
    font-weight: 900;
}

.nmco-detail-meta.accent-payment strong {
    color: #12805c;
}

.nmco-detail-meta.accent-expense strong {
    color: #d63d55;
}

.nmco-detail-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(92px, 118px);
    gap: 10px;
    align-items: stretch;
}

.nmco-gallery-feature,
.nmco-gallery-rail a {
    overflow: hidden;
    border: 1px solid #e5edf6;
    border-radius: 12px;
    background: #f8fafc;
}

.nmco-gallery-feature {
    display: grid;
    min-height: 320px;
}

.nmco-gallery-feature img,
.nmco-gallery-rail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 180ms ease;
}

.nmco-gallery-feature:hover img {
    transform: scale(1.08);
}

.nmco-gallery-rail {
    display: grid;
    grid-auto-rows: 82px;
    gap: 8px;
    max-height: 380px;
    overflow: auto;
    padding-inline-end: 2px;
}

.nmco-gallery-rail a {
    display: grid;
    min-height: 82px;
}

html.nmco-dark-ui .nmco-detail-totals span,
html.nmco-dark-ui .nmco-detail-totals strong,
html.nmco-dark-ui .nmco-detail-meta,
html.nmco-dark-ui .nmco-gallery-feature,
html.nmco-dark-ui .nmco-gallery-rail a {
    border-color: #253446;
    background: #151f2b;
}

html.nmco-dark-ui .nmco-detail-totals span,
html.nmco-dark-ui .nmco-detail-meta small {
    color: #a5b4c5;
}

html.nmco-dark-ui .nmco-detail-meta strong {
    color: #e7eef7;
}

@media (max-width: 980px) {
    #nmco-portal-app .nmco-entry-form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #nmco-portal-app .nmco-entry-form .nmco-field.customer {
        grid-column: 1 / -1;
        order: 1;
    }

    #nmco-portal-app .nmco-entry-form .nmco-field.description {
        grid-column: 1 / -1;
        order: 2;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-field:nth-of-type(3) {
        grid-column: span 1;
        order: 3;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-field:nth-of-type(4) {
        grid-column: 1 / -1;
        order: 3;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-field:nth-of-type(5) {
        grid-column: span 1;
        order: 3;
    }

    #nmco-portal-app .nmco-entry-form .nmco-total-box {
        grid-column: span 1;
        order: 3;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-field:nth-of-type(7) {
        grid-column: 1 / -1;
        order: 4;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-field.attachments {
        order: 5;
    }

    #nmco-portal-app .nmco-entry-form > .nmco-button {
        grid-column: 1 / -1;
        order: 6;
    }
}

@media (max-width: 520px) {
    .nmco-detail-gallery {
        grid-template-columns: 1fr;
    }

    .nmco-gallery-feature {
        min-height: 230px;
    }

    .nmco-gallery-rail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 68px;
        max-height: none;
    }

    .nmco-detail-totals {
        justify-items: start;
    }
}

/* Compact detail gallery and mobile header v0.5.1 */
.nmco-detail-modal {
    width: min(780px, 96vw);
}

.nmco-detail-gallery {
    grid-template-columns: minmax(0, 1fr) 82px;
    gap: 8px;
}

.nmco-gallery-feature {
    min-height: 210px;
    max-height: 260px;
}

.nmco-gallery-rail {
    grid-auto-rows: 56px;
    max-height: 260px;
    gap: 6px;
}

.nmco-gallery-rail a {
    min-height: 56px;
    border-radius: 9px;
}

.nmco-gallery-feature,
.nmco-gallery-rail a {
    border-radius: 10px;
}

#nmco-portal-app .nmco-movement-thumb,
#nmco-portal-app .nmco-thumb-button {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
}

#nmco-portal-app .nmco-thumb-count {
    min-width: 17px;
    height: 17px;
    font-size: 10px;
    line-height: 17px;
}

@media (max-width: 520px) {
    .nmco-detail-modal {
        width: 100%;
        max-height: calc(100dvh - 18px);
    }

    .nmco-detail-modal header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 38px;
        align-items: start;
        gap: 8px;
        padding: 8px;
    }

    .nmco-detail-modal header .nmco-detail-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
        padding: 10px;
        border-radius: 12px;
    }

    .nmco-detail-modal header > .nmco-action {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .nmco-detail-hero > div:first-child {
        align-self: auto;
    }

    .nmco-detail-hero div strong {
        font-size: 17px;
        white-space: normal;
    }

    .nmco-detail-hero span,
    .nmco-detail-hero small {
        font-size: 11px;
    }

    .nmco-detail-totals {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 7px;
    }

    .nmco-detail-totals span {
        font-size: 11px;
        padding: 3px 8px;
    }

    .nmco-detail-totals strong {
        font-size: 17px;
        padding: 6px 10px;
    }

    .nmco-detail-gallery {
        grid-template-columns: minmax(0, 1fr) 58px;
        gap: 7px;
    }

    .nmco-gallery-feature {
        min-height: 155px;
        max-height: 190px;
    }

    .nmco-gallery-rail {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: 44px;
        max-height: 190px;
        gap: 5px;
        overflow: auto;
    }

    .nmco-gallery-rail a {
        min-height: 44px;
        border-radius: 8px;
    }

    #nmco-portal-app .nmco-movement-thumb,
    #nmco-portal-app .nmco-thumb-button {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}

/* Final overrides v0.5.2 */
#nmco-portal-app .nmco-field.customer,
#nmco-portal-app .nmco-field.description {
    z-index: 6;
}

#nmco-portal-app .nmco-suggestions {
    position: absolute;
    inset-block-start: calc(100% + 5px);
    inset-inline: 0;
    z-index: 60;
    margin-top: 0;
}

#nmco-portal-app .nmco-field:has(.nmco-suggestions.open) {
    z-index: 80;
}

.nmco-gallery-feature {
    place-items: center;
}

.nmco-gallery-feature img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.nmco-gallery-rail a,
.nmco-gallery-rail button {
    min-height: 56px;
    overflow: hidden;
    border: 1px solid #e5edf6;
    border-radius: 9px;
    background: #f8fafc;
}

.nmco-gallery-rail button {
    display: grid;
    cursor: pointer;
    padding: 0;
}

.nmco-gallery-rail button.active {
    border-color: var(--nmco-primary);
    box-shadow: 0 0 0 2px var(--nmco-focus);
}

.nmco-gallery-rail button img {
    object-fit: cover;
}

html.nmco-dark-ui .nmco-gallery-rail button {
    border-color: #253446;
    background: #151f2b;
}

.nmco-import-progress {
    display: grid;
    gap: 6px;
    color: var(--nmco-muted);
    font-size: 12px;
    font-weight: 900;
}

.nmco-import-progress strong {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--nmco-line-soft);
}

.nmco-import-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--nmco-primary), var(--nmco-accent));
    transition: width 180ms ease;
}

@media (max-width: 520px) {
    .nmco-gallery-rail a,
    .nmco-gallery-rail button {
        min-height: 44px;
        border-radius: 8px;
    }
}
