:root {
  --rd-orange: #ff6a00;
  --rd-orange-dark: #d95700;
  --rd-dark: #1c1f26;
  --rd-bg: #f4f5f7;
  --rd-border: #e0e2e6;
  --rd-danger: #c62828;
  --rd-ok: #2e7d32;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--rd-bg);
  color: #222;
}

.topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--rd-dark);
  color: white;
  padding: 0.6rem 1rem;
}

.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; }
.logo { height: 32px; width: 32px; }

.mainnav { display: flex; flex-wrap: wrap; gap: 0.9rem; flex: 1; }
.mainnav a { color: #ddd; text-decoration: none; font-size: 0.95rem; padding: 0.3rem 0.2rem; }
.mainnav a:hover { color: var(--rd-orange); }
.scan-link { color: var(--rd-orange) !important; font-weight: 600; }

.usermenu { display: flex; gap: 0.8rem; }
.usermenu a { color: #ccc; text-decoration: none; font-size: 0.9rem; }

.content { max-width: 1100px; margin: 0 auto; padding: 1.2rem 1rem 3rem; }

.flash-box { margin-bottom: 1rem; }
.flash { background: #fff3cd; border: 1px solid #ffe08a; padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.4rem; }

h1, h2, h3 { color: var(--rd-dark); }

table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; }
th, td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--rd-border); text-align: left; font-size: 0.95rem; }
th { background: #ececef; }
tr:hover td { background: #fafafa; }

.card { background: white; border-radius: 10px; padding: 1.1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 1rem; }

.btn {
  display: inline-block; background: var(--rd-orange); color: white; border: none;
  padding: 0.5rem 1rem; border-radius: 6px; text-decoration: none; cursor: pointer; font-size: 0.95rem;
  min-height: 44px; line-height: 1.3; /* touch-freundliche Mindestgroesse (Tablet/Handy) */
}
.btn:hover { background: var(--rd-orange-dark); }
.btn.secondary { background: #6c757d; }
.btn.danger { background: var(--rd-danger); }
.btn.small { padding: 0.3rem 0.6rem; font-size: 0.85rem; min-height: 34px; }

form.inline { display: inline; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.8rem 1.2rem; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } .mainnav { gap: 0.5rem; } }

label { display: block; font-size: 0.85rem; margin-bottom: 0.25rem; color: #555; }
input, select, textarea {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--rd-border); border-radius: 5px; font-size: 0.95rem;
  min-height: 42px; /* touch-freundlich */
}
textarea { min-height: 80px; }
.field { margin-bottom: 0.6rem; }

.badge { padding: 0.15rem 0.55rem; border-radius: 20px; font-size: 0.78rem; font-weight: 600; color: white; }
.badge.OFFEN, .badge.ENTWURF { background: #f0a500; }
.badge.BEZAHLT, .badge.ERHALTEN, .badge.EXPORTIERT { background: var(--rd-ok); }
.badge.STORNIERT { background: var(--rd-danger); }
.badge.BESTELLT, .badge.TEILWEISE_ERHALTEN, .badge.MAHNUNG { background: #1e6fd9; }

.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.stat { background: white; border-radius: 10px; padding: 1rem 1.4rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 160px; }
.stat .num { font-size: 1.8rem; font-weight: 700; color: var(--rd-orange); }

.disclaimer { background: #fdeeee; border: 1px solid #f3b8b8; padding: 0.7rem 1rem; border-radius: 8px; font-size: 0.88rem; margin-bottom: 1rem; }

#scan-video { width: 100%; max-width: 480px; border-radius: 8px; background: #000; }
.qr-img { image-rendering: pixelated; }

/* Tablet/groesserer Bildschirm: mehr Platz fuer die Kamera-Vorschau beim Scannen,
   und die Scan-Steuerung (Lagerort/Typ) nebeneinander statt untereinander. */
@media (min-width: 700px) {
  #scan-video { max-width: 640px; }
  .scan-controls { display: flex; gap: 1rem; }
  .scan-controls .field { flex: 1; margin-bottom: 0; }
}

@media print {
  .topbar, .no-print { display: none !important; }
  body { background: white; }
}
