/* Inventario Annamara — shell styles */
:root {
  --bg0: #f3efe6;
  --bg1: #e7dfd0;
  --ink: #1c1915;
  --muted: #5c564c;
  --line: #cfc4b0;
  --accent: #0f5c4c;
  --accent-ink: #f7f3ea;
  --danger: #8b2e2e;
  --card: rgba(255, 252, 246, 0.88);
  --shadow: 0 10px 30px rgba(28, 25, 21, 0.08);
  --radius: 14px;
  --font: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fff8e8 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #d9ebe4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

body {
  padding-bottom: 64px;
}

a { color: var(--accent); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  backdrop-filter: blur(10px);
  background: rgba(243, 239, 230, 0.85);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font);
  font-size: 1.35rem;
  letter-spacing: 0.02em;
}

.brand span {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

nav button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

nav button.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--card);
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 1.25rem;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1rem;
}

.panel h2 {
  font-family: var(--font);
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}

.panel p.lead {
  margin: 0 0 1rem;
  color: var(--muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; }
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}

textarea { min-height: 72px; resize: vertical; }

.field { margin-bottom: 0.75rem; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

button.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  font: inherit;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
}

button.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

button.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.btn.danger {
  background: var(--danger);
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.qty {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.qty.zero { color: var(--danger); }

.muted { color: var(--muted); }
.hidden { display: none !important; }

#sessionStrip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: #1c1915;
  color: #f7f3ea;
  font-size: 0.9rem;
}

#sessionStrip .status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.4rem;
  background: #c45c5c;
}

#sessionStrip.connected .status-dot { background: #3dbb8a; }

#sessionStrip button {
  border: 1px solid rgba(247, 243, 234, 0.35);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 40;
  max-width: min(360px, calc(100vw - 2rem));
  background: #1c1915;
  color: #f7f3ea;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.auth-gate {
  max-width: 420px;
  margin: 2.5rem auto;
}

.auth-gate h1 {
  font-family: var(--font);
  font-size: 2rem;
  margin: 0 0 0.4rem;
}

.empty {
  padding: 1rem 0;
  color: var(--muted);
}

.chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}

.view { display: none; }
.view.active { display: block; }

.product-card {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0;
}

.product-card:first-child { border-top: 0; }

.product-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font);
  font-size: 1.15rem;
}

/* Role shell */
body.is-admin .nav-inv { display: none; }
body.is-inventory .nav-admin { display: none; }
body.is-admin:not(.is-support-view) .view-inv { /* gated by JS active */ }
body.is-support-view .nav-inv { display: inline-flex; }
body.is-support-view .nav-admin { display: none; }

.session-strip.is-ok { background: #1c1915; }
.session-strip.is-warn { background: #3a2a1c; }
.session-strip .session-actions { display: flex; gap: 0.4rem; }

.support-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1.25rem;
  background: #0f5c4c;
  color: #f7f3ea;
  font-size: 0.92rem;
}

.support-banner.hidden { display: none !important; }

code {
  font-size: 0.85em;
  background: rgba(28, 25, 21, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
