/* ============================================================
   AVITEA – Design System
   Dark Mode, Modern, Mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* Colors */
  --bg:              #0a0f1e;
  --surface:         #121828;
  --surface-2:       #1a2236;
  --surface-3:       #222d42;
  --border:          #2a3550;
  --border-light:    #1e2d48;

  --primary:         #6c63ff;
  --primary-hover:   #5a52e8;
  --primary-glow:    rgba(108, 99, 255, 0.18);
  --primary-light:   rgba(108, 99, 255, 0.1);

  --accent:          #00c8b4;
  --accent-light:    rgba(0, 200, 180, 0.1);

  --success:         #10b981;
  --success-light:   rgba(16, 185, 129, 0.12);
  --success-border:  rgba(16, 185, 129, 0.25);

  --danger:          #f43f5e;
  --danger-light:    rgba(244, 63, 94, 0.12);
  --danger-border:   rgba(244, 63, 94, 0.25);

  --warning:         #f59e0b;
  --warning-light:   rgba(245, 158, 11, 0.12);
  --warning-border:  rgba(245, 158, 11, 0.25);

  --info:            #38bdf8;
  --info-light:      rgba(56, 189, 248, 0.12);

  /* Text */
  --text:            #e8edf5;
  --text-muted:      #8a96b0;
  --text-dim:        #5a6480;

  /* Layout */
  --nav-width:       260px;
  --radius:          14px;
  --radius-sm:       8px;
  --radius-xs:       5px;
  --shadow:          0 4px 32px rgba(0,0,0,0.4);
  --shadow-sm:       0 2px 12px rgba(0,0,0,0.25);
  --transition:      0.2s ease;
}

/* ── RESET & BASE ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

input, select, textarea, button { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; color: var(--text); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

/* ── LOADING SCREEN ─────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 9999;
  transition: opacity 0.4s;
}
#loading-screen.fade-out { opacity: 0; pointer-events: none; }

.loading-logo {
  font-size: 3rem;
  animation: pulse 1.5s ease infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-screen p { color: var(--text-muted); font-size: 0.9rem; }

/* ── CONFIG WARNING ─────────────────────────────────────────── */
#config-warning {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 9998; padding: 2rem;
}
.warning-box {
  background: var(--surface);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 520px;
  text-align: center;
}
.warning-box .w-icon { font-size: 3rem; margin-bottom: 1rem; }
.warning-box h2 { color: var(--warning); margin-bottom: 1rem; }
.warning-box p { color: var(--text-muted); margin-bottom: 0.75rem; }
.warning-box code {
  background: var(--surface-2); padding: 2px 8px;
  border-radius: var(--radius-xs); color: var(--accent); font-size: 0.85rem;
}

/* ── UTIL: HIDDEN ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── AUTH PAGES ─────────────────────────────────────────────── */
#auth-container {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(0,200,180,0.06) 0%, transparent 50%),
              var(--bg);
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { opacity:0; transform: translateY(24px); } to { opacity:1; transform: none; } }

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-logo-icon {
  width: 64px; height: 64px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  box-shadow: 0 0 30px var(--primary-glow);
}
.auth-logo h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; }

.auth-link { text-align: center; margin-top: 1.25rem; color: var(--text-muted); font-size: 0.875rem; }
.auth-link a { color: var(--primary); font-weight: 500; }

/* ── APP SHELL ──────────────────────────────────────────────── */
#app-shell { display: flex; min-height: 100vh; }

/* ── SIDEBAR NAV ────────────────────────────────────────────── */
#main-nav {
  width: var(--nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.nav-brand {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.nav-brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.nav-brand-text { font-weight: 800; font-size: 1.1rem; }
.nav-brand-sub { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }

.nav-section { flex: 1; padding: 1rem 0.75rem; overflow-y: auto; }
.nav-section-label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-dim); text-transform: uppercase;
  padding: 0 0.5rem; margin: 1rem 0 0.5rem;
}
.nav-section-label:first-child { margin-top: 0; }

.nav-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500; font-size: 0.9rem;
  transition: all var(--transition);
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
}
.nav-user {
  display: flex; align-items: center; gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0;
}
.user-info { overflow: hidden; }
.user-name { font-weight: 600; font-size: 0.85rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: var(--text-muted); }
.role-badge-admin { color: var(--warning); }
.role-badge-employee { color: var(--text-muted); }

/* ── HAMBURGER (Mobile) ─────────────────────────────────────── */
#hamburger-btn {
  display: none;
  position: fixed; top: 1rem; left: 1rem;
  z-index: 200;
  width: 42px; height: 42px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-direction: column; gap: 5px;
}
#hamburger-btn span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all 0.3s;
}
#hamburger-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
#hamburger-btn.open span:nth-child(2) { opacity: 0; }
#hamburger-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

#nav-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
  backdrop-filter: blur(2px);
}
#nav-overlay.visible { display: block; }

/* ── MAIN CONTENT ───────────────────────────────────────────── */
#main-content {
  flex: 1;
  margin-left: var(--nav-width);
  padding: 2rem;
  min-height: 100vh;
}

.page { display: none; animation: pageIn 0.3s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: none; } }

/* ── PAGE HEADER ────────────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h1 { margin: 0; }
.page-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; flex-wrap: wrap; gap: 0.75rem;
}
.card-header h2 { margin: 0; }

/* ── STATS GRID ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary-light); }
.stat-icon.success { background: var(--success-light); }
.stat-icon.warning { background: var(--warning-light); }
.stat-icon.accent  { background: var(--accent-light); }
.stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); box-shadow: 0 0 20px var(--primary-glow); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #0da271; box-shadow: 0 0 20px rgba(16,185,129,0.3); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #e03354; }

.btn-warning { background: var(--warning); color: #000; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { background: #e08900; }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }

.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }

.btn-full { width: 100%; justify-content: center; }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; }

.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-xs); color: var(--text-muted);
  cursor: pointer; transition: all var(--transition); font-size: 1rem;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--primary); }

.btn-back {
  display: flex; align-items: center; gap: 0.5rem;
  background: transparent; border: none;
  color: var(--text-muted); font-weight: 500; font-size: 0.875rem;
  cursor: pointer; transition: color var(--transition);
  padding: 0;
}
.btn-back:hover { color: var(--text); }

.app-version {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-align: center;
  margin: -0.15rem 0 0.65rem 0;
  opacity: 0.85;
}

.btn-logout {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; margin-bottom: 0.4rem;
  font-size: 0.85rem; font-weight: 500; color: var(--text-muted);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
input::placeholder { color: var(--text-dim); }

.quantity-input {
  display: flex; align-items: center; gap: 0.5rem;
}
.quantity-input input { text-align: center; width: 80px; }
.qty-btn {
  width: 38px; height: 38px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 1.25rem; line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--surface-3); border-color: var(--primary); color: var(--primary); }

/* ── SEARCH INPUT ───────────────────────────────────────────── */
.search-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  color: var(--text);
  font-size: 0.85rem;
  width: 220px;
  outline: none;
  transition: border-color var(--transition);
}
.search-input:focus { border-color: var(--primary); }

/* ── TABLES ─────────────────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: var(--surface-2); }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em;
  color: var(--text-muted); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody td { padding: 0.85rem 1rem; vertical-align: middle; }
tbody td:first-child { font-weight: 600; font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--accent); }

.table-empty {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); font-size: 0.9rem;
}
.table-empty .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* ── BADGES / STATUS ────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-open    { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-closed  { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-admin   { background: var(--primary-light); color: var(--primary); }
.badge-employee{ background: var(--surface-3); color: var(--text-muted); }

/* ── FILTER TABS ────────────────────────────────────────────── */
.filter-tabs {
  display: flex; gap: 0.4rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  width: fit-content;
}
.filter-tab {
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  padding: 0.45rem 1rem;
  color: var(--text-muted);
  font-weight: 500; font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-tab.active { background: var(--primary); color: #fff; }
.filter-tab:not(.active):hover { background: var(--surface-2); color: var(--text); }

/* ── ORDER CARDS ────────────────────────────────────────────── */
.orders-grid { display: grid; gap: 0.85rem; }
.order-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.order-card:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.order-card-left { flex: 1; min-width: 0; }
.order-card-number {
  font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.2rem;
  font-family: 'Courier New', monospace;
}
.order-card-customer { font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 1rem; flex-wrap: wrap; }
.order-card-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }

/* ── ORDER DETAIL ───────────────────────────────────────────── */
.order-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.info-block { background: var(--surface-2); border-radius: var(--radius-sm); padding: 1rem; }
.info-block-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.3rem; font-weight: 500; }
.info-block-value { font-weight: 700; font-size: 1rem; }

/* ── SCAN BUTTON (big, eye-catching) ────────────────────────── */
.scan-cta {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  background: var(--primary-light);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  margin-bottom: 1.5rem;
}
.scan-cta:hover { background: rgba(108,99,255,0.15); box-shadow: 0 0 30px var(--primary-glow); }
.scan-cta-icon { font-size: 3rem; animation: scanPulse 2s ease infinite; }
@keyframes scanPulse { 0%,100% { transform: scale(1); opacity:1; } 50% { transform: scale(1.05); opacity:0.8; } }
.scan-cta h3 { color: var(--primary); font-size: 1.1rem; }
.scan-cta p { color: var(--text-muted); font-size: 0.85rem; }

/* ── ITEMS TABLE: consumed highlight ───────────────────────── */
td.consumed-cell { font-weight: 700; color: var(--danger); }
td.consumed-zero  { color: var(--text-dim); }

/* ── IMPORT ZONE ────────────────────────────────────────────── */
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 1.25rem;
}
.import-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.import-zone:hover { border-color: var(--primary); }
.import-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.import-zone p { color: var(--text-muted); margin-bottom: 0.5rem; }
.import-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.5rem !important; }

.import-preview {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.import-preview p { color: var(--success); font-weight: 600; }

/* ── MODALS ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow);
  animation: scaleIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes scaleIn { from { transform: scale(0.93); opacity:0; } to { transform: scale(1); opacity:1; } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h3 { margin: 0; }

/* ── SCANNER MODAL ──────────────────────────────────────────── */
.scanner-modal-content { max-width: 520px; }

#qr-reader {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
/* Override html5-qrcode default styles */
#qr-reader__camera_selection { 
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  padding: 0.4rem; margin: 0.5rem 0; width: 100%;
}
#qr-reader__dashboard_section_csr span { color: var(--text-muted) !important; font-size: 0.8rem !important; }
#qr-reader__dashboard_section_swaplink { color: var(--primary) !important; }
#qr-reader__status_span { color: var(--text-muted) !important; font-size: 0.8rem !important; }

.scanner-hint {
  text-align: center; color: var(--text-muted);
  font-size: 0.85rem; margin-top: 1rem;
}

/* ── ARTICLE INFO IN MODAL ──────────────────────────────────── */
.article-info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.article-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.35rem 0;
}
.article-info-row:not(:last-child) { border-bottom: 1px solid var(--border-light); }
.article-info-label { font-size: 0.8rem; color: var(--text-muted); }
.article-info-value { font-weight: 600; font-size: 0.9rem; }

.action-btns-grid { display: grid; gap: 0.5rem; margin-top: 1rem; }
.action-btns-grid .btn { padding: 0.85rem; font-size: 0.9rem; }

/* ── TOAST NOTIFICATIONS ────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  z-index: 9000; max-width: 340px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: var(--shadow);
  animation: toastIn 0.3s ease;
  font-size: 0.875rem; font-weight: 500;
}
@keyframes toastIn { from { opacity:0; transform: translateX(100%); } to { opacity:1; transform: none; } }
.toast.out { animation: toastOut 0.3s ease forwards; }
@keyframes toastOut { to { opacity:0; transform: translateX(100%); } }
.toast-success { border-color: var(--success-border); }
.toast-success .toast-icon { color: var(--success); }
.toast-error   { border-color: var(--danger-border); }
.toast-error .toast-icon   { color: var(--danger); }
.toast-info    { border-color: var(--primary); }
.toast-info .toast-icon    { color: var(--primary); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ── ERROR MESSAGE ──────────────────────────────────────────── */
.error-message {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.9rem;
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.75rem;
}

/* ── SPINNER IN BUTTON ──────────────────────────────────────── */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── ARTICLE NOT FOUND ──────────────────────────────────────── */
.not-found-card {
  background: var(--warning-light);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
  margin-bottom: 1rem;
}
.not-found-card p { color: var(--warning); font-weight: 500; }

/* ── DIVIDER ────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1rem 0; }

/* ── CURRENT ITEM STATUS BADGE ──────────────────────────────── */
.item-status-row {
  display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center;
  font-size: 0.8rem; margin-top: 0.25rem;
}
.item-status-chip {
  background: var(--surface-3);
  border-radius: 100px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.item-status-chip.taken   { background: var(--danger-light);  color: var(--danger); }
.item-status-chip.stored  { background: var(--success-light); color: var(--success); }
.item-status-chip.returned{ background: var(--info-light);    color: var(--info); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  #hamburger-btn { display: flex; }

  #main-nav {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  #main-nav.open { transform: translateX(0); }

  #main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }

  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header-actions { width: 100%; }
  .page-header-actions .btn { flex: 1; justify-content: center; }

  .form-row { grid-template-columns: 1fr; }

  h1 { font-size: 1.4rem; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  .search-input { width: 100%; }

  #toast-container { bottom: 1rem; right: 1rem; left: 1rem; max-width: none; }

  .modal-content { padding: 1.25rem; }

  .filter-tabs { width: 100%; }
  .filter-tab { flex: 1; text-align: center; }

  .order-info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .order-info-grid { grid-template-columns: 1fr; }
}

/* V16: professionelle Datenverwaltung */
.page-subtitle{
  margin-top:.35rem;
  color:var(--text-muted);
  font-size:1rem;
}
.data-management-grid{
  display:grid;
  gap:1rem;
  margin-top:1rem;
}
.data-tile{
  width:100%;
  display:flex;
  align-items:center;
  gap:1rem;
  text-align:left;
  border:1px solid var(--border-color);
  background:var(--card-bg);
  color:var(--text-primary);
  border-radius:24px;
  padding:1.15rem 1.25rem;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
}
.data-tile:active{ transform:scale(.99); }
.data-tile-icon{
  width:56px;
  height:56px;
  min-width:56px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  background:rgba(108,92,231,.16);
  font-size:1.65rem;
}
.data-tile-text strong{
  display:block;
  font-size:1.15rem;
  margin-bottom:.25rem;
}
.data-tile-text small{
  display:block;
  color:var(--text-muted);
  line-height:1.35;
  font-size:.92rem;
}
.section-title-row{
  display:flex;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}
.btn-small{
  width:auto !important;
  padding:.65rem .85rem !important;
  white-space:nowrap;
}
.muted-small{
  color:var(--text-muted);
  font-size:.92rem;
  margin:.25rem 0 0;
}
.centered-hint{
  text-align:center;
  margin:.85rem 0 0;
}
.import-zone.compact{
  margin-top:1rem;
  padding:1.25rem;
  min-height:120px;
}
@media (min-width: 760px){
  .data-management-grid{ grid-template-columns:1fr 1fr; }
}


.order-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.order-item-actions .btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .order-item-actions {
    flex-direction: column;
    align-items: stretch;
  }
}


.edit-item-modal-content {
  max-width: 620px;
  width: min(94vw, 620px);
}

.edit-item-grid {
  display: grid;
  gap: 1rem;
}

.edit-item-qty-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.edit-item-hint {
  padding: 0.85rem;
  border-radius: var(--radius-md, 12px);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 640px) {
  .edit-item-qty-row {
    grid-template-columns: 1fr;
  }
}


.form-hint {
  display: block;
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.badge-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-active {
  background: rgba(16, 185, 129, 0.14);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* V28 UI */
#material-search-btn{background:linear-gradient(135deg,#7b68ee,#6c63ff)!important;color:#fff!important;min-height:56px;}


/* V29 – klickbare Auftragsfelder und luftigere Hauptbuttons */
.editable-info-block {
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.editable-info-block:hover {
  border-color: var(--primary);
  background: rgba(108,99,255,0.10);
  transform: translateY(-1px);
}
.editable-info-block .info-block-value::after {
  content: "  ✎";
  color: var(--primary);
  font-size: 0.9em;
  opacity: .85;
}
.order-main-action {
  min-height: 64px;
  font-size: 1rem;
  border-radius: var(--radius);
  justify-content: center;
  box-shadow: 0 0 18px rgba(108,99,255,0.18);
}


/* V30: Passwort-Reset / Admin-Aktionen */
.success-message {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #bbf7d0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.admin-action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: stretch;
}

.admin-action-stack .btn {
  white-space: nowrap;
}

/* ============================================================
   V39 – Scan-Dialog + Tablet-Layout
   ============================================================ */

/* Scan-Vorschau: Beschriftungen und Eingabefelder sauber ausrichten */
#action-modal .article-info-row {
  display: grid;
  grid-template-columns: minmax(105px, 135px) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

#action-modal .article-info-label {
  padding-top: 0.7rem;
  line-height: 1.25;
}

#action-modal .article-info-value {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
}

#action-modal #action-fm-number {
  padding-top: 0.65rem;
  text-align: right;
}

#action-modal #manual-article-name-input,
#action-modal #manual-article-unit-input {
  width: 100% !important;
  max-width: 100%;
  min-width: 0;
}

/* Die Seite selbst darf auf Handy und Tablet niemals seitlich verschoben werden. */
html,
body,
#app-shell,
#main-content,
.page {
  max-width: 100%;
}

#app-shell,
#main-content {
  min-width: 0;
}

@media (max-width: 1180px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden !important;
  }

  #app-shell {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 4.75rem 1rem 1.5rem !important;
    overflow-x: hidden !important;
  }

  #main-content > .page,
  .page.active {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
  }

  .page-header,
  .page-header-actions,
  .card,
  .order-info-grid,
  .orders-grid,
  #order-detail-actions,
  #order-info-card,
  #order-items-card,
  #scan-cta-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #order-detail-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.65rem !important;
  }

  #order-detail-actions .btn {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    text-align: center;
    justify-content: center;
  }

  .order-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .info-block,
  .info-block-value {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .modal-content {
    width: min(94vw, 620px) !important;
    max-width: 94vw !important;
  }
}

@media (max-width: 700px) {
  #order-detail-actions {
    grid-template-columns: 1fr !important;
  }

  .order-info-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  #action-modal .article-info-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  #action-modal .article-info-label,
  #action-modal #action-fm-number {
    padding-top: 0;
    text-align: left;
  }
}


/* V40 – Lagerbestand, Importvorschau und Lagerzählung */
.import-mode-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem;margin-bottom:1rem}
.import-mode-card{display:flex;gap:.8rem;align-items:flex-start;padding:1rem;border:1px solid var(--border);border-radius:14px;background:var(--surface-2);color:var(--text);cursor:pointer}
.import-mode-card:has(input:checked){border-color:var(--primary);box-shadow:0 0 0 2px rgba(108,99,255,.18)}
.import-mode-card input{margin-top:.25rem}.import-mode-card span{display:flex;flex-direction:column;gap:.25rem}.import-mode-card small{color:var(--text-muted);line-height:1.35}
.import-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem;margin:1rem 0}.import-summary-box{padding:.8rem;border-radius:12px;background:var(--surface-2);border:1px solid var(--border);text-align:center}.import-summary-box strong{display:block;font-size:1.4rem}.import-conflicts{max-height:220px;overflow:auto;margin:.75rem 0;padding:.75rem;border:1px solid rgba(245,158,11,.45);border-radius:12px;background:rgba(245,158,11,.08)}
.inventory-count-card{max-width:850px}.inventory-count-actions{display:grid;gap:1rem}.inventory-manual-row{display:grid;grid-template-columns:1fr auto;gap:.65rem}.inventory-empty-state{margin-top:1rem;padding:2rem;text-align:center;color:var(--text-muted);border:1px dashed var(--border);border-radius:14px}.inventory-result-card{margin-top:1rem;padding:1.1rem;border:1px solid var(--border);border-radius:16px;background:var(--surface-2)}.inventory-result-head{display:flex;justify-content:space-between;gap:1rem;align-items:flex-start}.inventory-stock-number{font-size:2rem;font-weight:800;color:#22c55e}.inventory-count-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-top:1rem}.inventory-count-buttons{display:grid;grid-template-columns:1fr 1fr;gap:.75rem;margin-top:1rem}.stock-badge{display:inline-flex;align-items:center;gap:.35rem;padding:.35rem .7rem;border-radius:999px;border:1px solid rgba(34,197,94,.45);background:rgba(34,197,94,.1);color:#34d399;font-weight:700}.stock-untracked{border-color:rgba(148,163,184,.4);background:rgba(148,163,184,.08);color:var(--text-muted)}
.admin-action-stack .inventory-permission-btn{white-space:nowrap}
@media(max-width:760px){.import-mode-grid,.import-summary-grid,.inventory-count-grid,.inventory-count-buttons{grid-template-columns:1fr}.inventory-manual-row{grid-template-columns:1fr}.inventory-result-head{flex-direction:column}}

/* V41 – Bestandswarnungen */
.stock-alert-card { border: 1px solid rgba(251, 191, 36, .38); margin: 12px 0; }
.stock-alert-list { display: grid; gap: .75rem; }
.stock-alert-row { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem; border-radius:14px; background:rgba(251,191,36,.08); border:1px solid rgba(251,191,36,.18); }
@media (max-width: 700px){ .stock-alert-row { align-items:stretch; flex-direction:column; } }


/* ── V47: Anklickbare Excel-Konfliktprüfung ───────────────── */
.import-summary-box.import-summary-clickable{
  appearance:none;
  width:100%;
  color:var(--text);
  font:inherit;
  cursor:pointer;
  transition:border-color .18s ease,transform .18s ease,box-shadow .18s ease,background .18s ease;
}
.import-summary-box.import-summary-clickable span{display:block}
.import-summary-box.import-summary-clickable small{display:block;margin-top:.28rem;color:var(--primary);font-size:.73rem;font-weight:700}
.import-summary-box.import-summary-clickable:not(:disabled):hover,
.import-summary-box.import-summary-clickable:not(:disabled):focus-visible{
  border-color:var(--primary);
  background:rgba(108,99,255,.12);
  box-shadow:0 0 0 3px rgba(108,99,255,.16);
  transform:translateY(-2px);
  outline:none;
}
.import-summary-box.import-summary-disabled{cursor:default;opacity:.72}
.import-conflict-modal-content{max-width:1050px;padding:1.5rem}
.import-conflict-header{align-items:flex-start;margin-bottom:.65rem}
.import-conflict-header p{margin:.25rem 0 0;color:var(--success);word-break:break-word}
.conflict-explanation{margin:0 0 1rem;color:var(--text-muted);line-height:1.5}
.import-conflict-toolbar{display:grid;grid-template-columns:minmax(0,2fr) minmax(180px,1fr);gap:.85rem;align-items:end;margin-bottom:.5rem}
.import-conflict-toolbar .form-group{margin-bottom:0}
.import-conflict-toolbar input,.import-conflict-toolbar select{width:100%}
.conflict-result-count{color:var(--text-muted);font-size:.88rem;margin:.7rem 0}
.import-conflict-list{display:flex;flex-direction:column;gap:.7rem;max-height:58vh;overflow:auto;padding-right:.2rem}
.conflict-card{border:1px solid var(--border);border-radius:14px;background:var(--surface-2);overflow:hidden;color:var(--text)}
.conflict-card.is-open{border-color:rgba(245,158,11,.65);box-shadow:0 0 0 2px rgba(245,158,11,.1)}
.conflict-card-toggle{appearance:none;-webkit-appearance:none;width:100%;min-height:64px;border:0;background:transparent;color:var(--text);display:flex;justify-content:space-between;gap:1rem;align-items:center;padding:.95rem 1rem;text-align:left;cursor:pointer}
.conflict-card-toggle:hover,.conflict-card-toggle:focus-visible{background:rgba(108,99,255,.08);outline:none}
.conflict-card-chevron{flex:0 0 auto;font-size:1.25rem;color:var(--text-muted);transition:transform .18s ease}
.conflict-card.is-open .conflict-card-chevron{transform:rotate(180deg)}
.conflict-card-title{display:flex;flex-direction:column;gap:.2rem;min-width:0;flex:1}
.conflict-card-title strong{font-size:1rem;color:var(--text)}
.conflict-card-title span{color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conflict-card-badges{display:flex;gap:.35rem;flex-wrap:wrap;justify-content:flex-end}
.conflict-type-badge{display:inline-flex;align-items:center;padding:.25rem .48rem;border-radius:999px;font-size:.72rem;font-weight:800;background:rgba(148,163,184,.14);color:var(--text-muted);border:1px solid var(--border)}
.conflict-type-description{background:rgba(59,130,246,.13);color:#93c5fd;border-color:rgba(59,130,246,.35)}
.conflict-type-stock{background:rgba(245,158,11,.13);color:#fbbf24;border-color:rgba(245,158,11,.35)}
.conflict-type-unit{background:rgba(168,85,247,.13);color:#c4b5fd;border-color:rgba(168,85,247,.35)}
.conflict-card-body{border-top:1px solid var(--border);padding:1rem;display:grid;gap:1rem;color:var(--text)}
.conflict-card-body[hidden]{display:none!important}
.conflict-card-body h4{margin:0 0 .65rem;font-size:.94rem}
.conflict-db-box,.conflict-excel-box{padding:.85rem;border:1px solid var(--border);border-radius:12px;background:rgba(15,23,42,.28)}
.conflict-db-grid{display:grid;grid-template-columns:minmax(100px,.35fr) minmax(0,1fr);gap:.45rem .8rem;font-size:.88rem}
.conflict-db-grid span{color:var(--text-muted)}
.conflict-db-grid strong{overflow-wrap:anywhere;color:var(--text)}
.conflict-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.conflict-table{width:100%;min-width:720px;border-collapse:collapse;font-size:.84rem;color:var(--text)}
.conflict-table th,.conflict-table td{text-align:left;padding:.55rem .6rem;border-bottom:1px solid var(--border);vertical-align:top}
.conflict-table th{color:var(--text-muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.04em}
.conflict-table tbody tr:last-child td{border-bottom:0}
.conflict-note{margin:0;padding:.75rem;border-radius:10px;background:rgba(245,158,11,.08);color:#fcd34d;font-size:.82rem;line-height:1.45}
.conflict-empty{text-align:center;padding:2.2rem 1rem;border:1px dashed var(--border);border-radius:12px;color:var(--text-muted)}
.import-conflict-footer{display:flex;justify-content:flex-end;margin-top:1rem}
@media(max-width:760px){
  .import-conflict-modal-content{padding:1rem;max-height:95vh}
  .import-conflict-toolbar{grid-template-columns:1fr}
  .import-conflict-list{max-height:55vh}
  .conflict-card-toggle{align-items:flex-start;flex-wrap:wrap}
  .conflict-card-badges{justify-content:flex-start;width:calc(100% - 2rem)}
  .conflict-db-grid{grid-template-columns:1fr}
  .conflict-db-grid span{margin-top:.25rem}
  .import-conflict-footer .btn{width:100%}
}

/* V47.2 – robuste, immer sichtbare Konfliktliste */
.conflict-visible-card-v472{
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface-2);
  padding:1rem;
  color:var(--text);
}
.conflict-visible-head-v472{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding-bottom:.85rem;
  border-bottom:1px solid var(--border);
}
.conflict-visible-title-v472{display:flex;flex-direction:column;gap:.25rem;min-width:0}
.conflict-visible-title-v472 strong{font-size:1.05rem;color:var(--text)}
.conflict-visible-title-v472 span{color:var(--text-muted);overflow-wrap:anywhere}
.conflict-visible-badges-v472{display:flex;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.conflict-visible-compare-v472{
  display:grid;
  grid-template-columns:minmax(240px,.7fr) minmax(0,1.3fr);
  gap:1rem;
  margin-top:1rem;
}
.conflict-visible-box-v472{
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(15,23,42,.28);
  padding:.85rem;
  min-width:0;
}
.conflict-visible-box-v472 h4{margin:0 0 .75rem;color:var(--text);font-size:.95rem}
.conflict-value-row-v472{
  display:grid;
  grid-template-columns:105px minmax(0,1fr);
  gap:.65rem;
  padding:.35rem 0;
  border-bottom:1px solid rgba(148,163,184,.13);
}
.conflict-value-row-v472:last-child{border-bottom:0}
.conflict-value-label-v472{color:var(--text-muted);font-size:.82rem}
.conflict-value-text-v472{color:var(--text);font-size:.86rem;overflow-wrap:anywhere}
.conflict-muted-v472{margin:0;color:var(--text-muted)}
.conflict-table-wrap-v472{overflow-x:auto;-webkit-overflow-scrolling:touch}
.conflict-table-v472{width:100%;min-width:700px;border-collapse:collapse;color:var(--text);font-size:.84rem}
.conflict-table-v472 th,.conflict-table-v472 td{
  text-align:left;
  padding:.55rem .6rem;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
.conflict-table-v472 th{font-size:.72rem;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted)}
.conflict-table-v472 td{color:var(--text)}
.conflict-table-v472 tbody tr:last-child td{border-bottom:0}
@media(max-width:760px){
  .conflict-visible-head-v472{flex-direction:column}
  .conflict-visible-badges-v472{justify-content:flex-start}
  .conflict-visible-compare-v472{grid-template-columns:1fr}
}


/* V47.3 – Konflikte auswählen und auflösen */
.conflict-resolved-card-v473{
  border-color:rgba(34,197,94,.45);
  box-shadow:0 0 0 1px rgba(34,197,94,.08);
}
.conflict-type-resolved-v473{
  background:rgba(34,197,94,.14);
  color:#6ee7b7;
  border-color:rgba(34,197,94,.4);
}
.conflict-resolution-box-v473{
  margin-top:1rem;
  padding:1rem;
  border:1px solid rgba(108,99,255,.32);
  border-radius:12px;
  background:rgba(108,99,255,.06);
}
.conflict-resolution-box-v473 h4{
  margin:0 0 .8rem;
  color:var(--text);
  font-size:.95rem;
}
.conflict-resolution-options-v473{
  display:grid;
  gap:.6rem;
}
.conflict-resolution-option-v473{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:.7rem;
  align-items:flex-start;
  padding:.8rem;
  border:1px solid var(--border);
  border-radius:11px;
  background:rgba(15,23,42,.22);
  cursor:pointer;
  transition:border-color .15s ease,background .15s ease,box-shadow .15s ease;
}
.conflict-resolution-option-v473:hover{
  border-color:rgba(108,99,255,.55);
  background:rgba(108,99,255,.08);
}
.conflict-resolution-option-v473:has(input:checked){
  border-color:var(--primary);
  background:rgba(108,99,255,.13);
  box-shadow:0 0 0 2px rgba(108,99,255,.12);
}
.conflict-resolution-option-v473 input{
  margin-top:.2rem;
  accent-color:var(--primary);
}
.conflict-resolution-option-text-v473{
  display:flex;
  flex-direction:column;
  gap:.18rem;
  min-width:0;
}
.conflict-resolution-option-text-v473 strong{
  color:var(--text);
  overflow-wrap:anywhere;
}
.conflict-resolution-option-text-v473 small{
  color:var(--text-muted);
  line-height:1.4;
  overflow-wrap:anywhere;
}
.conflict-resolution-actions-v473{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.8rem;
  margin-top:.85rem;
}
.conflict-resolution-selected-v473{
  margin-right:auto;
  color:#6ee7b7;
  font-size:.86rem;
  font-weight:700;
}
.conflict-resolution-status-v473{
  color:var(--text-muted);
  font-size:.88rem;
  margin-right:auto;
}
.import-conflict-footer{
  align-items:center;
  gap:1rem;
}
.import-conflict-blocker-v473{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  margin:1rem 0;
  padding:.85rem 1rem;
  border:1px solid rgba(245,158,11,.35);
  border-radius:12px;
  background:rgba(245,158,11,.08);
  color:#fcd34d;
}
.import-conflict-blocker-v473 span{
  color:var(--text-muted);
  font-size:.86rem;
}
.import-mode-card:disabled{
  cursor:not-allowed;
  opacity:.5;
  filter:saturate(.7);
}
.import-mode-card:disabled:hover{
  transform:none;
  border-color:var(--border);
  box-shadow:none;
}
@media(max-width:760px){
  .conflict-resolution-actions-v473{
    align-items:stretch;
    flex-direction:column;
  }
  .conflict-resolution-selected-v473{
    margin-right:0;
  }
  .conflict-resolution-actions-v473 .btn{
    width:100%;
  }
  .import-conflict-footer{
    align-items:stretch;
    flex-direction:column;
  }
  .conflict-resolution-status-v473{
    margin-right:0;
  }
}

/* v48 – stabiler, paketweiser Excel-Import */
.import-progress-v474 {
  display: none;
  margin: 18px 0;
  padding: 15px 16px;
  border: 1px solid var(--border, #2a3857);
  border-radius: 12px;
  background: rgba(15, 23, 42, .5);
}
.import-progress-v474.is-visible { display: block; }
.import-progress-head-v474 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.import-progress-track-v474 {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .22);
}
.import-progress-track-v474 > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #695cff, #16c79a);
  transition: width .2s ease;
}
#import-progress-detail-v48 {
  display: block;
  margin-top: 9px;
  color: var(--text-muted, #94a3b8);
}

/* v50.5 – Rollengetrennte Lagerzählung */
/* v50.4 – Avitea Rebranding & UI Polish */
/* v50.3 – Lagerzählungsprotokoll und Export */
.inventory-history-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap}
.inventory-export-actions{display:flex;gap:.6rem;flex-wrap:wrap}
.inventory-history-filters{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:.8rem;margin:1rem 0}
.inventory-history-summary{margin:.35rem 0 .85rem}
.inventory-diff-positive{color:#f59e0b;font-weight:700}.inventory-diff-negative{color:#ef4444;font-weight:700}.inventory-diff-zero{color:#22c55e;font-weight:700}
@media(max-width:900px){.inventory-history-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.inventory-history-filters{grid-template-columns:1fr}.inventory-export-actions{width:100%}.inventory-export-actions .btn{flex:1 1 100%}}


/* ============================================================
   v50.4 – AVITEA REBRANDING
   Transparente Markenlogos in Login, Ladebild und Navigation
   ============================================================ */
.loading-logo {
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.5s ease infinite;
}
.loading-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-logo-icon {
  width: 92px;
  height: 92px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}
.auth-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.auth-logo h1 {
  letter-spacing: -0.02em;
}

.nav-brand-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
.nav-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.nav-brand-text {
  letter-spacing: -0.01em;
}


/* v50.6 – Das mobile Schließen-X wird ausgeblendet.
   Das Menü lässt sich weiterhin durch Tippen außerhalb schließen. */
@media (max-width: 900px) {
  .sidebar-close,
  .nav-close,
  .mobile-nav-close,
  #sidebar-close,
  #nav-close,
  [data-action="close-sidebar"] {
    display: none !important;
  }
}


/* ============================================================
   v50.7 – Menü-Icon korrigiert
   Das bisherige X ist der geöffnete Hamburger-Button selbst.
   Während das mobile Menü geöffnet ist, wird dieser Button
   vollständig ausgeblendet. Schließen erfolgt per Tipp auf
   den Bereich neben dem Menü.
   ============================================================ */
@media (max-width: 900px) {
  #hamburger-btn.open {
    display: none !important;
  }
}


/* ============================================================
   v51.0 – WARENEINGANG SCHRITT 2
   ============================================================ */
.goods-receipts-page-header .page-subtitle { max-width: 760px; }
.goods-receipt-step-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.15rem;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(249, 115, 22, .35);
  background: rgba(249, 115, 22, .08);
  border-radius: var(--radius);
}
.goods-receipt-step-notice p { margin: .25rem 0 0; color: var(--text-muted); line-height: 1.45; }
.goods-receipt-step-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}
.goods-receipt-stats .stat-icon { display: grid; place-items: center; font-size: 1.4rem; background: var(--surface-2); }
.goods-receipt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.goods-receipt-toolbar .filter-tabs { margin-bottom: 0; }
.goods-receipt-search { flex: 1 1 360px; max-width: 620px; margin: 0; }
.goods-receipt-grid { display: grid; gap: .85rem; }
.goods-receipt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.goods-receipt-card:hover { transform: translateY(-1px); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.goods-receipt-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.goods-receipt-card-number { font-family: 'Courier New', monospace; font-weight: 800; color: var(--primary); margin-bottom: .25rem; }
.goods-receipt-card-title { font-size: 1.05rem; font-weight: 750; }
.goods-receipt-card-subtitle { color: var(--text-muted); margin-top: .2rem; font-size: .87rem; }
.goods-receipt-card-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-top: .9rem; color: var(--text-muted); font-size: .82rem; }
.goods-receipt-card-meta strong { color: var(--text); font-weight: 650; }
.goods-receipt-card-footer { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--border-light); flex-wrap: wrap; }
.goods-receipt-destination-label { font-size: .82rem; color: var(--text-muted); }
.goods-receipt-edit-hint { font-size: .78rem; color: var(--primary); font-weight: 650; }
.badge-gr-draft { background: rgba(148,163,184,.16); color: #cbd5e1; border: 1px solid rgba(148,163,184,.3); }
.badge-gr-progress { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-gr-completed { background: var(--success-light); color: var(--success); border: 1px solid var(--success-border); }
.badge-gr-offline { background: rgba(99,102,241,.14); color: #a5b4fc; border: 1px solid rgba(99,102,241,.28); }
.goods-receipt-modal-content { max-width: 760px; }
.goods-receipt-modal-subtitle { margin: .25rem 0 0; }
.goods-receipt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.goods-receipt-grid-wide { grid-column: 1 / -1; }
.optional-label { font-size: .72rem; font-weight: 500; color: var(--text-muted); }
.goods-receipt-destination-fieldset { border: 0; padding: 0; margin: .25rem 0 1rem; min-width: 0; }
.goods-receipt-destination-fieldset legend { font-size: .85rem; font-weight: 650; margin-bottom: .55rem; }
.goods-receipt-destination-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.goods-receipt-destination-option {
  position: relative;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.goods-receipt-destination-option:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.goods-receipt-destination-option input { margin-top: .25rem; accent-color: var(--primary); }
.goods-receipt-destination-option strong { display: block; font-size: .9rem; }
.goods-receipt-destination-option small { display: block; color: var(--text-muted); font-size: .75rem; line-height: 1.35; margin-top: .2rem; }
.goods-receipt-option-icon { font-size: 1.25rem; }
.goods-receipt-scope-warning { padding: .85rem 1rem; margin: .2rem 0 1rem; border-radius: var(--radius-sm); background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: var(--text-muted); font-size: .82rem; line-height: 1.45; }
.goods-receipt-scope-warning strong { color: var(--warning); }
.goods-receipt-modal-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: .3rem; }
#goods-receipt-notes { resize: vertical; min-height: 82px; }

@media (max-width: 720px) {
  .goods-receipt-form-grid,
  .goods-receipt-destination-options { grid-template-columns: 1fr; }
  .goods-receipt-grid-wide { grid-column: auto; }
  .goods-receipt-toolbar { align-items: stretch; }
  .goods-receipt-toolbar .filter-tabs { width: 100%; overflow-x: auto; }
  .goods-receipt-toolbar .filter-tab { white-space: nowrap; }
  .goods-receipt-search { max-width: none; width: 100%; }
  .goods-receipt-modal-actions { flex-direction: column-reverse; }
  .goods-receipt-modal-actions .btn { width: 100%; justify-content: center; }
}


/* ── v51.0 Schritt 2: Lieferschein-Upload und Archiv ───────── */
.badge-gr-ocr {
  background: rgba(59, 130, 246, .12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, .28);
  white-space: nowrap;
}
.goods-receipt-documents-section {
  margin: .35rem 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.goods-receipt-documents-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.goods-receipt-documents-header h4 { margin: 0; font-size: 1rem; }
.goods-receipt-documents-header p { margin: .25rem 0 0; color: var(--text-muted); font-size: .78rem; line-height: 1.4; }
.goods-receipt-upload-actions { display: flex; gap: .65rem; flex-wrap: wrap; }
.goods-receipt-upload-actions .btn { justify-content: center; }
.visually-hidden-file-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.goods-receipt-upload-note {
  margin-top: .7rem;
  padding: .65rem .75rem;
  border-radius: 9px;
  background: rgba(99, 102, 241, .08);
  color: var(--text-muted);
  font-size: .75rem;
  line-height: 1.4;
}
.goods-receipt-upload-note.is-offline { background: rgba(245, 158, 11, .1); color: var(--warning); }
.goods-receipt-documents-list { display: grid; gap: .55rem; margin-top: .75rem; }
.goods-receipt-documents-empty {
  padding: .85rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  text-align: center;
  font-size: .8rem;
}
.goods-receipt-document-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .7rem;
  padding: .7rem;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--surface);
}
.goods-receipt-document-row.document-status-error { border-color: var(--danger-border); background: var(--danger-light); }
.goods-receipt-document-row.document-status-success { border-color: var(--success-border); }
.goods-receipt-document-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 1.15rem;
}
.goods-receipt-document-info { min-width: 0; }
.goods-receipt-document-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .84rem; }
.goods-receipt-document-info small { display: block; margin-top: .18rem; color: var(--text-muted); font-size: .7rem; line-height: 1.3; }
.goods-receipt-document-open { min-height: 34px !important; padding: .35rem .65rem; font-size: .74rem; text-decoration: none; }
.goods-receipt-upload-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: goodsReceiptSpin .8s linear infinite;
}
@keyframes goodsReceiptSpin { to { transform: rotate(360deg); } }

/* Nur die Wareneingangs-Kennzahlen auf Mobilgeräten kompakt als 2 × 2 Raster. */
@media (max-width: 720px) {
  .goods-receipt-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .65rem !important;
  }
  .goods-receipt-stats .stat-card {
    padding: .8rem !important;
    gap: .65rem !important;
    border-radius: 14px !important;
    min-width: 0;
  }
  .goods-receipt-stats .stat-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
  }
  .goods-receipt-stats .stat-value { font-size: 1.55rem !important; }
  .goods-receipt-stats .stat-label { font-size: .75rem !important; }
  .goods-receipt-upload-actions { display: grid; grid-template-columns: 1fr; }
  .goods-receipt-upload-actions .btn { width: 100%; }
  .goods-receipt-document-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: .55rem; padding: .6rem; }
  .goods-receipt-document-open { padding: .35rem .5rem; }
}


/* ============================================================
   v51.0 – WARENEINGANG ABLAUF-UPDATE
   ============================================================ */
.goods-receipt-total-icon img {
  width: 30px !important;
  height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  object-fit: contain;
  display: block;
}
.goods-receipt-primary-step {
  border: 2px solid rgba(102, 92, 255, .62);
  background: linear-gradient(180deg, rgba(102, 92, 255, .10), var(--surface-2));
  margin-top: .1rem;
}
.goods-receipt-workflow-heading {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.goods-receipt-workflow-heading h4,
.goods-receipt-details-section h4,
.goods-receipt-items-section h4 {
  margin: 0;
  font-size: 1.02rem;
}
.goods-receipt-workflow-heading p,
.goods-receipt-items-header p,
.goods-receipt-section-heading p {
  margin: .2rem 0 0;
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.4;
}
.goods-receipt-workflow-number {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  font-size: .82rem;
}
.goods-receipt-upload-actions-primary {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}
.goods-receipt-upload-actions-primary .btn {
  min-height: 52px;
  font-weight: 750;
}
.goods-receipt-document-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  flex-wrap: wrap;
  margin-top: .8rem;
}
.goods-receipt-document-state-row small { color: var(--text-muted); }
.goods-receipt-items-section,
.goods-receipt-details-section {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.goods-receipt-items-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .8rem;
  flex-wrap: wrap;
  margin-bottom: .85rem;
}
.goods-receipt-items-preview {
  display: grid;
  gap: .55rem;
}
.goods-receipt-items-empty {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  text-align: center;
}
.goods-receipt-items-empty.is-ready {
  border-color: rgba(245, 158, 11, .35);
  background: rgba(245, 158, 11, .07);
}
.goods-receipt-items-empty strong { color: var(--text); }
.goods-receipt-items-empty p { margin: .35rem 0 0; line-height: 1.45; font-size: .8rem; }
.goods-receipt-position-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--surface);
}
.goods-receipt-position-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
}
.goods-receipt-position-main strong { display: block; font-size: .86rem; }
.goods-receipt-position-main small { display: block; margin-top: .18rem; color: var(--text-muted); font-size: .74rem; }
.goods-receipt-position-state { font-size: .72rem; font-weight: 700; white-space: nowrap; }
.goods-receipt-position-state.is-ok { color: var(--success); }
.goods-receipt-position-state.is-review { color: var(--warning); }
.goods-receipt-section-heading { margin-bottom: .9rem; }
.goods-receipt-destination-fieldset legend {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .9rem;
}
body:has(#goods-receipt-modal:not(.hidden)) #hamburger-btn { display: none !important; }

@media (max-width: 720px) {
  .goods-receipt-step-notice { padding: .8rem; gap: .7rem; }
  .goods-receipt-step-notice p { font-size: .78rem; }
  .goods-receipt-upload-actions-primary { grid-template-columns: 1fr; }
  .goods-receipt-position-row { grid-template-columns: 28px minmax(0, 1fr); }
  .goods-receipt-position-state { grid-column: 2; }
  .goods-receipt-modal-content { padding-top: 1rem; }
}

/* ============================================================
   v51.1 – LIEFERSCHEIN-ERKENNUNG UND PRÜFLISTE
   ============================================================ */
.goods-receipt-stats .goods-receipt-total-icon {
  overflow: hidden !important;
  padding: 7px !important;
}
.goods-receipt-stats .goods-receipt-total-icon img {
  width: 24px !important;
  height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  object-fit: contain !important;
}
.badge-gr-ocr.is-analyzed {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success-border);
}
.badge-gr-ocr.is-failed {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger-border);
}
.goods-receipt-analysis-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .8rem;
  flex-wrap: wrap;
}
.goods-receipt-analysis-actions .btn { flex: 1 1 240px; justify-content: center; }
.goods-receipt-analysis-actions small { flex: 1 1 240px; color: var(--text-muted); line-height: 1.4; }
.goods-receipt-analysis-progress {
  margin-top: .75rem;
  padding: .75rem;
  border: 1px solid rgba(59,130,246,.25);
  border-radius: 10px;
  background: rgba(59,130,246,.07);
}
.goods-receipt-analysis-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-light);
}
.goods-receipt-analysis-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #38bdf8);
  transition: width .2s ease;
}
.goods-receipt-analysis-progress small { display: block; margin-top: .45rem; color: var(--text-muted); }
.goods-receipt-items-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .8rem;
}
.goods-receipt-items-actions .btn { flex: 1 1 220px; justify-content: center; }
.goods-receipt-edit-position {
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.goods-receipt-edit-position.is-ok { border-color: rgba(34,197,94,.32); }
.goods-receipt-edit-position.is-review { border-color: rgba(245,158,11,.38); }
.goods-receipt-edit-position.is-error { border-color: rgba(239,68,68,.38); }
.goods-receipt-edit-position-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .65rem;
  margin-bottom: .7rem;
}
.goods-receipt-edit-position-head .goods-receipt-position-state { justify-self: start; }
.goods-receipt-position-state.is-error { color: var(--danger); }
.goods-receipt-position-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem .75rem;
}
.goods-receipt-position-fields .form-group { margin: 0; }
.goods-receipt-position-fields label { font-size: .72rem; }
.goods-receipt-position-fields input,
.goods-receipt-position-fields select,
.goods-receipt-position-fields textarea {
  min-height: 42px;
  padding: .62rem .7rem;
  font-size: .82rem;
}
.goods-receipt-position-fields textarea { resize: vertical; }
.goods-receipt-position-description,
.goods-receipt-position-article { grid-column: 1 / -1; }
.goods-receipt-position-article small { display: block; margin-top: .28rem; color: var(--text-muted); font-size: .7rem; line-height: 1.35; }
.goods-receipt-candidate-list {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .7rem;
  padding-top: .65rem;
  border-top: 1px solid var(--border-light);
}
.goods-receipt-candidate-list > span { color: var(--text-muted); font-size: .72rem; }
.goods-receipt-candidate-btn {
  border: 1px solid rgba(102,92,255,.35);
  background: var(--primary-light);
  color: var(--text);
  border-radius: 999px;
  padding: .34rem .58rem;
  font: inherit;
  font-size: .68rem;
  cursor: pointer;
}
.goods-receipt-candidate-btn:hover { border-color: var(--primary); }
.goods-receipt-order-suggestion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: -.2rem 0 1rem;
  padding: .8rem;
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 11px;
  background: rgba(34,197,94,.08);
}
.goods-receipt-order-suggestion > div { display: grid; gap: .18rem; }
.goods-receipt-order-suggestion strong { color: var(--success); }
.goods-receipt-order-suggestion span,
.goods-receipt-order-suggestion small { color: var(--text-muted); line-height: 1.35; }
.goods-receipt-ocr-details {
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.goods-receipt-ocr-details summary {
  padding: .75rem;
  cursor: pointer;
  font-weight: 650;
  font-size: .78rem;
}
.goods-receipt-ocr-details summary span { color: var(--text-muted); font-weight: 500; margin-left: .35rem; }
.goods-receipt-ocr-details pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: .8rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  background: #080d19;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: .68rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .goods-receipt-stats .goods-receipt-total-icon img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
  }
  .goods-receipt-position-fields { grid-template-columns: 1fr; }
  .goods-receipt-position-description,
  .goods-receipt-position-article { grid-column: auto; }
  .goods-receipt-order-suggestion { align-items: stretch; flex-direction: column; }
  .goods-receipt-order-suggestion .btn { width: 100%; justify-content: center; }
  .goods-receipt-analysis-actions { display: grid; grid-template-columns: 1fr; }
  .goods-receipt-items-actions { display: grid; grid-template-columns: 1fr; }
}

/* ============================================================
   v51.2 – WARENEINGANGSPRÜFUNG UND VERBINDLICHE BUCHUNG
   ============================================================ */
.goods-receipt-delivery-state {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-left: auto;
  border-radius: 999px;
  padding: .35rem .65rem;
  font-size: .77rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}
.goods-receipt-delivery-state.is-delivery-complete { color: #34d399; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.35); }
.goods-receipt-delivery-state.is-delivery-partial { color: #fbbf24; background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.35); }
.goods-receipt-delivery-state.is-delivery-missing { color: #fb7185; background: rgba(244,63,94,.12); border-color: rgba(244,63,94,.34); }
.goods-receipt-delivery-state.is-delivery-damaged { color: #f59e0b; background: rgba(217,119,6,.14); border-color: rgba(245,158,11,.4); }
.goods-receipt-delivery-state.is-delivery-over { color: #60a5fa; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.34); }
.goods-receipt-edit-position.is-delivery-partial,
.goods-receipt-edit-position.is-delivery-damaged { box-shadow: inset 4px 0 0 rgba(245,158,11,.75); }
.goods-receipt-edit-position.is-delivery-missing { box-shadow: inset 4px 0 0 rgba(244,63,94,.75); }
.goods-receipt-edit-position.is-delivery-over { box-shadow: inset 4px 0 0 rgba(59,130,246,.75); }
.goods-receipt-position-note { grid-column: 1 / -1; }
.goods-receipt-booking-section {
  margin-top: 1.25rem;
  padding: 1.15rem;
  border: 1px solid rgba(108,99,255,.38);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(108,99,255,.09), rgba(17,24,39,.1));
}
.goods-receipt-booking-summary { margin-top: 1rem; display: grid; gap: .85rem; }
.goods-receipt-booking-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: .6rem;
}
.goods-receipt-booking-overview > div {
  min-width: 0;
  padding: .85rem .6rem;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background: rgba(8,15,31,.42);
}
.goods-receipt-booking-overview strong { display: block; color: var(--text-primary); font-size: 1.25rem; }
.goods-receipt-booking-overview small { color: var(--text-muted); font-size: .75rem; }
.goods-receipt-booking-quantities { display: grid; gap: .45rem; }
.goods-receipt-booking-qty-row {
  display: grid;
  grid-template-columns: minmax(68px,.65fr) minmax(150px,1.8fr) auto;
  align-items: center;
  gap: .65rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(15,23,42,.5);
  font-size: .84rem;
}
.goods-receipt-booking-qty-row span { color: var(--text-muted); }
.goods-receipt-booking-qty-row strong { color: var(--text-primary); }
.goods-receipt-booking-qty-row em { font-style: normal; font-weight: 800; }
.goods-receipt-booking-qty-row em.is-zero { color: #34d399; }
.goods-receipt-booking-qty-row em.is-negative { color: #fb7185; }
.goods-receipt-booking-qty-row em.is-positive { color: #60a5fa; }
.goods-receipt-booking-discrepancies { display: flex; flex-wrap: wrap; gap: .45rem; }
.goods-receipt-booking-discrepancies span,
.goods-receipt-booking-ok {
  display: inline-flex;
  align-items: center;
  padding: .45rem .65rem;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
  color: var(--text-muted);
  font-size: .79rem;
  font-weight: 700;
}
.goods-receipt-booking-ok { color: #34d399; }
.goods-receipt-booking-errors {
  border: 1px solid rgba(245,158,11,.4);
  background: rgba(120,53,15,.18);
  color: #fcd34d;
  border-radius: 13px;
  padding: .8rem .9rem;
  font-size: .82rem;
}
.goods-receipt-booking-errors ul { margin: .45rem 0 0 1.1rem; color: var(--text-muted); }
.goods-receipt-booking-errors li + li { margin-top: .25rem; }
.goods-receipt-booked-info,
.goods-receipt-cancelled-info {
  padding: .8rem .9rem;
  border-radius: 13px;
  font-size: .82rem;
  line-height: 1.5;
}
.goods-receipt-booked-info { color: #a7f3d0; background: rgba(6,78,59,.28); border: 1px solid rgba(16,185,129,.35); }
.goods-receipt-cancelled-info { color: #fde68a; background: rgba(120,53,15,.22); border: 1px solid rgba(245,158,11,.35); }
.badge-gr-booking-open { color: #fbbf24; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.34); }
.badge-gr-booking-booked { color: #34d399; background: rgba(16,185,129,.13); border: 1px solid rgba(16,185,129,.38); }
.badge-gr-booking-cancelled { color: #fca5a5; background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.35); }
.goods-receipt-booking-card-badge { font-size: .7rem; }
.goods-receipt-card-footer { flex-wrap: wrap; gap: .45rem .8rem; }
.goods-receipt-card-qty { color: var(--text-muted); font-size: .78rem; }
.goods-receipt-modal-actions-v512 { flex-wrap: wrap; }
.goods-receipt-modal-actions-v512 .btn { flex: 1 1 180px; }
.goods-receipt-is-booked input:disabled,
.goods-receipt-is-booked select:disabled,
.goods-receipt-is-booked textarea:disabled {
  opacity: .82;
  cursor: not-allowed;
}
.goods-receipt-is-booked .goods-receipt-edit-position { border-color: rgba(16,185,129,.28); }
.order-direct-delivery-chip {
  display: inline-flex;
  margin-top: .4rem;
  padding: .3rem .55rem;
  border-radius: 999px;
  color: #93c5fd;
  background: rgba(59,130,246,.12);
  border: 1px solid rgba(59,130,246,.28);
  font-size: .72rem;
  font-weight: 700;
}
.goods-receipt-scope-warning-v512 { border-color: rgba(16,185,129,.36); background: rgba(6,78,59,.16); }

@media (max-width: 680px) {
  .goods-receipt-edit-position-head { align-items: flex-start; flex-wrap: wrap; }
  .goods-receipt-delivery-state { margin-left: 0; order: 4; width: fit-content; }
  .goods-receipt-booking-overview { grid-template-columns: repeat(3, minmax(0,1fr)); gap: .4rem; }
  .goods-receipt-booking-overview > div { padding: .7rem .35rem; }
  .goods-receipt-booking-overview strong { font-size: 1.05rem; }
  .goods-receipt-booking-qty-row { grid-template-columns: 1fr; gap: .22rem; }
  .goods-receipt-booking-qty-row em { justify-self: start; }
  .goods-receipt-modal-actions-v512 { display: grid; grid-template-columns: 1fr; }
  .goods-receipt-modal-actions-v512 .btn { width: 100%; }
}


/* v51.2.2 – Mitarbeiterfreigabe Wareneingang */
.employee-permission-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  min-width: 150px;
}
.goods-receipt-permission-btn {
  border-color: rgba(234, 101, 25, .45);
}
@media (max-width: 760px) {
  .employee-permission-list { min-width: 132px; }
}


/* ============================================================
   v51.2.3 – ARTIKELSUCHE UND MATERIALDETAILS
   ============================================================ */
.article-search-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: .4rem 0 1rem;
}
.article-search-group {
  flex: 1;
  margin-bottom: 0;
}
.article-search-input-row {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.article-search-input {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  background: var(--surface-2);
}
.article-result-count {
  flex: 0 0 auto;
  margin-bottom: .15rem;
}
.articles-overview-table {
  min-width: 720px;
}
.article-list-row {
  cursor: pointer;
  outline: none;
}
.article-list-row:hover,
.article-list-row:focus-visible {
  background: var(--surface-2);
}
.article-list-row:focus-visible {
  box-shadow: inset 3px 0 0 var(--primary);
}
.article-fm-cell {
  color: var(--accent);
  font-family: 'Courier New', monospace;
  font-weight: 700;
}
.article-name-cell {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.article-row-mobile-hint {
  display: none;
  margin-top: .25rem;
  color: var(--text-muted);
}
.article-stock-value {
  white-space: nowrap;
  color: var(--success);
}
.article-stock-negative {
  color: var(--danger) !important;
}
.article-stock-untracked {
  color: var(--text-muted);
  font-size: .8rem;
  white-space: nowrap;
}
.article-open-cell {
  color: var(--primary);
  font-size: 1.65rem;
  font-weight: 300;
  text-align: right;
}

.article-detail-modal-content {
  max-width: 620px;
}
.article-detail-eyebrow {
  margin: 0 0 .2rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}
.article-detail-stock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(34,197,94,.35);
  border-radius: var(--radius-sm);
  background: rgba(34,197,94,.08);
}
.article-detail-stock-card.article-detail-stock-negative {
  border-color: rgba(239,68,68,.45);
  background: rgba(239,68,68,.09);
}
.article-detail-stock-label {
  display: block;
  color: var(--text-muted);
  font-size: .8rem;
  margin-bottom: .25rem;
}
#article-detail-stock {
  display: block;
  font-size: 1.65rem;
  line-height: 1.1;
}
.article-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
.article-detail-field {
  min-width: 0;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.article-detail-field-wide {
  grid-column: 1 / -1;
}
.article-detail-field span {
  display: block;
  color: var(--text-muted);
  font-size: .75rem;
  margin-bottom: .3rem;
}
.article-detail-field strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: .95rem;
}
.article-detail-warning {
  margin: 0 0 1rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(245,158,11,.35);
  border-radius: var(--radius-sm);
  background: rgba(245,158,11,.08);
  color: var(--text);
  line-height: 1.45;
  font-size: .88rem;
}

.article-detail-history-controls {
  margin: 0 0 1rem;
}
.article-detail-history-panel {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.article-detail-history-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.article-detail-history-header h4 {
  margin: 0;
  font-size: 1rem;
}
.article-detail-history-summary {
  margin: 0 0 .75rem;
}
.article-detail-history-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.article-detail-history-item {
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.article-detail-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .35rem;
}
.article-detail-history-type {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
}
.article-detail-history-time {
  color: var(--text-muted);
  font-size: .78rem;
  white-space: nowrap;
}
.article-detail-history-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.75rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .82rem;
  white-space: nowrap;
  border: 1px solid rgba(148,163,184,.28);
  background: rgba(148,163,184,.10);
}
.article-detail-history-delta.is-positive {
  color: #22c55e;
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
}
.article-detail-history-delta.is-negative {
  color: #f87171;
  border-color: rgba(248,113,113,.35);
  background: rgba(248,113,113,.08);
}
.article-detail-history-delta.is-neutral {
  color: var(--text-muted);
}
.article-detail-history-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem .75rem;
  margin-top: .75rem;
}
.article-detail-history-meta-item {
  min-width: 0;
}
.article-detail-history-meta-item span {
  display: block;
  margin-bottom: .18rem;
  color: var(--text-muted);
  font-size: .72rem;
}
.article-detail-history-meta-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: .85rem;
}
.article-detail-history-reference,
.article-detail-history-note {
  margin-top: .55rem;
  font-size: .84rem;
  line-height: 1.45;
}
.article-detail-history-reference strong,
.article-detail-history-note strong {
  color: var(--text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-right: .35rem;
}

@media (max-width: 640px) {
  .article-search-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .article-search-input-row {
    align-items: stretch;
  }
  .article-search-input-row .btn {
    flex: 0 0 auto;
  }
  .article-detail-history-header {
    flex-direction: column;
    align-items: stretch;
  }
  .article-detail-history-time {
    white-space: normal;
  }
  .article-detail-history-meta {
    grid-template-columns: 1fr;
  }
  .article-result-count {
    align-self: flex-start;
  }
  .articles-overview-table {
    min-width: 0;
  }
  .articles-overview-table thead {
    display: none;
  }
  .articles-overview-table,
  .articles-overview-table tbody,
  .articles-overview-table tr,
  .articles-overview-table td {
    display: block;
    width: 100%;
  }
  .articles-overview-table tr.article-list-row {
    position: relative;
    margin-bottom: .75rem;
    padding: .9rem 2.25rem .9rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
  }
  .articles-overview-table tr.article-list-row:last-child {
    margin-bottom: 0;
  }
  .articles-overview-table td {
    padding: .18rem 0;
    border: none;
  }
  .articles-overview-table td:first-child {
    padding-bottom: .3rem;
  }
  .articles-overview-table td:nth-child(3)::before {
    content: 'Einheit: ';
    color: var(--text-muted);
    font-size: .8rem;
    font-family: inherit;
    font-weight: 400;
  }
  .articles-overview-table td:nth-child(4)::before {
    content: 'Bestand: ';
    color: var(--text-muted);
    font-size: .8rem;
    font-weight: 400;
  }
  .article-row-mobile-hint {
    display: block;
  }
  .article-open-cell {
    position: absolute;
    top: 50%;
    right: .85rem;
    transform: translateY(-50%);
    width: auto !important;
  }
  .article-detail-grid {
    grid-template-columns: 1fr;
  }
  .article-detail-field-wide {
    grid-column: auto;
  }
  .article-detail-stock-card {
    align-items: flex-start;
    flex-direction: column;
  }
}


/* v51.2.4 – Live-Bestandsabgleich in den Artikeldetails */
#article-detail-tracking.badge-pending {
  border-color: rgba(245, 158, 11, .5);
}


/* ============================================================
   v51.2.9 – OFFLINE-MATERIAL
   ============================================================ */

.article-reorder-panel {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border, #dfe3e8);
  border-radius: 12px;
  background: var(--surface-soft, #f8fafc);
}

.article-reorder-panel h4 { margin: 0; }

#password-reset-requests-card { margin-bottom: 1rem; }
.dashboard-material-stock-card {
  border-color: rgba(234, 101, 25, .45);
  background:
    linear-gradient(135deg, rgba(234,101,25,.08), transparent 60%),
    var(--surface);
}
.dashboard-material-stock-card:hover {
  border-color: rgba(234, 101, 25, .8);
  transform: translateY(-2px);
}
.dashboard-action-value {
  font-size: 1.25rem;
  line-height: 1.15;
}
.material-stock-page-header {
  align-items: flex-start;
}
.material-stock-search-card {
  max-width: 980px;
}
.material-stock-status {
  margin: 0 0 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: .86rem;
}
.material-stock-result-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.material-stock-result {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: .9rem;
  padding: .95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.material-stock-result:hover,
.material-stock-result:focus-visible {
  border-color: var(--primary);
  background: var(--surface-3, var(--surface-2));
  transform: translateY(-1px);
  outline: none;
}
.material-stock-result-main {
  min-width: 0;
}
.material-stock-result-main strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: .96rem;
}
.material-stock-result-main span {
  display: block;
  margin-top: .25rem;
  color: var(--text-muted);
  font-size: .8rem;
}
.material-stock-result-quantity {
  white-space: nowrap;
  text-align: right;
}
.material-stock-result-arrow {
  color: var(--primary);
  font-size: 1.6rem;
}
.material-stock-limit-note {
  margin: .85rem 0 0;
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
}
.material-stock-empty small {
  color: var(--text-muted);
}
.material-stock-hint-card {
  max-width: 980px;
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  color: var(--text-muted);
}
.material-stock-hint-card strong {
  display: block;
  color: var(--text);
  margin-bottom: .25rem;
}
.material-stock-hint-card p {
  margin: 0;
  font-size: .88rem;
}
.material-stock-hint-icon {
  font-size: 1.25rem;
}

@media (max-width: 640px) {
  .material-stock-page-header {
    gap: .85rem;
  }
  .material-stock-page-header .btn {
    width: 100%;
  }
  .material-stock-result {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .material-stock-result-quantity {
    grid-column: 1 / 2;
    text-align: left;
    margin-top: .2rem;
  }
  .material-stock-result-arrow {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
