:root {
  --primary: #2563eb;
  --secondary: #0f172a;
  --success: #0f766e;
  --danger: #dc2626;
  --background: #f8fafc;
  --surface: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --border: #dbe3ee;
  --brand-new: #dfeafc;
  --brand-second: #e8f5e9;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
}

body {
  min-height: 100vh;
}

button, input, select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-title {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: clamp(1rem, 2.8vw, 1.2rem);
}

.admin-button,
.primary-button,
.secondary-button,
.category-button,
.ghost-button,
.danger-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  transition: 0.15s ease;
}

.admin-button {
  min-width: 68px;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-color: transparent;
  background: #eef2ff;
  color: var(--secondary);
}

.primary-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 700;
}

.secondary-button {
  background: #f8fafc;
}

.ghost-button {
  background: transparent;
}

.danger-button {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.status-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72vh;
  padding: 24px 0;
}

.status-card {
  width: min(100%, 440px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
}

.status-card h1 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 5.4vw, 2rem);
}

.status-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1rem;
}

.app-password-card form {
  display: grid;
  gap: 12px;
}

#app-password-input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.45rem;
  font-weight: 700;
  color: var(--secondary);
}

#app-password-form .primary-button {
  width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.price-app {
  padding-top: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.category-button {
  background: #f1f5f9;
  color: var(--secondary);
  padding: 12px 10px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.category-button.active {
  background: var(--brand-new);
  border-color: #b9d4ff;
}

.category-button[data-category="second"].active {
  background: var(--brand-second);
  border-color: #bfe8c8;
}

.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.brand-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  min-height: 40px;
}

.brand-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.search-wrap {
  margin-bottom: 12px;
}

.search-wrap input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
}

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.price-table {
  width: 100%;
  border-collapse: collapse;
}

.price-table th,
.price-table td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

.price-table thead th {
  background: #f8fafc;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.price-table tbody tr:last-child td {
  border-bottom: none;
}

.price-col {
  width: 130px;
  text-align: right;
}

.price-value {
  font-weight: 800;
  color: var(--secondary);
  text-align: right;
  white-space: nowrap;
}

.empty-row td {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  line-height: 1.6;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.modal-card {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-card h2 {
  margin: 0 0 14px;
  font-size: 1.3rem;
}

.modal-card label {
  display: block;
  margin: 12px 0 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.modal-card input,
.modal-card select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.modal-card button {
  margin-top: 14px;
  width: 100%;
}

.inline-error,
.inline-message {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--danger);
  min-height: 20px;
}

.inline-message.success {
  color: var(--success);
}

@media (min-width: 768px) {
  .page-shell {
    padding: 16px 18px 28px;
  }

  .topbar {
    padding-top: 16px;
  }

  .price-table th,
  .price-table td {
    padding: 14px 12px;
  }
}
