:root {
    --bg: #f4f8f7;
    --surface: #ffffff;
    --surface-strong: #e8f3f0;
    --ink: #17312f;
    --muted: #687a77;
    --line: #d9e5e2;
    --accent: #0f766e;
    --accent-dark: #0b5f59;
    --warn: #b7791f;
    --blue: #2563eb;
    --shadow: 0 18px 55px rgba(20, 64, 61, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.modal-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    background: #0e2e2b;
    color: #fff;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(6, 36, 33, 0.18);
    overflow: hidden;
    flex: 0 0 auto;
}

.brand-mark img {
    display: block;
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    object-fit: contain;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    margin-top: 2px;
    color: #a6c9c4;
    font-size: 12px;
}

.nav-list {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.nav-list a {
    padding: 12px 14px;
    border-radius: 8px;
    color: #d7ebe8;
    text-decoration: none;
    font-weight: 600;
}

.nav-list a.active,
.nav-list a:hover {
    background: rgba(84, 214, 198, 0.16);
    color: #fff;
}

.main {
    min-width: 0;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.user-chip span {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
}

.user-chip strong {
    font-size: 13px;
}

.logout-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.topbar h1,
.hero-panel h2,
.section-heading h2 {
    margin: 0;
}

.topbar h1 {
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.icon-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}

.icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--ink);
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(8, 42, 39, 0.72), rgba(11, 95, 89, 0.78)),
        url("https://images.unsplash.com/photo-1546026423-cc4642628d2b?auto=format&fit=crop&w=1600&q=80") center/cover;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    gap: 28px;
    min-height: 100vh;
    align-items: center;
    padding: 34px;
}

.login-visual {
    display: grid;
    min-height: calc(100vh - 68px);
    align-content: space-between;
    color: #fff;
}

.login-brand {
    width: max-content;
}

.login-visual .eyebrow {
    color: #9ff0e5;
}

.login-visual h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(36px, 6vw, 76px);
    line-height: 1;
}

.login-visual p:not(.eyebrow) {
    max-width: 640px;
    color: #d9f1ee;
    font-size: 17px;
    line-height: 1.7;
}

.login-panel {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.login-heading h2 {
    margin: 0 0 18px;
    font-size: 28px;
}

.login-alert {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid #f5b5ae;
    border-radius: 8px;
    background: #fff1ef;
    color: #b42318;
    font-size: 13px;
    font-weight: 800;
}

.login-form {
    display: grid;
    gap: 16px;
}

.role-options {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.role-options legend {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.role-options label {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.role-options input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.role-options strong,
.role-options small {
    display: block;
}

.role-options small {
    margin-top: 3px;
    color: var(--muted);
    line-height: 1.45;
}

.login-form > label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.login-form input[type="password"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

.demo-accounts {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 12px;
}

.demo-accounts strong {
    color: var(--ink);
}

.public-trace-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(8, 42, 39, 0.72), rgba(11, 95, 89, 0.78)),
        url("https://images.unsplash.com/photo-1546026423-cc4642628d2b?auto=format&fit=crop&w=1600&q=80") center/cover fixed;
}

.public-trace-shell {
    display: grid;
    gap: 24px;
    width: min(960px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.public-trace-brand {
    width: max-content;
    color: #fff;
}

.public-trace-panel {
    padding: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.public-trace-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.public-trace-header h1 {
    margin: 0;
    font-size: clamp(30px, 6vw, 56px);
    line-height: 1;
}

.public-trace-header p,
.public-trace-panel > p {
    color: var(--muted);
    line-height: 1.6;
}

.public-trace-photo {
    display: block;
    width: 100%;
    max-height: 420px;
    margin-bottom: 18px;
    border-radius: 8px;
    object-fit: cover;
}

.public-trace-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.public-trace-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
}

.public-trace-grid span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.public-trace-grid strong {
    display: block;
    line-height: 1.45;
}

.hero-panel {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(120deg, rgba(15, 118, 110, 0.9), rgba(17, 80, 104, 0.86)),
        url("https://images.unsplash.com/photo-1546026423-cc4642628d2b?auto=format&fit=crop&w=1400&q=80") center/cover;
    color: #fff;
    box-shadow: var(--shadow);
}

.hero-panel .eyebrow {
    color: #9ff0e5;
}

.hero-panel h2 {
    max-width: 800px;
    font-size: clamp(27px, 4vw, 52px);
    line-height: 1.04;
}

.hero-actions,
.input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.primary-button,
.secondary-button,
.danger-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.primary-button {
    background: var(--accent);
    color: #fff;
}

.primary-button:hover {
    background: var(--accent-dark);
}

.secondary-button {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.danger-button {
    border: 1px solid #f2b8b5;
    background: #fff1f0;
    color: #b42318;
}

.danger-button:hover {
    background: #ffe1de;
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.68;
}

.hero-panel .secondary-button {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.small {
    min-height: 36px;
    padding-inline: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.stats-grid article,
.panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 35px rgba(20, 64, 61, 0.06);
}

.stats-grid article {
    padding: 18px;
}

.stats-grid span,
.stats-grid small,
td small,
.activity-list small {
    color: var(--muted);
}

.stats-grid strong {
    display: block;
    margin: 8px 0;
    font-size: 30px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 18px;
    align-items: start;
}

.panel {
    padding: 20px;
}

.wide {
    grid-column: span 1;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-heading h2 {
    font-size: 21px;
}

.section-actions,
.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.coral-form {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
}

.form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.form-head h3 {
    margin: 0;
    font-size: 18px;
}

.form-badge {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.coral-form label,
.inventory-toolbar label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.coral-form input,
.coral-form select,
.coral-form textarea,
.inventory-toolbar input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

.coral-form textarea {
    min-height: 88px;
    padding-block: 10px;
    resize: vertical;
}

.full-field {
    grid-column: 1 / -1;
}

.form-actions {
    justify-content: flex-end;
}

.form-actions p {
    flex: 1;
    margin: 0;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
}

.inventory-toolbar {
    display: grid;
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 1180px;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td strong,
td small {
    display: block;
}

.status-pill {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-width: 280px;
}

.photo-thumb {
    display: inline-grid;
    width: 74px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #eef5f3;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-thumb.empty {
    padding: 6px;
}

.qr-thumb-link {
    display: inline-flex;
    color: inherit;
    text-decoration: none;
}

.qr-thumb {
    display: grid;
    width: 74px;
    height: 74px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.qr-thumb img,
.qr-thumb canvas {
    width: 70px;
    height: 70px;
}

.location-link {
    display: inline-flex;
    margin-top: 4px;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.map-modal,
.scanner-modal {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(8, 31, 29, 0.64);
}

.map-modal.open,
.scanner-modal.open {
    display: flex;
}

.map-dialog,
.scanner-dialog {
    width: min(920px, 100%);
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.map-header,
.map-footer,
.scanner-header,
.scanner-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
}

.map-header,
.scanner-header {
    border-bottom: 1px solid var(--line);
}

.map-header h2,
.scanner-header h2 {
    margin: 0;
    font-size: 22px;
}

.map-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.map-canvas {
    height: min(62vh, 520px);
    min-height: 360px;
}

.map-footer,
.scanner-footer {
    border-top: 1px solid var(--line);
}

.map-footer p,
.scanner-footer p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.scanner-dialog {
    width: min(620px, 100%);
}

.scanner-stage {
    position: relative;
    display: grid;
    min-height: 360px;
    place-items: center;
    overflow: hidden;
    background: #071f1d;
}

.scanner-stage video {
    width: 100%;
    height: min(64vh, 520px);
    min-height: 360px;
    object-fit: cover;
}

.scanner-frame {
    position: absolute;
    width: min(68vw, 280px);
    aspect-ratio: 1;
    border: 3px solid #54d6c6;
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(4, 22, 20, 0.36);
}

.map-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.progress {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7eeee;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--blue));
}

.trace-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.trace-form input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--ink);
}

.trace-result {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-strong);
}

.trace-result p {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.qr-box {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border: 6px solid #fff;
    border-radius: 8px;
    background: repeating-linear-gradient(45deg, #133f3b 0 7px, #fff 7px 14px);
    color: var(--accent);
    font-weight: 900;
}

.activity-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-list li {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
}

.activity-list time {
    color: var(--accent-dark);
    font-weight: 800;
}

.activity-list strong,
.activity-list small {
    display: block;
}

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

.water-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
}

.water-grid article.watch {
    border-color: #ebc77d;
    background: #fff8e8;
}

.water-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.water-grid strong {
    display: flex;
    gap: 4px;
    align-items: baseline;
    margin-top: 7px;
    font-size: 28px;
}

.water-grid small {
    font-size: 13px;
    color: var(--muted);
}

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

.flow a {
    display: grid;
    min-height: 58px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
    text-align: center;
}

.flow a:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
    color: var(--accent-dark);
}

.traceability-page {
    min-height: 100vh;
    background: var(--bg);
}

.traceability-shell {
    display: grid;
    gap: 20px;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 28px;
}

.traceability-shell .public-trace-brand {
    color: var(--ink);
}

.traceability-panel {
    display: grid;
    gap: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.traceability-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.traceability-header h1 {
    margin: 0;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1;
}

.traceability-header p:not(.eyebrow) {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.6;
}

.traceability-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.traceability-tabs a {
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.traceability-tabs a.active,
.traceability-tabs a:hover {
    border-color: var(--accent);
    background: var(--surface-strong);
    color: var(--accent-dark);
}

.traceability-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.traceability-stats article,
.traceability-card,
.empty-state,
.traceability-note {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
}

.traceability-stats article {
    padding: 14px;
}

.traceability-stats span,
.traceability-card dt {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.traceability-stats strong {
    display: block;
    margin-top: 6px;
    font-size: 30px;
}

.traceability-note {
    padding: 12px 14px;
    background: var(--surface-strong);
    color: var(--accent-dark);
    font-weight: 700;
    line-height: 1.5;
}

.empty-state {
    padding: 18px;
}

.empty-state p {
    margin: 6px 0 0;
    color: var(--muted);
}

.traceability-list {
    display: grid;
    gap: 12px;
}

.traceability-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
    gap: 16px;
    padding: 16px;
    align-items: start;
}

.traceability-card h2 {
    margin: 10px 0 4px;
    font-size: 24px;
}

.traceability-card p {
    margin: 0;
    color: var(--muted);
}

.traceability-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.traceability-card dd {
    margin: 5px 0 0;
    font-weight: 800;
    line-height: 1.45;
}

.traceability-card .progress {
    grid-column: 1 / -1;
}

.traceability-photo {
    display: block;
    width: 100%;
    max-width: 180px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.traceability-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.report-document {
    display: grid;
    gap: 18px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.report-kop {
    padding-bottom: 18px;
    border-bottom: 3px double var(--ink);
    text-align: center;
}

.report-kop h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 38px);
    line-height: 1.05;
    text-transform: uppercase;
}

.report-kop p {
    margin: 7px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.report-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.report-meta div,
.report-summary article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f9fbfb;
}

.report-meta span,
.report-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.report-meta strong,
.report-summary strong {
    display: block;
    margin-top: 6px;
    line-height: 1.35;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-summary strong {
    font-size: 28px;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    min-width: 1180px;
    background: #fff;
}

.report-table th {
    background: var(--surface-strong);
}

.report-table td {
    vertical-align: top;
}

.report-signature {
    display: grid;
    gap: 70px;
    width: 260px;
    justify-self: end;
    margin-top: 16px;
    text-align: center;
}

.report-signature span {
    color: var(--muted);
    font-weight: 800;
}

@media (max-width: 1050px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 20;
        inset: 0 auto 0 0;
        width: min(82vw, 310px);
        transform: translateX(-100%);
        transition: transform 180ms ease;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .icon-button {
        display: block;
        flex: 0 0 auto;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-visual {
        min-height: auto;
        gap: 44px;
    }

    .main {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .traceability-card,
    .traceability-card dl {
        grid-template-columns: 1fr;
    }

    .report-meta,
    .report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        align-items: flex-end;
        flex-direction: column;
    }

    .logout-button,
    .user-chip {
        display: none;
    }

    .login-shell {
        padding: 18px;
    }

    .login-panel {
        padding: 18px;
    }

    .login-visual h1 {
        font-size: 36px;
    }

    .public-trace-shell {
        padding: 18px;
    }

    .public-trace-panel {
        padding: 18px;
    }

    .public-trace-header {
        flex-direction: column;
    }

    .public-trace-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        display: grid;
        min-height: 420px;
        align-content: end;
        padding: 20px;
    }

    .hero-actions,
    .input-row {
        width: 100%;
    }

    .hero-actions button,
    .input-row button {
        flex: 1;
    }

    .stats-grid,
    .form-grid,
    .inventory-toolbar,
    .water-grid,
    .flow,
    .traceability-stats,
    .report-meta,
    .report-summary {
        grid-template-columns: 1fr;
    }

    .traceability-shell {
        padding: 18px;
    }

    .traceability-panel {
        padding: 18px;
    }

    .traceability-header {
        flex-direction: column;
    }

    .report-document {
        padding: 18px;
    }

    .report-signature {
        justify-self: stretch;
        width: 100%;
    }

    .section-heading,
    .form-head,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .section-actions {
        width: 100%;
    }

    .map-header,
    .map-footer,
    .scanner-header,
    .scanner-footer,
    .map-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .map-actions {
        width: 100%;
    }

    .section-actions button,
    .form-actions button,
    .map-actions button {
        flex: 1;
    }

    .map-canvas {
        height: 56vh;
        min-height: 320px;
    }

    .scanner-stage,
    .scanner-stage video {
        min-height: 320px;
    }

    .flow span {
        min-height: 46px;
    }
}
