:root {
  font-family: system-ui, sans-serif;
  color: #3f3027;
  background: #f4eee5;
  font-size: 17px;
  --brown-900: #493226;
  --brown-700: #6f4934;
  --brown-500: #9a6848;
  --sand-300: #d8c0a5;
  --sand-100: #f1e3d2;
  --cream: #fffaf3;
  --empty: #8b3f32;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  background: var(--brown-900);
  color: white;
  padding: 12px 3%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
h1 { font-size: 1.35rem; margin: 0; }
nav { display: flex; gap: 12px; align-items: center; }
a { color: inherit; font-weight: 800; }
button {
  background: var(--brown-700);
  color: white;
  border: 0;
  border-radius: 7px;
  padding: 11px 16px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
}
button:hover { background: var(--brown-900); }
input, select {
  min-height: 44px;
  border: 2px solid #b89474;
  border-radius: 7px;
  padding: 7px;
  font-size: 1rem;
  min-width: 0;
  background: var(--cream);
  color: #3f3027;
}
main { padding: 18px 3%; }
.notice { background: #eadbc8; border: 2px solid var(--brown-500); border-radius: 8px; padding: 14px; margin-bottom: 15px; }
.notice-error { background: #ead0cb; border-color: var(--empty); color: #672a22; }
.notice-warning { background: #efe0bc; border-color: #a1732b; color: #62491e; }
.dashboard-actions { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.button-link { display:inline-flex; align-items:center; justify-content:center; background:var(--brown-700); color:white; border-radius:7px; padding:11px 16px; text-decoration:none; font-weight:800; }
.button-link:hover { background:var(--brown-900); }
.export-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.indicators.collapsed { display:none; }
.indicators { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
.indicator {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 76px;
  background: var(--cream);
  border: 2px solid var(--sand-300);
  border-radius: 9px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}
a.indicator:hover, .indicator.active { background: var(--sand-100); border-color: var(--brown-700); transform: translateY(-1px); }
.indicator strong { display: block; font-size: 1.35rem; color: var(--brown-700); }
.indicator .date { font-size: .82rem; }
.search { display: grid; grid-template-columns: 1fr auto minmax(180px, auto) auto; gap: 8px; margin-bottom: 12px; }
.search-field { position: relative; display: block; }
.search-field input { width: 100%; padding-right: 48px; }
#clearSearch {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brown-700);
  font-size: 1.6rem;
  line-height: 1;
}
#clearSearch:hover { background: var(--sand-100); }
.row { display: grid; grid-template-columns: 100px minmax(240px, 2fr) repeat(4, minmax(80px, .7fr)) minmax(120px, 1fr) 90px; gap: 7px; align-items: center; padding: 8px; }
.product:nth-child(odd) { background: var(--sand-100); }
.product:nth-child(even) { background: var(--cream); }
.product .sku { font-size: 1.22rem; letter-spacing: .02em; }
.product > span { font-size: 1.15rem; font-weight: 750; line-height: 1.25; }
.product small { display: block; color: #725b4d; }
.product.empty { background: var(--empty); color: white; }
.product.empty small { color: #f7ded7; }
.product.empty input, .product.empty select { background: #fff8f4; border-color: #d8a093; }
.product.empty button { background: #54271f; }
.product.scanned-result { outline: 5px solid #e6a24f; outline-offset: -4px; animation: scanned-pulse 1s ease-in-out 3; }
@keyframes scanned-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(230,162,79,0); } 50% { box-shadow: 0 0 0 10px rgba(230,162,79,.45); } }
.headings { background: var(--brown-700); color: white; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 15px; }
.settings section, .login-box { background: var(--cream); padding: 20px; border-radius: 10px; border: 1px solid var(--sand-300); }
.settings form, .login-box form { display: grid; gap: 10px; }
.settings label, .login-box label { display: grid; gap: 5px; font-weight: bold; }
.danger { border: 2px solid var(--empty) !important; }
.danger button { background: var(--empty); }
table { width: 100%; border-collapse: collapse; font-size: .85rem; background: var(--cream); }
td, th { padding: 7px; border: 1px solid #bca58f; text-align: left; }
dialog { border: 0; border-radius: 12px; padding: 12px; width: min(95vw, 600px); }
.scanner-frame { position: relative; overflow: hidden; border-radius: 10px; background: #17100c; }
.scanner-frame video { display: block; width: 100%; min-height: 260px; object-fit: cover; }
.scan-line { position: absolute; left: 7%; right: 7%; top: 8%; height: 3px; border-radius: 3px; background: #e8b26f; box-shadow: 0 0 5px #fff, 0 0 14px #d96f45; animation: scanner-sweep 2s ease-in-out infinite; }
.scan-corners { position: absolute; inset: 10%; border: 3px solid rgba(255,250,243,.82); border-radius: 12px; box-shadow: inset 0 0 0 999px rgba(35,20,12,.12); pointer-events: none; }
@keyframes scanner-sweep { 0%,100% { top: 10%; opacity: .8; } 50% { top: 88%; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation-duration: 4s; } }
dialog video { width: 100%; background: #111; max-height: 70vh; }
.login { display: grid; place-items: center; min-height: 100vh; }
.login-box { width: min(92vw, 420px); }
.error { color: var(--empty); font-weight: bold; }

@media (max-width: 900px) {
  :root { font-size: 18px; }
  header { align-items: flex-start; flex-direction: column; }
  nav { flex-wrap: wrap; }
.dashboard-actions { display:flex; gap:8px; align-items:center; margin-bottom:10px; }
.button-link { display:inline-flex; align-items:center; justify-content:center; background:var(--brown-700); color:white; border-radius:7px; padding:11px 16px; text-decoration:none; font-weight:800; }
.button-link:hover { background:var(--brown-900); }
.export-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.indicators.collapsed { display:none; }
  .indicators { grid-template-columns: repeat(2, 1fr); }
  .search { grid-template-columns: 1fr auto; }
  .search select { grid-column: 1 / 2; }
  .headings { display: none; }
  .row.product { display: grid; grid-template-columns: repeat(2, 1fr); border-radius: 10px; margin-bottom: 10px; padding: 12px; }
  .row.product .sku, .row.product span { grid-column: 1 / -1; }
  .row.product input, .row.product select, .row.product button { width: 100%; }
  table { display: block; overflow: auto; }
}
