* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1e3a5f; --primary-light: #2d5a9b;
  --accent: #e67e22; --bg: #f4f6f9;
  --text: #1a1a2e; --text-sec: #6b7280;
  --border: #e2e8f0; --shadow: 0 2px 8px rgba(0,0,0,0.08); --radius: 12px;
}
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.page { display: none; }
.page.active { display: block; }

/* ── Login ── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(135deg, #1e3a5f, #2d5a9b); }
.login-card { background: #fff; border-radius: 20px; padding: 36px 28px 32px; width: 100%; max-width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo-icon { font-size: 42px; margin-bottom: 8px; }
.login-logo-name { font-size: 20px; font-weight: 800; color: var(--primary); }
.login-logo-sub { font-size: 12px; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1px; margin-top: 3px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-sec); margin-bottom: 6px; }
.form-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; color: var(--text); outline: none; transition: border-color .2s; background: #fff; }
.form-input:focus { border-color: var(--primary-light); }
textarea.form-input { line-height: 1.55; }
.login-err { background: #fee2e2; color: #b91c1c; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; display: none; }
.login-err.show { display: block; }
.login-btn { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .15s; margin-top: 4px; }
.login-btn:hover { background: var(--primary-light); }
.login-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Header ── */
.header { background: var(--primary); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.25); }
.header-logo { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.header-sub { font-size: 11px; opacity: .65; text-transform: uppercase; letter-spacing: 1px; margin-top: 1px; }
.header-right { margin-left: auto; position: relative; }
.header-user { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 6px 8px; border-radius: 8px; transition: background .15s; }
.header-user:hover { background: rgba(255,255,255,0.12); }
.avatar-sm { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,0.2); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.huser-name { font-size: 13px; font-weight: 600; display: none; }
.huser-role { font-size: 11px; opacity: .7; display: none; }
@media(min-width:420px){ .huser-name, .huser-role { display: block; } }

/* ── Dropdown ── */
.dropdown { position: absolute; top: calc(100% + 8px); right: 0; background: #fff; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.18); min-width: 220px; z-index: 200; display: none; overflow: hidden; }
.dropdown.open { display: block; }
.dd-head { padding: 14px 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.dd-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.dd-name { font-size: 14px; font-weight: 700; }
.dd-user { font-size: 12px; color: var(--text-sec); }
.dd-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: none; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; font-family: inherit; transition: background .1s; }
.dd-item:hover { background: var(--bg); }
.dd-item.red { color: #dc2626; }
.dd-sep { height: 1px; background: var(--border); }

/* ── Back button ── */
.back-btn { background: rgba(255,255,255,0.12); border: none; color: #fff; cursor: pointer; padding: 10px 12px; border-radius: 8px; font-size: 15px; display: flex; align-items: center; gap: 6px; transition: background .15s; flex-shrink: 0; }
.back-btn:hover { background: rgba(255,255,255,0.22); }
.header-title-block { flex: 1; min-width: 0; }
.header-title-main { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title-sub { font-size: 12px; opacity: .7; }

/* ── Content ── */
.content { padding: 18px; max-width: 800px; margin: 0 auto; padding-bottom: 100px; }

/* ── Search & Filter ── */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; pointer-events: none; }
.search-bar { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 13px 14px 13px 42px; font-size: 16px; width: 100%; outline: none; transition: border-color .2s; color: var(--text); }
.search-bar:focus { border-color: var(--primary-light); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip { padding: 8px 16px; border-radius: 20px; border: 1.5px solid var(--border); background: #fff; font-size: 14px; cursor: pointer; transition: all .15s; font-weight: 500; }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-chip:hover:not(.active) { border-color: var(--primary-light); color: var(--primary); }

/* ── Article cards ── */
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-sec); margin-bottom: 10px; }
.article-card { background: #fff; border-radius: var(--radius); padding: 15px; margin-bottom: 10px; box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; gap: 12px; transition: transform .12s, box-shadow .12s; -webkit-tap-highlight-color: transparent; }
.article-card:hover { transform: translateY(-2px); box-shadow: 0 5px 18px rgba(0,0,0,0.12); }
.article-card:active { transform: scale(.98); }
.article-icon { width: 46px; height: 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; background: #f3f4f6; }
.article-info { flex: 1; min-width: 0; }
.article-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-meta { font-size: 13px; color: var(--text-sec); }
.article-badge { font-size: 12px; padding: 4px 10px; border-radius: 6px; font-weight: 600; flex-shrink: 0; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-sec); }
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .es-text { font-size: 15px; }

/* ── FAB ── */
.fab { position: fixed; bottom: 24px; right: 20px; background: var(--accent); color: #fff; border: none; border-radius: 30px; padding: 15px 20px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(230,126,34,.45); display: flex; align-items: center; gap: 8px; transition: transform .15s, box-shadow .15s; z-index: 50; }
.fab:hover { transform: translateY(-2px); }
.add-user-fab { position: fixed; bottom: 24px; right: 20px; background: var(--primary); color: #fff; border: none; border-radius: 30px; padding: 15px 20px; font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 20px rgba(30,58,95,.4); display: flex; align-items: center; gap: 8px; transition: transform .15s; z-index: 50; }
.add-user-fab:hover { transform: translateY(-2px); }

/* ── Tab bar ── */
.tab-bar { background: #fff; display: flex; overflow-x: auto; border-bottom: 2px solid var(--border); position: sticky; top: 57px; z-index: 90; scrollbar-width: none; }
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn { padding: 13px 16px; border: none; background: none; font-size: 14px; color: var(--text-sec); cursor: pointer; white-space: nowrap; border-bottom: 2.5px solid transparent; margin-bottom: -2px; transition: all .15s; font-weight: 500; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Cards ── */
.card { background: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-title { font-size: 12px; font-weight: 700; color: var(--text-sec); text-transform: uppercase; letter-spacing: .8px; }
.edit-btn { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 5px; color: var(--text-sec); transition: all .15s; font-weight: 500; font-family: inherit; }
.edit-btn:hover { border-color: var(--primary-light); color: var(--primary); background: #eef3fb; }

/* ── Role-based visibility ── */
.role-leser .editor-only { display: none !important; }
.role-leser .fab { display: none !important; }
.role-leser .editor-only-cursor { pointer-events: none; }
body:not(.role-admin) .admin-only { display: none !important; }

/* ── Fields ── */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field-row.single { grid-template-columns: 1fr; }
.field-row:last-child { margin-bottom: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-sec); font-weight: 600; }
.field-value { font-size: 16px; font-weight: 700; padding: 10px 13px; background: var(--bg); border-radius: 8px; }
.notes-display { background: var(--bg); border-radius: 8px; padding: 13px 14px; min-height: 52px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }

/* ── Images ── */
.image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.img-wrap { display: flex; flex-direction: column; gap: 6px; }
.img-wrap img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; display: block; cursor: pointer; }
.image-placeholder { background: var(--bg); border: 2px dashed var(--border); border-radius: 10px; height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-sec); font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s; gap: 8px; }
.image-placeholder:hover { border-color: var(--primary-light); color: var(--primary); }
.ph-icon { font-size: 24px; }
.img-caption-row { display: flex; align-items: center; gap: 6px; }
.img-caption-text { font-size: 13px; color: var(--text-sec); flex: 1; font-style: italic; }
.img-del-btn { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-sec); padding: 2px 5px; border-radius: 5px; transition: color .15s, background .15s; flex-shrink: 0; }
.img-del-btn:hover { color: #dc2626; background: #fee2e2; }
.img-edit-btn { background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text-sec); padding: 2px 5px; border-radius: 5px; transition: color .15s, background .15s; flex-shrink: 0; }
.img-edit-btn:hover { color: var(--primary); background: #eef3fb; }

/* ── Näharbeit ── */
.keder-ref { display: flex; align-items: center; gap: 12px; background: #eef3fb; border: 1.5px solid #c7d8f0; border-radius: 10px; padding: 13px 15px; margin-bottom: 12px; }
.keder-ref-icon { font-size: 22px; flex-shrink: 0; }
.keder-ref-value { font-size: 14px; font-weight: 700; color: var(--primary); }
.keder-ref-note { font-size: 13px; color: var(--text-sec); margin-top: 2px; }
.link-btn { background: none; border: none; font-size: 13px; color: var(--primary-light); font-weight: 600; cursor: pointer; padding: 0; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }
.nm-row { display: flex; align-items: center; gap: 12px; padding: 10px 13px; background: var(--bg); border-radius: 8px; margin-bottom: 8px; }
.nm-icon { font-size: 20px; flex-shrink: 0; }
.nm-label { font-size: 11px; color: var(--text-sec); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.nm-value { font-size: 15px; font-weight: 700; }

/* ── Bezugsfarbe-Nähgarne ── */
.bf-group { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.bf-group:last-child { margin-bottom: 0; }
.bf-header { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: var(--bg); border-bottom: 1px solid var(--border); }
.bf-dot { width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0,0,0,0.1); }
.bf-name { font-size: 14px; font-weight: 700; flex: 1; }
.bf-row { display: flex; align-items: center; padding: 9px 13px; border-bottom: 1px solid var(--border); gap: 0; }
.bf-row:last-child { border-bottom: none; }
.bf-seam { font-size: 13px; color: var(--text-sec); min-width: 110px; flex-shrink: 0; }
.bf-thread { font-size: 14px; font-weight: 500; flex: 1; }
.bf-tdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: middle; border: 1.5px solid rgba(0,0,0,0.12); }
.bf-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Schneidarbeit ── */
.next-step { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.next-step-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 15px 10px; border-radius: 10px; border: 2px solid var(--border); background: var(--bg); cursor: pointer; transition: all .15s; text-align: center; font-family: inherit; width: 100%; }
.next-step-btn.active { border-color: var(--primary); background: #eef3fb; }
.ns-icon { font-size: 24px; }
.ns-label { font-size: 14px; font-weight: 700; color: var(--text-sec); }
.next-step-btn.active .ns-label { color: var(--primary); }
.ns-check { font-size: 11px; font-weight: 700; color: var(--primary); opacity: 0; }
.next-step-btn.active .ns-check { opacity: 1; }

/* ── Strickerei: Farb-Tabs ── */
.color-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.color-tab { display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 20px; border: 1.5px solid var(--border); background: #fff; font-size: 13px; cursor: pointer; transition: all .15s; font-weight: 500; font-family: inherit; }
.color-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.color-tab:hover:not(.active) { border-color: var(--primary-light); color: var(--primary); }
.ct-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; border: 2px solid rgba(0,0,0,.1); }

/* ── Fadenführer ── */
.fd-list { display: flex; flex-direction: column; gap: 8px; }
.fd-divider { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-sec); font-weight: 700; }
.fd-divider::before, .fd-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.fd-row { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: var(--bg); border-radius: 8px; }
.fd-nr { width: 31px; height: 31px; border-radius: 7px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; flex-shrink: 0; }
.fd-nr-l { background: #d97706; }
.fd-side { font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 5px; flex-shrink: 0; }
.fd-side-r { background: #dbeafe; color: #1d4ed8; }
.fd-side-l { background: #fef3c7; color: #b45309; }
.fd-garn { font-size: 14px; flex: 1; }
.fd-del { background: none; border: none; cursor: pointer; font-size: 14px; color: var(--text-sec); padding: 4px 6px; border-radius: 5px; transition: color .15s; flex-shrink: 0; }
.fd-del:hover { color: #dc2626; }
.fd-edit-btns { display: flex; }

/* ── Maschinen-Tags ── */
.machine-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.machine-tag { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 13px; font-size: 15px; font-weight: 700; color: var(--primary); }

/* ── QK ── */
.tol-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tol-value { font-size: 30px; font-weight: 800; color: var(--primary); }
.tol-badge { background: var(--bg); padding: 6px 13px; border-radius: 8px; font-size: 13px; color: var(--text-sec); font-weight: 500; }
.error-list { display: flex; flex-direction: column; gap: 8px; }
.error-item { display: flex; align-items: center; gap: 10px; padding: 10px 13px; background: var(--bg); border-radius: 8px; font-size: 14px; }
.edot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-r { background: #ef4444; } .dot-y { background: #f59e0b; } .dot-g { background: #22c55e; }
.error-text { flex: 1; }
.rekl-item { border-left: 3px solid var(--border); padding-left: 14px; margin-bottom: 16px; }
.rekl-item:last-child { margin-bottom: 0; }
.rekl-item.st-behoben { border-left-color: #22c55e; }
.rekl-item.st-offen { border-left-color: #f59e0b; }
.rekl-date { font-size: 12px; color: var(--text-sec); margin-bottom: 3px; font-weight: 600; }
.rekl-text { font-size: 14px; line-height: 1.5; }
.rekl-st { display: inline-block; margin-top: 6px; font-size: 11px; padding: 3px 8px; border-radius: 5px; font-weight: 700; }
.st-ok { background: #dcfce7; color: #15803d; }
.st-open { background: #fff3cd; color: #b45309; }

/* ── Verpacken ── */
.aufkleber-box { display: flex; align-items: flex-start; gap: 12px; background: var(--bg); border-radius: 8px; padding: 13px 14px; }
.aufkleber-text { font-size: 14px; line-height: 1.6; }

/* ── Benutzerverwaltung ── */
.admin-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 14px 16px; box-shadow: var(--shadow); text-align: center; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-sec); }
.user-card { background: #fff; border-radius: var(--radius); padding: 13px 15px; margin-bottom: 10px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.u-avatar { width: 44px; height: 44px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.u-info { flex: 1; min-width: 0; }
.u-name { font-size: 15px; font-weight: 600; }
.u-uname { font-size: 12px; color: var(--text-sec); }
.u-badges { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.role-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; }
.rb-admin { background: #ede9fe; color: #7c3aed; }
.rb-bearbeiter { background: #dbeafe; color: #1d4ed8; }
.rb-leser { background: #f3f4f6; color: #6b7280; }
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.sb-active { background: #dcfce7; color: #15803d; }
.sb-inactive { background: #fee2e2; color: #b91c1c; }
.u-actions { display: flex; gap: 6px; flex-shrink: 0; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 15px; transition: all .15s; font-family: inherit; }
.icon-btn:hover { border-color: var(--primary-light); background: #eef3fb; }
.icon-btn.del:hover { border-color: #fca5a5; background: #fee2e2; }
.rights-info { background: #f8f9fa; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 4px; }
.rights-row { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); gap: 10px; }
.rights-row:last-child { border-bottom: none; }
.rights-role { min-width: 110px; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 300; display: none; align-items: flex-end; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 20px 20px 0 0; padding: 24px 20px 40px; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; }
@media(min-width:560px){ .modal-overlay { align-items: center; } .modal { border-radius: 20px; max-height: 82vh; } }
.modal-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-select { width: 100%; padding: 12px 13px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 15px; font-family: inherit; color: var(--text); outline: none; transition: border-color .2s; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 13px center; appearance: none; padding-right: 34px; cursor: pointer; }
.form-select:focus { border-color: var(--primary-light); }
.role-hint { font-size: 12px; color: var(--text-sec); background: var(--bg); border-radius: 7px; padding: 9px 12px; margin-top: 6px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn-primary { flex: 1; background: var(--primary); color: #fff; border: none; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background .15s; }
.btn-primary:hover { background: var(--primary-light); }
.btn-secondary { flex: 1; background: var(--bg); color: var(--text); border: 1.5px solid var(--border); border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-secondary:hover { border-color: var(--primary-light); }

/* ── Nähgarn Zeilen im Modal ── */
.ng-zeile { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 6px; align-items: end; margin-bottom: 8px; }
.ng-zeile input { padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 7px; font-size: 13px; font-family: inherit; color: var(--text); outline: none; }
.ng-zeile input:focus { border-color: var(--primary-light); }
.ng-zeile-del { width: 36px; height: 36px; background: none; border: 1.5px solid var(--border); border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--text-sec); flex-shrink: 0; }
.ng-zeile-del:hover { border-color: #fca5a5; background: #fee2e2; color: #dc2626; }
.ng-zeile-color { width: 36px; height: 36px; border: 1.5px solid var(--border); border-radius: 7px; cursor: pointer; padding: 1px; }

/* ── Toast ── */
.toast { position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(14px); background: #1e3a5f; color: #fff; padding: 11px 20px; border-radius: 30px; font-size: 14px; font-weight: 500; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 400; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 500; display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 95vw; max-height: 95vh; border-radius: 8px; object-fit: contain; }
.lightbox-close { position: absolute; top: 16px; right: 20px; background: none; border: none; color: #fff; font-size: 32px; cursor: pointer; line-height: 1; }

@media(min-width:580px){ .field-row { grid-template-columns: repeat(3,1fr); } .image-grid { grid-template-columns: repeat(3,1fr); } .content { padding: 22px; } }
