:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #2b2420;
  --muted: #7a6f63;
  --border: #e7ddd0;
  --accent: #b5652b;
  --accent-dark: #8c4c1e;
  --ok: #3a7d44;
  --warn: #c0392b;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--accent);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.app-header h1 { font-size: 1.1rem; margin: 0; display: flex; align-items: center; }
header.app-header button { background: rgba(255,255,255,0.15); color: white; border: none; }

.logo-wordmark { display: block; object-fit: contain; background: #fff; border-radius: 8px; }
header.app-header .logo-wordmark { height: 44px; padding: 4px 10px; }
.login-card { text-align: center; }
.login-card .logo-wordmark { height: 130px; margin: 0 auto 14px; padding: 10px 16px; }
.login-card p, .login-card form { text-align: left; }

nav.tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 9;
}
nav.tabs a {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}
nav.tabs a.active { background: var(--accent); color: white; border-color: var(--accent); }

main { padding: 16px; max-width: 900px; margin: 0 auto; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
tr:last-child td { border-bottom: none; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.75rem; background: #f1ebe2; color: var(--muted); }

input, select, button {
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
button {
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
}
button:hover { background: var(--accent-dark); }
button.secondary { background: white; color: var(--accent); border: 1px solid var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.stock-input { width: 90px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: var(--warn); font-size: 0.9rem; }
.ok { color: var(--ok); }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card { max-width: 380px; width: 100%; }
.login-card .field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
.login-card input { width: 100%; }

.offline-banner {
  background: #fff3cd;
  color: #7a5b00;
  padding: 8px 16px;
  text-align: center;
  font-size: 0.85rem;
  display: none;
}
.offline-banner.show { display: block; }
