:root {
  color-scheme: dark;
  font-family: "Inter", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --glow: rgba(56, 189, 248, 0.45);
  --panel: rgba(15, 23, 42, 0.78);
  --panel-border: rgba(148, 163, 184, 0.25);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.14);
  --danger: #f87171;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.35), transparent 55%),
              radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.25), transparent 55%),
              linear-gradient(135deg, var(--bg-primary) 0%, #020617 100%);
  color: var(--text);
  padding: 0 1.5rem 3rem;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  backdrop-filter: blur(30px) saturate(120%);
  pointer-events: none;
  z-index: -1;
}

.app-header {
  max-width: 1360px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}

.hero-badge {
  align-self: flex-start;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.app-header h1 {
  margin: 0;
  font-size: 3rem;
  line-height: 1.15;
}

.app-header p {
  margin: 0;
  max-width: 100%;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0f172a;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(14, 165, 233, 0.45);
}

.hero-link--ghost {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.hero-link--ghost:hover {
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.4);
}



.column {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
  min-width: 0;
}




.layout {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}


.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 1.75rem;
  box-shadow: 0 25px 60px rgba(2, 8, 23, 0.45);
  backdrop-filter: blur(12px);
}

.card h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
}

fieldset {
  margin: 0 0 1.5rem;
  padding: 1.25rem;
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
}

legend {
  padding: 0 0.4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.field-grid {
  display: grid;
  gap: 1rem 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-grid--text {
  margin-top: 1.5rem;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.95rem;
}

label span,
label small {
  color: var(--text-muted);
}

input,
select,
textarea,
button {
  font: inherit;
  color: var(--text);
}

input,
select,
textarea {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

textarea {
  min-height: 5rem;
  resize: vertical;
}

button,
.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 26px rgba(14, 165, 233, 0.35);
}

button:hover,
.file-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.4);
}

button:disabled {
  background: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.6);
  box-shadow: none;
  cursor: not-allowed;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.form-actions,
.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}
#item-form .form-actions {
  margin-top: 1.25rem;
}



.preview-embed {
  margin: 2.25rem 0 2rem;
  padding: 1.75rem;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08);
}

.preview-embed h2 {
  margin: 0 0 1.2rem;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.preview-embed .preview-wrapper {
  display: grid;
  justify-content: center;
  gap: 1.2rem;
}

#order-clear {
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.95) 0%, rgba(239, 68, 68, 0.95) 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(239, 68, 68, 0.35);
}

#preview-canvas {
  display: block;
  background: transparent;
  border-radius: 14px;
  border: none;
  box-shadow: none;
}

#article-preview {
  max-width: 360px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 40px rgba(8, 47, 73, 0.5);
}

#preview-hint {
  margin: 0;
  color: var(--text-muted);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin: 1.5rem 0 0;
}

.summary div {
  background: rgba(148, 163, 184, 0.08);
  border-radius: 16px;
  padding: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.summary dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.summary dd {
  margin: 0.25rem 0 0;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

#order-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  background: rgba(15, 23, 42, 0.55);
  border-radius: 20px;
  overflow: hidden;
}

#order-table th {
  text-align: left;
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
}

#order-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

#order-table tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

#order-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.12);
}

#order-table tbody tr.selected {
  background: rgba(56, 189, 248, 0.22);
}

.order-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.85rem;
  align-items: baseline;
  margin-top: 1.75rem;
  font-size: 1.2rem;
}

.order-footer span {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.app-footer {
  max-width: 1360px;
  margin: 3rem auto 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .app-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1.2rem;
  }

  .column {
    gap: 2rem;
  }

  .hero {
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  body {
    padding: 0 1rem 2.5rem;
  }

  .hero-link,
  .hero-link--ghost,
  .form-actions button,
  .file-button,
  .order-actions button {
    width: 100%;
  }

  fieldset {
    padding: 1rem;
  }

  #order-table th:nth-child(4),
  #order-table td:nth-child(4) {
    display: none; /* Hide Stück */
  }
}

.field-grid .address-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  margin: 0 0 1rem;
  grid-column: 1 / -1;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.field-grid .address-toggle input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
  margin: 0;
  flex-shrink: 0;
}









.field-grid input:disabled,
.field-grid select:disabled,
.field-grid textarea:disabled {
  opacity: 1;
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text);
}


.field-grid label > input,
.field-grid label > select,
.field-grid label > textarea {
  width: 100%;
}


@media (min-width: 1200px) {
  .field-grid--address {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }

  .field-grid--address .address-toggle {
    grid-column: 1 / span 4;
  }
}

@media (max-width: 550px) {
  #preview-canvas,
  #article-preview {
    max-width: 100%;
    height: auto;
  }
}

/* Responsive Order Table */
@media (max-width: 900px) {
  #order-table th:nth-child(1),
  #order-table td:nth-child(1) {
    display: none; /* Hide Material */
  }
}

@media (max-width: 750px) {
  #order-table th:nth-child(5),
  #order-table td:nth-child(5) {
    display: none; /* Hide Preis */
  }
}

@media (max-width: 500px) {
  #order-table th:nth-child(2),
  #order-table td:nth-child(2) {
    display: none; /* Hide Form */
  }

  .app-header h1 {
    font-size: 2.25rem;
  }
}
