/* ==========================================================================
   Fotogalerien – Verwaltung · modernes Dashboard
   Ein System: Inter, 8er-Abstände, Radius 10/14, Grau-Hintergrund, weiße Karten
   ========================================================================== */
.fg-app {
	--bg: #f4f5f7;
	--surface: #ffffff;
	--surface-2: #f8f9fa;
	--ink: #111214;
	--text: #2b2e33;
	--muted: #6b7280;
	--faint: #9aa0a9;
	--line: #e6e8ec;
	--line-strong: #d5d9df;
	--accent: #111214;
	--accent-hover: #2d3036;
	--danger: #d92d20;
	--danger-soft: #fef3f2;
	--ok: #12805c;
	--ok-soft: #ecfdf3;
	--warn-soft: #fffaeb;
	--r-sm: 8px;
	--r: 10px;
	--r-lg: 14px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
	--shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
	--h: 46px;
	--side: 260px;
	--font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font: 400 15px/1.55 var(--font);
	color: var(--text);
	text-align: left;
	-webkit-font-smoothing: antialiased;
	min-height: 100vh;
	background: var(--bg);
}
.fg-app *, .fg-app *::before, .fg-app *::after { box-sizing: border-box; }
.fg-app h1, .fg-app h2, .fg-app h3 { margin: 0; color: var(--ink); font-family: var(--font); letter-spacing: -.015em; }
.fg-app h1 { font-size: 26px; font-weight: 650; line-height: 1.2; }
.fg-app h2 { font-size: 17px; font-weight: 600; line-height: 1.3; margin-bottom: 16px; }
.fg-app a { color: inherit; text-decoration: none; }
.fg-app img { max-width: 100%; display: block; }
.fg-app [hidden] { display: none !important; }
.fg-app code { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.fg-ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.fg-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.fg-loading, .fg-empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.fg-empty a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.fg-muted { color: var(--muted); }
.fg-center { text-align: center; }

/* --------------------------------------------------------------- Rahmen: Seitenleiste + Inhalt */
.fg-shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.fg-side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px; padding: 22px 16px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.admin-bar .fg-side { top: 32px; height: calc(100vh - 32px); }
.fg-side__brand { padding: 2px 8px 18px; }
.fg-brand { display: inline-flex; align-items: center; color: var(--ink); font: 650 18px/1 var(--font); }
.fg-brand svg { display: block; width: 112px; height: auto; margin: 0; }
.fg-side__cta { width: 100%; height: 44px; margin-bottom: 14px; }
.fg-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.fg-nav__label { margin: 14px 10px 6px; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.fg-nav__item { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); font-weight: 500; font-size: 14.5px; color: var(--text); transition: background .15s, color .15s; }
.fg-nav__item .fg-ico { color: var(--faint); transition: color .15s; }
.fg-nav__item:hover { background: var(--surface-2); color: var(--ink); }
.fg-nav__item:hover .fg-ico { color: var(--ink); }
.fg-nav__item.is-active { background: #eef0f3; color: var(--ink); font-weight: 600; }
.fg-nav__item.is-active .fg-ico { color: var(--ink); }
.fg-side__foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.fg-me { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--r-sm); transition: background .15s; }
.fg-me:hover, .fg-me.is-active { background: var(--surface-2); }
.fg-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font: 600 12.5px/1 var(--font); letter-spacing: .02em; }
.fg-me__text { display: flex; flex-direction: column; min-width: 0; }
.fg-me__text strong { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-me__text small { font-size: 12.5px; color: var(--muted); }
.fg-side__links { display: flex; gap: 4px; margin-top: 6px; }
.fg-side__links a, .fg-side__links button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border: 0; border-radius: var(--r-sm); background: none; font: 500 13px/1 var(--font); color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.fg-side__links a:hover, .fg-side__links button:hover { background: var(--surface-2); color: var(--ink); }
.fg-side__links .fg-ico { width: 16px; height: 16px; }

.fg-content { min-width: 0; padding: 0 clamp(18px, 3.2vw, 48px) 72px; }
.fg-mobilebar { display: none; }
.fg-scrim { display: none; }
.fg-pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; max-width: 1180px; padding: 34px 0 24px; }
.fg-main { max-width: 1180px; }
.fg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* --------------------------------------------------------------- Buttons */
.fg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink) !important; font: 600 14px/1 var(--font); letter-spacing: 0; text-transform: none; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.fg-btn:hover { background: var(--surface-2); border-color: #c4c9d0; }
.fg-btn:active { transform: translateY(1px); }
.fg-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.fg-btn .fg-ico { width: 17px; height: 17px; }
.fg-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff !important; }
.fg-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.fg-btn-primary:disabled { background: var(--accent); }
.fg-btn-danger { color: var(--danger) !important; }
.fg-btn-danger:hover { background: var(--danger-soft); border-color: #fecdca; }
.fg-btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.fg-btn-large { height: 52px; padding: 0 24px; font-size: 15px; }
.fg-btn-block { width: 100%; white-space: normal; }
.fg-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- Karten */
.fg-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(20px, 2.4vw, 28px); margin-bottom: 20px; }
.fg-card > h2:first-child { padding-bottom: 14px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }

/* --------------------------------------------------------------- Formulare */
.fg-form .fg-field { display: block; margin-bottom: 20px; }
.fg-label { display: block; margin-bottom: 7px; font: 600 13.5px/1.3 var(--font); color: var(--ink); letter-spacing: 0; text-transform: none; }
.fg-req { color: var(--danger); font-weight: 600; }
.fg-hint { display: block; margin-top: 7px; font-size: 13px; color: var(--muted); }
.fg-counter { text-align: right; font-variant-numeric: tabular-nums; }
.fg-error { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--danger); }
.fg-error:empty { display: none; }

.fg-app input[type=text], .fg-app input[type=email], .fg-app input[type=password], .fg-app input[type=date], .fg-app input[type=number], .fg-app input[type=search], .fg-app textarea, .fg-app select {
	display: block; width: 100%; height: var(--h); margin: 0; padding: 0 14px;
	border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface);
	font: 400 15px/1.2 var(--font); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	-webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.fg-app input[type=date] { line-height: var(--h); }
.fg-app input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.fg-app textarea { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.fg-app select { padding-right: 40px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; background-size: 16px; }
.fg-app input::placeholder, .fg-app textarea::placeholder { color: var(--faint); }
.fg-app input:hover, .fg-app textarea:hover, .fg-app select:hover { border-color: #bfc5cd; }
.fg-app input:focus, .fg-app textarea:focus, .fg-app select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 18, 20, .1); }
.fg-field.has-error input, .fg-field.has-error textarea, .fg-field.has-error select { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 45, 32, .12); }
.fg-app input.fg-num { display: inline-block; width: 110px; }
.fg-app select.fg-small { width: auto; height: 32px; padding: 0 34px 0 11px; font-size: 13px; background-position: right 9px center; }
.fg-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fg-unit { font-size: 13px; color: var(--muted); }
.fg-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.fg-form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.fg-sticky { position: sticky; bottom: 0; z-index: 5; margin: 0 -2px; padding: 14px 2px; border-top: 1px solid var(--line); background: var(--bg); }
.fg-narrow { max-width: 620px; }
.fg-narrow h2 { margin-top: 12px; }

/* Checkbox */
.fg-app input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #b9bfc7; border-radius: 5px; background: var(--surface); cursor: pointer; display: inline-grid; place-content: center; transition: background .15s, border-color .15s; }
.fg-app input[type=checkbox]::before { content: ""; width: 10px; height: 10px; background: #fff; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 37% 70%); transform: scale(0); transition: transform .12s; }
.fg-app input[type=checkbox]:checked { background: var(--ink); border-color: var(--ink); }
.fg-app input[type=checkbox]:checked::before { transform: scale(1); }
.fg-app input[type=checkbox]:focus-visible { outline: 3px solid rgba(17, 18, 20, .15); outline-offset: 1px; }
.fg-check { display: flex; align-items: center; gap: 9px; margin: 6px 0 14px; font-size: 14px; font-weight: 500; cursor: pointer; }

/* Schalter */
.fg-switch { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.fg-switch:hover { border-color: var(--line-strong); }
.fg-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fg-switch-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: 99px; background: #d0d5dc; transition: background .2s; }
.fg-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .25); transition: transform .2s cubic-bezier(.2, .7, .2, 1); }
.fg-switch input:checked + .fg-switch-ui { background: var(--ink); }
.fg-switch input:checked + .fg-switch-ui::after { transform: translateX(18px); }
.fg-switch input:focus-visible + .fg-switch-ui { box-shadow: 0 0 0 3px rgba(17, 18, 20, .15); }
.fg-switch:has(input:checked) { background: var(--surface); border-color: var(--ink); }
.fg-switch-text { display: flex; flex-direction: column; gap: 2px; }
.fg-switch-text strong { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.fg-switch-text span { font-size: 13px; color: var(--muted); }

/* Umschalter */
.fg-seg { display: inline-flex; width: 100%; height: var(--h); padding: 4px; gap: 4px; border-radius: var(--r-sm); background: #eceef1; }
.fg-seg button { flex: 1; border: 0; border-radius: 6px; background: transparent; font: 600 14px/1 var(--font); color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.fg-seg button:hover { color: var(--ink); }
.fg-seg button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Meldungen im Formular */
.fg-alert { padding: 12px 14px; margin-bottom: 16px; border: 1px solid; border-radius: var(--r-sm); font-size: 14px; }
.fg-alert-error { background: var(--danger-soft); border-color: #fecdca; color: #912018; }
.fg-alert-warn { background: var(--warn-soft); border-color: #fedf89; color: #7a2e0e; }

/* --------------------------------------------------------------- Upload-Maske (Schritte) */
.fg-simple { max-width: 860px; }
.fg-steps { list-style: none; margin: 0; padding: 0; }
.fg-stepbox { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; margin: 0 0 16px; padding: clamp(20px, 2.6vw, 28px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.fg-stepbox__num { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font: 650 15px/1 var(--font); }
.fg-stepbox__body h2 { margin: 6px 0 4px; font-size: 18px; }
.fg-stepbox__help { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.fg-stepbox .fg-field:last-child, .fg-stepbox .fg-grid-2 .fg-field { margin-bottom: 0; }
.fg-stepbox .fg-switch + .fg-field { margin-top: 18px; }
.fg-submitbar { margin-top: 20px; }
.fg-submitbar .fg-btn { width: 100%; height: 54px; font-size: 15.5px; }
.fg-submitbar .fg-view { display: block; margin-top: 14px; text-align: center; font-size: 14px; }
.fg-simple + .fg-card { margin-top: 28px; }

/* Dropzone */
.fg-drop { padding: clamp(32px, 6vw, 56px) 20px; border: 2px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.fg-drop:hover, .fg-drop:focus { border-color: #9aa1ab; background: #f3f4f6; outline: none; }
.fg-drop.is-over { border-color: var(--ink); background: #eceef1; }
.fg-drop.is-error { border-color: var(--danger); background: var(--danger-soft); }
.fg-drop-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); }
.fg-drop-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.fg-drop-title { font: 600 16px/1.4 var(--font); color: var(--ink); }
.fg-drop-hint { margin-top: 4px; font-size: 13px; color: var(--muted); }
.fg-queue-head { display: flex; justify-content: space-between; margin: 16px 0 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.fg-queue { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.fg-queue:empty { display: none; }
.fg-q { display: grid; grid-template-columns: minmax(0, 1fr) 72px 150px 130px 24px; gap: 12px; align-items: center; padding: 9px 12px; font-size: 13px; }
.fg-q + .fg-q { border-top: 1px solid var(--line); }
.fg-q-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.fg-q-size { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-bar { height: 6px; border-radius: 99px; background: #eceef1; overflow: hidden; }
.fg-bar-fill { display: block; height: 100%; border-radius: 99px; background: var(--ink); transition: width .2s; }
.fg-q-done .fg-bar-fill { background: var(--ok); }
.fg-q-error .fg-bar-fill { background: var(--danger); width: 100% !important; }
.fg-q-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-q-done .fg-q-status { color: var(--ok); font-weight: 600; }
.fg-q-error .fg-q-status { color: var(--danger); white-space: normal; }
.fg-q-remove { background: none; border: 0; padding: 0; font-size: 18px; line-height: 1; color: var(--faint); cursor: pointer; }
.fg-q-remove:hover { color: var(--ink); }

/* --------------------------------------------------------------- Galerie-Liste */
.fg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.fg-toolbar input[type=search] { flex: 1; min-width: 220px; width: auto; padding-left: 40px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa0a9' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 17px; }
.fg-toolbar select { width: auto; min-width: 150px; }
.fg-toolbar-check { margin: 0 0 0 4px; white-space: nowrap; }
.fg-gallery-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.fg-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 14px 18px; transition: background .15s; }
.fg-row + .fg-row { border-top: 1px solid var(--line); }
.fg-row:hover { background: var(--surface-2); }
.fg-row-cover { display: block; aspect-ratio: 3 / 2; border-radius: var(--r-sm); overflow: hidden; background: #e9ebee; }
.fg-row-cover img { width: 100%; height: 100%; object-fit: cover; }
.fg-nocover { display: flex; height: 100%; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); }
.fg-row-date { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fg-row-cat { padding: 2px 8px; border-radius: 99px; background: #eef0f3; color: var(--text); font-size: 12px; font-weight: 600; }
.fg-row-title { display: block; margin-bottom: 2px; font: 600 16px/1.35 var(--font); color: var(--ink); }
.fg-row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.fg-row-desc { max-width: 70ch; font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.fg-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.fg-row-actions { display: flex; gap: 8px; }
.fg-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }

/* Badges */
.fg-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font: 600 12px/1 var(--font); }
.fg-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.fg-badge-ok { background: var(--ok-soft); color: var(--ok); }
.fg-badge-draft { background: #f2f4f7; color: #475467; }
.fg-badge-home { background: #fff4e5; color: #b54708; }
.fg-badge-home::before { display: none; }

/* --------------------------------------------------------------- Bilder-Raster */
.fg-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.fg-section-head h2 { margin: 0; }
.fg-section-head h2 .fg-muted { font-weight: 500; }
.fg-section-head .fg-check { margin: 0; }
.fg-images { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; margin: 16px 0 0; padding: 0; }
.fg-img { margin: 0; cursor: grab; }
.fg-img-thumb { position: relative; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--r); background: #e9ebee; box-shadow: 0 0 0 0 transparent; transition: box-shadow .15s; }
.fg-img.is-selected .fg-img-thumb { box-shadow: 0 0 0 3px var(--ink); }
.fg-img.is-cover .fg-img-thumb::after { content: "Titelbild"; position: absolute; top: 8px; right: 8px; padding: 4px 8px; border-radius: 99px; background: rgba(17, 18, 20, .85); color: #fff; font: 600 11px/1 var(--font); }
.fg-img.is-drag { opacity: .35; }
.fg-img-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.fg-img-check { position: absolute; top: 8px; left: 8px; line-height: 0; cursor: pointer; }
.fg-img-check input[type=checkbox] { border-color: #fff; background: rgba(17, 18, 20, .3); }
.fg-img-tools { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 4px; padding: 4px; border-radius: var(--r-sm); background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(6px); transition: opacity .15s, transform .15s; }
.fg-img:hover .fg-img-tools, .fg-img:focus-within .fg-img-tools { opacity: 1; transform: none; }
.fg-img-tools button, .fg-img-tools a { flex: 1; height: 30px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 6px; background: none; color: var(--ink) !important; font-size: 14px; cursor: pointer; }
.fg-img-tools button:hover, .fg-img-tools a:hover { background: #eef0f3; }
.fg-img-tools .active { color: #dc6803 !important; }
.fg-img-tools .danger:hover { background: var(--danger-soft); }
.fg-img-name { padding: 7px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
@media (hover: none) { .fg-img-tools { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- Tabellen */
.fg-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fg-table th, .fg-table td { padding: 12px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.fg-table th { background: var(--surface-2); font: 600 12px/1.2 var(--font); color: var(--muted); }
.fg-table thead th:first-child { border-top-left-radius: var(--r-sm); }
.fg-table thead th:last-child { border-top-right-radius: var(--r-sm); }
.fg-table tr:last-child td { border-bottom: 0; }
.fg-table td strong { font-weight: 600; color: var(--ink); }
.fg-table tr.is-inactive td { opacity: .5; }
.fg-td-actions { white-space: nowrap; text-align: right !important; }
.fg-td-actions .fg-btn { margin-left: 6px; }
.fg-table-kv th { width: 230px; background: none; font-size: 13.5px; color: var(--muted); font-weight: 500; }
.fg-table-kv td { color: var(--ink); font-weight: 500; }

/* Rubriken */
.fg-inline-form { display: flex; gap: 10px; }
.fg-inline-form input { flex: 1; }
.fg-inline-form .fg-btn { height: var(--h); }
.fg-cat-list { list-style: none; margin: 0; padding: 0; }
.fg-cat { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 10px 0; }
.fg-cat + .fg-cat { border-top: 1px solid var(--line); }
.fg-cat input[type=text] { flex: 1; width: auto; min-width: 200px; font-weight: 500; }
.fg-cat-order { display: flex; gap: 4px; }
.fg-cat-order .fg-btn { width: 32px; padding: 0; }
.fg-cat-count { min-width: 90px; font-size: 13px; color: var(--muted); }
.fg-cat-move { padding: 12px; border-radius: var(--r-sm); background: var(--warn-soft); }
.fg-cat-move select { width: auto; }

/* Wasserzeichen */
.fg-wm-preview { margin-bottom: 20px; }
.fg-wm-preview img { max-width: 300px; max-height: 130px; margin-bottom: 12px; padding: 14px; border-radius: var(--r-sm); background-color: #4b5563; background-image: linear-gradient(45deg, #59616d 25%, transparent 25%), linear-gradient(-45deg, #59616d 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #59616d 75%), linear-gradient(-45deg, transparent 75%, #59616d 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }

/* --------------------------------------------------------------- Login */
.fg-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 40px 16px; background: var(--bg); }
.fg-auth-card { width: 100%; max-width: 420px; padding: clamp(28px, 5vw, 40px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); }
.fg-auth-card h1 { margin-bottom: 24px; font-size: 24px; }
.fg-auth-card .fg-field { display: block; margin-bottom: 16px; }
.fg-auth-card .fg-btn { height: 48px; margin-top: 6px; }
.fg-auth-card p { margin: 16px 0 0; }
.fg-auth-card a { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- Toasts */
.fg-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.fg-toast { padding: 13px 16px; border-radius: var(--r, 10px); background: #111214; color: #fff; font: 500 14px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-shadow: 0 12px 32px rgba(16, 24, 40, .2); animation: fg-in .2s ease; transition: opacity .4s; }
.fg-toast-error { background: #b42318; }
.fg-toast.fg-out { opacity: 0; }
@keyframes fg-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* --------------------------------------------------------------- Mobil */
@media (max-width: 960px) {
	.fg-shell { grid-template-columns: minmax(0, 1fr); }
	.fg-side { position: fixed; left: 0; top: 0; z-index: 60; width: 280px; height: 100vh; transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .7, .2, 1); box-shadow: var(--shadow-lg); }
	.fg-shell.is-open .fg-side { transform: none; }
	.fg-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(16, 24, 40, .35); }
	.fg-shell.is-open .fg-scrim { display: block; }
	.fg-mobilebar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: 60px; margin: 0 calc(-1 * clamp(18px, 3.2vw, 48px)); padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
	.fg-mobilebar .fg-brand svg { width: 92px; }
	.fg-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; color: var(--ink); }
	.fg-pagehead { padding-top: 24px; }
}
@media (max-width: 700px) {
	.fg-row { grid-template-columns: 96px minmax(0, 1fr); padding: 12px; gap: 12px; }
	.fg-row-actions { grid-column: 1 / -1; }
	.fg-q { grid-template-columns: minmax(0, 1fr) 96px 24px; }
	.fg-q-size, .fg-bar { display: none; }
	.fg-stepbox { grid-template-columns: 1fr; gap: 10px; }
	.fg-images { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
	.fg-table thead { display: none; }
	.fg-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
	.fg-table td { display: flex; justify-content: space-between; padding: 4px 2px; border: 0; }
	.fg-table td[data-label]::before { content: attr(data-label); font-size: 12.5px; color: var(--muted); }
	.fg-table-kv tr { display: table-row; }
	.fg-table-kv th, .fg-table-kv td { display: table-cell; }
}
@media (min-width: 961px) {
	.fg-shell { background: linear-gradient(90deg, var(--surface) calc(var(--side) - 1px), var(--line) calc(var(--side) - 1px), var(--line) var(--side), transparent var(--side)); }
}
