:root {
    --bg: #f1f7ee;
    --panel: #fffef8;
    --ink: #13251b;
    --muted: #667768;
    --line: #d7e5d0;
    --blue: #0f8f73;
    --green: #087a3b;
    --amber: #d99a22;
    --red: #c43f4b;
    --teal: #006f35;
    --nav-dark: #062f1b;
    --nav-deep: #0b241f;
    --soft-green: #eaf6e5;
    --shadow: 0 16px 38px rgba(4, 69, 35, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(213, 236, 204, .85), transparent 34rem),
        linear-gradient(180deg, #f7fbf4 0%, var(--bg) 100%);
    color: var(--ink);
    letter-spacing: 0;
}

a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }

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

.sidebar {
    background:
        linear-gradient(180deg, rgba(0, 111, 53, .18) 0%, rgba(0, 0, 0, 0) 34%),
        linear-gradient(180deg, var(--nav-dark) 0%, var(--nav-deep) 100%);
    color: #fff;
    padding: 20px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, .06);
    box-shadow: 12px 0 34px rgba(4, 45, 26, .14);
}

.app-brand, .brand-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-brand { color: #fff; padding: 6px 8px 22px; }
.app-brand span:last-child, .brand-line div:last-child { display: grid; gap: 2px; }
.app-brand small { color: #bed7c0; font-size: 13px; }
.brand-line span { color: #778476; font-size: 13px; }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #eef8e8 100%);
    color: var(--teal);
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, .62);
    box-shadow: 0 10px 22px rgba(0, 0, 0, .16);
    overflow: hidden;
    flex: 0 0 44px;
}

.brand-logo {
    display: block;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.nav-list { display: grid; gap: 6px; margin-top: 8px; }
.nav-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #d9ead7;
    padding: 12px;
    border-radius: 8px;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}
.nav-list a.active, .nav-list a:hover {
    background: linear-gradient(180deg, #ffffff 0%, #eef8e8 100%);
    color: #0b3d22;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
}
.nav-list a:hover { transform: translateX(2px); }
.nav-list a.active:hover { transform: none; }
.nav-list .icon { color: currentColor; }
}

.main-column { min-width: 0; }
.topbar {
    height: 72px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(255, 254, 248, 0.94);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(14px);
}
.topbar > div { display: grid; gap: 2px; }
.topbar span { color: var(--muted); font-size: 13px; }
.content { padding: 28px 34px; display: grid; gap: 22px; }

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
}
.page-heading h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.eyebrow {
    color: var(--teal);
    margin: 0 0 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .04em;
}

.panel, .approval-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.panel { padding: 22px; }
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.panel-header h2 { margin: 0; font-size: 18px; }
.count-label { color: var(--muted); font-size: 13px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
}
.stat-grid.compact .stat-card { min-height: 110px; }
.stat-card {
    min-height: 132px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fffdf6 100%);
    display: grid;
    align-content: space-between;
    gap: 10px;
    box-shadow: 0 12px 26px rgba(5, 74, 39, .07);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 112px;
    height: 112px;
    border-radius: 999px;
    background: rgba(8, 122, 59, .07);
}
.stat-card .icon {
    width: 22px;
    height: 22px;
    color: var(--teal);
}
.stat-card strong { font-size: 36px; line-height: 1; position: relative; z-index: 1; }
.stat-card span { color: var(--muted); }
.stat-card.blue { border-top: 4px solid var(--teal); }
.stat-card.green { border-top: 4px solid #15925a; }
.stat-card.amber { border-top: 4px solid var(--amber); }
.stat-card.red { border-top: 4px solid var(--red); }
.stat-card.danger { border-top: 4px solid #c43f4b; }
.stat-card.blue::after { background: rgba(0, 111, 53, .08); }
.stat-card.green::after { background: rgba(21, 146, 90, .09); }
.stat-card.amber::after { background: rgba(217, 154, 34, .12); }
.stat-card.red::after { background: rgba(196, 63, 75, .09); }
.stat-card.danger::after { background: rgba(196, 63, 75, .12); }

.two-column, .split-layout, .lookup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.split-layout { grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); align-items: start; }
.lookup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 13px; color: #526556; background: #f3f9ef; }
td small { display: block; color: var(--muted); margin-top: 3px; }
.muted-row { opacity: .55; }

.btn, .icon-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 8px;
    padding: 9px 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn.primary {
    background: linear-gradient(180deg, #13a55c 0%, var(--teal) 100%);
    color: #fff;
    border-color: var(--teal);
    box-shadow: 0 10px 22px rgba(0, 111, 53, .18);
}
.btn.primary:hover {
    background: linear-gradient(180deg, #0e8f4d 0%, #00592b 100%);
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 111, 53, .24);
}
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { background: #fffef8; }
.btn.ghost:hover, .icon-button:hover {
    border-color: #b7d4ae;
    background: #f1f8ed;
    color: var(--teal);
}
.btn.small { min-height: 34px; padding: 6px 10px; }
.btn.wide { width: 100%; }
.icon-button { width: 40px; height: 40px; padding: 0; background: #fffef8; }
.icon-button.danger { color: var(--red); }
.icon { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.sidebar-toggle { display: none; }

.stacked-form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
label span { font-weight: 600; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 11px;
    color: var(--ink);
    background: #fffef8;
    min-height: 42px;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 111, 53, .12);
    outline: 0;
}
textarea { resize: vertical; }
.checkline { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.checkline input { width: 18px; min-height: 18px; }

.segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.segmented label {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffef8;
}
.segmented input { width: 16px; min-height: 16px; }

.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-field { flex: 1 1 300px; position: relative; }
.search-field .icon { position: absolute; left: 12px; top: 36px; color: var(--muted); }
.search-field input { padding-left: 38px; }

.badge, .stock-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid transparent;
}
.badge.success { color: #047044; background: #e3f7e8; border-color: #bde8c8; }
.badge.warning { color: #8a5a0c; background: #fff5d6; border-color: #f0d789; }
.badge.danger { color: #9f2631; background: #fdeced; border-color: #f5c5ca; }
.badge.muted { color: #53635a; background: #edf3ea; border-color: #dce8d6; }
.stock-pill { background: #e8f6ee; color: #006f35; border-color: #c5e2ce; }
.stock-pill.low { background: #fff2df; color: #9a5c06; border-color: #f0cf90; }
.inline-stock-form {
    display: grid;
    grid-template-columns: minmax(70px, 1fr) auto 34px;
    align-items: center;
    gap: 6px;
    width: min(170px, 100%);
    padding: 5px;
    border: 1px solid #c5e2ce;
    border-radius: 999px;
    background: #e8f6ee;
}
.inline-stock-form.low {
    border-color: #f0cf90;
    background: #fff2df;
}
.inline-stock-form input {
    min-height: 30px;
    height: 30px;
    padding: 4px 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .82);
    color: #073d21;
    font-weight: 700;
    text-align: center;
}
.inline-stock-form span {
    color: #315a38;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.inline-stock-form.low span { color: #9a5c06; }
.stock-save-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    border-radius: 999px;
    color: #006f35;
    background: #ffffff;
}
.stock-save-button .icon {
    width: 15px;
    height: 15px;
}
.material-thumb {
    width: 58px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #f9fafb;
    display: block;
}
.material-thumb.preview {
    width: 118px;
    height: 88px;
}
.material-filter-panel { padding: 18px; }
.material-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px) auto;
    align-items: end;
}
.materials-catalog-layout { display: block; }
.materials-catalog-panel { padding: 24px; }
.material-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.material-card {
    display: grid;
    grid-template-rows: 160px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
    box-shadow: 0 14px 30px rgba(5, 74, 39, .07);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.material-card:hover {
    transform: translateY(-2px);
    border-color: #b7d4ae;
    box-shadow: 0 18px 38px rgba(5, 74, 39, .11);
}
.material-card.is-muted { opacity: .62; }
.material-card-media {
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #f1f8ed 0%, #ffffff 100%);
    border-bottom: 1px solid var(--line);
}
.material-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
}
.material-card-body {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 14px;
}
.material-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.material-code {
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
}
.material-card h3 {
    margin: 0;
    color: #10251a;
    font-size: 18px;
    line-height: 1.35;
}
.material-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}
.material-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    color: #5f725f;
    font-size: 12px;
    font-weight: 700;
}
.image-preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}
.upload-field input[type="file"] {
    padding: 12px;
    background: #f8fbf4;
    border: 1px dashed #9fbea0;
    cursor: pointer;
}
.upload-field input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: 0;
    border-radius: 8px;
    padding: 9px 14px;
    background: #0a8f48;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.compact-list { display: grid; gap: 10px; }
.stock-row, .item-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fffef8;
}
.stock-row span { display: grid; gap: 2px; }
.stock-row small { color: var(--muted); }
.stock-row b { color: #0c3b22; }
.empty-state { color: var(--muted); margin: 0; }

.department-usage-panel .panel-header,
.department-report-panel .panel-header {
    align-items: start;
}
.department-usage-list {
    display: grid;
    gap: 12px;
}
.department-usage-card {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
}
.department-usage-card > div {
    display: grid;
    gap: 4px;
}
.department-usage-card strong { color: #0c3b22; }
.department-usage-card span:not(.badge) {
    color: var(--muted);
    font-size: 13px;
}
.department-usage-card ul {
    margin: 0;
    padding-left: 18px;
    color: #263c2f;
}
.department-usage-card li + li { margin-top: 4px; }
.department-report-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(130px, .55fr)) minmax(180px, .75fr) minmax(260px, 1.2fr) minmax(150px, .6fr) auto auto;
    align-items: end;
    margin-bottom: 16px;
}
.department-report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.department-report-summary article {
    padding: 14px;
    border: 1px solid #dfead8;
    border-radius: 8px;
    background: #f8fcf5;
}
.department-report-summary span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.department-report-summary strong {
    display: block;
    margin-top: 6px;
    color: var(--teal);
    font-size: 26px;
    line-height: 1;
}
.department-report-table table { min-width: 1080px; }

.people-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 14px;
}
.people-metrics article {
    min-height: 92px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbf4 100%);
    box-shadow: 0 12px 26px rgba(5, 74, 39, .06);
}
.people-metrics span { color: var(--muted); font-weight: 700; }
.people-metrics strong { color: var(--teal); font-size: 30px; line-height: 1; }
.user-filter-panel { padding: 16px; }
.people-filter {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(130px, .45fr) minmax(180px, .7fr) minmax(130px, .45fr) auto auto;
}
.filter-bar .search-field .icon { top: 12px; }
.users-layout {
    display: grid;
    grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.user-form-panel {
    position: sticky;
    top: 92px;
    max-height: calc(100vh - 118px);
    overflow: auto;
}
.user-form { gap: 18px; }
.user-form-section {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dfead8;
    border-radius: 8px;
    background: #fbfdf8;
}
.user-form-section h3 {
    margin: 0;
    color: #0c3b22;
    font-size: 15px;
}
.users-panel { min-width: 0; }
.users-list {
    display: grid;
    gap: 12px;
}
.user-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
}
.user-card.is-muted { opacity: .62; }
.user-avatar {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(180deg, #e8f6ee 0%, #d4ebd6 100%);
    color: var(--teal);
    font-weight: 800;
    border: 1px solid #c5e2ce;
}
.user-main {
    min-width: 0;
    display: grid;
    gap: 8px;
}
.user-title-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.user-title-line strong {
    font-size: 17px;
    color: #10251a;
}
.user-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}
.user-meta span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f8ed;
}
.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 8px;
    color: #33483a;
    font-size: 13px;
}
.user-detail-grid span {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.user-detail-grid b {
    color: var(--muted);
    font-size: 12px;
}
.user-side {
    display: grid;
    justify-items: end;
    gap: 12px;
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    color: var(--muted);
    font-weight: 700;
}

.bar-chart {
    height: 240px;
    display: flex;
    align-items: end;
    gap: 18px;
    padding: 16px 4px 8px;
}
.bar-group { flex: 1; min-width: 40px; display: grid; gap: 8px; align-items: end; text-align: center; }
.bars { height: 190px; display: flex; align-items: end; justify-content: center; gap: 6px; border-bottom: 1px solid var(--line); }
.bar { width: 16px; min-height: 8px; border-radius: 6px 6px 0 0; }
.bar.issue, .issue-dot { background: var(--teal); }
.bar.borrow, .borrow-dot { background: var(--amber); }
.legend { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.legend span { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }

.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions form { margin: 0; }
.approval-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.approval-card { padding: 18px; display: grid; gap: 14px; }
.approval-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.approval-head div { display: grid; gap: 3px; }
.approval-head span:not(.badge) { color: var(--muted); font-size: 13px; }
.approval-actions { display: grid; gap: 10px; }
.approval-actions form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.approval-actions input { flex: 1 1 180px; }
.item-list { display: grid; gap: 8px; }
.item-list strong { white-space: nowrap; }
.request-line {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) 120px minmax(160px, .45fr) 40px;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fcf5;
}
.request-line.needs-material {
    border-color: #efb3a6;
    background: #fff9f6;
}
.request-picker {
    min-width: 0;
    display: grid;
    gap: 10px;
}
.request-picker-top {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(180px, .9fr) minmax(220px, 1.2fr);
    gap: 10px;
}
.selected-material {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #bfe0c6;
    border-radius: 8px;
    background: #eef9ef;
    color: #0c3b22;
    font-size: 13px;
}
.selected-material strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.selected-material span {
    flex: 0 0 auto;
    color: #047044;
    font-weight: 700;
}
.selected-material.is-empty {
    border-color: #f0cf90;
    background: #fff8ea;
    color: #9a5c06;
    font-weight: 700;
}
.needs-material .selected-material.is-empty {
    border-color: #ef9a8d;
    background: #fff0ed;
    color: #b42318;
}
.material-choice-list {
    max-height: 300px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
}
.material-choice-group + .material-choice-group {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}
.material-choice-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #0c3b22;
    font-weight: 800;
}
.material-choice-title small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.material-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.material-choice {
    width: 100%;
    display: grid;
    gap: 3px;
    text-align: left;
    border: 1px solid #d7e5d2;
    border-radius: 8px;
    padding: 10px;
    background: #fbfff8;
    color: var(--ink);
    cursor: pointer;
}
.material-choice:hover {
    border-color: var(--teal);
    background: #eef9ef;
}
.material-choice.is-selected {
    border-color: var(--teal);
    background: #e8f7ec;
    box-shadow: 0 0 0 2px rgba(0, 111, 53, .12);
}
.material-choice.is-out {
    background: #fffaf0;
}
.material-choice-code {
    color: #047044;
    font-size: 12px;
    font-weight: 800;
}
.material-choice strong {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
}
.material-choice span:last-child {
    color: var(--muted);
    font-size: 12px;
}
.material-choice-empty {
    padding: 18px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}
.requisition-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.requisition-rules article {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffef8;
    box-shadow: 0 12px 26px rgba(5, 74, 39, .06);
}
.requisition-rules strong {
    color: #0c3b22;
    font-size: 17px;
}
.requisition-rules span {
    color: var(--muted);
    font-size: 13px;
}
.requisition-rules b {
    width: fit-content;
    margin-top: 4px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
}
.requisition-rules .open b {
    color: #047044;
    background: #e3f7e8;
    border: 1px solid #bde8c8;
}
.requisition-rules .closed b {
    color: #9a5c06;
    background: #fff2df;
    border: 1px solid #f0cf90;
}

.dialog {
    border: 0;
    border-radius: 8px;
    padding: 22px;
    min-width: min(420px, calc(100vw - 36px));
    box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(17, 24, 39, 0.45); }
.dialog-actions { display: flex; justify-content: end; gap: 10px; }
.hidden { display: none; }

.tag-list { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-list span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 10px;
    background: #f9fafb;
}

.alert {
    border-radius: 8px;
    border: 1px solid var(--line);
    padding: 12px 14px;
    background: #fff;
}
.alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.alert.danger { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }

.login-page, .install-page { min-height: 100vh; background: #eef2f7; }
.tman-login-page {
    --login-green: #006f35;
    --login-green-bright: #098746;
    --login-green-deep: #004f28;
    --login-green-soft: #edf7e8;
    --login-green-line: #c7dfbc;
    --login-green-muted: #5f8064;
    --login-amber: #e4a51f;
    background: #edf7e8;
    overflow-x: hidden;
}
.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(440px, 1.08fr) minmax(520px, .92fr);
}
.tman-login-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 56vw) minmax(430px, 1fr);
    overflow: hidden;
}
.login-visual {
    display: grid;
    place-items: stretch;
    overflow: hidden;
    background: #eaf5e8;
}
.tman-login-visual {
    position: relative;
    z-index: 0;
}
.login-banner {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
}
.tman-login-visual .login-banner {
    height: 100vh;
    object-fit: cover;
    object-position: center top;
}
.login-panel {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92) 0%, rgba(247, 252, 244, .98) 100%),
        #f7fbf3;
    display: grid;
    align-content: center;
    border-left: 1px solid var(--login-green-line);
    border-right: 3px solid var(--login-green);
    padding: 40px clamp(36px, 6vw, 64px);
}
.tman-login-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    margin: 0;
    padding: clamp(112px, 25vh, 178px) clamp(34px, 3vw, 52px) 28px;
    background: #fbfdf8;
    border: 0;
    align-content: start;
}
.login-card {
    width: min(568px, 100%);
    margin: 0 auto;
    display: grid;
    gap: 24px;
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, .94);
    border: 1px solid #dcebd4;
    border-radius: 8px;
    box-shadow: 0 22px 54px rgba(0, 79, 40, .13);
    padding: 42px clamp(26px, 4vw, 44px) 34px;
}
.tman-login-panel .login-card {
    width: min(568px, 100%);
    margin: 0 auto;
    padding: 0;
    gap: 24px;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--login-green-deep), var(--login-green-bright), var(--login-amber));
}
.tman-login-panel .login-card::before { display: none; }
.login-card h1 {
    margin: 0 0 4px;
    text-align: center;
    font-size: 30px;
    line-height: 1.3;
    color: #123d26;
}
.tman-login-panel .login-card h1 {
    margin-bottom: 10px;
    font-size: 28px;
    color: #111827;
}
.login-form {
    display: grid;
    gap: 22px;
}
.tman-login-panel .login-form { gap: 22px; }
.login-field {
    display: grid;
    gap: 8px;
    color: #244b32;
    font-weight: 600;
    font-size: 14px;
}
.tman-login-panel .login-field {
    gap: 7px;
    color: #314436;
    font-size: 13px;
}
.login-input {
    height: 52px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    border: 1px solid var(--login-green-line);
    border-radius: 8px;
    background: #f8fcf5;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .86);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.tman-login-panel .login-input {
    height: 43px;
    grid-template-columns: 42px minmax(0, 1fr);
    border-color: #d9e2d5;
    border-radius: 4px;
    background: #ffffff;
    box-shadow: none;
}
.login-input .icon {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 8px;
    justify-self: center;
    color: var(--login-green);
    background: #e5f3de;
}
.tman-login-panel .login-input .icon {
    width: 18px;
    height: 18px;
    padding: 0;
    border-radius: 0;
    color: #a6b0a7;
    background: transparent;
}
.login-input input {
    width: 100%;
    height: 100%;
    min-width: 0;
    border: 0;
    border-left: 1px solid #dbead4;
    padding: 0 14px;
    color: #153a24;
    background: #f2f8ed;
    outline: 0;
    font-weight: 600;
}
.tman-login-panel .login-input input {
    border-left-color: #edf1eb;
    background: #fbfdf8;
    color: #1c3524;
    font-size: 13px;
    font-weight: 600;
}
.login-input input::placeholder { color: #7d927c; }
.login-input:focus-within {
    border-color: var(--login-green-bright);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(9, 135, 70, .14), 0 12px 24px rgba(0, 79, 40, .08);
}
.login-submit {
    height: 50px;
    border-radius: 8px;
    background: linear-gradient(180deg, #12a055 0%, var(--login-green) 100%);
    border-color: #08753d;
    color: #fff;
    justify-content: center;
    margin-top: 6px;
    font-weight: 700;
    box-shadow: 0 14px 28px rgba(0, 111, 53, .22);
    transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.tman-login-panel .login-submit {
    height: 43px;
    border-radius: 4px;
    background: #108f73;
    border-color: #108f73;
    margin-top: 8px;
    font-size: 13px;
    box-shadow: none;
}
.login-submit:hover {
    background: linear-gradient(180deg, #0f934d 0%, var(--login-green-deep) 100%);
    border-color: var(--login-green-deep);
    box-shadow: 0 16px 30px rgba(0, 111, 53, .28);
    transform: translateY(-1px);
}
.tman-login-panel .login-submit:hover {
    background: #006f58;
    border-color: #006f58;
}
.login-submit:active { transform: translateY(0); filter: saturate(.95); }
.login-links {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    font-size: 14px;
}
.tman-login-panel .login-links {
    gap: 24px;
    font-size: 13px;
}
.login-links a {
    color: #315a38;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}
.login-links a:hover { color: var(--login-green); }
.login-links div {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0 24px;
    text-align: right;
}
.login-links span {
    flex-basis: 100%;
    margin-top: 4px;
    color: var(--login-green-muted);
    font-size: 12px;
}
.login-version {
    margin: 70px 0 0;
    text-align: center;
    color: #708b74;
    font-size: 12px;
}
.tman-login-panel .login-version {
    margin-top: 96px;
    color: #7b8c80;
}
.auth-login-shell {
    min-height: 100vh;
    overflow: visible;
}
.auth-login-panel {
    padding-top: clamp(34px, 7vh, 72px);
    padding-bottom: 34px;
    overflow-y: auto;
}
.tman-login-panel .auth-card {
    width: min(720px, 100%);
    padding: 28px;
    gap: 18px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(199, 223, 188, .9);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(0, 79, 40, .14);
}
.tman-login-panel .auth-card-narrow {
    width: min(520px, 100%);
}
.auth-form {
    gap: 14px;
}
.auth-form-section {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #e1eadc;
    border-radius: 8px;
    background: #fbfdf8;
}
.auth-form-section h2 {
    margin: 0;
    color: #0c3b22;
    font-size: 16px;
}
.auth-form-grid {
    display: grid;
    gap: 10px;
}
.auth-form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.auth-form input,
.auth-form select {
    min-height: 41px;
    background: #ffffff;
}
.auth-links {
    justify-content: center;
}
.auth-note {
    margin: 0;
    color: #6d7d70;
    text-align: center;
    font-size: 12px;
}
.credentials { color: var(--muted); font-size: 13px; display: grid; gap: 4px; }
.install-panel {
    background: #fff;
    padding: 42px;
    display: grid;
    align-content: center;
    gap: 20px;
}
.install-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.install-panel { width: min(560px, 100%); border-radius: 8px; box-shadow: var(--shadow); }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        display: none;
        position: fixed;
        inset: 0 auto 0 0;
        width: 260px;
        z-index: 20;
    }
    body.sidebar-open .sidebar { display: block; }
    .sidebar-toggle { display: inline-flex; }
    .stat-grid, .two-column, .split-layout, .lookup-grid, .users-layout, .people-filter, .material-filter, .department-usage-card, .department-report-filter, .requisition-rules { grid-template-columns: 1fr; }
    .people-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .department-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .user-form-panel {
        position: static;
        max-height: none;
    }
    .user-detail-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-visual { min-height: 46vh; }
    .login-banner { min-height: 46vh; }
    .login-panel { border-left: 0; border-right: 0; min-height: 54vh; }
    .login-version { margin-top: 40px; }
    .tman-login-shell {
        min-height: 100vh;
        overflow: visible;
    }
    .tman-login-visual { min-height: 46vh; }
    .tman-login-visual .login-banner {
        height: 46vh;
        min-height: 46vh;
        object-position: center top;
    }
    .tman-login-panel {
        width: 100%;
        min-width: 0;
        min-height: auto;
        margin: 0;
        padding: 34px 28px 28px;
        align-content: start;
        background: #fbfdf8;
    }
    .tman-login-panel .login-card {
        width: min(460px, 100%);
        margin: 0 auto;
        padding: 28px 22px 24px;
        background: rgba(255, 255, 255, .92);
        border: 1px solid rgba(199, 223, 188, .9);
        border-radius: 8px;
        box-shadow: 0 18px 44px rgba(0, 79, 40, .16);
    }
    .tman-login-panel .login-version { margin-top: 26px; }
}

@media (max-width: 640px) {
    .content { padding: 18px; }
    .topbar { padding: 0 16px; }
    .page-heading { align-items: stretch; flex-direction: column; }
    .page-heading h1 { font-size: 24px; }
    .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
    .auth-form-grid.two { grid-template-columns: 1fr; }
    .request-line { grid-template-columns: 1fr; }
    .request-picker-top { grid-template-columns: 1fr; }
    .selected-material { align-items: flex-start; flex-direction: column; }
    .selected-material strong { white-space: normal; }
    .stat-grid { grid-template-columns: 1fr; }
    .department-report-summary { grid-template-columns: 1fr; }
    .material-catalog-grid { grid-template-columns: 1fr; }
    .material-card { grid-template-rows: 140px minmax(0, 1fr); }
    .people-metrics { grid-template-columns: 1fr; }
    .user-card {
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: start;
    }
    .user-avatar {
        width: 42px;
        height: 42px;
    }
    .user-side {
        grid-column: 1 / -1;
        justify-items: stretch;
        grid-template-columns: 1fr auto;
        align-items: center;
    }
    .logout-form .btn { width: 42px; padding: 0; overflow: hidden; }
    .logout-form .btn span { display: none; }
    .login-panel { padding: 32px 18px; }
    .login-card h1 { font-size: 24px; }
    .login-links { display: grid; gap: 12px; }
    .login-links div { justify-content: flex-start; text-align: left; }
    .tman-login-panel { padding: 18px; }
    .tman-login-panel .login-card { padding: 24px 18px 20px; }
    .tman-login-panel .auth-card { padding: 20px 16px; }
    .tman-login-panel .login-card h1 { font-size: 22px; }
    .tman-login-panel .login-links { gap: 10px; }
}
