:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  color: #172126;
  background: #f5f7f6;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.shell { max-width: 1240px; margin: 0 auto; padding: 36px 28px 48px; }
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .17em; color: #5c7579; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 48px); letter-spacing: -.04em; }
.subtitle { margin: 8px 0 0; color: #5b696d; }
.update-box { min-width: 205px; padding: 14px 18px; border: 1px solid #dce5e2; border-radius: 12px; background: #fff; }
.update-label, .refresh-status { display: block; color: #607075; font-size: 12px; }
.update-box strong { display: block; margin: 6px 0; font-size: 15px; }
.refresh-status.error { color: #a23636; }
.logout-button { margin-top: 10px; padding: 0; border: 0; background: none; color: #176b60; font-size: 12px; text-decoration: underline; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 420px); padding: 32px; border: 1px solid #dce5e2; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px #1721260d; }
.login-card .subtitle { line-height: 1.5; margin-bottom: 28px; }
.login-card label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.login-card input { display: block; width: 100%; height: 44px; padding: 0 12px; border: 1px solid #c8d4d1; border-radius: 8px; }
.login-card button { width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 8px; background: #176b60; color: #fff; font-weight: 700; }
.login-card button:hover { background: #10594f; }
.login-error { padding: 12px; border-radius: 8px; background: #fceceb; color: #a23d38; font-size: 13px; }
.login-note { margin: 20px 0 0; color: #7a898c; font-size: 12px; line-height: 1.5; }

.controls { display: grid; grid-template-columns: minmax(230px, 1.8fr) minmax(170px, 1fr) minmax(170px, 1fr) auto; gap: 14px; align-items: end; padding: 18px; background: #fff; border: 1px solid #dce5e2; border-radius: 14px; }
.controls label:not(.stock-toggle) { display: grid; gap: 7px; min-width: 0; font-size: 13px; font-weight: 700; }
.controls input[type="search"], .controls select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #c8d4d1; border-radius: 8px; background: #fff; color: inherit; outline-offset: 2px; }
.controls input:focus, .controls select:focus { border-color: #257f72; }
.stock-toggle { display: flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; font-size: 13px; font-weight: 700; }
.stock-toggle input { width: 17px; height: 17px; accent-color: #147568; }

.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 64px; font-size: 14px; color: #526166; }
.results-bar button, .show-more { padding: 9px 14px; border: 1px solid #bfcfcc; border-radius: 8px; background: #fff; color: #176b60; font-weight: 700; }
.results-bar button:hover, .show-more:hover { background: #e8f3f0; }
.message { margin-bottom: 14px; padding: 13px 16px; border-radius: 9px; background: #fff4e8; color: #775019; }
.table-wrap { overflow-x: auto; border: 1px solid #dce5e2; border-radius: 13px; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 15px 18px; background: #eff4f2; color: #526469; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 18px; border-top: 1px solid #e9eeec; font-size: 14px; }
tbody tr:hover { background: #f8fbfa; }
.item-code { font-family: Consolas, monospace; font-weight: 700; white-space: nowrap; }
.qty { text-align: right; white-space: nowrap; }
.qty-value { display: inline-block; min-width: 50px; padding: 5px 9px; border-radius: 7px; background: #e7f5ee; color: #167348; font-weight: 700; }
.qty-value.zero { background: #eef1f2; color: #68787c; }
.qty-value.negative { background: #fceceb; color: #a23d38; }
.show-more { display: block; margin: 18px auto 0; }
.show-more[hidden], .message[hidden] { display: none; }
.footnote { margin-top: 24px; color: #7a898c; font-size: 12px; }

@media (max-width: 850px) {
  .controls { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .stock-toggle { align-self: end; }
}
@media (max-width: 560px) {
  .shell { padding: 22px 14px 34px; }
  .page-header { display: block; }
  .update-box { margin-top: 20px; }
  .controls { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  th, td { padding: 12px; }
  table { min-width: 690px; }
  .results-bar { align-items: flex-start; flex-direction: column; padding: 14px 0; }
}
