/* Shared styles used by BOTH hosts (ERP.Web and ERP.Desktop).
   Served at _content/ERP.Components/css/app.css */

html, body {
    margin: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Layout / spacing utilities used by pages (esp. the login screen). */
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.vh-100 { height: 100vh; }
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffe0e0;
    padding: .75rem 1.25rem;
    box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: .75rem;
    top: .5rem;
}

/* Inventory transaction workspace */
.txn-shell {
    --txn-accent: #2563eb;
    --txn-accent-soft: rgba(37, 99, 235, .1);
    max-width: 1520px;
    margin: 0 auto;
    color: var(--rz-text-color);
}

.txn-type-receipt { --txn-accent: #059669; --txn-accent-soft: rgba(5, 150, 105, .1); }
.txn-type-issue { --txn-accent: #d97706; --txn-accent-soft: rgba(217, 119, 6, .11); }
.txn-type-adjustment { --txn-accent: #2563eb; --txn-accent-soft: rgba(37, 99, 235, .1); }

.txn-hero {
    padding: 1.1rem 1.25rem;
    margin-bottom: .5rem;
    border: 1px solid var(--rz-base-300);
    border-left: 4px solid var(--txn-accent);
    border-radius: 14px;
    background: linear-gradient(135deg, var(--txn-accent-soft), transparent 48%), var(--rz-base-background-color);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .06);
}

.txn-eyebrow {
    margin-bottom: .18rem;
    color: var(--txn-accent);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.txn-title {
    margin: 0;
    font-size: clamp(1.45rem, 2.2vw, 2rem);
    line-height: 1.2;
}

.txn-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem 1rem;
    margin-top: .55rem;
    color: var(--rz-text-secondary-color);
    font-size: .84rem;
}

.txn-meta-row > span { display: inline-flex; align-items: center; gap: .3rem; }
.txn-meta-row .rzi { font-size: 1rem; }
.txn-back-button { color: var(--rz-text-color) !important; font-weight: 650; }

.txn-status {
    padding: .22rem .58rem;
    border-radius: 999px;
    background: var(--txn-accent-soft);
    color: var(--txn-accent);
    font-weight: 700;
}

.txn-status-posted { background: rgba(5, 150, 105, .12); color: #047857; }

.txn-tabs {
    display: flex;
    gap: 1.6rem;
    padding: 0 1rem;
    margin: .8rem 0 1rem;
    border-bottom: 1px solid var(--rz-base-300);
}

.txn-tabs button {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: .75rem .2rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--rz-text-secondary-color);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.txn-tabs button:hover, .txn-tabs button:focus-visible { color: var(--txn-accent); }
.txn-tabs button:focus-visible { outline: 2px solid var(--txn-accent); outline-offset: 3px; border-radius: 4px; }
.txn-tabs button.active { border-bottom-color: var(--txn-accent); color: var(--txn-accent); }

.txn-tab-count {
    min-width: 1.35rem;
    padding: .08rem .36rem;
    border-radius: 999px;
    background: var(--txn-accent-soft);
    font-size: .72rem;
    text-align: center;
}

.txn-tab-pane { display: none; }
.txn-tab-pane.active { display: block; }

.txn-panel, .txn-line-composer, .txn-grid-wrap {
    border: 1px solid var(--rz-base-300);
    border-radius: 12px;
    background: var(--rz-base-background-color);
    box-shadow: 0 4px 16px rgba(15, 23, 42, .05);
}

.txn-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin: 0 0 .9rem;
}

.txn-section-heading h2 { margin: 0; font-size: 1.08rem; }
.txn-section-heading p { margin: .25rem 0 0; color: var(--rz-text-secondary-color); font-size: .84rem; }
.txn-products-heading { padding: 0 .2rem; }

.txn-line-summary { display: flex; gap: .65rem; }
.txn-line-summary span {
    padding: .38rem .65rem;
    border: 1px solid var(--rz-base-300);
    border-radius: 8px;
    color: var(--rz-text-secondary-color);
    font-size: .78rem;
}

.txn-line-composer { padding: 1rem !important; border-top: 3px solid var(--txn-accent); }
.txn-composer-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .9rem;
    color: var(--txn-accent);
    font-size: .9rem;
    font-weight: 750;
}

.txn-grid-wrap { overflow-x: auto; }
.txn-grid-wrap .rz-data-grid { min-width: 850px; border: 0; box-shadow: none; }
.txn-lines-grid .rz-column-title { font-size: .78rem; letter-spacing: .015em; }

.txn-action-bar {
    position: sticky;
    bottom: .75rem;
    z-index: 8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--rz-base-300);
    border-radius: 12px;
    background: color-mix(in srgb, var(--rz-base-background-color) 94%, transparent);
    box-shadow: 0 10px 32px rgba(15, 23, 42, .16);
    backdrop-filter: blur(12px);
}

.txn-action-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; font-size: .82rem; }
.txn-action-summary > span:first-child { color: var(--rz-text-secondary-color); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

@media (max-width: 760px) {
    .txn-hero { padding: 1rem; }
    .txn-tabs { gap: 1rem; padding: 0 .25rem; }
    .txn-products-heading, .txn-action-bar { align-items: stretch; flex-direction: column; }
    .txn-line-summary { flex-wrap: wrap; }
    .txn-action-bar { position: static; }
    .txn-action-bar .rz-stack { width: 100%; }
    .txn-action-bar .rz-button { flex: 1; }
}

/* Modern inventory transaction editor: shared across receipts, issues and adjustments. */
.txn-shell {
    --txn-accent: #2563eb;
    --txn-accent-soft: color-mix(in srgb, #2563eb 9%, transparent);
    max-width: 1600px;
}

.txn-type-receipt,
.txn-type-issue,
.txn-type-adjustment {
    --txn-accent: #2563eb;
    --txn-accent-soft: color-mix(in srgb, #2563eb 9%, transparent);
}

.txn-hero {
    padding: .25rem 0 .85rem;
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.txn-eyebrow {
    margin-bottom: .55rem;
    color: var(--rz-text-secondary-color, #64748b);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.txn-title { font-size: clamp(1.5rem, 2vw, 1.9rem); font-weight: 700; }
.txn-meta-row { margin-top: .45rem; gap: .45rem .9rem; }

.txn-tabs {
    gap: 1.5rem;
    padding: 0;
    margin: 0 0 1rem;
}

.txn-tabs button { min-height: 42px; padding: .6rem .1rem; font-weight: 600; }

.txn-panel,
.txn-line-composer,
.txn-grid-wrap {
    border-color: var(--rz-base-300, #dfe4ea);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.txn-panel { padding: 1rem !important; }
.txn-panel .txn-section-heading { margin-bottom: .75rem; }
.txn-panel .txn-section-heading p { margin-top: .15rem; }

.txn-products-heading { margin-bottom: .65rem; }
.txn-products-heading h2 { font-size: 1.05rem; }
.txn-line-summary span { padding: .28rem .55rem; border-radius: 6px; }

.txn-line-composer {
    padding: .8rem !important;
    margin-bottom: 0 !important;
    border-top: 1px solid var(--rz-base-300, #dfe4ea);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    box-shadow: none;
}

.txn-composer-title {
    margin-bottom: .7rem;
    color: var(--rz-text-color, #1e293b);
    font-size: .85rem;
    font-weight: 650;
}

.txn-line-composer .rz-form-field { margin-bottom: 0; }
.txn-line-composer .rz-button { min-height: 40px; }

.txn-grid-wrap {
    border-radius: 0 0 8px 8px;
    box-shadow: none;
}

.txn-grid-wrap .rz-data-grid { min-width: 1080px; }
.txn-lines-grid .rz-grid-table { table-layout: fixed; }
.txn-lines-grid .rz-data-grid-data td { padding-top: .7rem; padding-bottom: .7rem; vertical-align: top; }
.txn-lines-grid .rz-column-title { color: var(--rz-text-secondary-color, #64748b); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .035em; }
.txn-lines-grid .rz-textbox,
.txn-lines-grid .rz-numeric { width: 100%; }

.txn-cell-secondary {
    display: block;
    margin-top: .3rem;
    color: var(--rz-text-secondary-color, #64748b);
    font-size: .72rem;
    line-height: 1.3;
}

.txn-quantity-inputs { display: grid; grid-template-columns: minmax(82px, 1fr) auto; align-items: center; gap: .45rem; }
.txn-unit-display { min-width: 44px; padding: .48rem .55rem; border: 1px solid var(--rz-base-300, #dfe4ea); border-radius: 5px; background: var(--rz-base-100, #f8fafc); font-size: .78rem; font-weight: 650; text-align: center; }
.txn-impact-values { display: flex; align-items: baseline; gap: .35rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.txn-impact-values > span { color: var(--rz-text-secondary-color, #64748b); font-size: .78rem; }
.txn-increase { color: var(--rz-success, #15803d); }
.txn-decrease { color: var(--rz-danger, #b91c1c); }

.txn-action-bar {
    bottom: .6rem;
    margin-top: .85rem;
    padding: .75rem .9rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--rz-base-background-color, #fff) 96%, transparent);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .12);
}

.txn-action-bar .rz-button-primary { background: #2563eb; border-color: #2563eb; }
.txn-status-posted { color: var(--rz-success, #047857); }

@media (max-width: 760px) {
    .txn-hero { padding-top: 0; }
    .txn-line-composer { border-bottom: 1px solid var(--rz-base-300, #dfe4ea); border-radius: 8px; margin-bottom: .7rem !important; }
    .txn-grid-wrap { border-radius: 8px; }
    .txn-action-bar { gap: .65rem; }
}

/* Receiving lines (receive panel). Below 600px each line stacks with its own labels, so a quantity is entered without
   scrolling the table sideways (receiver acceptance, 7 Oct 2026). */
.rcv-lines { width: 100%; min-width: 560px; border-collapse: collapse; font-size: .9rem; }
@media (max-width: 600px) {
    .rcv-lines { min-width: 0; }
    .rcv-lines thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .rcv-lines, .rcv-lines tbody, .rcv-lines tr, .rcv-lines td { display: block; width: auto !important; }
    .rcv-lines tr { padding: .4rem 0; }
    .rcv-lines td { padding: .15rem 0 !important; text-align: left !important; }
    .rcv-lines td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; opacity: .65; }

    /* Header: the user's name stays readable to screen readers; Logout becomes an icon (named by aria-label). */
    .hdr-user { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .hdr-logout .rz-button-text { display: none; }
}

/* Inventory movement report: wide table that scrolls inside the page, headers stay in view; prints landscape without menus. */
.mv-title { margin: .25rem 0 .5rem; }
.mv-edited { display: block; margin: -.25rem 0 .5rem; color: var(--rz-warning-darker, #8a5a00); }
.mv-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--rz-base-300); }
.mv-table { border-collapse: collapse; font-size: .82rem; white-space: nowrap; }
.mv-table th, .mv-table td { padding: .3rem .5rem; border-bottom: 1px solid var(--rz-base-200); text-align: right; font-weight: normal; }
.mv-table thead th { position: sticky; top: 0; background: var(--rz-base-100); font-weight: 600; vertical-align: bottom; white-space: normal; min-width: 5.5rem; z-index: 1; }
.mv-table .mv-left { text-align: left; }
.mv-table tbody th[scope=row] { font-weight: 600; }
.mv-table .mv-dispatch { background: color-mix(in srgb, var(--rz-primary) 4%, transparent); }
.mv-table .mv-class th { background: var(--rz-base-200); font-weight: 600; }
/* Print size of the table; html.mv-measure applies it on screen for a moment so movement-print.js can measure the width. */
html.mv-measure .mv-table { font-size: 7pt; }
html.mv-measure .mv-table th, html.mv-measure .mv-table td { padding: 1px 3px; }
html.mv-measure .mv-table thead th { min-width: 0; }
html.mv-measure .mv-table .mv-desc { white-space: normal; min-width: 9em; max-width: 18em; }
@media print {
    @page { size: landscape; margin: 10mm; }
    .rz-header, .rz-sidebar, .rz-footer, .mv-noprint { display: none !important; }
    /* The app layout scrolls inside a full-height body; on paper it must grow, or only the first screen prints. */
    html, body, .rz-layout, .rz-body { height: auto !important; max-height: none !important; overflow: visible !important; }
    .rz-layout { display: block !important; }
    .rz-body { margin: 0 !important; padding: 0 !important; }
    .mv-scroll { overflow: visible; max-height: none; border: 0; }
    /* Fitted to the page width by movement-print.js (zoom); headings repeat on every page; a row never splits. */
    .mv-table { font-size: 7pt; zoom: var(--mv-print-zoom, 1); }
    .mv-table th, .mv-table td { padding: 1px 3px; }
    .mv-table thead { display: table-header-group; }
    .mv-table thead th { position: static; min-width: 0; }
    .mv-table .mv-desc { white-space: normal; min-width: 9em; max-width: 18em; }
    .mv-table tr { break-inside: avoid; }
    .mv-table .mv-dispatch { background: none; }
}
