/* LNS Ops dashboard — minimal styles on top of Pico CSS */

:root {
  --error: #d44f4f;
  --error-bg: #fdecec;
  --warn: #b07c1a;
  --warn-bg: #fdf3da;
  --ok-bg: #e9f6e9;
  --ok-text: #2c7a2c;

  /* Tighten Pico's default scale — Pico ships with marketing-page sizes;
     a data dashboard wants compact, dense. */
  --pico-font-size:        14.5px;
  --pico-line-height:      1.45;
  --pico-spacing:          0.85rem;
  --pico-form-element-spacing-vertical:   0.45rem;
  --pico-form-element-spacing-horizontal: 0.7rem;
}

html { font-size: 14.5px; }
body { font-size: 0.95rem; }
h1   { font-size: 1.5rem;  margin-bottom: 0.4rem; }
h2   { font-size: 1.25rem; margin-bottom: 0.35rem; }
h3   { font-size: 1.05rem; margin-bottom: 0.3rem; }
h4   { font-size: 0.95rem; margin-bottom: 0.25rem; }
table { font-size: 0.88rem; margin-bottom: 0.6rem; }
table th, table td { padding: 0.45rem 0.6rem; }
button { font-size: 0.9rem; padding: 0.45rem 0.9rem; }
input, select, textarea { font-size: 0.9rem; padding: 0.4rem 0.55rem; }
article { padding: 0.85rem 1rem; margin-bottom: 0.85rem; }
.container, .container-fluid { padding-top: 8px; padding-bottom: 8px; }

.hidden { display: none !important; }
.muted { opacity: 0.7; }
.small { font-size: 0.85rem; }

.login-container {
  max-width: 460px;
  padding-top: 6vh;
}

.app-nav {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding: 8px 16px;
  background: var(--pico-card-background-color);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-links a {
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}
.nav-links a.active {
  background: var(--pico-secondary-background);
  font-weight: 600;
}

.state-screen {
  text-align: center;
  padding: 48px 16px;
}

.form-error {
  background: var(--error-bg);
  color: var(--error);
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.page {
  padding-top: 16px;
}

/* Entries page */
.entries-header {
  padding: 16px 0 8px;
}
.filter-bar {
  padding: 14px 16px;
  margin-bottom: 12px;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-grid label { margin: 0; }
.filter-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--pico-muted-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.filter-actions {
  display: flex;
  gap: 8px;
}
.filter-actions button { width: auto; margin: 0; }

.entries-meta { padding: 8px 0; }
.table-wrap { overflow-x: auto; }
.table-wrap table { font-size: 0.9rem; }
.table-wrap th { white-space: nowrap; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 16px 0 24px;
}
.pager button { width: auto; margin: 0; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-recorded { background: #e7eff8; color: #1d4ed8; }
.badge-verified { background: #e9f6e9; color: #2c7a2c; }
.badge-void     { background: #fdecec; color: #d44f4f; }

.stock-positive { color: #2c7a2c; }
.stock-negative { color: #d44f4f; }
.stock-zero     { color: var(--pico-muted-color); }

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--pico-muted-border-color);
  border-top-color: var(--pico-primary);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
