:root {
    --bg: #f5f7f4;
    --panel: #ffffff;
    --text: #15221d;
    --muted: #68756f;
    --line: #dce4df;
    --brand: #166534;
    --brand-dark: #104c29;
    --warning: #b45309;
    --danger: #b42318;
    --shadow: 0 12px 30px rgba(21, 34, 29, .07);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}
a { color: inherit; }
.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    color: white;
    background: #0f2f22;
}
.brand { font-size: 22px; font-weight: 800; text-decoration: none; letter-spacing: -.04em; }
.tagline { color: #b9d4c6; font-size: 14px; }
.user-menu { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.user-identity { display: grid; text-align: right; font-size: 13px; text-decoration: none; }
.user-menu small { color: #b9d4c6; }
.user-menu form { margin: 0; }
.user-menu button { padding: 7px 11px; border: 1px solid #668f7c; border-radius: 8px; color: white; background: transparent; cursor: pointer; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.guest-shell { min-height: calc(100vh - 68px); }
.guest-shell .content { display: grid; place-items: center; min-height: calc(100vh - 68px); }
.sidebar { padding: 24px 14px; border-right: 1px solid var(--line); background: #eef3ef; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar a { display: flex; justify-content: space-between; gap: 8px; padding: 11px 13px; border-radius: 9px; text-decoration: none; font-weight: 650; }
.sidebar a:hover:not([aria-disabled="true"]) { background: white; }
.sidebar a[aria-disabled="true"] { color: #86918c; cursor: default; }
.sidebar small { font-weight: 500; }
.content { min-width: 0; padding: 34px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-header h1 { margin: 4px 0 8px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.045em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid var(--brand); border-radius: 9px; color: white; background: var(--brand); font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-dark); }
.button.small { min-height: 34px; padding: 0 11px; font-size: 13px; }
.button.secondary { background: #173d30; }
.button.ghost { color: var(--brand); background: transparent; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.panel-heading { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 4px 0 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow); }
.stat-card span { color: var(--muted); font-size: 14px; }
.stat-card strong { font-size: 32px; letter-spacing: -.04em; }
.stat-card.warning strong { color: var(--warning); }
.stat-card.danger strong { color: var(--danger); }
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); }
.feature-grid div { display: grid; gap: 6px; padding: 24px; background: white; }
.feature-grid span { color: var(--muted); }
.search-form { display: flex; gap: 10px; margin-bottom: 18px; }
.search-form input { flex: 1; }
input, select { min-height: 44px; width: 100%; padding: 9px 12px; border: 1px solid #b9c6c0; border-radius: 8px; background: white; color: var(--text); font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(22, 101, 52, .13); border-color: var(--brand); }
.form-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid label { display: grid; gap: 7px; font-weight: 700; }
.form-grid label span { font-size: 14px; }
.form-grid label small { color: var(--muted); font-weight: 500; }
.form-grid .wide { grid-column: 1 / -1; }
.upload-field { padding: 16px; border: 1px dashed #9fb0a8; border-radius: 10px; background: #f8faf8; }
.form-actions { display: flex; justify-content: flex-end; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.confirm-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 18px 0; padding: 20px; }
.confirm-panel p { margin: 6px 0 0; color: var(--muted); }
.notice { margin-top: 20px; padding: 14px 16px; border-left: 4px solid var(--brand); background: #eff8f2; line-height: 1.6; }
.table-panel { overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8faf8; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.product-thumb { width: 58px; height: 58px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.image-placeholder { display: grid; place-items: center; width: 58px; height: 58px; padding: 5px; border-radius: 8px; color: var(--muted); background: #edf1ee; font-size: 10px; text-align: center; }
.empty-state { padding: 44px 24px; text-align: center; }
.empty-state p { color: var(--muted); }
.alert { margin: 0 0 20px; padding: 14px 16px; border-radius: 9px; border: 1px solid #afc7ba; background: #eef8f1; }
.alert-error { color: #7a271a; border-color: #f1b5ad; background: #fff1ef; }
.alert-success { color: #125b31; }
.status { display: inline-block; padding: 4px 8px; border-radius: 99px; background: #edf1ee; font-size: 12px; }
.status.success { color: #125b31; background: #e8f6ed; }
.status.error { color: #7a271a; background: #fff1ef; }
.table-link { font-weight: 650; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.section-panel { margin-top: 24px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-card { padding: 22px; }
.detail-card dl { display: grid; gap: 0; margin: 14px 0 0; }
.detail-card dl div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-card dl div:last-child { border-bottom: 0; }
.detail-card dt { color: var(--muted); }
.detail-card dd { margin: 0; font-weight: 700; text-align: right; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; padding: 20px; }
.image-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }
.text-success { color: var(--brand); font-weight: 750; }
.text-danger { color: var(--danger); font-weight: 750; }
.muted { color: var(--muted); }
.login-shell { width: min(100%, 460px); }
.login-card { padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.login-card h1 { margin: 4px 0 8px; font-size: 36px; }
.login-card > p:not(.eyebrow) { margin: 0; color: var(--muted); }
.login-form { display: grid; gap: 18px; margin-top: 26px; }
.login-form label { display: grid; gap: 7px; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .content { padding: 22px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    .tagline, .user-menu small { display: none; }
    .topbar { padding: 0 16px; }
    .user-identity { display: none; }
    .page-header { display: grid; }
    .stats-grid, .feature-grid, .form-grid, .detail-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .confirm-panel { display: grid; }
}
