/* NCPA Sound Inventory — shared styles. Mobile-first. */
*,*::before,*::after { box-sizing: border-box; }
:root {
  --bg: #0f1115;
  --panel: #161a22;
  --panel-2: #1d222d;
  --border: #2a313f;
  --text: #e8ecf3;
  --muted: #8b94a7;
  --accent: #4f8cff;
  --accent-2: #2563eb;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 10px;
}
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; line-height: 1.4; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
button, select, input, textarea {
  font: inherit;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
button { cursor: pointer; background: var(--accent); border-color: var(--accent); color: white; font-weight: 600; }
button.secondary { background: var(--panel-2); color: var(--text); border-color: var(--border); }
button.danger { background: var(--bad); border-color: var(--bad); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
input[type="text"], input[type="password"], input[type="search"], select, textarea { width: 100%; }
label { font-size: 14px; color: var(--muted); display: block; margin-bottom: 6px; }
.field { margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tag { display: inline-block; font-size: 11px; padding: 2px 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--muted); }
.tag.head { background: #3b2f10; color: #fbbf24; border-color: #5a4416; }
.tag.warn { background: #3a2410; color: #fbbf24; border-color: #5a3a16; }
.tag.bad { background: #3a1414; color: #fca5a5; border-color: #5a1f1f; }
.tag.good { background: #11331f; color: #86efac; border-color: #1d4d2f; }

/* ---- mobile shell ---- */
.app { max-width: 720px; margin: 0 auto; min-height: 100dvh; padding-bottom: 88px; }
header.app-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(15,17,21,0.96); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}
header.app-header h1 { font-size: 16px; margin: 0 0 8px; letter-spacing: 0.2px; }
header.app-header .row { gap: 8px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--panel); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.tabbar button {
  background: transparent; border: 0; border-radius: 0; color: var(--muted);
  padding: 14px 4px; font-weight: 500; font-size: 12px;
}
.tabbar button.active { color: var(--accent); }
.tabbar .icon { display: block; font-size: 18px; }

main { padding: 14px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.panel h2 { margin: 0 0 10px; font-size: 15px; }

/* ---- list / items ---- */
.search-row { position: sticky; top: 96px; z-index: 4; padding: 8px 0; background: var(--bg); }
.cat-header { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); padding: 12px 4px 6px; }
.item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); margin-bottom: 6px;
}
.item.checked { background: #18305b; border-color: var(--accent); }
.item input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .label { font-weight: 500; }
.item .meta { font-size: 12px; color: var(--muted); }

/* selected count footer (above tabbar) */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 64px; z-index: 9;
  background: var(--panel); border-top: 1px solid var(--border);
  padding: 10px 14px; display: none; gap: 10px; align-items: center;
}
.action-bar.show { display: flex; }
.action-bar .count { font-weight: 700; color: var(--accent); }
.action-bar button { flex: 1; }

/* history */
.move {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 10px 12px; margin-bottom: 8px;
}
.move .when { font-size: 11px; color: var(--muted); }
.move .what { font-weight: 500; }
.move .arrow { color: var(--muted); }
.move.checkout .arrow { color: var(--warn); }
.move.return .arrow { color: var(--good); }

/* dialog/toast */
.toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px; border-radius: var(--radius); z-index: 50; max-width: 90%;
}
.toast.bad { border-color: var(--bad); }
.toast.good { border-color: var(--good); }

.empty { text-align: center; padding: 24px 12px; color: var(--muted); }

/* ---- desktop admin ---- */
.admin {
  max-width: 1280px; margin: 0 auto; padding: 16px;
}
.admin nav.tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto;
}
.admin nav.tabs button {
  background: transparent; color: var(--muted); border: 0; border-radius: 0;
  padding: 10px 14px; font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap;
}
.admin nav.tabs button.active { color: var(--text); border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.3px; position: sticky; top: 0; background: var(--bg); }
tbody tr:hover { background: var(--panel-2); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar .field { margin: 0; min-width: 160px; }

.login-card {
  max-width: 360px; margin: 80px auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.login-card h1 { margin: 0 0 16px; font-size: 18px; }

.loading { padding: 40px; text-align: center; color: var(--muted); }
