:root {
    --ink: #2b211b;
    --muted: #756a62;
    --green-950: #211610;
    --green-900: #352219;
    --green-700: #6a4424;
    --green-500: #a67c48;
    --cream: #f5f0e7;
    --paper: #ffffff;
    --line: #e5ddd2;
    --amber: #d4ad68;
    --danger: #b84c3e;
    --purple: #735d8f;
    --radius: 18px;
    --shadow: 0 12px 30px rgba(25, 49, 41, .07);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(166, 124, 72, .12), transparent 34rem),
        #f7f4ef;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
.min-w-0 { min-width: 0; }
.w-fit { width: fit-content; }
.bg-soft { background: #f4f6f4; }
.card { border-radius: var(--radius); box-shadow: var(--shadow); }
.form-control, .form-select {
    border-color: #cbd7d1;
    border-radius: 10px;
    min-height: 44px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 .2rem rgba(63, 149, 119, .14);
}
.searchable-select {
    position: relative;
    width: 100%;
}
.searchable-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
}
.searchable-select-control {
    position: relative;
}
.searchable-select-input {
    padding-right: 2.8rem;
    background: #fff;
}
.searchable-select-toggle {
    position: absolute;
    top: 50%;
    right: .35rem;
    display: grid;
    place-items: center;
    width: 2.15rem;
    height: 2.15rem;
    padding: 0;
    transform: translateY(-50%);
    color: var(--muted);
    border: 0;
    border-radius: 8px;
    background: transparent;
}
.searchable-select-toggle::before {
    width: .58rem;
    height: .58rem;
    content: "";
    transform: translateY(-.15rem) rotate(45deg);
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
}
.searchable-select-toggle:hover,
.searchable-select-toggle:focus-visible {
    color: var(--green-900);
    background: #f3eee7;
    outline: none;
}
.searchable-select-menu {
    position: absolute;
    z-index: 1080;
    top: calc(100% + .35rem);
    right: 0;
    left: 0;
    max-height: min(19rem, 55vh);
    overflow: auto;
    padding: .35rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(33, 22, 16, .16);
}
.searchable-select-menu[hidden] {
    display: none !important;
}
.searchable-select-list {
    display: grid;
    gap: .15rem;
}
.searchable-select-option {
    min-height: 38px;
    padding: .55rem .7rem;
    cursor: pointer;
    border-radius: 8px;
    line-height: 1.3;
}
.searchable-select-option:hover,
.searchable-select-option.is-active {
    color: var(--green-950);
    background: #f2e9dc;
}
.searchable-select-option.is-selected {
    font-weight: 700;
}
.searchable-select-option.is-disabled {
    cursor: not-allowed;
    opacity: .45;
}
.searchable-select-empty {
    padding: .8rem .7rem;
    color: var(--muted);
    font-size: .86rem;
}
.searchable-select-error {
    margin-top: .35rem;
    color: var(--danger);
    font-size: .82rem;
}
.searchable-select.is-disabled .searchable-select-input {
    color: var(--muted);
    background: #e9ecef;
}
.searchable-select.is-invalid .searchable-select-input {
    border-color: var(--danger);
    box-shadow: 0 0 0 .2rem rgba(184, 76, 62, .12);
}
.btn {
    border-radius: 10px;
    font-weight: 650;
}
.btn-primary {
    --bs-btn-bg: var(--green-700);
    --bs-btn-border-color: var(--green-700);
    --bs-btn-hover-bg: var(--green-900);
    --bs-btn-hover-border-color: var(--green-900);
    --bs-btn-active-bg: var(--green-950);
    --bs-btn-active-border-color: var(--green-950);
}
.btn-success { --bs-btn-bg: #258259; --bs-btn-border-color: #258259; }
.eyebrow {
    color: var(--green-700);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
}
.app-navbar {
    position: sticky;
    z-index: 1030;
    top: 0;
    overflow: visible;
    background: rgba(16, 45, 37, .97);
    box-shadow: 0 7px 28px rgba(8, 29, 23, .16);
    backdrop-filter: blur(12px);
}
.dropdown-menu {
    z-index: 1100;
    color: var(--ink);
    border-color: var(--line);
    background: #fff;
    box-shadow: 0 16px 36px rgba(33, 22, 16, .16);
}
.dropdown-item { color: var(--ink); }
.dropdown-item:hover,
.dropdown-item:focus { color: var(--ink); background: #f6efe5; }
.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    line-height: 1.05;
}
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup small { opacity: .65; font-size: .68rem; margin-top: .18rem; }
.brand-logo {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .76);
    border-radius: 50%;
    background: #fff;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: var(--green-950);
    background: var(--amber);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .04em;
}
.brand-mark-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 1rem; }
.navbar .nav-link { color: rgba(255, 255, 255, .72); font-weight: 600; border-radius: 8px; padding-inline: .8rem !important; }
.navbar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.navbar button.nav-link {
    border: 0;
    background: transparent;
}
.navbar button.nav-link:focus-visible {
    color: #fff;
    outline: 2px solid rgba(255, 255, 255, .45);
    outline-offset: 2px;
}
.navigation-more-menu {
    min-width: 230px;
    padding: .45rem;
}
.navigation-more-menu .dropdown-header {
    padding: .4rem .65rem .25rem;
    color: #8a7b70;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}
.navigation-more-menu .dropdown-item {
    padding: .55rem .65rem;
    border-radius: 7px;
    font-size: .84rem;
}
.nav-notification-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: .25rem;
    padding: 0 .3rem;
    color: #2b211b;
    border-radius: 999px;
    background: #e8bd64;
    font-size: .62rem;
    font-weight: 850;
    line-height: 1;
}
.user-menu { color: #fff; border: 1px solid rgba(255, 255, 255, .22); margin-left: .5rem; }
.user-menu:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }
.user-menu-name {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}
.page-heading { display: flex; justify-content: space-between; align-items: center; }
.app-footer {
    color: var(--muted);
    font-size: .78rem;
    padding: 2.2rem 0;
}

.auth-shell { background: var(--green-950); }
.auth-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr);
}
.auth-panel {
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 9vw, 9rem);
    background:
        linear-gradient(135deg, rgba(53, 34, 25, .97), rgba(33, 22, 16, .93)),
        repeating-linear-gradient(45deg, transparent, transparent 18px, rgba(255,255,255,.03) 18px, rgba(255,255,255,.03) 19px);
}
.auth-brand { display: flex; align-items: center; gap: 1rem; }
.auth-logo {
    width: 92px;
    height: 92px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, .78);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
}
.auth-panel .lead { max-width: 42rem; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.auth-note { display: flex; flex-direction: column; gap: .25rem; padding-left: 1rem; border-left: 3px solid var(--amber); }
.auth-note span { color: rgba(255,255,255,.62); }
.auth-form-panel { display: grid; place-items: center; padding: 2rem; background: var(--cream); }
.auth-card { width: min(100%, 430px); padding: clamp(1.5rem, 5vw, 3rem); border-radius: 24px; background: #fff; box-shadow: 0 30px 80px rgba(5, 25, 19, .18); }
.auth-shell .app-footer { display: none; }
.install-card { max-width: 580px; }
.install-brand { display: flex; align-items: center; gap: 1rem; }
.install-brand img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

.auth-wrap-simple { grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); }
.auth-panel-simple {
    align-items: center;
    padding: clamp(2rem, 7vw, 7rem);
    text-align: center;
    background: linear-gradient(145deg, #211610, #442b1d);
}
.auth-panel-simple h1 { margin: 1.4rem 0 0; font-size: clamp(1.8rem, 4vw, 3.2rem); letter-spacing: .12em; }
.auth-logo-large {
    width: clamp(150px, 20vw, 260px);
    height: clamp(150px, 20vw, 260px);
    border: 6px solid rgba(255,255,255,.9);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
}

.hero-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border-radius: var(--radius);
    background: linear-gradient(120deg, #fff, #f4ece0);
    border: 1px solid #e8ddd0;
}
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.action-card {
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .18s ease, border-color .18s ease;
}
.action-card:hover { color: var(--ink); transform: translateY(-3px); border-color: var(--green-500); }
.action-card strong { font-size: 1.05rem; }
.action-card small { color: var(--muted); margin-top: .35rem; }
.action-code {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--green-900);
    background: #f2e6d6;
    font-weight: 850;
}
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; }
.metric-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    text-decoration: none;
    border-left: 4px solid;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow);
}
.metric-card span { color: var(--muted); font-size: .82rem; font-weight: 650; }
.metric-card strong { color: var(--ink); font-size: 1.7rem; }
.metric-secondary { border-color: #87948e; }
.metric-warning { border-color: var(--amber); }
.metric-danger { border-color: var(--danger); }
.metric-success { border-color: #2a9467; }
.metric-primary { border-color: #3177c7; }
.metric-purple { border-color: var(--purple); }

.transaction-list { display: flex; flex-direction: column; }
.transaction-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--ink);
    text-decoration: none;
    border-top: 1px solid #eef1ef;
}
.transaction-row:first-child { border-top: 0; }
.transaction-row:hover { color: var(--ink); background: #f8faf9; }
.transaction-row small { display: block; color: var(--muted); margin-top: .25rem; }
.transaction-row-lg { min-height: 88px; }
.transaction-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--green-900);
    background: #e9f2ed;
    font-size: .75rem;
    font-weight: 850;
}
.row-arrow { color: #91a19a; font-size: 1.7rem; }
.transaction-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--muted); font-size: .8rem; margin-top: .38rem; }
.badge-soft-secondary { color: #56615c; background: #e9edeb; }
.badge-soft-primary { color: #17569a; background: #dcecff; }
.badge-soft-info { color: #176272; background: #d8f2f7; }
.badge-soft-warning { color: #76510a; background: #fff0c8; }
.badge-soft-purple { color: #553e8e; background: #ece5ff; }
.badge-soft-success { color: #176844; background: #d9f3e6; }
.badge-soft-danger { color: #912c25; background: #f9ddda; }

.warehouse-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.warehouse-check { margin: 0; padding: .85rem .85rem .85rem 2.3rem; border: 1px solid var(--line); border-radius: 10px; background: #fafcfb; }
.permission-check .form-check-label strong,
.permission-check .form-check-label small { display: block; }
.permission-check .form-check-label small { color: var(--muted); margin-top: .18rem; font-size: .75rem; }
.permission-check:has(.form-check-input:checked) {
    border-color: var(--green-500);
    background: #fbf5eb;
}
.table > :not(caption) > * > * { padding: 1rem; }
.table thead th { color: var(--muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; background: #f8faf9; white-space: nowrap; }

.camera-stage {
    position: relative;
    overflow: hidden;
    min-height: 300px;
    border-radius: 16px;
    background: #08120f;
}
.camera-stage video { display: block; width: 100%; max-height: 68vh; object-fit: contain; }
.camera-modal-content {
    overflow: hidden;
    color: #fff;
    border: 0;
    background: #08120f;
}
.camera-modal-content .modal-header { border-color: rgba(255,255,255,.14); }
.camera-guide {
    position: absolute;
    inset: 12% 10% 22%;
    pointer-events: none;
    border: 2px solid rgba(255,255,255,.58);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(0,0,0,.08);
}
.camera-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    gap: .75rem;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.photo-preview-grid, .evidence-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}
.captured-photo, .existing-photo, .evidence-grid a {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #edf1ef;
}
.captured-photo img, .existing-photo img, .evidence-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.captured-photo button { position: absolute; top: .5rem; right: .5rem; }
.existing-photo .form-check { display: block; padding: .7rem .7rem .7rem 2rem; font-size: .8rem; }
.evidence-grid a { color: var(--ink); text-decoration: none; }
.evidence-grid small { display: block; padding: .6rem; }
.item-stack { display: flex; flex-direction: column; gap: 1rem; }
.item-card {
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcfb;
}
.item-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.access-section { padding: 1.1rem; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf6; }
.access-table { min-width: 680px; }
.access-check { width: 1.2rem; height: 1.2rem; }
.period-active { color: var(--muted); font-size: .82rem; }
.metric-card span small { display: block; margin-top: .22rem; opacity: .8; font-weight: 500; }
.task-card { overflow: hidden; }
.revision-message { color: var(--muted); font-size: .86rem; white-space: normal; }
.late-warning { padding: .85rem 1rem; color: #6d350b; background: #fff3d8; border: 1px solid #e9c17c; border-radius: 10px; }
.manual-barcode-warning { padding: .7rem; color: #73510d; background: #fff6df; border-radius: 9px; font-size: .82rem; }
.stock-availability { font-size: .78rem; }
.sticky-submit {
    position: sticky;
    z-index: 20;
    bottom: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    width: fit-content;
    margin: 0 0 0 auto;
    padding: .65rem;
    border: 1px solid rgba(210, 221, 215, .8);
    border-radius: 14px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 40px rgba(18, 45, 36, .16);
    backdrop-filter: blur(12px);
}
#qr-reader { width: 100%; min-height: 280px; }

.detail-topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.transaction-hero { background: linear-gradient(125deg, #fff 15%, #edf5f1); }
.detail-facts { display: flex; gap: 1rem; }
.detail-facts > div { min-width: 115px; padding: .9rem; border-radius: 12px; background: rgba(255,255,255,.78); }
.detail-facts small, .detail-facts strong { display: block; }
.detail-facts small { color: var(--muted); font-size: .72rem; margin-bottom: .25rem; }
.workflow-panel { border-left: 5px solid var(--amber) !important; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.detail-grid div { padding-bottom: .8rem; border-bottom: 1px solid #edf0ee; }
.detail-grid dt { color: var(--muted); font-size: .76rem; font-weight: 650; margin-bottom: .3rem; }
.detail-grid dd { margin: 0; }
.detail-grid .detail-span { grid-column: 1 / -1; }
.item-detail-list { display: flex; flex-direction: column; }
.item-detail { display: flex; gap: 1rem; padding: 1rem 0; border-top: 1px solid #edf0ee; }
.item-detail:first-child { padding-top: 0; border-top: 0; }
.item-detail-number { flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #eaf2ee; font-weight: 800; font-size: .8rem; }
.item-quantity { color: var(--green-900); font-size: 1.15rem; font-weight: 750; }
.item-tags { display: flex; flex-wrap: wrap; gap: .45rem; }
.item-tags span { padding: .35rem .55rem; color: var(--muted); background: #f3f6f4; border-radius: 7px; font-size: .75rem; }
.item-tags code { color: var(--green-900); }
.attachment-list { display: flex; flex-direction: column; gap: .6rem; }
.attachment-list a { display: flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; padding: .8rem; border: 1px solid var(--line); border-radius: 10px; }
.attachment-list small, .attachment-list strong { display: block; }
.attachment-list small { color: var(--muted); margin-top: .2rem; }
.attachment-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 9px; background: #eaf2ee; font-size: .7rem; font-weight: 900; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; display: flex; gap: .8rem; padding-bottom: 1.4rem; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 15px; bottom: 0; width: 2px; background: #dce5e0; }
.timeline-dot { position: relative; z-index: 1; flex: 0 0 auto; width: 14px; height: 14px; margin-top: .25rem; border: 3px solid #c7dbd1; border-radius: 50%; background: var(--green-700); }
.timeline strong, .timeline small { display: block; }
.timeline small { color: var(--muted); margin-top: .2rem; }
.timeline p { margin: .45rem 0 0; color: var(--muted); font-size: .83rem; }
.audit-entry { padding: .7rem 0; border-top: 1px solid #edf0ee; }
.audit-entry:first-of-type { border-top: 0; }
.audit-entry summary { cursor: pointer; }
.audit-entry summary strong, .audit-entry summary small { display: block; }
.audit-entry summary small { color: var(--muted); margin-top: .2rem; }
.audit-values { margin-top: .7rem; }
.audit-values span { color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.audit-values pre { max-height: 180px; overflow: auto; padding: .6rem; font-size: .68rem; white-space: pre-wrap; background: #f4f6f5; border-radius: 8px; }
.notification-unread { background: #f2f8f5; }
.notification-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: .45rem; border-radius: 50%; background: var(--green-500); }
.report-table { min-width: 950px; }
.report-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.report-page-heading h1 { color: var(--ink); }
.report-count {
    flex: 0 0 auto;
    padding: .45rem .75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 700;
}
.report-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}
.report-sidebar {
    position: sticky;
    top: 92px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(33, 22, 16, .05);
}
.report-sidebar-heading {
    padding: .9rem 1rem;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.report-sidebar nav { padding: .4rem; }
.report-sidebar-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding: .72rem .75rem;
    color: #4e4640;
    border-radius: 9px;
    font-size: .84rem;
    font-weight: 650;
    line-height: 1.3;
    text-decoration: none;
}
.report-sidebar-link:hover,
.report-sidebar-link:focus-visible { color: var(--green-900); background: #f1f6f3; }
.report-sidebar-link.active { color: #fff; background: var(--green-900); }
.report-workspace { min-width: 0; }
.report-mobile-picker { display: none; margin-bottom: 1rem; }
.report-filter-panel {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(33, 22, 16, .045);
}
.report-filter-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1rem;
    cursor: pointer;
    list-style: none;
}
.report-filter-panel > summary::-webkit-details-marker { display: none; }
.report-filter-panel > summary strong,
.report-filter-panel > summary small { display: block; }
.report-filter-panel > summary small { margin-top: .1rem; color: var(--muted); }
.report-filter-toggle {
    color: var(--green-800);
    font-size: .78rem;
    font-weight: 800;
}
.report-filter-panel[open] .report-filter-toggle::after { content: ' ▲'; }
.report-filter-panel:not([open]) .report-filter-toggle::after { content: ' ▼'; }
.report-filter-body { padding: 1rem; border-top: 1px solid var(--line); }
@media (max-width: 991.98px) {
    .report-layout { display: block; }
    .report-sidebar { display: none; }
    .report-mobile-picker { display: block; }
    .report-page-heading { align-items: center; }
}
@media (max-width: 575.98px) {
    .report-page-heading { align-items: flex-start; }
    .report-page-heading h1 { font-size: 1.35rem; }
    .report-filter-panel > summary { padding: .8rem; }
    .report-filter-body { padding: .8rem; }
}.table-group-row > td {
    padding: .75rem 1rem;
    color: var(--green-900);
    background: #edf5f0 !important;
    border-top: 2px solid rgba(47, 113, 88, .25);
}

.label-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.label-grid { display: grid; grid-template-columns: repeat(2, 360px); justify-content: center; gap: 1.2rem; }
.batch-label { display: flex; flex-direction: column; align-items: stretch; padding: 1.3rem; text-align: center; border: 2px solid var(--ink); border-radius: 14px; background: #fff; break-inside: avoid; }
.label-content { display: flex; flex-direction: column; align-items: center; }
.label-brand { display: flex; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-weight: 900; letter-spacing: .14em; }
.label-brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.qr-code { width: 176px; height: 176px; }
.qr-code img, .qr-code canvas { width: 176px !important; height: 176px !important; }
.batch-code { margin-top: .7rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; }
.batch-label h2 { font-size: 1.2rem; margin: .7rem 0; }
.batch-label dl { width: 100%; margin: 0 0 .8rem; font-size: .8rem; }
.batch-label dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .22rem 0; border-bottom: 1px dotted #aaa; }
.batch-label dd { margin: 0; text-align: right; font-weight: 700; }
.label-actions { display: flex; justify-content: center; gap: .5rem; margin-top: .6rem; }
.print-stage { display: none; }
.layout-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.layout-option {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    padding: 1rem;
    text-align: left;
    color: var(--ink);
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.layout-option:hover, .layout-option.active { border-color: var(--green-700); background: #fbf3e8; }
.layout-option small { color: var(--muted); }
.layout-preview { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; border-radius: 12px; background: #dfdbd4; }
.label-preview-page {
    display: grid;
    align-content: start;
    gap: .45rem;
    width: min(100%, 760px);
    min-height: 420px;
    margin-inline: auto;
    padding: .65rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.label-preview-page.layout-1x1 { grid-template-columns: 1fr; }
.label-preview-page.layout-2x2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.label-preview-page.layout-3x2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label-preview-page .batch-label { min-width: 0; padding: .65rem; border-width: 1px; border-radius: 7px; }
.label-preview-page .label-brand { font-size: .7rem; }
.label-preview-page .label-brand img { width: 22px; height: 22px; }
.label-preview-page .qr-code,
.label-preview-page .qr-code img { width: 92px !important; height: 92px !important; }
.label-preview-page .batch-code { font-size: .7rem; }
.label-preview-page h2 { font-size: .82rem; margin: .35rem 0; }
.label-preview-page dl { font-size: .55rem; margin-bottom: 0; }

/* V3 transaction experience */
.action-card {
    justify-content: flex-start;
    min-height: 174px;
}
.action-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 1.1rem;
    color: var(--green-700);
    border-radius: 16px;
    background: #f4eadc;
}
.action-icon svg,
.transaction-icon-svg svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.action-card strong { margin-top: auto; }
.transaction-icon-svg svg { width: 22px; height: 22px; }
:is(#transactionTypeModal, #createTransactionModal) .modal-dialog { max-width: min(900px, calc(100vw - 2rem)); }
:is(#transactionTypeModal, #createTransactionModal) .modal-body.action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 1.25rem;
}
:is(#transactionTypeModal, #createTransactionModal) .action-card { min-height: 156px; }

.form-page-top,
.transaction-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.form-page-top { justify-content: flex-start; }
.form-page-top > div { padding-left: 1rem; border-left: 1px solid var(--line); }
.form-section-card { overflow: visible; }
.form-section-card > .card-body { padding: clamp(1.1rem, 2.5vw, 1.75rem); }
.section-heading,
.item-section-heading,
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.section-heading { justify-content: flex-start; margin-bottom: 1.35rem; }
.section-step {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: var(--green-700);
    font-size: .82rem;
    font-weight: 850;
}
.item-section-heading { margin-bottom: 1rem; }
.readonly-value {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .55rem .8rem;
    border: 1px solid #d8dfdb;
    border-radius: 10px;
    background: #f5f7f6;
}
.readonly-value strong,
.readonly-value small { display: block; }
.readonly-value small { margin-top: .15rem; color: var(--muted); font-size: .74rem; }
.upload-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}
.upload-choice-grid-single { grid-template-columns: minmax(0, 480px); }
.upload-choice {
    min-height: 112px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-content: center;
    column-gap: .8rem;
    padding: 1rem;
    text-align: left;
    color: var(--ink);
    cursor: pointer;
    border: 1px dashed #b9c9c1;
    border-radius: 14px;
    background: #fafcfb;
}
.upload-choice:hover { border-color: var(--green-700); background: #fbf5eb; }
.upload-choice-icon {
    grid-row: span 2;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 12px;
    background: var(--green-700);
    font-size: 1.35rem;
}
.upload-choice strong,
.upload-choice small { display: block; }
.upload-choice small { color: var(--muted); font-size: .76rem; }
.barcode-control {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) auto auto;
    gap: .45rem;
}
.barcode-control .btn { min-height: 44px; white-space: nowrap; }
.selected-item-unit {
    display: none;
    margin-top: .35rem;
    color: var(--muted);
    font-size: .75rem;
}
.selected-item-unit.is-visible { display: block; }
.quantity-input { font-variant-numeric: tabular-nums; }
.scanner-status {
    margin-bottom: .75rem;
    padding: .65rem .8rem;
    color: var(--muted);
    border-radius: 9px;
    background: #f3f6f4;
    font-size: .8rem;
}
#qr-reader { overflow: hidden; border: 0 !important; border-radius: 12px; }
#qr-reader video { border-radius: 10px; }
#qr-reader button {
    min-height: 42px;
    padding: .45rem .75rem;
    border: 1px solid var(--green-700);
    border-radius: 9px;
    background: #fff;
}
.item-card {
    padding: clamp(1rem, 2vw, 1.3rem);
    background: #fff;
    box-shadow: 0 6px 20px rgba(32, 43, 38, .04);
}
.item-card-head strong { font-size: .94rem; }

.revision-alert-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    color: #493313;
    border: 1px solid #e4c282;
    border-left: 6px solid #c88c29;
    border-radius: 14px;
    background: linear-gradient(120deg, #fff8e9, #fffdf8);
    box-shadow: var(--shadow);
}
.revision-alert-card .eyebrow { color: #8a5b11; }
.revision-alert-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    background: #b97713;
    font-weight: 900;
}
.revision-alert-approved {
    color: #174d38;
    border-color: #9bcbb5;
    border-left-color: #258259;
    background: linear-gradient(120deg, #edf9f3, #fbfffd);
}
.revision-alert-approved .revision-alert-icon { background: #258259; }
.revision-alert-approved .eyebrow { color: #257453; }

.transaction-top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.action-menu { min-width: 230px; padding-block: .45rem; }
.action-menu form { margin: 0; }
.action-menu .dropdown-item { padding: .65rem 1rem; }
.transaction-detail-shell { overflow: hidden; }
.transaction-tabs-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}
.transaction-tabs-wrap::-webkit-scrollbar { display: none; }
.transaction-tabs {
    min-width: max-content;
    padding: 0 1rem;
    border-bottom: 0;
}
.transaction-tabs .nav-link {
    min-height: 58px;
    color: var(--muted);
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    font-weight: 700;
}
.transaction-tabs .nav-link:hover { color: var(--ink); border-color: transparent; }
.transaction-tabs .nav-link.active {
    color: var(--green-700);
    border-bottom-color: var(--green-700);
    background: transparent;
}
.tab-count {
    display: inline-grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    margin-left: .25rem;
    padding-inline: .35rem;
    border-radius: 999px;
    background: #eef2f0;
    font-size: .7rem;
}
.transaction-tab-content { min-height: 340px; }
.content-section { padding: clamp(1.1rem, 3vw, 2rem); }
.history-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.history-grid > section + section { border-left: 1px solid var(--line); }
.empty-state {
    display: grid;
    place-items: center;
    min-height: 210px;
    padding: 2rem;
    text-align: center;
    border: 1px dashed #cfd9d4;
    border-radius: 14px;
    background: #fbfcfb;
}
.empty-state > span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: .8rem;
    color: var(--green-700);
    border-radius: 14px;
    background: #eaf2ee;
    font-size: 1.4rem;
}
.empty-state-compact {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1rem;
    color: var(--muted);
    border-radius: 10px;
    background: #f6f8f7;
}
.empty-state-compact > span { font-weight: 850; }
.revision-request-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #ead5ad;
    border-radius: 14px;
    background: #fffaf0;
}
.revision-request-card > p { grid-column: 1 / -1; }
.audit-readable {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
    margin-top: .7rem;
    padding: .75rem;
    border-radius: 10px;
    background: #f5f7f6;
}
.audit-readable div { min-width: 0; }
.audit-readable span,
.audit-readable strong { display: block; }
.audit-readable span { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.audit-readable strong { margin-top: .2rem; overflow-wrap: anywhere; font-size: .82rem; }
.audit-readable p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .8rem; }

.attachment-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}
.upload-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .65rem;
    padding: 1rem;
    cursor: pointer;
    border: 1px dashed #b9c9c1;
    border-radius: 14px;
    background: #fbfcfb;
}
.upload-card:hover,
.upload-card:focus-visible,
.upload-card.is-upload-active,
.upload-card.is-dragging {
    border-color: var(--green-700);
    background: #fbf5eb;
    box-shadow: 0 0 0 3px rgba(24, 91, 68, .1);
    outline: 0;
}
.upload-card.is-dragging { border-style: solid; transform: translateY(-1px); }
.upload-card-required { border-style: solid; border-color: #d8b773; }
.upload-card-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--green-700);
    border-radius: 12px;
    background: #eaf2ee;
    font-size: 1.15rem;
    font-weight: 850;
}
.upload-card > span > strong,
.upload-card > span > small { display: block; }
.upload-card > span > small { margin-top: .2rem; color: var(--muted); font-size: .73rem; }
.upload-card > .btn { margin-top: auto; pointer-events: none; }
.upload-card-actions { display: flex; align-items: center; gap: .55rem; margin-top: auto; }
.upload-card-actions > small,
.upload-paste-hint { color: var(--muted); font-size: .7rem; }
.upload-paste-hint { display: block; }
.selected-files { display: flex; flex-direction: column; gap: .35rem; width: 100%; }
.selected-file-chip {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
    padding: .42rem .5rem .42rem .6rem;
    color: var(--muted);
    border-radius: 8px;
    background: #edf2ef;
    font-size: .68rem;
}
.selected-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.selected-file-remove {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #8d251f;
    border: 0;
    border-radius: 50%;
    background: #fff;
    font-size: 1rem;
    line-height: 1;
}
.selected-file-remove:hover { background: #f9deda; }
.paste-target-list { display: grid; gap: .7rem; }
.paste-target-button {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .2rem;
    padding: .9rem 1rem;
    text-align: left;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.paste-target-button:hover,
.paste-target-button:focus-visible {
    border-color: var(--green-700);
    background: #f5f8f6;
    outline: 0;
}
.paste-target-button small { color: var(--muted); }
.accurate-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.25rem;
}
.attachment-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}
.attachment-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}
.attachment-preview {
    min-height: 130px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--green-700);
    background: #edf2ef;
    text-decoration: none;
}
.attachment-preview img { width: 100%; height: 150px; object-fit: cover; }
.attachment-file-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    font-size: .78rem;
    font-weight: 900;
}
.attachment-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .9rem; }
.attachment-card-body form { width: 100%; margin: 0; }
.attachment-card-body form .btn { width: 100%; }
.attachment-card-body > strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-card-body > small { color: var(--muted); font-size: .7rem; }
.attachment-kind {
    color: var(--green-700);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.evidence-card > span { display: block; padding: .7rem; }
.evidence-card strong,
.evidence-card small { display: block; }
.evidence-card small { margin-top: .2rem; color: var(--muted); }

/* V3 label controls */
.label-toolbar-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.print-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(145px, .7fr);
    align-items: end;
    gap: .8rem;
}
.print-capacity {
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: .45rem .75rem;
    border-radius: 10px;
    background: #edf2ef;
}
.print-capacity span { color: var(--muted); font-size: .68rem; }
.print-capacity strong { font-size: .9rem; }
.print-readability-note {
    padding: .75rem 1rem;
    color: #345f4d;
    border-radius: 10px;
    background: #eaf5ef;
    font-size: .8rem;
}
.print-readability-note.is-warning { color: #70480c; background: #fff2d8; }
.dynamic-label-page {
    grid-template-columns: repeat(var(--label-cols), minmax(0, 1fr)) !important;
    grid-template-rows: repeat(var(--label-rows), minmax(0, 1fr));
}
.label-preview-page.dynamic-label-page {
    aspect-ratio: 210 / 297;
    min-height: 0;
}
.label-density-medium .batch-label { padding: .45rem; }
.label-density-medium .label-brand { font-size: .58rem; }
.label-density-medium .label-brand img { width: 18px; height: 18px; }
.label-density-medium .qr-code,
.label-density-medium .qr-code img { width: 68px !important; height: 68px !important; }
.label-density-medium .batch-code { font-size: .58rem; }
.label-density-medium h2 { font-size: .7rem; margin: .25rem 0; }
.label-density-medium dl { font-size: .48rem; }
.label-density-high .batch-label { padding: .28rem; }
.label-density-high .label-brand { margin-bottom: .2rem; font-size: .46rem; letter-spacing: 0; }
.label-density-high .label-brand img { width: 14px; height: 14px; }
.label-density-high .qr-code,
.label-density-high .qr-code img { width: 48px !important; height: 48px !important; }
.label-density-high .batch-code { margin-top: .2rem; font-size: .46rem; }
.label-density-high h2 { font-size: .58rem; margin: .15rem 0; }
.label-density-high dl { font-size: .4rem; }
.bulk-option {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    margin-bottom: .7rem;
    padding: 1rem;
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfb;
}
.bulk-option:has(input:checked) { border-color: var(--green-700); background: #fbf5eb; }
.bulk-option strong,
.bulk-option small { display: block; }
.bulk-option small { margin-top: .2rem; color: var(--muted); }
.bulk-progress { display: flex; flex-direction: column; gap: .45rem; margin-top: 1rem; }
.bulk-progress .progress { height: 8px; }
.bulk-progress .progress-bar { background: var(--green-700); transition: width .15s ease; }
.bulk-progress small { color: var(--muted); }

@media (max-width: 991.98px) {
    .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .auth-wrap-simple { display: flex; min-height: 100vh; flex-direction: column; background: var(--cream); }
    .auth-wrap-simple .auth-panel-simple { display: flex; flex: 0 0 auto; min-height: 180px; padding: 1.5rem; }
    .auth-wrap-simple .auth-panel-simple h1 { margin-top: .75rem; font-size: 1.35rem; }
    .auth-wrap-simple .auth-logo-large { width: 88px; height: 88px; border-width: 3px; }
    .auth-wrap-simple .auth-form-panel { min-height: auto; flex: 1; align-items: start; padding-top: 1.5rem; }
    .navbar-collapse { padding: 1rem 0; }
    .navbar .nav-link {
        width: 100%;
        padding-block: .65rem;
        text-align: left;
    }
    .navigation-more-menu {
        width: 100%;
        margin: .25rem 0 .5rem;
    }
    .user-menu { margin: .5rem 0 0; width: 100%; text-align: left; }
    .user-menu-name {
        max-width: calc(100vw - 110px);
    }
    .detail-facts { flex-wrap: wrap; }
    .attachment-upload-grid,
    .attachment-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .print-settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
    .metric-grid { grid-template-columns: 1fr; }
    .hero-strip { align-items: stretch; flex-direction: column; }
    .hero-strip .btn { width: 100%; }
    .transaction-row { padding: .9rem 1rem; gap: .7rem; }
    .transaction-icon { width: 36px; height: 36px; }
    .transaction-meta { gap: .15rem .6rem; }
    .warehouse-check-grid { grid-template-columns: 1fr; }
    .photo-preview-grid, .evidence-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sticky-submit { width: 100%; bottom: .5rem; }
    .sticky-submit .btn { flex: 1; font-size: .9rem; }
    .detail-topbar { align-items: flex-start; flex-direction: column; }
    .detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); }
    .detail-facts > div { min-width: 0; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid .detail-span { grid-column: auto; }
    .label-grid { grid-template-columns: minmax(0, 360px); }
    .label-toolbar { grid-template-columns: 1fr; }
    .label-toolbar .btn { width: 100%; }
    .layout-options { grid-template-columns: 1fr; }
    .label-preview-page { min-height: 300px; }
    .label-preview-page.layout-3x2 .label-brand { letter-spacing: 0; }
    .label-preview-page.layout-3x2 .qr-code,
    .label-preview-page.layout-3x2 .qr-code img { width: 58px !important; height: 58px !important; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .btn { width: 100%; }
    .form-page-top { align-items: flex-start; }
    .transaction-topbar { align-items: stretch; flex-direction: column; }
    .transaction-top-actions { justify-content: flex-start; }
    .transaction-top-actions > .btn,
    .transaction-top-actions > .dropdown { flex: 1 1 auto; }
    .transaction-top-actions > .dropdown > .btn { width: 100%; }
    .section-heading { align-items: flex-start; }
    .item-section-heading { align-items: stretch; flex-direction: column; }
    .item-section-heading .btn { width: 100%; }
    .barcode-control { grid-template-columns: minmax(0, 1fr) auto; }
    .barcode-control .barcode-input { grid-column: 1 / -1; }
    .barcode-control .btn { min-height: 46px; }
    .upload-choice-grid,
    .attachment-upload-grid,
    .attachment-card-grid { grid-template-columns: 1fr; }
    .sticky-submit {
        position: static;
        width: 100%;
        margin-inline: 0;
        padding: .55rem;
        box-shadow: none;
        backdrop-filter: none;
    }
    .history-grid { grid-template-columns: 1fr; }
    .history-grid > section + section { border-top: 1px solid var(--line); border-left: 0; }
    .revision-request-card { grid-template-columns: 1fr; }
    .accurate-form-actions { align-items: stretch; flex-direction: column-reverse; }
    .accurate-form-actions .btn { width: 100%; }
    .label-toolbar-actions { align-items: stretch; flex-direction: column; }
    .print-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .action-grid { grid-template-columns: 1fr; }
    .action-card { min-height: 125px; }
    :is(#transactionTypeModal, #createTransactionModal) .modal-body.action-grid { grid-template-columns: 1fr; }
    .detail-facts { grid-template-columns: 1fr; }
    .photo-preview-grid, .evidence-grid { grid-template-columns: 1fr; }
    .form-page-top { flex-direction: column; }
    .form-page-top > div { padding-top: .8rem; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
    .revision-alert-card { padding: 1rem; }
    .revision-alert-icon { width: 32px; height: 32px; }
    .transaction-tabs { padding-inline: .35rem; }
    .transaction-tabs .nav-link { min-height: 52px; padding-inline: .75rem; font-size: .82rem; }
    .content-section { padding: 1rem; }
    .audit-readable { grid-template-columns: 1fr; }
    .audit-readable p { grid-column: auto; }
    .section-title-row { align-items: flex-start; }
    .label-grid { grid-template-columns: minmax(0, 1fr); }
}

@media print {
    @page { size: A4; margin: 10mm; }
    body { background: #fff; }
    .app-navbar,
    .page-heading,
    .app-footer,
    .no-print,
    .modal,
    .modal-backdrop,
    .screen-labels,
    .searchable-select-toggle,
    .searchable-select-menu,
    .searchable-select-error { display: none !important; }
    .searchable-select-input { padding: 0; border: 0; box-shadow: none; }
    main.container-fluid { max-width: none; padding: 0 !important; }
    .print-stage { display: block !important; }
    .label-print-page {
        display: grid;
        align-content: start;
        width: 190mm;
        min-height: 277mm;
        gap: 5mm;
        break-after: page;
        page-break-after: always;
    }
    .label-print-page:last-child { break-after: auto; page-break-after: auto; }
    .label-print-page.layout-1x1 { grid-template-columns: 1fr; }
    .label-print-page.layout-2x2 { grid-template-columns: repeat(2, 92.5mm); grid-template-rows: repeat(2, 133mm); }
    .label-print-page.layout-3x2 { grid-template-columns: repeat(3, 60mm); grid-template-rows: repeat(2, 133mm); }
    .label-print-page .batch-label { min-width: 0; max-height: 133mm; box-shadow: none; border-radius: 0; padding: 4mm; overflow: hidden; }
    .label-print-page.layout-1x1 .batch-label { min-height: 250mm; justify-content: center; }
    .label-print-page.layout-3x2 .batch-label { padding: 2.5mm; }
    .label-print-page.layout-3x2 .label-brand { font-size: 8pt; letter-spacing: .04em; }
    .label-print-page.layout-3x2 .label-brand img { width: 7mm; height: 7mm; }
    .label-print-page.layout-3x2 .qr-code,
    .label-print-page.layout-3x2 .qr-code img { width: 30mm !important; height: 30mm !important; }
    .label-print-page.layout-3x2 .batch-code { font-size: 8pt; }
    .label-print-page.layout-3x2 h2 { font-size: 10pt; margin: 2mm 0; }
    .label-print-page.layout-3x2 dl { font-size: 7pt; }
    .label-actions { display: none !important; }
}
.xml-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.xml-summary-grid article {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.9rem;
    background: var(--surface-soft, #f7f4ee);
}

.xml-summary-grid span {
    color: var(--bs-secondary-color);
    font-size: 0.78rem;
}

.xml-download-card {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid rgba(115, 75, 35, 0.18);
    border-radius: 1rem;
    background: #fff;
}

@media (max-width: 767.98px) {
    .xml-summary-grid {
        grid-template-columns: 1fr;
    }

    .xml-download-card {
        align-items: stretch;
        flex-direction: column;
    }
}

.notification-event-option {
    display: flex;
    gap: .65rem;
    align-items: flex-start;
    padding: .75rem .85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: #fff;
}
.notification-event-option .form-check-input {
    margin-top: .2rem;
    flex: 0 0 auto;
}
.cron-command {
    padding: .85rem;
    border-radius: .75rem;
    background: #f4f0ea;
    color: #3a2418;
    overflow-wrap: anywhere;
}
.notification-message-row td {
    padding-top: 0;
    border-top: 0;
}
.notification-message-row details {
    font-size: .82rem;
    color: #6c625b;
}
.notification-message-row pre {
    margin: .75rem 0 0;
    padding: .85rem;
    border-radius: .65rem;
    background: #f8f6f2;
    white-space: pre-wrap;
    font: inherit;
    color: #33261f;
}

/* v3.60 - keamanan, pengumuman, maintenance, pelacakan, dan pembayaran */

/* v3.70 - monitoring inventori dan tindak lanjut terkontrol */
.health-action-details {
    position: relative;
    min-width: 120px;
}
.health-action-details > summary {
    list-style: none;
    cursor: pointer;
}
.health-action-details > summary::-webkit-details-marker { display: none; }
.health-action-panel {
    width: min(320px, 82vw);
    margin-top: .75rem;
    padding: 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 14px 35px rgba(33, 24, 17, .14);
}
.security-state-warning {
    background: #fff3cd;
    color: #775500;
}
.security-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.security-state {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem .75rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 750;
    white-space: nowrap;
}
.security-state::before {
    width: .55rem;
    height: .55rem;
    content: "";
    border-radius: 50%;
    background: currentColor;
}
.security-state-ok { color: #176c49; background: #e6f5ed; }
.security-metric {
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}
.security-metric span { color: var(--muted); font-weight: 650; }
.security-metric strong { font-size: 1.7rem; }
.security-table-wrap { max-height: 410px; }
.admin-editor-card { top: 6.5rem; }
.target-chip-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.target-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 36px;
    margin: 0;
    padding: .4rem .65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}
.target-chip.is-fixed {
    color: #fff;
    border-color: var(--green-700);
    background: var(--green-700);
    font-size: .88rem;
    font-weight: 700;
}
.announcement-modal { overflow: hidden; border: 0; border-radius: 20px; }
.announcement-modal-image {
    display: block;
    width: 100%;
    max-height: min(55vh, 520px);
    margin: 1rem 0;
    object-fit: contain;
    border-radius: 14px;
    background: #f6f2eb;
}
.announcement-modal-message {
    color: #4f463f;
    line-height: 1.7;
    white-space: normal;
}
.maintenance-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(circle at top left, rgba(166,124,72,.2), transparent 34rem),
        #f6f2eb;
}
.maintenance-card {
    width: min(680px, 100%);
    padding: clamp(1.5rem, 5vw, 3rem);
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(43,33,27,.12);
}
.maintenance-logo {
    width: 74px;
    height: 74px;
    margin-bottom: 1.2rem;
    border-radius: 50%;
    object-fit: cover;
}
.maintenance-card h1 {
    margin-bottom: 1rem;
    font-size: clamp(1.75rem, 5vw, 2.5rem);
}
.maintenance-image {
    width: 100%;
    max-height: 48vh;
    margin: 1rem 0;
    object-fit: contain;
    border-radius: 16px;
    background: #f7f4ef;
}
.maintenance-message {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}
.maintenance-time {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem 1rem;
    margin-top: 1.25rem;
    color: #6f6258;
    font-size: .86rem;
}
.maintenance-login-notice {
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    color: #664512;
    border: 1px solid #efd49d;
    border-radius: 12px;
    background: #fff7e6;
    font-size: .9rem;
}
@media (max-width: 767.98px) {
    .security-summary { align-items: flex-start; flex-direction: column; }
    .security-metric { min-height: 76px; }
    .admin-editor-card { position: static !important; }
}

/* v4.10 - pusat administrasi, keamanan akun, dan autentikasi dua langkah */
.admin-hub-intro {
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, #fff 0%, #f5eee4 100%);
    box-shadow: var(--shadow);
}
.admin-hub-card {
    display: flex;
    min-height: 118px;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    gap: .4rem;
    padding: 1.25rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.admin-hub-card:hover,
.admin-hub-card:focus-visible {
    color: var(--ink);
    border-color: #b98852;
    box-shadow: 0 16px 35px rgba(44, 30, 20, .11);
    transform: translateY(-2px);
}
.admin-hub-card span { color: var(--muted); font-size: .9rem; line-height: 1.45; }
.policy-switch-card {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #faf8f4;
}
.policy-switch-card .form-check-input { flex: 0 0 auto; margin-top: .25rem; }
.policy-switch-card label { display: grid; gap: .25rem; }
.policy-switch-card label span { color: var(--muted); font-size: .9rem; }
.totp-setup-grid {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
}
.totp-qr {
    display: grid;
    width: 244px;
    min-height: 244px;
    place-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.totp-qr img,
.totp-qr canvas { max-width: 100%; height: auto; }
.totp-secret,
.recovery-key-box {
    padding: .9rem 1rem;
    overflow-wrap: anywhere;
    color: #2b1d16;
    border: 1px dashed #b98852;
    border-radius: 12px;
    background: #fff9ee;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 750;
    letter-spacing: .06em;
}
.totp-code-input { letter-spacing: .22em; font-weight: 750; }
@media (max-width: 767.98px) {
    .totp-setup-grid { grid-template-columns: 1fr; }
    .totp-qr { width: 100%; }
    .admin-hub-card { min-height: 96px; }
}

/* v4.11 - motion system dan penyempurnaan interaksi */
:root {
    --motion-fast: 120ms;
    --motion-base: 180ms;
    --motion-slow: 260ms;
    --motion-ease: cubic-bezier(.2, .8, .2, 1);
    --motion-ease-out: cubic-bezier(.16, 1, .3, 1);
}

html { scroll-behavior: smooth; }

.btn,
.dropdown-item,
.navbar .nav-link,
.user-menu,
.form-control,
.form-select,
.searchable-select-input,
.searchable-select-toggle,
.searchable-select-option,
.pagination .page-link,
.nav-tabs .nav-link,
.transaction-row,
.upload-card,
.attachment-card,
.selected-file-chip,
.policy-switch-card,
.form-check-input {
    transition:
        color var(--motion-fast) ease,
        background-color var(--motion-fast) ease,
        border-color var(--motion-fast) ease,
        box-shadow var(--motion-base) ease,
        opacity var(--motion-base) ease,
        transform var(--motion-base) var(--motion-ease);
}

.btn:not(:disabled):not(.disabled):active {
    transform: translateY(1px) scale(.985);
}

.btn.is-processing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    cursor: wait;
}

.btn.is-processing::before {
    width: .92rem;
    height: .92rem;
    flex: 0 0 .92rem;
    content: "";
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: bk-spin .65s linear infinite;
}

.navbar .nav-link {
    position: relative;
}

.navbar .nav-link::after {
    position: absolute;
    right: .8rem;
    bottom: .22rem;
    left: .8rem;
    height: 2px;
    content: "";
    border-radius: 999px;
    background: var(--amber);
    opacity: 0;
    transform: scaleX(.35);
    transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease-out);
}

.navbar .nav-link.is-current {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.navbar .nav-link.is-current::after {
    opacity: 1;
    transform: scaleX(1);
}

.navbar button.nav-link.dropdown-toggle::after {
    position: static;
    width: auto;
    height: auto;
    margin-left: .3em;
    vertical-align: .18em;
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
    border-radius: 0;
    background: transparent;
    opacity: 1;
    transform: none;
    transition: transform var(--motion-base) var(--motion-ease);
}

.navbar button.nav-link.dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.navbar-toggler {
    transition: border-color var(--motion-fast) ease, background-color var(--motion-fast) ease, transform var(--motion-fast) ease;
}

.navbar-toggler:active { transform: scale(.96); }

.dropdown-menu.show,
.searchable-select-menu:not([hidden]) {
    transform-origin: top center;
    animation: bk-popover-in var(--motion-base) var(--motion-ease-out) both;
}

.modal.fade .modal-dialog {
    transform: translateY(12px) scale(.985);
    transition: transform var(--motion-slow) var(--motion-ease-out);
}

.modal.show .modal-dialog { transform: none; }
.modal-backdrop.fade { transition: opacity var(--motion-base) ease; }

.alert {
    animation: bk-notice-in var(--motion-slow) var(--motion-ease-out) both;
}

.alert.fade {
    transition: opacity var(--motion-base) ease, transform var(--motion-base) var(--motion-ease);
}

.alert.fade:not(.show) { transform: translateY(-6px); }

.motion-enabled .motion-enter {
    opacity: 0;
    transform: translateY(9px);
}

.motion-enabled.motion-ready .motion-enter {
    animation: bk-content-enter var(--motion-slow) var(--motion-ease-out) both;
    animation-delay: var(--motion-delay, 0ms);
}

.content-refreshed {
    animation: bk-content-refresh var(--motion-base) var(--motion-ease-out) both;
}

[data-ajax-list][aria-busy="true"],
[data-live-region][aria-busy="true"],
[data-partial-list][aria-busy="true"] {
    opacity: .66;
    transition: opacity var(--motion-base) ease;
}

.selected-file-chip { animation: bk-chip-in var(--motion-base) var(--motion-ease-out) both; }

.scanner-status {
    position: relative;
    overflow: hidden;
}

.scanner-status::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    content: "";
    background: var(--green-500);
    transform: scaleY(.45);
    transition: transform var(--motion-base) var(--motion-ease-out);
}

.scanner-status:not(:empty)::before { transform: scaleY(1); }

@media (hover: hover) and (pointer: fine) {
    .action-card:hover,
    .admin-hub-card:hover,
    .attachment-card:hover {
        transform: translateY(-2px);
    }

    .upload-card:hover { transform: translateY(-1px); }
    .transaction-row:hover { transform: translateX(2px); }
}

/* Bootstrap memberi margin negatif pada switch. Layout kartu v4.11 menetralkannya. */
.policy-switch-card {
    width: 100%;
    min-width: 0;
    padding: 1rem;
    padding-left: 1rem;
    cursor: pointer;
}

.policy-switch-card .form-check-input {
    width: 2.5em;
    min-width: 2.5em;
    height: 1.35em;
    margin-top: .15rem;
    margin-left: 0;
    cursor: pointer;
}

.policy-switch-card .policy-switch-copy {
    min-width: 0;
    flex: 1 1 auto;
    cursor: pointer;
}

.policy-switch-card:focus-within {
    border-color: var(--green-500);
    box-shadow: 0 0 0 .2rem rgba(106, 68, 36, .1);
}

@keyframes bk-content-enter {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
}

@keyframes bk-content-refresh {
    from { opacity: .55; transform: translateY(3px); }
    to { opacity: 1; transform: none; }
}

@keyframes bk-popover-in {
    from { opacity: 0; transform: translateY(-5px) scale(.985); }
    to { opacity: 1; transform: none; }
}

@keyframes bk-notice-in {
    from { opacity: 0; transform: translateY(-7px); }
    to { opacity: 1; transform: none; }
}

@keyframes bk-chip-in {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: none; }
}

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

@media (max-width: 991.98px) {
    .navbar-collapse.show .nav-item {
        animation: bk-mobile-nav-in var(--motion-base) var(--motion-ease-out) both;
    }
    .navbar-collapse.show .nav-item:nth-child(2) { animation-delay: 24ms; }
    .navbar-collapse.show .nav-item:nth-child(3) { animation-delay: 48ms; }
    .navbar-collapse.show .nav-item:nth-child(4) { animation-delay: 72ms; }
    .navbar-collapse.show .nav-item:nth-child(5) { animation-delay: 96ms; }
    .navbar-collapse.show .nav-item:nth-child(6) { animation-delay: 120ms; }
    .navbar .nav-link::after { right: auto; left: .8rem; width: 28px; }
}

@media (max-width: 575.98px) {
    .policy-switch-card { gap: .75rem; padding: .9rem; }
    .policy-switch-card .policy-switch-copy { line-height: 1.4; }
}

@keyframes bk-mobile-nav-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .motion-enabled .motion-enter {
        opacity: 1;
        transform: none;
    }
}

/* v4.14 - monitoring lifecycle barcode */
.inventory-health-guide {
    background: linear-gradient(135deg, rgba(255, 255, 255, .98), rgba(246, 240, 232, .92));
}

.inventory-health-guide .col-md-4 + .col-md-4 {
    border-left: 1px solid var(--border-color, #eadfce);
}

.inventory-health-table th {
    white-space: nowrap;
}

.inventory-health-table td {
    min-width: 150px;
    vertical-align: top;
}

.inventory-health-table td:nth-child(2) {
    min-width: 220px;
}

.health-balance-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .15rem 0;
    font-size: .875rem;
}

.health-modal-identity {
    display: grid;
    gap: .2rem;
    padding: .9rem 1rem;
    border: 1px solid var(--border-color, #eadfce);
    border-radius: .8rem;
    background: #faf7f2;
}

.health-modal-identity strong {
    font-family: var(--bs-font-monospace);
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .inventory-health-guide .col-md-4 + .col-md-4 {
        border-left: 0;
        border-top: 1px solid var(--border-color, #eadfce);
        padding-top: 1rem;
    }
}
