:root {
    --bg: #f4f7f5;
    --panel: #ffffff;
    --text: #17211b;
    --muted: #5e6b62;
    --line: #d6e0d8;
    --brand: #1f7a4d;
    --brand-dark: #145737;
    --danger: #a33030;
    --warn: #9a6b12;
    --success: #146c43;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #102016; color: #eef5f0; padding: 24px 18px; }
.brand { margin-bottom: 22px; }
.brand-title { font-size: 1.2rem; font-weight: 700; }
.brand-subtitle { color: #b8cbbd; font-size: .9rem; margin-top: 6px; }
.menu { display: grid; gap: 8px; }
.menu-link { padding: 11px 12px; border-radius: 10px; background: rgba(255,255,255,.05); }
.menu-link:hover { background: rgba(255,255,255,.1); }
.menu-link.danger { color: #ffd6d6; }
.main-content { padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 18px; }
.topbar h1 { margin: 0 0 6px; }
.topbar-meta { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 240px; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; box-shadow: 0 8px 22px rgba(12, 27, 18, 0.04); }
.panel.narrow { max-width: 720px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
.stat-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fbfdfb; }
.stat-label { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.info-table th { width: 220px; color: var(--muted); font-weight: 600; }
.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; border: 1px solid var(--line); }
.flash-error { background: #fff2f2; border-color: #f1c3c3; color: #7f1d1d; }
.flash-success { background: #effaf3; border-color: #bfe6cb; color: var(--success); }
.flash-warning { background: #fff8eb; border-color: #ecd7a0; color: var(--warn); }
.muted { color: var(--muted); }
.footer { margin-top: 12px; font-size: .9rem; }
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 12px 30px rgba(12, 27, 18, 0.06); }
.form-grid { display: grid; gap: 14px; }
label span { display: block; margin-bottom: 6px; font-weight: 600; }
input { width: 100%; border: 1px solid #c7d4cb; border-radius: 10px; padding: 11px 12px; font-size: 1rem; }
button { background: var(--brand); color: white; border: 0; border-radius: 10px; padding: 12px 14px; font-size: 1rem; cursor: pointer; }
button:hover { background: var(--brand-dark); }
code { background: #eef2ef; padding: 2px 6px; border-radius: 6px; }
ul { padding-left: 18px; }
@media (max-width: 960px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { padding-bottom: 8px; }
    .grid.two { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; }
    .topbar-meta { width: 100%; }
}
.panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:14px; }
.panel-head h2 { margin:0 0 4px; }
.badge-wrap { display:flex; gap:8px; flex-wrap:wrap; }
.badge { display:inline-flex; align-items:center; padding:6px 10px; border-radius:999px; background:#e8f3ec; color:var(--brand-dark); font-size:.86rem; font-weight:700; }
.badge.soft { background:#f2f4f3; color:var(--muted); }
.cards-9 { grid-template-columns: repeat(auto-fit, minmax(170px,1fr)); }
.stat-meta { margin-top:8px; color:var(--muted); font-size:.84rem; line-height:1.35; }
.tone-warn { background:#fff9ef; border-color:#f1ddb1; }
.tone-ok { background:#f4fbf6; border-color:#cae7d3; }
.table-wrap { overflow:auto; }
.data-table { width:100%; border-collapse:collapse; }
.data-table th, .data-table td { padding:10px 8px; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.data-table th { color:var(--muted); font-size:.9rem; font-weight:700; background:#fbfcfb; position:sticky; top:0; }
.data-table.compact th, .data-table.compact td { padding:9px 8px; }
.small { font-size:.82rem; }
.pill { display:inline-flex; align-items:center; gap:6px; padding:5px 9px; border-radius:999px; background:#eef4ef; color:#243027; font-size:.8rem; font-weight:700; }
.pill.warn { background:#fff1d8; color:#8a5a00; }
.empty-state { margin:0; padding:12px 0 4px; color:var(--muted); }
.equal-top { align-items:start; }
@media (max-width: 960px) {
  .panel-head { flex-direction:column; }
}
.hero-panel { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; background:linear-gradient(135deg,#ffffff 0%,#f3f8f5 100%); border:1px solid var(--line); border-radius:18px; padding:20px; margin-bottom:18px; box-shadow: 0 8px 22px rgba(12, 27, 18, 0.04); }
.hero-panel h2 { margin:8px 0 8px; }
.hero-panel p { margin:0; color:var(--muted); max-width:760px; line-height:1.45; }
.eyebrow { display:inline-block; padding:4px 8px; border-radius:999px; background:#e8f3ec; color:var(--brand-dark); font-size:.78rem; font-weight:700; }
.compact-gap { margin-bottom:14px; }
.slim-top { margin-bottom:18px; }
.cards-4 { grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); }
.tone-accent { background:#eef7f1; border-color:#d8eadf; }
.between { justify-content:space-between; }
.stack-gap { display:grid; gap:18px; }
.form-stack { display:grid; gap:16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
textarea, select { width:100%; border:1px solid #c7d4cb; border-radius:10px; padding:11px 12px; font-size:1rem; background:#fff; }
textarea { resize:vertical; min-height:88px; }
.form-actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; background:var(--brand); color:#fff; border:0; border-radius:10px; padding:12px 14px; font-size:1rem; cursor:pointer; text-decoration:none; }
.btn:hover { background:var(--brand-dark); }
.btn-secondary { background:#edf3ef; color:var(--text); border:1px solid var(--line); }
.btn-secondary:hover { background:#e4ece7; }
.btn-danger { background:var(--danger); }
.btn-danger:hover { background:#842525; }
.request-entry-table select, .request-entry-table input { min-width: 140px; }
.unequal-right { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.95fr); }
.detail-grid { display:grid; gap:10px 16px; }
.detail-grid.two-col { grid-template-columns:repeat(2, minmax(0,1fr)); }
.top-gap { margin-top:14px; }
.inline-form { display:flex; }
.text-link { color:var(--brand); font-weight:700; }
.text-link:hover { text-decoration:underline; }
@media (max-width: 960px) {
  .hero-panel { flex-direction:column; }
  .form-grid.cols-3, .detail-grid.two-col, .unequal-right { grid-template-columns:1fr; }
}



.lookup-field { position: relative; min-width: 220px; }
.lookup-input { width: 100%; }
.lookup-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 24px rgba(12, 27, 18, 0.10); max-height: 220px; overflow: auto; z-index: 40; }
.lookup-option, .lookup-empty { display: block; width: 100%; text-align: left; padding: 10px 12px; background: #fff; color: var(--text); border: 0; border-bottom: 1px solid #eef2ef; font-size: .95rem; }
.lookup-option:last-child, .lookup-empty:last-child { border-bottom: 0; }
.lookup-option:hover { background: #f2f7f4; }
.lookup-empty { color: var(--muted); cursor: default; }
.line-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; flex-wrap:wrap; }
.line-toolbar .muted { margin:0; }
.btn-outline { background:#fff; color:var(--brand-dark); border:1px solid #c7d4cb; }
.btn-outline:hover { background:#edf3ef; }
.col-remove { width: 92px; }
.row-remove-btn { min-width: 72px; padding: 9px 10px; }
.request-entry-table td.actions-cell { white-space:nowrap; }
@media (max-width: 960px) {
  .line-toolbar { align-items:flex-start; }
}

.filter-select-wrap { min-width: 220px; }
.filter-select-wrap .filter-select-hint { margin-top: 4px; font-size: .78rem; }
.request-entry-table .filter-select-wrap select { min-width: 220px; }

.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.compact-form-grid { align-items:end; }
.align-end { align-items:end; }
.btn-sm { padding:8px 10px; font-size:.9rem; }
.action-stack { display:flex; gap:8px; flex-wrap:wrap; }
.status-active { background:#e9f6ee; color:#146c43; }
.status-inactive { background:#f4f4f4; color:#5d6860; }
.check-card { border:1px solid var(--line); border-radius:12px; padding:12px; background:#fbfcfb; }
.check-card > span { margin-bottom:10px; }
.check-row { display:flex; align-items:center; gap:10px; }
.check-row input[type="checkbox"] { width:auto; transform:scale(1.1); }
.check-row small { display:block; }
@media (max-width: 960px) {
  .form-grid.cols-4, .form-grid.cols-2 { grid-template-columns:1fr; }
}

.checkbox-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
}

.chip-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

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

.tight-bottom {
  margin-bottom: 0.75rem;
}
