:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #06170d;
  background: #f7fbf5;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: #f7fbf5; }
a { color: #007331; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, .button-link { border: 0; border-radius: 8px; background: #007331; color: #fff; font-weight: 700; cursor: pointer; padding: .7rem 1rem; display: inline-block; }
button:hover, .button-link:hover { background: #005b27; text-decoration: none; }
.danger-button { background: #e11d48; }
.danger-button:hover { background: #be123c; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, #063b1d 0%, #007331 58%, #18552d 100%); }
.login-card, .card { background: #fff; border: 1px solid #d8e4d4; border-radius: 16px; padding: 2rem; box-shadow: 0 12px 32px #063b1d1c; }
.login-card { width: min(440px, 100%); }
.login-card h2 { margin: 0 0 .4rem; font-size: 1.8rem; }
form { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; font-weight: 600; color: #173521; }
input, select, textarea { width: 100%; padding: .7rem .8rem; border: 1px solid #cbdac7; border-radius: 8px; background: #fff; color: #06170d; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #00733122; border-color: #007331; }
.form-error, .alert-error { color: #9f1239; background: #fff1f2; border: 1px solid #fecdd3; padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { color: #05652c; background: #ecfdf3; border: 1px solid #a7e3bb; padding: .8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
aside { display: flex; flex-direction: column; min-height: 100vh; padding: 1.25rem; background: #063b1d; color: #fff; }
.brand { display: flex; align-items: center; gap: .7rem; padding: .45rem .55rem 1.25rem; border-bottom: 1px solid #ffffff22; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: #f5bf2f; color: #063b1d; font-weight: 900; }
.brand strong { font-size: 1.1rem; letter-spacing: .04em; }
aside nav { display: grid; gap: .25rem; margin: 1.5rem 0; }
aside nav a { color: #eaf5e8; padding: .7rem .8rem; border-radius: 8px; font-size: .94rem; }
aside nav a:hover { color: #fff; background: #18552d; text-decoration: none; }
aside nav a.active, aside nav a.active:hover { color: #063b1d; background: #f5bf2f; box-shadow: inset 4px 0 0 #fff; font-weight: 800; text-decoration: none; }
.nav-section { margin: .9rem .8rem .3rem; color: #a9c7a9; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.user-panel { margin-top: auto; padding: .9rem; border: 1px solid #ffffff22; border-radius: 10px; color: #dbeed9; font-size: .85rem; }
.user-panel strong { display: block; color: #fff; }
aside form { margin-top: .8rem; }
aside form button { width: 100%; background: transparent; border: 1px solid #ffffff44; text-align: left; }
aside form button:hover { background: #ffffff16; }
.content { min-width: 0; padding: 1.5rem clamp(1rem, 3vw, 3rem) 3rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 52px; margin-bottom: 1.75rem; padding-bottom: 1rem; border-bottom: 1px solid #d8e4d4; }
.topbar-title { font-size: 1.35rem; font-weight: 800; }
.topbar-actions { display: flex; align-items: center; gap: .8rem; }
.notification-link { display: inline-flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-radius: 8px; background: #fff; border: 1px solid #d8e4d4; }
.notification-link:hover { background: #f0f8ee; text-decoration: none; }
.eyebrow { margin: 0 0 .3rem; color: #007331; font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.muted { color: #5c6f61; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-heading-actions { display: flex; gap: .6rem; align-items: center; }
.ui-icon { width: 1rem; height: 1rem; margin-right: .35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.heading-icon { width: 1.15rem; height: 1.15rem; margin-right: .45rem; fill: none; stroke: #007331; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }
.page-heading h2, .page-heading h3 { margin: 0; }
.hero-card { color: #fff; background: linear-gradient(135deg, #007331, #18552d); border-radius: 16px; padding: clamp(1.5rem, 4vw, 2.4rem); margin-bottom: 1.25rem; box-shadow: 0 10px 24px #063b1d22; }
.hero-card .eyebrow { color: #f5bf2f; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: #fff; border: 1px solid #d8e4d4; border-radius: 12px; padding: 1.2rem; box-shadow: 0 4px 12px #063b1d09; }
.stat-card span { display: block; color: #5c6f61; font-size: .85rem; }
.stat-card strong { display: block; margin-top: .5rem; font-size: 1.55rem; }
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.25rem; }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.section-heading-actions { display: flex; align-items: center; gap: .6rem; }
.supplier-detail-heading { align-items: flex-end; }
.supplier-detail-actions { align-self: flex-end; justify-content: flex-end; flex-wrap: wrap; margin-left: auto; }
.supplier-detail-actions form { display: block; margin: 0; }
.supplier-detail-actions button, .supplier-detail-actions .button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; white-space: nowrap; }
.secondary-button { color: #007331; background: #fff; border: 1px solid #9fc4a3; }
.secondary-button:hover { color: #fff; background: #005b27; }
.supplier-detail-actions .detail-danger-action { margin-left: .4rem; padding-left: 1rem; border-left: 1px solid #d8e4d4; }
.report-card-header { align-items: center; }
.card-filter { display: flex; align-items: center; gap: .5rem; }
.card-filter select, .card-filter input { min-width: 110px; padding: .55rem .7rem; }
.card-filter button { padding: .55rem .8rem; }
.filter-submit { display: none; }
.section-heading h3, .card h3 { margin: .2rem 0 1rem; }
.inline-form { display: inline-block; margin-left: .4rem; }
.inline-form button { padding: .4rem .65rem; font-size: .75rem; }
.danger-icon-button { display: inline-flex; align-items: center; justify-content: center; width: 2.8rem; height: 2.8rem; padding: 0 !important; background: #dc2626; border: 1px solid #b91c1c; color: #fff; border-radius: 8px; cursor: pointer; }
.danger-icon-button:hover { background: #b91c1c; }
.danger-icon-button svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-card { margin-bottom: 1rem; }
.filter-form { display: grid; grid-template-columns: repeat(5, 1fr) auto; align-items: end; gap: .8rem; }
.period-filter { grid-template-columns: 2fr 1.3fr 1fr auto; }
.form-card { max-width: 1100px; }
.supplier-report-form-card { width: 100%; max-width: none; }
.raw-plan-form-card { width: 100%; max-width: none; }
.report-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: .8rem; margin-top: .5rem; }
.form-actions a { padding: .7rem 1rem; }
.table-card { overflow-x: auto; padding: 0; }
table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .9rem; }
th { padding: .85rem 1rem; color: #5c6f61; background: #f0f7ee; font-size: .75rem; text-align: left; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { padding: .9rem 1rem; border-top: 1px solid #e4eee1; vertical-align: top; }
td strong, td small { display: block; }
td small { color: #5c6f61; margin-top: .2rem; }
td:nth-last-child(1) { white-space: nowrap; }
.status-active, .status-approved, .status-submitted { color: #007331; font-weight: 700; }
.status-inactive, .status-rejected, .status-archived { color: #b42318; font-weight: 700; }
.status-pending, .status-draft { color: #a16207; font-weight: 700; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid #d8e4d4; margin-bottom: 1.25rem; }
.tabs a { padding: .75rem 1rem; color: #5c6f61; border-bottom: 3px solid transparent; }
.tabs a:hover, .tabs a.active { color: #007331; border-bottom-color: #007331; text-decoration: none; }
.report-item { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1.2fr auto; gap: .7rem; align-items: end; padding: 1rem; border: 1px solid #d8e4d4; border-radius: 10px; background: #f7fbf5; }
.plan-item { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 2fr) 3rem; }
.raw-plan-help { margin: -.8rem 0 .8rem; font-size: .9rem; font-weight: 400; }
.role-form-card { width: 100%; }
.role-meta-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr .7fr; gap: 1rem; }
.role-system-notice { padding: 1rem; border: 1px solid #cbdac7; border-radius: 8px; background: #f0f7ee; color: #173521; }
.bgn-setting-card { width: 100%; max-width: 900px; }
.setting-status { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; margin-bottom: 1.5rem; padding: 1rem; border-radius: 10px; background: #f7fbf5; }
.setting-status > div { display: grid; gap: .25rem; }
.setting-status-label { color: #5c6f61; font-size: .8rem; }
.bgn-setting-card small { color: #5c6f61; font-weight: 400; }
.setting-readonly-note { margin: 0; }
.permission-matrix { overflow-x: auto; border: 1px solid #d8e4d4; border-radius: 10px; }
.permission-row { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(80px, .6fr)); align-items: center; min-width: 640px; min-height: 48px; border-top: 1px solid #e4eee1; }
.permission-row:first-child { border-top: 0; }
.permission-row > * { padding: .65rem .8rem; }
.permission-row label { display: flex; justify-content: center; align-items: center; }
.permission-row input { width: 1.1rem; height: 1.1rem; }
.permission-row label span { display: none; }
.permission-head { background: #f0f7ee; color: #5c6f61; font-size: .78rem; text-transform: uppercase; }
.permission-head span { text-align: center; }
.master-list-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.master-search-form { display: flex; grid-template-columns: none; align-items: center; gap: .6rem; width: min(680px, 100%); }
.master-search-form input { min-width: 260px; }
.master-search-form a { padding: .65rem .4rem; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1rem; }
.pagination > div { display: flex; align-items: center; gap: .5rem; }
.pagination-link { padding: .55rem .8rem; }
.pagination-disabled { padding: .55rem .8rem; border: 1px solid #d8e4d4; border-radius: 8px; color: #94a39a; background: #f7fbf5; }
.permission-page-heading { margin-bottom: 1.5rem; }
.permission-request-card { width: 100%; margin-bottom: 1.25rem; }
.permission-card-title h3, .permission-list-header h3 { margin: 0; }
.permission-card-title p, .permission-list-header p { margin: .25rem 0 0; }
.permission-card-title { margin-bottom: 1.25rem; }
.permission-request-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.permission-module-field, .permission-reason-field, .permission-form-actions { grid-column: 1 / -1; }
.permission-form-actions { display: flex; justify-content: flex-end; }
.permission-form-actions button { min-width: 150px; }
.permission-list-card { margin-top: 0; }
.permission-list-header { align-items: center; padding: 1.25rem 1rem; }
.permission-list-header form { margin: 0; }
.permission-empty-state { padding: 1.4rem 1rem; text-align: center; }
.report-item + .report-item { margin-top: .7rem; }
.report-period-card, .permission-card, .history-card { margin-top: 1.25rem; }
.period-list { display: grid; gap: .8rem; }
.period-table-head { display: grid; grid-template-columns: 1.1fr 1fr 1.2fr .9fr 1fr .8fr .5fr; gap: 1rem; padding: .85rem 1rem; color: #5c6f61; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.period-block { overflow: hidden; border: 1px solid #d8e4d4; border-radius: 10px; background: #fbfdfb; }
.history-period-list { display: grid; gap: .8rem; }
.history-period-block { overflow: hidden; border: 1px solid #d8e4d4; border-radius: 10px; background: #fbfdfb; }
.history-period-block table { margin: 0; }
.history-total { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; padding: 1rem; border-radius: 10px; background: #edf6e9; color: #5c6f61; }
.history-total strong { color: #007331; font-size: 1.1rem; }
.period-heading { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; background: #f0f7ee; color: #17351f; }
.period-heading { cursor: pointer; user-select: none; }
.period-heading::before { display: none; }
.period-date { display: flex; align-items: center; gap: .55rem; }
.period-date > strong { font-size: 1.25rem; font-weight: 400; line-height: .8; }
.period-date .accordion-icon { display: inline-block; width: 1rem; color: #5c6f61; font-size: 1.35rem; transition: transform .15s ease; }
.period-collapsed .period-date .accordion-icon { transform: rotate(-90deg); }
.period-date em { padding: .2rem .45rem; border-radius: 4px; background: #fff; color: #5c6f61; font-size: .75rem; font-style: normal; font-weight: 400; }
.period-collapsed table, .period-collapsed .period-empty { display: none; }
.period-heading span { color: #5c6f61; font-size: .85rem; }
.period-empty { margin: 0; padding: 1rem; color: #5c6f61; }
.history-parent { background: #fbfdfb; }
.history-child td:first-child { padding-left: 2rem; color: #5c6f61; }
.total-card { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; background: #edf6e9; color: #5c6f61; }
.total-card strong { color: #007331; font-size: 1.15rem; }
.material-results { position: relative; z-index: 2; max-height: 220px; overflow-y: auto; color: #5c6f61; font-size: .82rem; }
.material-result { display: block; width: 100%; padding: .55rem .7rem; border: 1px solid #d8e4d4; border-top: 0; border-radius: 0; background: #fff; color: #17351f; text-align: left; cursor: pointer; }
.material-result:hover { background: #edf8ea; }
.template-actions { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; margin: 1rem 0; }
.template-actions > a { padding: .65rem .8rem; border: 1px solid #007331; border-radius: 8px; color: #007331; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; }
.checkbox-label input { width: auto; }
.notification-counts { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.notification-counts span { background: #f7fbf5; border-radius: 999px; padding: .45rem .7rem; font-size: .85rem; }
.notification-item, .history-row { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #d8e4d4; padding: .8rem 0; }
.notification-item span { display: block; color: #5c6f61; font-size: .85rem; margin-top: .2rem; }
.notification-item em { font-style: normal; font-size: .75rem; font-weight: 700; text-transform: capitalize; }
.total-line { padding-top: 1rem; border-top: 1px solid #d8e4d4; text-align: right; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } .dashboard-grid { grid-template-columns: 1fr; } .filter-form { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .app-shell { display: block; } aside { min-height: auto; padding: .8rem; } .brand { padding-bottom: .8rem; } aside nav { display: flex; overflow-x: auto; margin: .7rem 0; } aside nav a { white-space: nowrap; } .nav-section { display: none; } .user-panel { display: none; } aside form { position: absolute; top: .8rem; right: .8rem; margin: 0; } aside form button { width: auto; padding: .45rem .7rem; } .content { padding: 1rem; } .topbar { margin-bottom: 1.2rem; } .filter-form, .period-filter { grid-template-columns: 1fr 1fr; } .page-heading-actions, .section-heading-actions, .card-filter { flex-wrap: wrap; } .report-card-header { display: block; } .report-card-header .section-heading-actions { margin-top: .8rem; } .period-table-head { display: none; } .period-heading { display: block; } .period-heading span { display: flex; margin-top: .35rem; } .report-meta-grid { grid-template-columns: 1fr; } .report-item { grid-template-columns: 1fr 1fr; } .report-item button { grid-column: 1 / -1; } }
@media (max-width: 760px) { .permission-request-form { grid-template-columns: 1fr; } .permission-module-field, .permission-reason-field, .permission-form-actions { grid-column: auto; } .permission-form-actions button { width: 100%; } .permission-list-header { align-items: flex-start; } }
@media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } .page-heading { align-items: start; flex-direction: column; } .filter-form { grid-template-columns: 1fr; } .topbar-actions small { display: none; } .login-card { padding: 1.4rem; } }
@media (max-width: 480px) { .supplier-detail-actions { width: 100%; margin-left: 0; justify-content: flex-end; } .supplier-detail-actions .detail-danger-action { margin-left: 0; padding-left: .6rem; } }
