﻿/* ============================================================
   AgroMix — نظام إدارة المختبر
   Custom RTL design system: forest, sand, and gold.
   ============================================================ */

:root {
    --forest-900: #08251c;
    --forest-800: #0c3327;
    --forest-700: #104434;
    --forest-600: #165943;
    --forest-500: #1f7255;
    --moss-100: #e4efe8;
    --moss-200: #c9dfd2;
    --gold-600: #a9822f;
    --gold-500: #c19a3f;
    --gold-400: #d4b061;
    --gold-100: #f4e9cd;
    --sand-50: #faf7ee;
    --sand-100: #f4efe1;
    --sand-200: #eae2cf;
    --paper: #fffdf8;
    --ink: #1b2a24;
    --ink-soft: #3d4f47;
    --muted: #71817a;
    --line: #e3dcc9;
    --line-strong: #d3c9b1;
    --danger: #a8322a;
    --danger-soft: #fbeae8;
    --success: #1d6f4b;
    --success-soft: #e6f3ec;
    --warning: #93610c;
    --warning-soft: #fbf0d9;
    --info: #255e7a;
    --info-soft: #e6f1f6;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(20, 45, 35, 0.06);
    --shadow: 0 12px 30px -18px rgba(12, 51, 39, 0.35);
    --shadow-lg: 0 30px 60px -30px rgba(8, 37, 28, 0.45);
    --sidebar-width: 276px;
    --font: "Segoe UI", "Tahoma", "Arial", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--sand-50);
    line-height: 1.7;
    font-size: 15px;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

a {
    color: var(--forest-600);
    text-decoration: none;
}

a:hover {
    color: var(--forest-500);
}

img {
    max-width: 100%;
}

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

/* ---------- App shell ---------- */

.app {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 400px at 100% 0%, rgba(193, 154, 63, 0.14), transparent 60%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 14px),
        linear-gradient(170deg, var(--forest-800), var(--forest-900));
    color: #eef4ef;
    z-index: 40;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px 18px 14px;
    color: #fff;
    border-block-end: 1px solid rgba(255, 255, 255, 0.08);
}

.brand:hover {
    color: #fff;
}

.brand-logo {
    display: block;
    width: 100%;
    max-width: 200px;
    height: auto;
    background: #fff;
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.brand-text {
    display: flex;
    justify-content: center;
    line-height: 1.3;
}

.brand-text small {
    color: rgba(238, 244, 239, 0.68);
    font-size: 11.5px;
}

.nav {
    padding: 12px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-label {
    margin: 12px 12px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: rgba(238, 244, 239, 0.42);
    text-transform: uppercase;
}

.nav-label:first-child {
    margin-block-start: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 13px;
    border-radius: 10px;
    color: rgba(238, 244, 239, 0.82);
    font-size: 14px;
    border-inline-start: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.nav-link.is-active {
    background: linear-gradient(270deg, rgba(193, 154, 63, 0.2), rgba(193, 154, 63, 0.04));
    border-inline-start-color: var(--gold-400);
    color: #fff;
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    color: var(--gold-400);
    opacity: 0.9;
}

.sidebar-foot {
    padding: 16px 18px 22px;
    border-block-start: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(212, 176, 97, 0.5);
    color: var(--gold-400);
    font-weight: 700;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
    overflow: hidden;
}

.user-meta strong {
    font-size: 13.5px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta small {
    font-size: 11.5px;
    color: rgba(238, 244, 239, 0.55);
}

.shell {
    margin-inline-start: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 66px;
    padding: 0 32px;
    background: rgba(250, 247, 238, 0.88);
    backdrop-filter: blur(10px);
    border-block-end: 1px solid var(--line);
}

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    min-width: 0;
}

.crumb-section {
    font-weight: 700;
    color: var(--forest-700);
}

.crumb-sep {
    color: var(--line-strong);
}

.crumb-page {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-side {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 12.5px;
    color: var(--muted);
}

.topbar-role {
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--moss-100);
    color: var(--forest-700);
    font-weight: 600;
}

.topbar-date {
    font-variant-numeric: tabular-nums;
}

.icon-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 10px;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.icon-btn span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--forest-700);
}

.icon-btn.topbar-print {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--forest-700);
    flex: 0 0 auto;
}

.icon-btn.topbar-print:hover {
    background: var(--moss-100);
    border-color: var(--line-strong);
}

.content {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
    padding: 30px 32px 44px;
    flex: 1;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 32px;
    border-block-start: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    background: var(--sand-100);
}

/* ---------- Page header ---------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-block-end: 24px;
}

.eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--gold-600);
    text-transform: uppercase;
    margin-block-end: 6px;
}

.page-head h1 {
    font-size: clamp(24px, 2.4vw, 32px);
    color: var(--forest-800);
}

.page-head p {
    margin-block-start: 6px;
    color: var(--muted);
    max-width: 70ch;
}

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

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(160deg, var(--forest-600), var(--forest-800));
    color: #fff;
    box-shadow: 0 10px 20px -14px rgba(8, 37, 28, 0.9);
}

.btn-primary:hover {
    background: linear-gradient(160deg, var(--forest-500), var(--forest-700));
    color: #fff;
}

.btn-secondary {
    background: var(--gold-500);
    color: var(--forest-900);
}

.btn-secondary:hover {
    background: var(--gold-400);
    color: var(--forest-900);
}

.btn-ghost {
    background: transparent;
    color: var(--forest-700);
    border-color: var(--line-strong);
}

.btn-ghost:hover {
    background: var(--sand-100);
    color: var(--forest-800);
}

.btn-outline {
    background: transparent;
    color: rgba(238, 244, 239, 0.9);
    border-color: rgba(238, 244, 239, 0.22);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #eec9c5;
}

.btn-danger:hover {
    background: #f6d9d6;
    color: #8d241d;
}

.btn-sm {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-lg {
    min-height: 48px;
    font-size: 15px;
}

.btn-block {
    width: 100%;
}

.btn-link {
    background: none;
    border: 0;
    padding: 0;
    color: var(--forest-600);
    font-weight: 700;
    cursor: pointer;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* ---------- Cards ---------- */

.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: 3px;
    background: linear-gradient(270deg, var(--gold-500), rgba(193, 154, 63, 0.1) 55%, transparent);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-block-end: 1px solid var(--line);
    background: linear-gradient(180deg, var(--paper), var(--sand-50));
}

.card-title {
    font-size: 16px;
    color: var(--forest-800);
}

.card-subtitle {
    margin-block-start: 2px;
    font-size: 12.5px;
    color: var(--muted);
}

.card-body {
    padding: 22px;
}

.card-body-tight {
    padding: 0;
}

.card-foot {
    padding: 16px 22px;
    border-block-start: 1px solid var(--line);
    background: var(--sand-50);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

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

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    min-width: 0;
}

.stack {
    display: grid;
    gap: 20px;
    min-width: 0;
}

/* ---------- Stats ---------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-block-end: 24px;
}

.stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px 20px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.stat::after {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block: 0;
    width: 4px;
    background: var(--gold-500);
    opacity: 0.85;
}

.stat-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--moss-100);
    color: var(--forest-700);
    font-size: 18px;
    margin-block-end: 8px;
}

.stat-value {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    color: var(--forest-800);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
}

.stat a {
    font-size: 12px;
    font-weight: 700;
    margin-block-start: 6px;
}

/* ---------- Forms ---------- */

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

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

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

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

.field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-soft);
}

.field label .req {
    color: var(--danger);
    margin-inline-start: 2px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field input[type="search"],
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--forest-500);
    box-shadow: 0 0 0 3px rgba(31, 114, 85, 0.13);
}

.field input[readonly],
.field select[disabled],
.field input[disabled] {
    background: var(--sand-100);
    color: var(--muted);
    cursor: not-allowed;
}

.field-help {
    font-size: 11.5px;
    color: var(--muted);
}

.field-error,
.form-error {
    font-size: 12px;
    color: var(--danger);
}

.form-error:empty,
.field-error:empty {
    display: none;
}

.form-error ul {
    margin: 0;
    padding-inline-start: 18px;
}

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

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--ink-soft);
    cursor: pointer;
    user-select: none;
}

.check input {
    width: 17px;
    height: 17px;
    accent-color: var(--forest-600);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-block-start: 22px;
    padding-block-start: 18px;
    border-block-start: 1px dashed var(--line-strong);
}

.form-actions .spacer {
    flex: 1;
}

fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

legend {
    font-weight: 700;
    color: var(--forest-800);
    margin-block-end: 12px;
}

/* ---------- Tables ---------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.data-table th {
    text-align: start;
    padding: 11px 13px;
    font-size: 11.5px;
    letter-spacing: 0.04em;
    color: var(--muted);
    background: var(--sand-100);
    border-block-end: 1px solid var(--line);
    white-space: nowrap;
    font-weight: 800;
}

.data-table td {
    padding: 11px 13px;
    border-block-end: 1px solid var(--line);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-block-end: 0;
}

.data-table tbody tr:hover {
    background: rgba(228, 239, 232, 0.35);
}

.data-table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.data-table td.actions-cell {
    text-align: end;
}

/* ---------- Badges & chips ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: #c4e2d3;
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #eec9c5;
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: #eedcb5;
}

.badge-neutral {
    background: var(--sand-100);
    color: var(--muted);
    border-color: var(--line);
}

.badge-info {
    background: var(--info-soft);
    color: var(--info);
    border-color: #c9e0ea;
}

.badge-stage {
    background: var(--moss-100);
    color: var(--forest-700);
    border-color: var(--moss-200);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-soft);
}

/* ---------- Filter tabs ---------- */

.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 5px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.filter-tab {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.filter-tab:hover {
    color: var(--forest-700);
}

.filter-tab.is-active {
    background: var(--paper);
    color: var(--forest-800);
    box-shadow: var(--shadow-sm);
}

/* ---------- Alerts ---------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    margin-block-end: 20px;
    font-size: 13.5px;
}

.alert-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.alert-success {
    background: var(--success-soft);
    border-color: #c4e2d3;
    color: #175b3d;
}

.alert-success .alert-icon {
    background: var(--success);
    color: #fff;
}

.alert-danger {
    background: var(--danger-soft);
    border-color: #eec9c5;
    color: #8d241d;
}

.alert-danger .alert-icon {
    background: var(--danger);
    color: #fff;
}

.alert-close {
    margin-inline-start: auto;
    background: none;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: inherit;
    opacity: 0.55;
    cursor: pointer;
    padding: 0 2px;
}

.alert-close:hover {
    opacity: 1;
}

/* ---------- Details ---------- */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
}

.detail-item {
    min-width: 0;
}

.detail-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.detail-value {
    font-size: 14px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.detail-value.empty-value {
    color: var(--line-strong);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 0 12px;
    font-size: 15px;
    color: var(--forest-800);
}

.section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ---------- Timeline ---------- */

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    margin-block-start: 5px;
    border-radius: 50%;
    background: var(--line-strong);
    box-shadow: 0 0 0 4px var(--sand-100);
}

.timeline-dot.is-done {
    background: var(--success);
    box-shadow: 0 0 0 4px var(--success-soft);
}

.timeline-dot.is-rejected {
    background: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.timeline-body {
    padding: 12px 14px;
    background: var(--sand-50);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 13px;
    font-weight: 700;
    color: var(--forest-800);
}

.timeline-meta {
    font-size: 11.5px;
    color: var(--muted);
    font-weight: 400;
}

/* ---------- Empty & state pages ---------- */

.empty {
    padding: 46px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: var(--sand-100);
    border: 1px dashed var(--line-strong);
    font-size: 22px;
    color: var(--gold-600);
}

.empty h3 {
    color: var(--ink-soft);
    font-size: 15px;
    margin-block-end: 4px;
}

.state-page {
    max-width: 560px;
    margin: 8vh auto;
    text-align: center;
    padding: 34px;
}

.state-mark {
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    margin: 0 auto 18px;
    border-radius: 22px;
    background: var(--sand-100);
    border: 1px solid var(--line);
    color: var(--gold-600);
    font-size: 26px;
    font-weight: 800;
}

.state-page h1 {
    font-size: 24px;
    color: var(--forest-800);
    margin-block-end: 8px;
}

.state-ref {
    margin-block-start: 14px;
    font-size: 12.5px;
    color: var(--muted);
}

.state-ref code {
    background: var(--sand-100);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 11.5px;
}

.state-actions {
    margin-block-start: 22px;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ---------- Utilities ---------- */

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.mono {
    font-family: "Consolas", "Courier New", "Segoe UI", "Tahoma", monospace;
    font-variant-numeric: tabular-nums;
}

.nowrap {
    white-space: nowrap;
}

.divider {
    height: 1px;
    background: var(--line);
    margin-block: 20px;
}

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-block-end: 16px;
}

.toolbar-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    max-width: 100%;
}

.inline-note {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--info-soft);
    border: 1px solid #c9e0ea;
    color: var(--info);
    font-size: 12.5px;
}

/* ---------- Reports ---------- */

.report-sheet {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    min-width: 0;
    overflow: hidden;
}

.report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-block-end: 18px;
    border-block-end: 2px solid var(--forest-700);
    margin-block-end: 18px;
}

.report-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-brand h2 {
    font-size: 21px;
    color: var(--forest-800);
}

.report-brand p {
    font-size: 12px;
    color: var(--muted);
}

.report-logo {
    width: 118px;
    height: auto;
    background: #fff;
    border-radius: 10px;
    padding: 4px 6px;
    box-shadow: inset 0 0 0 1px rgba(16, 68, 52, 0.16);
}

.report-meta {
    text-align: end;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.8;
}

.report-meta strong {
    color: var(--ink);
}

.report-title {
    text-align: center;
    font-size: 18px;
    color: var(--forest-800);
    margin-block: 6px 18px;
}

.report-summary {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--sand-50);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-block-end: 18px;
    font-size: 13px;
}

.report-summary strong {
    color: var(--forest-700);
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-block-end: 16px;
}

/* ---------- Auth ---------- */

.auth-body {
    background: var(--sand-100);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px;
    color: #eef4ef;
    background:
        radial-gradient(900px 500px at 0% 100%, rgba(193, 154, 63, 0.2), transparent 60%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 16px),
        linear-gradient(160deg, var(--forest-700), var(--forest-900));
}

.auth-brand-inner {
    max-width: 460px;
    margin-block: auto;
}

.auth-logo {
    display: block;
    width: 320px;
    max-width: 100%;
    height: auto;
    background: #fff;
    border-radius: 16px;
    padding: 10px 14px;
    margin-block-end: 22px;
    box-shadow: 0 24px 50px -26px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.auth-brand p {
    color: var(--gold-400);
    font-size: 16px;
    margin-block: 4px 26px;
}

.auth-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 13px;
    font-size: 14px;
    color: rgba(238, 244, 239, 0.8);
}

.auth-points li {
    position: relative;
    padding-inline-start: 24px;
}

.auth-points li::before {
    content: "◆";
    position: absolute;
    inset-inline-start: 0;
    color: var(--gold-400);
    font-size: 10px;
    top: 6px;
}

.auth-brand-foot {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 11.5px;
    color: rgba(238, 244, 239, 0.4);
}

.auth-credit {
    color: var(--gold-400);
    font-weight: 600;
    text-decoration: none;
    border-block-end: 1px dotted rgba(193, 154, 63, 0.6);
    padding-block-end: 1px;
}

.auth-credit:hover {
    color: #fff;
    border-block-end-color: #fff;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 38px;
    box-shadow: var(--shadow-lg);
}

.auth-card-standalone {
    margin: 8vh auto;
}

.auth-head {
    margin-block-end: 24px;
}

.auth-head h2 {
    font-size: 27px;
    color: var(--forest-800);
}

.auth-head p {
    margin-block-start: 4px;
}

.auth-note {
    margin-block-start: 18px;
    text-align: center;
    font-size: 11.5px;
    color: var(--muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.22s ease;
        box-shadow: var(--shadow-lg);
    }

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

    .shell {
        margin-inline-start: 0;
    }

    .icon-btn.menu-btn {
        display: flex;
    }

    .topbar {
        padding: 0 20px;
    }

    .content {
        padding: 24px 20px 40px;
    }

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(8, 37, 28, 0.45);
        z-index: 35;
        backdrop-filter: blur(2px);
    }

    .overlay[hidden] {
        display: none;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

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

    .btn-sm {
        min-height: 38px;
        padding: 6px 12px;
    }

    .icon-btn {
        width: 44px;
        height: 44px;
    }

    .alert-close {
        min-width: 36px;
        min-height: 36px;
        display: inline-grid;
        place-items: center;
    }

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

    .auth-brand {
        padding: 34px 28px;
        min-height: 230px;
    }

    .auth-brand-inner {
        margin: 0;
    }

    .auth-logo {
        width: 260px;
    }

    .auth-points,
    .auth-brand-foot {
        display: none;
    }
}

@media (max-width: 720px) {
    body {
        font-size: 14px;
    }

    .topbar {
        padding: 0 14px;
        gap: 10px;
    }

    .topbar-role {
        max-width: 135px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-side .topbar-date {
        display: none;
    }

    .crumb-section,
    .crumb-sep {
        display: none;
    }

    .page-head {
        align-items: flex-start;
    }

    .toolbar-group {
        width: 100%;
    }

    .toolbar-group .field {
        flex: 1 1 160px;
        max-width: 100%;
    }

    .toolbar-group .btn {
        width: 100%;
    }

    .table-actions {
        flex-wrap: wrap;
    }

    .stats-grid,
    .form-grid,
    .form-grid-3,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 18px;
    }

    .card-head {
        padding: 15px 18px;
    }

    .report-sheet {
        padding: 18px;
    }

    .report-head {
        flex-direction: column;
    }

    .report-meta {
        text-align: start;
    }

    .auth-card {
        padding: 26px 22px;
    }

    .footer {
        flex-direction: column;
        padding: 16px 20px;
    }
}

/* ---------- Print ---------- */

.print-header {
    display: none;
}

@media print {
    @page {
        size: A4;
        margin: 14mm;
    }

    body {
        background: #fff;
        color: #000;
        font-size: 12px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .footer,
    .page-actions,
    .report-actions,
    .filter-tabs,
    .toolbar,
    .no-print,
    .alert,
    .icon-btn,
    .table-actions,
    .inline-form,
    .state-actions,
    .form-actions,
    .card-foot .btn,
    .pagination,
    .pager {
        display: none !important;
    }

    .print-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding-block-end: 10px;
        margin-block-end: 16px;
        border-block-end: 2px solid #104434;
    }

    .print-logo {
        width: 112px;
        height: auto;
    }

    .print-title {
        display: flex;
        flex: 1;
        flex-direction: column;
        text-align: center;
        line-height: 1.45;
    }

    .print-title strong {
        font-size: 17px;
        color: #104434;
    }

    .print-title span {
        font-size: 11px;
        color: #555;
    }

    .print-meta {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        font-size: 10.5px;
        color: #555;
        line-height: 1.7;
    }

    .shell {
        margin: 0 !important;
    }

    .content {
        padding: 0;
        max-width: none;
    }

    .card,
    .report-sheet {
        border: 0;
        box-shadow: none;
        padding: 0;
        overflow: visible !important;
    }

    .table-wrap {
        overflow: visible !important;
    }

    .card::before {
        display: none;
    }

    .data-table {
        min-width: 0;
        font-size: 10.5px;
    }

    .data-table th,
    .data-table td {
        padding: 6px 8px;
        border-color: #bbb;
    }

    .data-table thead {
        display: table-header-group;
    }

    .data-table tr {
        page-break-inside: avoid;
    }

    .detail-item,
    .recommendation-banner {
        break-inside: avoid;
    }

    .field input,
    .field select,
    .field textarea {
        border: 1px solid #999 !important;
        background: #fff !important;
        color: #000 !important;
    }

    a {
        color: #000;
        text-decoration: none;
    }
}

/* ---------- Extended utilities ---------- */

.is-hidden {
    display: none !important;
}

.mt-20 {
    margin-block-start: 20px;
}

.mt-12 {
    margin-block-start: 12px;
}

.grid-wide {
    grid-template-columns: 1.55fr 1fr;
    align-items: start;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.text-end {
    text-align: end;
}

.text-center {
    text-align: center;
}

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

.stack-sm {
    display: grid;
    gap: 10px;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Committee decision list */

.committee-list {
    display: grid;
    gap: 10px;
}

.committee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sand-50);
    flex-wrap: wrap;
}

.committee-name {
    font-weight: 700;
    color: var(--forest-800);
    font-size: 13.5px;
}

.committee-meta {
    font-size: 12px;
    color: var(--muted);
}

/* Dynamic form rows */

.repeater {
    display: grid;
    gap: 12px;
}

.repeater-row {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 0.7fr) 1.2fr auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--sand-50);
    min-width: 0;
}

.repeater-row > *,
.test-result-row > * {
    min-width: 0;
}

.repeater-row .field {
    gap: 4px;
}

.repeater-row .field label {
    font-size: 11px;
}

.repeater-remove {
    align-self: end;
}

.repeater-add {
    justify-self: start;
}

.test-results {
    display: grid;
    gap: 10px;
}

.test-result-row {
    display: grid;
    grid-template-columns: 1.4fr 1.6fr 0.8fr;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--sand-50);
}

.test-result-name {
    font-weight: 700;
    color: var(--forest-800);
    font-size: 13px;
}

.test-result-range {
    font-size: 11.5px;
    color: var(--muted);
}

.test-result-row .field {
    gap: 3px;
}

/* Report bars */

.bar-track {
    height: 10px;
    border-radius: 999px;
    background: var(--sand-200);
    overflow: hidden;
    min-width: 120px;
}

.bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--forest-600), var(--forest-500));
}

.progress-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.bar-progress {
    width: 100%;
    height: 10px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: var(--sand-200);
    appearance: none;
}

.bar-progress::-webkit-progress-bar {
    background: var(--sand-200);
    border-radius: 999px;
}

.bar-progress::-webkit-progress-value {
    background: linear-gradient(90deg, var(--forest-600), var(--forest-500));
    border-radius: 999px;
}

.bar-progress::-moz-progress-bar {
    background: var(--forest-600);
    border-radius: 999px;
}

/* Detail summary list */

.summary-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px 22px;
}

.summary-item {
    min-width: 0;
}

.summary-item dt {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--muted);
    margin: 0 0 2px;
}

.summary-item dd {
    margin: 0;
    font-size: 14px;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.summary-item dd.empty {
    color: var(--line-strong);
}

/* Field experiment photo gallery */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 16px;
}

.photo-card {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--sand-50);
    display: flex;
    flex-direction: column;
}

.photo-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: var(--sand-200);
}

.photo-card figcaption {
    padding: 8px 10px;
    font-size: 12px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.photo-card form {
    padding: 0 10px 10px;
    margin-top: auto;
}

/* Formulation comparison report */

.recommendation-banner {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 18px 0;
    padding: 18px 20px;
    border: 1px solid var(--forest-200, #c8ddce);
    border-radius: 16px;
    background: linear-gradient(135deg, #f2f8f3, #fbfdf9);
}

.recommendation-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    background: var(--forest-600);
    color: #fff;
    font-size: 22px;
}

.recommendation-banner h3 {
    margin: 0 0 6px;
    font-size: 18px;
}

.recommendation-banner p {
    margin: 0 0 6px;
    color: var(--ink);
}

.recommendation-meta {
    color: var(--muted) !important;
    font-size: 13px;
}

.data-table tr.is-recommended td {
    background: #f4faf5;
}

@media (max-width: 1024px) {
    .grid-wide {
        grid-template-columns: 1fr;
    }

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

    .test-result-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .repeater-row,
    .test-result-row {
        grid-template-columns: 1fr;
    }
}
