:root {
    --ink: #17211f;
    --muted: #66716f;
    --line: #dfe4df;
    --paper: #f5f5ef;
    --white: #fff;
    --green: #153f3b;
    --green-2: #1f5851;
    --mint: #d8eee7;
    --accent: #ee9e45;
    --accent-dark: #9c5716;
    --danger: #9f3e32;
    --shadow: 0 18px 50px rgba(26, 47, 42, .08);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { height: 74px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: rgba(245,245,239,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-family: Manrope, sans-serif; letter-spacing: -.8px; font-size: 21px; }
.brand b { color: var(--accent-dark); margin-left: 3px; }
.brand-mark { width: 31px; height: 31px; display: flex; gap: 3px; align-items: flex-end; padding: 6px; background: var(--green); border-radius: 9px; transform: rotate(-2deg); }
.brand-mark span { width: 4px; background: var(--mint); border-radius: 3px; }
.brand-mark span:nth-child(1) { height: 11px; }.brand-mark span:nth-child(2) { height: 18px; background: var(--accent); }.brand-mark span:nth-child(3) { height: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; padding: 8px 12px; color: var(--muted); font-size: 12px; background: var(--white); }
.connection-pill i { width: 7px; height: 7px; border-radius: 50%; background: #50a576; box-shadow: 0 0 0 3px #dff1e5; }
.connection-pill.offline i { background: var(--danger); box-shadow: 0 0 0 3px #f5dfdc; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--green); font-size: 20px; }
main { max-width: 1500px; margin: 0 auto; padding: 40px clamp(20px, 4vw, 64px) 70px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 9px; color: var(--accent-dark); font-weight: 800; font-size: 10px; letter-spacing: 1.7px; }
h1, h2 { font-family: Manrope, sans-serif; margin: 0; letter-spacing: -.04em; }
h1 { font-size: clamp(32px, 4vw, 52px); line-height: 1.03; max-width: 760px; }
h1 span { color: var(--green-2); }
.shipment-controls { width: min(490px, 100%); }
.shipment-controls > label, .manual-scan > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.select-row { display: flex; gap: 10px; }
select, input, textarea { width: 100%; border: 1px solid #cfd7d1; border-radius: 10px; background: var(--white); color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
select, input { height: 44px; padding: 0 13px; }
textarea { padding: 11px 13px; resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(31,88,81,.12); }
.button { border: 0; border-radius: 10px; min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; white-space: nowrap; transition: transform .15s, filter .15s, background .15s; }
.button:hover { filter: brightness(.97); }.button:active { transform: translateY(1px); }.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { background: var(--green); color: #fff; }
.button-secondary { background: var(--white); border: 1px solid #cfd7d1; color: var(--green); }
.button-accent { background: var(--accent); color: #2e251d; }
.button-ghost { background: transparent; color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.metric-card { min-height: 126px; padding: 20px; background: var(--white); border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 4px 20px rgba(26,47,42,.03); }
.metric-card > span, .progress-top span { color: var(--muted); font-size: 12px; font-weight: 600; }
.metric-card > strong { font-family: Manrope, sans-serif; font-size: clamp(24px, 2.2vw, 32px); letter-spacing: -.04em; margin: 7px 0 1px; }
.metric-card small { color: #84908d; font-size: 11px; }
.metric-due { background: #fff8ec; border-color: #efd5ad; }
.metric-due > strong { color: var(--accent-dark); }
.progress-card { gap: 14px; }
.progress-top { display: flex; justify-content: space-between; align-items: center; }
.progress-top strong { color: var(--green); font-family: Manrope, sans-serif; font-size: 22px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8ece8; }
.progress-track i { display: block; height: 100%; width: 0; background: var(--green-2); border-radius: inherit; transition: width .35s ease; }
.scan-section { display: grid; grid-template-columns: 1.25fr .75fr; min-height: 280px; margin-bottom: 16px; overflow: hidden; border-radius: 18px; background: var(--green); color: #fff; box-shadow: var(--shadow); }
.scan-copy { padding: clamp(24px, 4vw, 42px); }
.eyebrow.light { color: #f2b96f; }
.scan-copy h2 { max-width: 660px; font-size: clamp(27px, 3vw, 41px); line-height: 1.06; }
.scan-copy > p:not(.eyebrow) { margin: 12px 0 22px; color: #bfd0cc; font-size: 14px; }
.manual-scan { max-width: 720px; }
.manual-scan > label { color: #ccdad7; }
.scan-input-row { display: grid; grid-template-columns: minmax(160px, 1fr) 90px auto; gap: 8px; }
.scan-input-row input, .scan-input-row select { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; }
.scan-input-row input::placeholder { color: #9fb7b2; }
.scan-input-row select option { color: var(--ink); }
.scan-actions { display: flex; align-items: center; gap: 18px; margin-top: 13px; }
.camera-button { background: #fff; color: var(--green); }
.text-button { padding: 6px 0; border: 0; background: none; text-decoration: underline; text-underline-offset: 3px; }
.light-button { color: #c8d7d4; font-size: 12px; }
.camera-stage { position: relative; min-height: 280px; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #387069, #0b2f2c); }
.camera-stage::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; display: none; }
.camera-stage.active video { display: block; }.camera-stage.active .camera-placeholder { display: none; }
.camera-placeholder { text-align: center; color: #dce7e5; position: relative; z-index: 1; }
.camera-placeholder strong, .camera-placeholder small { display: block; }.camera-placeholder strong { margin: 17px 0 3px; }.camera-placeholder small { color: #99b4ae; }
.scan-corners { display: block; width: 128px; height: 76px; margin: auto; border: 2px solid rgba(255,255,255,.8); border-left-color: var(--accent); border-right-color: var(--accent); border-radius: 10px; position: relative; }
.scan-corners::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.close-camera { position: absolute; z-index: 3; right: 12px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,.52); font-size: 22px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 4px 22px rgba(26,47,42,.035); }
.panel-heading { padding: 21px 23px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #e7ebe7; }
.panel-heading h2 { font-size: 20px; }.panel-heading .eyebrow { margin-bottom: 3px; }
.panel-actions { display: flex; gap: 8px; }
.filter-input { position: relative; width: 210px; }.filter-input span { position: absolute; left: 12px; top: 9px; color: var(--muted); font-size: 19px; }.filter-input input { padding-left: 35px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 16px; color: #84908d; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; background: #fafbf8; white-space: nowrap; }
td { padding: 15px 16px; border-top: 1px solid #edf0ed; white-space: nowrap; }
.product-cell { min-width: 210px; white-space: normal; }.product-cell strong { display: block; font-size: 13px; }.product-cell small { color: var(--muted); }
.money-due { font-weight: 800; color: var(--accent-dark); }
.status { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status.complete { background: #e0f1e8; color: #28704e; }.status.pending { background: #fff0db; color: #8a531a; }.status.partial { background: #e8eeee; color: #41635e; }
.mobile-items { display: none; }
.no-results { text-align: center; color: var(--muted); padding: 40px; }
.activity-panel { display: flex; flex-direction: column; }
.panel-heading.compact { padding: 21px 20px; }
.activity-list { padding: 7px 20px; flex: 1; }
.activity-item { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0ed; }
.activity-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; color: #26664d; background: #e2f2ea; font-weight: 800; }
.activity-item.undo .activity-icon { color: #8a531a; background: #fff0db; }.activity-item strong { display: block; font-size: 12px; }.activity-item small { color: var(--muted); font-size: 10px; }.activity-qty { font-weight: 800; color: var(--green); font-size: 12px; }
.activity-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 35px 5px; }
.settlement { margin: 16px; padding: 18px; background: var(--paper); border-radius: 12px; }.settlement > div { display: flex; justify-content: space-between; align-items: baseline; }.settlement span { font-size: 11px; color: var(--muted); }.settlement strong { color: var(--accent-dark); font-family: Manrope, sans-serif; font-size: 21px; }.settlement p { margin: 10px 0 15px; color: var(--muted); font-size: 10px; line-height: 1.45; }.full { width: 100%; }
.empty-state { max-width: 650px; margin: 70px auto; padding: 50px; background: var(--white); border: 1px solid var(--line); border-radius: 20px; text-align: center; box-shadow: var(--shadow); }.empty-icon { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 18px; background: var(--mint); color: var(--green); font-family: Manrope, sans-serif; font-weight: 800; font-size: 24px; }.empty-state h2 { font-size: 30px; }.empty-state > p:not(.eyebrow) { color: var(--muted); margin: 10px auto 22px; max-width: 440px; }
.modal { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 90px rgba(10, 30, 26, .3); }.modal-wide { width: min(850px, calc(100% - 28px)); }.modal::backdrop { background: rgba(10, 30, 26, .55); backdrop-filter: blur(4px); }.modal-card { padding: 28px; position: relative; }.modal-card h2 { font-size: 28px; }.modal-description { color: var(--muted); margin: 7px 0 23px; font-size: 13px; }.modal-close { position: absolute; right: 19px; top: 17px; width: 35px; height: 35px; border: 0; border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 22px; }.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }.item-form-grid { grid-template-columns: repeat(3, 1fr); }.form-grid label > span { display: block; color: #52605d; margin-bottom: 6px; font-size: 11px; font-weight: 700; }.full-field { grid-column: 1 / -1; }.span-2 { grid-column: span 2; }.money-input { display: flex; align-items: center; border: 1px solid #cfd7d1; border-radius: 10px; background: #fff; }.money-input:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(31,88,81,.12); }.money-input b { padding-left: 12px; color: var(--muted); font-size: 11px; }.money-input input { border: 0; box-shadow: none; padding-left: 8px; }.money-input.disabled { background: #f0f2ef; }.money-input.disabled input { background: transparent; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 24px; max-width: min(420px, calc(100% - 32px)); padding: 13px 18px; border-radius: 10px; color: #fff; background: var(--green); box-shadow: 0 12px 40px rgba(0,0,0,.2); transform: translate(-50%, 130%); opacity: 0; transition: .25s ease; font-size: 13px; font-weight: 600; }.toast.show { transform: translate(-50%, 0); opacity: 1; }.toast.error { background: var(--danger); }
body.busy::after { content: ""; position: fixed; z-index: 90; right: 22px; bottom: 22px; width: 22px; height: 22px; border: 3px solid #dce6e3; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1080px) {
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }.activity-panel { min-height: 300px; }
}
@media (max-width: 780px) {
    .topbar { height: 64px; padding: 0 17px; }.desktop-only { display: none; }
    main { padding: 25px 14px 80px; }.page-heading { display: block; margin-bottom: 23px; }.page-heading h1 { margin-bottom: 24px; }.shipment-controls { width: 100%; }.select-row { display: grid; grid-template-columns: 1fr auto; }
    .scan-section { grid-template-columns: 1fr; }.camera-stage { order: -1; min-height: 200px; }.scan-copy { padding: 24px 18px 26px; }.scan-copy h2 { font-size: 27px; }.scan-input-row { grid-template-columns: 1fr 82px; }.scan-input-row .button { grid-column: 1 / -1; }.scan-actions { justify-content: space-between; }
    .panel-heading { display: block; padding: 18px; }.panel-actions { margin-top: 15px; }.filter-input { flex: 1; width: auto; }
    .table-wrap { display: none; }.mobile-items { display: block; }.mobile-item { padding: 17px 18px; border-top: 1px solid #edf0ed; }.mobile-item:first-child { border-top: 0; }.mobile-product { display: flex; justify-content: space-between; gap: 12px; }.mobile-product strong { display: block; font-size: 13px; }.mobile-product small { color: var(--muted); font-size: 10px; }.mobile-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }.mobile-counts div { padding: 9px; border-radius: 8px; background: var(--paper); }.mobile-counts span { display: block; color: var(--muted); font-size: 9px; }.mobile-counts b { font-size: 13px; }.mobile-value { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }.mobile-value strong { color: var(--accent-dark); font-size: 15px; }
    .item-form-grid, .form-grid { grid-template-columns: 1fr 1fr; }.span-2 { grid-column: span 2; }
}
@media (max-width: 520px) {
    .brand { font-size: 19px; }.metrics { grid-template-columns: 1fr 1fr; gap: 8px; }.metric-card { min-height: 112px; padding: 15px; }.metric-card > strong { font-size: 21px; }.metric-card small { font-size: 9px; }.progress-card { grid-column: 1 / -1; }.shipment-controls .button { width: 45px; padding: 0; font-size: 0; }.shipment-controls .button span { font-size: 18px; }
    .panel-actions { display: grid; grid-template-columns: 1fr auto; }.panel-actions .button { width: 44px; padding: 0; font-size: 0; }.panel-actions .button::first-letter { font-size: 18px; }
    .item-form-grid, .form-grid { grid-template-columns: 1fr; }.span-2, .full-field { grid-column: 1; }.modal-card { padding: 24px 18px; }.modal { max-height: calc(100vh - 24px); overflow-y: auto; }
}

