:root {
  --bg: #08090d;
  --bg-soft: #0d0f16;
  --surface: #14161f;
  --surface-hover: #191c27;
  --border: #23262f;
  --border-hover: #33384a;
  --text: #f2f3f7;
  --muted: #8b90a3;
  --muted-dim: #5c6076;
  --accent: #00e6a8;
  --accent-2: #7c5cff;
  --accent-dim: #00e6a81a;
  --accent-2-dim: #7c5cff1a;
  --warn: #ffb547;
  --warn-dim: #ffb5471a;
  --error: #ff5c7a;
  --error-dim: #ff5c7a1a;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --font-display: "Unbounded", "Manrope", -apple-system, sans-serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Safety net: some components below set `display` unconditionally, which would
   otherwise override the browser's native `[hidden] { display: none }` rule and
   make elements stay visible even when the `hidden` attribute is set via JS. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  position: relative;
  overflow-x: hidden;
}

/* Ambient background */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, #ffffff08 1px, transparent 1px),
    linear-gradient(to bottom, #ffffff08 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}

.bg-glow-1 {
  top: -200px;
  left: -100px;
  width: 500px;
  height: 500px;
  background: var(--accent);
}

.bg-glow-2 {
  top: 100px;
  right: -150px;
  width: 450px;
  height: 450px;
  background: var(--accent-2);
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: #08090dcc;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.nav-link:hover {
  color: var(--text);
}

/* Page + hero */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.hero {
  text-align: center;
  padding: 4.5rem 0 3.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid #00e6a840;
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  margin-bottom: 1.75rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.printer-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: -1rem 0 1.75rem;
}

.printer-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #b7bccb);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
}

.printer-status-list .printer-status {
  margin: 0;
}

.printer-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8b90a3;
}

.printer-status-dot.free {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.printer-status-dot.busy {
  background: #ffb547;
  box-shadow: 0 0 8px #ffb547;
}

.printer-status-dot.offline {
  background: #ff5c7a;
  box-shadow: 0 0 8px #ff5c7a55;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 1.25rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.hero-actions {
  margin-bottom: 3rem;
}

.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, #00c896 100%);
  color: #04140f;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px -8px #00e6a880;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -6px #00e6a8a0;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.hero-stat-label {
  font-size: 0.75rem;
  color: var(--muted-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 3.5rem;
}

.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.step:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.step-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.step-text {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Layout + cards */
.layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-margin-top: 5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
}

.card-heading {
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1.25rem;
  background: var(--bg-soft);
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
  outline: none;
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: center;
}

.dropzone-title {
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.98rem;
}

.dropzone-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.file-list {
  list-style: none;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.875rem;
}

.file-remove {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
  transition: color 0.15s;
}

.file-remove:hover {
  color: var(--error);
}

/* Fields */
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

select,
input {
  font-family: var(--font-body);
}

select {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:hover,
select:focus {
  border-color: var(--border-hover);
  outline: none;
}

button[type="submit"] {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #00c896 100%);
  color: #04140f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  font-family: var(--font-body);
}

button[type="submit"]:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

button[type="submit"]:not(:disabled):hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* Result card */
.result-card {
  animation: fade-up 0.35s ease;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.price-block {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.price-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.price-value {
  display: block;
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.price-note {
  display: block;
  font-size: 0.8rem;
  color: var(--muted-dim);
  margin-top: 0.5rem;
}

.warnings {
  display: flex;
  gap: 0.6rem;
  background: var(--warn-dim);
  border: 1px solid #ffb54740;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--warn);
}

.warnings ul {
  list-style: disc;
  padding-left: 1.1rem;
}

.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.item-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  transition: border-color 0.15s;
}

.item-card:hover {
  border-color: var(--border-hover);
}

.item-card.item-warn {
  border-color: #ffb54760;
}

.item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  word-break: break-all;
  font-size: 0.9rem;
}

.tag-warn {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-dim);
  border: 1px solid #ffb54760;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

.item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Cost breakdown */
.cost-breakdown {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.breakdown-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.breakdown-bar {
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-soft);
  margin-bottom: 0.85rem;
}

.breakdown-segment {
  height: 100%;
  transition: width 0.4s ease;
}

.breakdown-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.details dt {
  font-size: 0.73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted-dim);
}

.details dd {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.error-card:not([hidden]) {
  border-color: #ff5c7a50;
  color: var(--error);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.error-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--error-dim);
  border: 1px solid #ff5c7a50;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* Materials strip */
.materials-strip {
  margin-top: 3.5rem;
  text-align: center;
}

.materials-strip-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-dim);
  margin-bottom: 1rem;
}

.materials-chips {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.chip {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.chip-pla {
  color: var(--accent);
  border-color: #00e6a840;
  background: var(--accent-dim);
}

.chip-petg {
  color: var(--accent-2);
  border-color: #7c5cff40;
  background: var(--accent-2-dim);
}

.chip-tpu {
  color: var(--warn);
  border-color: #ffb54740;
  background: var(--warn-dim);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 640px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .details {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 1rem;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }
}

/* ============ Admin ============ */
.page-wide {
  max-width: 960px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.admin-header {
  text-align: left;
  padding: 3rem 0 2rem;
}

.admin-header .badge {
  margin-bottom: 1.25rem;
}

.admin-header h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.admin-header .subtitle {
  color: var(--muted);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.section-hint {
  font-size: 0.85rem;
  color: #8b90a3;
  margin: -0.75rem 0 1.25rem;
  line-height: 1.5;
}

.checkbox-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.85rem;
  align-items: end;
}

.admin-grid label {
  gap: 0.4rem;
}

.admin-grid input[type="number"],
.admin-grid input[type="text"],
.admin-grid input[type="password"] {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  width: 100%;
  transition: border-color 0.15s;
}

.admin-grid input:hover,
.admin-grid input:focus {
  border-color: var(--border-hover);
  outline: none;
}

.admin-grid button,
.btn-save {
  background: linear-gradient(135deg, var(--accent) 0%, #00c896 100%);
  color: #04140f;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.88rem;
  transition: opacity 0.15s;
}

.admin-grid button:hover,
.btn-save:hover {
  opacity: 0.9;
}

.printers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.printer-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.printer-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.printer-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-right: auto;
}

.printer-offline-banner {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.35);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  color: #ff9cae;
}

.printer-offline-banner strong {
  font-size: 0.95rem;
  color: #ff7a93;
}

.printer-offline-banner .pd-offline-text {
  font-size: 0.85rem;
  color: #c9a0a8;
  line-height: 1.4;
}

.printer-settings {
  margin-top: 1.1rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--border);
}

.printer-card-body {
  margin-bottom: 0.85rem;
}

.printer-card-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.printer-dashboard {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.printer-job-card {
  background: linear-gradient(135deg, rgba(0, 224, 168, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.printer-job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.printer-job-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  word-break: break-word;
}

.printer-job-state {
  color: #8b90a3;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.printer-job-progress-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.printer-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.printer-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #00c896);
  transition: width 0.4s ease;
}

.printer-job-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: #8b90a3;
  flex-wrap: wrap;
}

.printer-job-meta strong {
  color: var(--text);
  font-weight: 600;
}

.printer-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
}

.printer-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.printer-stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b90a3;
  margin-bottom: 0.3rem;
}

.printer-stat-value {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}

.printer-stat-sub {
  font-size: 0.72rem;
  color: #6d7285;
  margin-top: 0.15rem;
}

.printer-material-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.printer-material-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  background: #444;
}

.printer-material-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.printer-material-sub {
  font-size: 0.72rem;
  color: #8b90a3;
}

.printer-material-nozzle {
  margin-left: auto;
  font-size: 0.78rem;
  color: #8b90a3;
  white-space: nowrap;
}

.printer-error-banner {
  background: rgba(255, 92, 122, 0.1);
  border: 1px solid rgba(255, 92, 122, 0.35);
  color: #ff9cae;
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary, #b7bccb);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #b7bccb);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

.printer-raw-json {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #c9f4e5;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}

.materials-table {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.material-row {
  display: grid;
  grid-template-columns: 1fr repeat(3, minmax(90px, 120px)) auto;
  gap: 0.6rem;
  align-items: end;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.material-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.muted {
  color: var(--muted-dim);
  font-size: 0.8rem;
}

.material-row label {
  font-size: 0.68rem;
}

.material-row input {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font-size: 0.875rem;
  width: 100%;
}

.material-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.btn-save-mat {
  border-color: #00e6a860;
  color: var(--accent);
}

.btn-save-mat:hover {
  background: var(--accent-dim);
}

.btn-del-mat:hover {
  border-color: #ff5c7a60;
  color: var(--error);
  background: var(--error-dim);
}

.material-add {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.login-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.6rem;
}

.admin-status {
  text-align: center;
  font-size: 0.875rem;
  margin-top: 1.25rem;
  min-height: 1.25rem;
  font-weight: 500;
}

.admin-status.success {
  color: var(--accent);
}

.admin-status.error {
  color: var(--error);
}

.admin-main {
  flex-direction: column;
  gap: 1.25rem;
}

.admin-main:not([hidden]) {
  display: flex;
}

#login-card {
  max-width: 380px;
  margin: 2rem auto 0;
}

#login-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 768px) {
  .material-row {
    grid-template-columns: 1fr 1fr;
  }

  .material-info {
    grid-column: 1 / -1;
  }

  .material-actions {
    grid-column: 1 / -1;
    flex-direction: row;
  }
}
