/*
 * Central design-token + component CSS for the PIM frontend (/pim/*).
 *
 * Tokens and component patterns ported from the NEW ORDER clickable design prototype
 * (01_REFERENCE/design-prototype/dtnw-pim-design-prototype.html), per the client's stated
 * design priority: prototype for visuals/UX, live screenshots for actual functional scope,
 * browser handover for verified business logic. This file is the single source of truth for
 * these values - do not redeclare colors/spacing/fonts inline in individual templates.
 */

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

:root {
    --brand: #F59C00;
    --brand-dark: #DB8B00;
    --brand-soft: #FFF4E1;
    --success: #68B446;
    --success-dark: #4E9433;
    --success-soft: #EEF7E9;
    --danger: #D50911;
    --danger-soft: #FCECEC;
    --neutral-soft: #EEF2F6;
    --neutral-ink: #45545E;
    --cream: #FEF5E6;
    --body: #EFF0F1;
    --surface: #FFFFFF;
    --line: #E3E5E7;
    --hover: #F7F8F9;
    --ink: #3A3A3A;
    --ink-2: #5F6B72;
    --ink-3: #8A949B;
    --border: #D3D7DB;
    --border-strong: #C9CDD1;
    --radius: 0px;
    --shadow: 0 1px 2px rgba(35, 40, 45, .06), 0 1px 3px rgba(35, 40, 45, .05);
    --font: "Kantumruy Pro", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --maxw: 1200px;
    --field-h: 40px;
    --t-h1: 22px;
    --t-sec: 15px;
    --t-label: 11.5px;
}

* { box-sizing: border-box; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    background: var(--brand); color: #fff; padding: 10px 16px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
    background: var(--body);
    color: var(--ink);
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
}

/* ---------- Top bar / navigation ---------- */

.topbar { background: var(--cream); }
.topbar .wrap { display: flex; align-items: center; gap: 34px; height: 58px; }
.rule { height: 4px; background: var(--brand); }

.logo-slot { font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; }

nav.main { display: flex; gap: 30px; margin-left: 16px; }
nav.main a { font-size: 16px; color: var(--ink); padding: 5px 0; position: relative; text-decoration: none; }
nav.main a.active { color: var(--brand); }
nav.main a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 3px; background: var(--brand); }

.utils { margin-left: auto; display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); }
.utils a { color: var(--ink-2); text-decoration: none; }
.utils a:hover { color: var(--brand); }

/* ---------- Breadcrumbs ---------- */

.crumbs { font-size: 13px; color: var(--ink-3); padding: 14px 0 12px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs b { color: var(--ink); font-weight: 700; }
.crumbs .chip { margin-left: 10px; }

/* ---------- Status chips / badges (unified: header chip, product-list pstat) ---------- */

.chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; letter-spacing: .02em; }
.chip.open { background: var(--brand-soft); color: var(--brand-dark); }
.chip.pub { background: var(--success-soft); color: var(--success-dark); }
.chip.neutral { background: var(--neutral-soft); color: var(--neutral-ink); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.archived { background: var(--neutral-soft); color: var(--neutral-ink); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    font-size: 13.5px; font-weight: 600; border-radius: var(--radius);
    padding: 9px 15px; cursor: pointer; border: 1px solid transparent;
    transition: background .12s, border-color .12s, color .12s;
    white-space: nowrap; text-decoration: none; font-family: var(--font);
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--ink-2); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); }
.btn-danger { background: #fff; color: var(--danger); border-color: #E9A9AC; }
.btn-danger:hover { background: var(--danger-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Cards / sections ---------- */

.section, .card, .panel {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.section { padding: 20px 24px 22px; margin-bottom: 16px; }
.section > h2 { margin: 0 0 2px; font-size: var(--t-sec); font-weight: 700; }
.section .hint { color: var(--ink-2); font-size: 12.5px; margin: 0 0 16px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid.g2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid.g2 { grid-template-columns: 1fr; } }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 960px) { .grid.g3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.g3 { grid-template-columns: 1fr; } }

.card { padding: 16px; }
.card h2 { margin: 0 0 8px; font-size: 15px; }
.card .meta { font-size: 12px; color: var(--ink-2); }

/* Produktübersicht: Such-/Filterleiste + Ergebniszahl + Pager (VERIFIZIERT per Live-Screenshot) */
.dp-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin: 20px 0 12px;
}
.dp-toolbar .search {
    flex: 1 1 260px; height: var(--field-h); border: 1px solid var(--border);
    padding: 0 12px; font-size: 14px; font-family: var(--font); color: var(--ink);
}
.dp-toolbar .filter {
    height: var(--field-h); border: 1px solid var(--border); padding: 0 10px;
    font-size: 13.5px; font-family: var(--font); color: var(--ink); background: #fff;
}
.dp-count { color: var(--ink-2); font-size: 13px; margin-bottom: 12px; }
.ksblock {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: 8px; font-size: 12px; color: var(--ink-2);
}
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pager a, .pager .current {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 6px; font-size: 13px;
    border: 1px solid var(--border); color: var(--ink); text-decoration: none;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
@media (max-width: 640px) { .dp-toolbar .search { flex-basis: 100%; } }

/* brand overview card (mirrors prototype .panel/.brand-slot/.menu) */
.panel { padding: 20px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel .menu { list-style: none; padding: 0; margin: 0; }
.panel .menu li { padding: 0; }
.panel .menu a, .panel .menu .menu-link {
    display: flex; align-items: center; gap: 6px; padding: 7px 0;
    color: var(--ink); text-decoration: none; font-size: 14px;
    background: none; border: none; font-family: var(--font); cursor: pointer; width: 100%; text-align: left;
}
.panel .menu a:hover, .panel .menu .menu-link:hover { color: var(--brand); }
.panel .menu .chev { color: var(--brand); font-weight: 700; }

/* Markenübersicht: fester 3-Spalten-Raster (VERIFIZIERT, Datenpflege_Übersicht.png) */
.brandgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 960px) { .brandgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .brandgrid { grid-template-columns: 1fr; } }
.brand-slot {
    min-height: 56px; display: flex; align-items: center; margin-bottom: 14px;
    padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.brand-slot img { max-height: 48px; max-width: 100%; }
.brand-placeholder {
    font-size: 17px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em;
}

.empty { color: var(--ink-3); font-style: italic; }

/* ---------- Form fields (ready for the upcoming product editor) ---------- */

.field { margin-bottom: 16px; }
.field .lab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.field label {
    font-size: var(--t-label); font-weight: 600; letter-spacing: .02em;
    text-transform: uppercase; color: var(--ink-2);
}
.field label .req { color: var(--brand); margin-left: 2px; }
.field .counter { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.field input, .field select, .field textarea {
    width: 100%; height: var(--field-h); border: 1px solid var(--border);
    border-radius: var(--radius); background: #fff; padding: 0 12px;
    font-size: 14px; color: var(--ink); font-family: var(--font);
}
.field textarea { min-height: 46px; padding: 9px 12px; resize: vertical; height: auto; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand);
}
.field.readonly input, .field.readonly select, .field.readonly textarea {
    background: var(--hover); color: var(--ink-2);
}

/* ---------- Keyword-Chip-Eingabe (tag-style search field, VERIFIZIERT per Browseranalyse) ---------- */

.keyword-field .chips {
    display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.keyword-field .chips:empty { margin-bottom: 0; }
.keyword-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--brand-soft); color: var(--brand-dark); padding: 4px 6px 4px 10px;
}
.keyword-chip-remove {
    background: none; border: none; color: var(--brand-dark); font-size: 14px; line-height: 1;
    cursor: pointer; padding: 0 2px; font-family: var(--font);
}
.keyword-chip-remove:hover { color: var(--danger); }
.keyword-field .chip-input {
    width: 100%; height: var(--field-h); border: 1px solid var(--border);
    padding: 0 12px; font-size: 14px; color: var(--ink); font-family: var(--font);
}
.keyword-field .chip-input:focus {
    outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand);
}

/* ---------- Stepper (navigation layer over the existing area/progress/release logic) ---------- */

.stepbar {
    background: var(--surface); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 4px rgba(35, 40, 45, .05);
}
.stepper { max-width: var(--maxw); margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 4px; }
.step {
    flex: 1; min-width: 100px; text-align: center; position: relative;
    font-size: 12.5px; color: var(--ink-2); cursor: pointer; padding-top: 2px;
}
.step .node {
    width: 18px; height: 18px; margin: 0 auto 7px; border: 2px solid var(--border-strong);
    background: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 9px; color: #fff; position: relative; z-index: 2; transition: box-shadow .12s;
}
.step .pct { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.step.done .node { background: var(--success); border-color: var(--success); }
.step.done .pct { color: var(--success); }
.step.active { color: var(--brand); font-weight: 700; }
.step.active .node { border-color: var(--brand); }
.step::before { content: ""; position: absolute; top: 8px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 1; }
.step:first-child::before { display: none; }
.step.done::before { background: var(--success); }
.step:hover .node { box-shadow: 0 0 0 4px rgba(90, 107, 167, .12); }

/* ---------- Media/Asset cards ---------- */

.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.mcard { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px; }
.mcard .thumb {
    height: 120px; background: var(--hover); display: flex; align-items: center; justify-content: center;
    color: var(--ink-3); font-size: 12px; margin-bottom: 12px; text-align: center; padding: 8px;
}
.mcard .meta { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Radio group (e.g. Kundenservice Bearbeitungsstatus) ---------- */

.radios { display: flex; gap: 26px; align-items: center; min-height: var(--field-h); }
.radios label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.radios input[type="radio"] { width: 16px; height: 16px; accent-color: var(--brand); }

/* ---------- Kundenservice area-history entries ---------- */

.histentry { border: 1px solid var(--line); padding: 12px 16px; margin-bottom: 10px; background: var(--hover); }
.histentry .he-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.histentry textarea { width: 100%; }
.histentry .counter { font-size: 11px; color: var(--ink-3); text-align: right; margin-top: 2px; }

/* ---------- Checkbox grid (multiselect fields) ---------- */

.cbgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 12px; }
.cbgrid.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cbgrid, .cbgrid.c3 { grid-template-columns: 1fr; } }
.cbgrid label {
    display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink);
    padding: 8px 10px; transition: background .1s;
}
.cbgrid label:hover { background: var(--hover); }
.cbgrid label.on { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.field.readonly .cbgrid label:not(.on) { opacity: .45; }
.field.readonly .cbgrid input { pointer-events: none; }

/* ---------- Freigabe-Übersicht (approval rows, per design prototype .approve/.final) ---------- */

.approve { list-style: none; padding: 0; margin: 0; }
.approve li {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    padding: 14px 0; border-bottom: 1px solid var(--line);
}
.approve .name { font-weight: 600; font-size: 14px; }
.approve form { display: inline; }
.final {
    display: flex; justify-content: space-between; align-items: center; gap: 18px;
    margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line);
}
.final .name { font-weight: 600; font-size: 14px; }
.final .note { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.final form { display: inline; }

/* ---------- Flash messages ---------- */

.flash { padding: 10px 14px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }
.flash-success { background: var(--success-soft); color: var(--success-dark); }
.flash-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- Area progress header (stepper-lite: one area at a time for now) ---------- */

.area-progress {
    display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
    padding: 12px 16px; background: var(--surface); border: 1px solid var(--line);
}
.area-progress .bar { flex: 1; height: 8px; background: var(--line); position: relative; }
.area-progress .bar .fill { position: absolute; top: 0; left: 0; bottom: 0; background: var(--brand); }
.area-progress.ready .bar .fill { background: var(--success); }
.area-progress .pct { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Read-only (published) product state ---------- */

.ro-note {
    display: none; align-items: center; gap: 8px; background: var(--success-soft);
    color: var(--success-dark); font-size: 12.5px; font-weight: 600; padding: 8px 14px; margin-bottom: 16px;
}
/* Bug gefunden 11.09.2026 (Bug-Hunt): body.ro-Regeln als dead code entfernt. Diese Seite setzt
   bewusst NIE eine body.ro-Klasse (mehrere unabhängig freigebbare Bereiche gleichzeitig, siehe
   product_edit.html.twig Kommentar am Dateianfang) - Read-only wird ausschließlich serverseitig
   je Feld/Button (Twig-Bedingung bzw. .field.readonly-Klasse) durchgesetzt. .ro-note wird
   stattdessen direkt per style="display:flex" pro Bereich sichtbar gemacht, siehe Templates. */

/* ---------- Login page ---------- */

body.authpage {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
}
.authbox { background: var(--surface); box-shadow: var(--shadow); padding: 32px; width: 320px; }
.authbox h1 { font-size: 16px; color: var(--brand); margin: 0 0 20px; }
.authbox .error {
    background: var(--danger-soft); color: var(--danger); padding: 8px; margin-bottom: 16px; font-size: 13px;
}

/* ---------- Footer ---------- */

footer { text-align: center; padding: 24px; color: var(--ink-3); font-size: 12px; }
