/* rockinCRM - Design "ruhig" (zurueckhaltend, edel). Das Design der Anwendung.
   Ueberschreibschicht NACH assets/style.css (dort liegen Layout und Komponenten als Basis). Leitidee: keine
   Rahmen um Karten, Kacheln und Tabellen; Trennung durch Flaechenton und Weissraum; ein gedecktes Bordeaux nur
   fuer Fokus und Marke. Zugehoerig: assets/icons-flach.js (Emoji -> flache Icons) und
   assets/tabellen-mobil.css/.js (Handy-Karten). Werte und Regeln: DESIGN.md. */

:root {
    --crm-bg: #f3f1ed;
    --crm-card-bg: #ffffff;
    --crm-sidebar-bg: #1b1b1e;
    --crm-sidebar-fg: #a9abb3;
    --crm-text: #232326;
    --crm-text-muted: #75767d;
    --crm-border: rgba(35, 35, 38, .07);
    --crm-accent: #8f2a2a;
    --crm-accent-dark: #6f1f1f;
    --crm-success: #2f7a54;
    --crm-error: #a8372c;
    --crm-radius: 10px;
    --r-fill: rgba(35, 35, 38, .045);
    --r-fill-hover: rgba(35, 35, 38, .075);
    --r-btn: #232326;
    --r-ring: 0 0 0 3px rgba(143, 42, 42, .18);
    --r-soft: 0 1px 2px rgba(35, 35, 38, .04), 0 8px 24px -12px rgba(35, 35, 38, .10);
    --s-grau: #5b5c64;
}

html { accent-color: var(--r-btn); scrollbar-color: #cfcac2 transparent; }
::selection { background: #e9d6d3; color: #232326; }
input, textarea { caret-color: var(--crm-accent); }
body { font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; letter-spacing: .003em; }
a { color: var(--crm-text); text-decoration: none; }
a:hover { color: var(--crm-accent-dark); text-decoration: none; }
.crm-page-sub a, .crm-card p a, .crm-flash a { text-decoration: underline; text-decoration-color: rgba(35,35,38,.3); text-underline-offset: 3px; }
:where(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--crm-accent); outline-offset: 2px; }

/* --- Seitenleiste: tiefes Graphit, still ------------------------------------ */
.crm-sidebar { background: var(--crm-sidebar-bg); }
.crm-nav-link, .crm-nav-link:hover { text-decoration: none; }
.crm-nav-link {
    padding: 7px 12px; border-radius: 8px; font-size: .88rem; font-weight: 400;
    color: var(--crm-sidebar-fg); transition: background .2s, color .2s;
}
.crm-nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.crm-nav-link.is-active {
    background: rgba(255,255,255,.08) !important; color: #fff !important;
    border-radius: 8px !important; font-weight: 500;
}
.crm-nav-gruppe { opacity: .5; color: var(--crm-sidebar-fg); }
.crm-nav-gruppe:hover { opacity: .9; }
.sb-foot-links a, .sb-foot-copy { color: #6f7078; }
.crm-brand-name { opacity: .6 !important; font-weight: 400 !important; letter-spacing: .04em; }
#sidebar-toggle { background: var(--crm-card-bg); border-color: transparent; box-shadow: var(--r-soft); }

/* --- Kopfleiste: verschmilzt mit dem Grund --------------------------------- */
.crm-topbar { background: var(--crm-bg); border-bottom: 0; padding: 14px 28px; }
.crm-search input { border: 0; border-radius: 999px; background: var(--r-fill); padding: 9px 16px 9px 38px; transition: background .2s, box-shadow .2s; }
.crm-search input:focus { background: #fff; box-shadow: var(--r-soft), var(--r-ring); outline: none; }
.crm-user-name { font-weight: 500; }
.crm-logout { color: var(--crm-text-muted); text-decoration: none; }
.crm-logout:hover { color: var(--crm-accent-dark); }

/* --- Seitenkopf, Karten: Flaeche statt Rahmen ------------------------------- */
.crm-main { padding: 12px 28px 40px; }
.crm-page-head { margin-bottom: 28px; }
.crm-page-head h1 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.015em; }
.crm-page-sub { color: var(--crm-text-muted); }
.crm-page-head-sticky { background: var(--crm-bg); box-shadow: 0 10px 14px -14px rgba(35,35,38,.28); }
.crm-card { border: 0; border-radius: 12px; box-shadow: var(--r-soft); padding: 24px 28px; }
.crm-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 18px; }
.crm-field-label { font-weight: 500; letter-spacing: .05em; color: var(--crm-text-muted); }

/* --- Schaltflaechen --------------------------------------------------------- */
.crm-btn { border: 0; border-radius: 8px; background: var(--r-fill); color: var(--crm-text); font-weight: 500; transition: background .2s; }
.crm-btn:hover { background: var(--r-fill-hover); }
.crm-btn-xs { border: 0; background: var(--r-fill); color: var(--crm-text); }
.crm-btn-xs:hover { background: var(--r-fill-hover); }

/* --- Uebersicht: Kacheln ohne Rahmen, mit leichter heller Flaeche ------------ */
.crm-tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 8px; }
.crm-tile { background: rgba(255, 255, 255, .6); border: 0; box-shadow: none; padding: 14px 16px; border-radius: 12px; gap: 14px; transition: background .2s, box-shadow .2s; }
.crm-tile:hover { background: #fff; box-shadow: var(--r-soft); text-decoration: none; }
.crm-tile-label { font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--crm-text-muted); }
.crm-tile-count { font-size: 1.5rem; font-weight: 300; letter-spacing: -.02em; }
.crm-tile-meta { color: var(--crm-text-muted); }

/* --- Tabellen: weisse Flaeche, keine Rahmen, kaum sichtbare Zeilenlinien ---- */
.crm-table-wrap { background: var(--crm-card-bg); border: 0; border-radius: 12px; box-shadow: var(--r-soft); }
.crm-table th, .crm-table td { padding: 12px 14px; border-bottom: 1px solid rgba(35,35,38,.05); }
.crm-table th { background: transparent; font-size: .7rem; font-weight: 500; letter-spacing: .08em; color: var(--crm-text-muted); border-bottom-color: rgba(35,35,38,.08); }
.crm-table tbody tr:hover { background: rgba(35,35,38,.025); }
.crm-table tbody tr td:first-child > a { font-weight: 500; text-decoration: none; }

/* --- Filter und Auswahlfelder: getoent statt umrandet ----------------------- */
.crm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.crm-filters-label { font-size: .72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--crm-text-muted); margin-right: 6px; }
select, .crm-filter-select {
    appearance: none; -webkit-appearance: none;
    font: inherit; font-size: .86rem; color: var(--crm-text);
    background: var(--r-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2375767d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
    border: 0; border-radius: 8px; padding: 7px 32px 7px 12px; max-width: 100%;
    transition: background-color .2s, box-shadow .2s;
}
select:hover { background-color: var(--r-fill-hover); }
select:focus-visible { outline: none; background-color: #fff; box-shadow: var(--r-soft), var(--r-ring); }
select[multiple], select[size] { background-image: none; padding-right: 12px; }

/* --- Eingabefelder ---------------------------------------------------------- */
.crm-field input[type="text"]:not(.kb-chip-search):not(.crm-tag-input),
.crm-field input[type="password"] { border: 0; background: var(--r-fill); border-radius: 8px; padding: 9px 12px; }
.crm-field input:not(.kb-chip-search):not(.crm-tag-input):hover { background: var(--r-fill-hover); }
.crm-field input:not(.kb-chip-search):not(.crm-tag-input):focus,
.crm-field-textarea:focus { background: #fff; border: 0; box-shadow: var(--r-soft), var(--r-ring); }
.crm-field-textarea { border: 0; background: var(--r-fill); border-radius: 8px; }

/* --- Hinweise --------------------------------------------------------------- */
.crm-flash { border: 0; border-radius: 10px; }
.crm-flash-error { background: #f6e9e7; color: #7a2820; }
.crm-flash-success { background: #e7f1ec; color: #1f5a3c; }

/* --- Icons: flach, einfarbig (Strichstaerke 1.75), per Maske an die Linkziele gebunden.
   Gesetzt wird nur --ico; Farbe kommt von currentColor, damit Hover/Aktiv automatisch passen. */
.crm-nav-link, .crm-tile { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }
.crm-nav-link[href="index.php"], .crm-tile[href="index.php"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l9-8 9 8M5 10v10h5v-6h4v6h5V10'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=songs"], .crm-tile[href$="area=songs"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l12-2v13'/%3E%3Ccircle cx='6' cy='18' r='3'/%3E%3Ccircle cx='18' cy='16' r='3'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=releases"], .crm-tile[href$="area=releases"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=videos"], .crm-tile[href$="area=videos"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=projekte"], .crm-tile[href$="area=projekte"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=addresses"], .crm-tile[href$="area=addresses"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3Cpath d='M7.5 17c.8-2 2.4-3 4.5-3s3.7 1 4.5 3'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=costs"], .crm-tile[href$="area=costs"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15 9.5c-.5-1-1.5-1.5-3-1.5-1.7 0-3 .8-3 2s1.2 1.7 3 2 3 .8 3 2-1.3 2-3 2c-1.5 0-2.5-.5-3-1.5M12 6v2M12 16v2'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=reviews"], .crm-tile[href$="area=reviews"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=kalender"], .crm-tile[href$="page=kalender"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=werkmeldungen"], .crm-tile[href$="page=werkmeldungen"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='4' width='12' height='17' rx='2'/%3E%3Cpath d='M9 4V3h6v1M9 11h6M9 15h6'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=royalties"], .crm-tile[href$="page=royalties"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='20' height='12' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2.5'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=social"], .crm-tile[href$="page=social"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 13.5l6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=blog"], .crm-tile[href$="area=blog"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=dateien"], .crm-tile[href$="page=dateien"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7a2 2 0 012-2h4l2 2h8a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_rechnungen"], .crm-tile[href$="area=bh_rechnungen"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2zM9 8h6M9 12h6'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_buchhaltung"], .crm-tile[href$="area=bh_buchhaltung"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h13v18H6a2 2 0 01-2-2V5a2 2 0 012-2zM9 7h6'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_nutzungfahrzeug"], .crm-tile[href$="area=bh_nutzungfahrzeug"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 16v-4l2-5h12l2 5v4M4 16h16M4 16v3h3v-3M17 16v3h3v-3M7 12h10'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_produkte"], .crm-tile[href$="area=bh_produkte"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9zM4 7.5l8 4.5 8-4.5M12 12v9'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_lager"], .crm-tile[href$="area=bh_lager"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V9l9-6 9 6v12M3 21h18M8 21v-7h8v7'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=versandlisten"], .crm-tile[href$="area=versandlisten"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6h11v10H2zM13 9h4l4 3v4h-8'/%3E%3Ccircle cx='6' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_konten"], .crm-tile[href$="area=bh_konten"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20M6 15h4'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=mwst"], .crm-tile[href$="page=mwst"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 5L5 19'/%3E%3Ccircle cx='7' cy='7' r='2'/%3E%3Ccircle cx='17' cy='17' r='2'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=bh-abgleich"], .crm-tile[href$="page=bh-abgleich"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="page=abschluss"], .crm-tile[href$="page=abschluss"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12l3 3 5-6'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_files"], .crm-tile[href$="area=bh_files"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8zM14 3v5h5'/%3E%3C/svg%3E"); }
.crm-nav-link[href$="area=bh_erfolgsrechnung"], .crm-tile[href$="area=bh_erfolgsrechnung"] { --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E"); }

.crm-nav-icon, .crm-tile-icon {
    display: inline-block; flex: 0 0 auto;
    width: 18px; height: 18px; font-size: 0; line-height: 0; overflow: hidden;
    background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat;
            mask: var(--ico) center / contain no-repeat;
}
.crm-nav-icon { margin-right: 2px; opacity: .85; }
.crm-nav-link:hover .crm-nav-icon, .crm-nav-link.is-active .crm-nav-icon { opacity: 1; }
.crm-tile-icon { color: #9a9aa0; width: 20px; height: 20px; }
.crm-tile:hover .crm-tile-icon { color: var(--crm-text); }


/* Chips und Tags: grau statt blau */
.kb-chip, .crm-tag { background: rgba(35, 35, 38, .075); color: var(--crm-text); border-radius: 6px; }
.kb-chip-remove, .crm-tag-remove { color: #9a9aa0; }
.kb-chip-remove:hover, .crm-tag-remove:hover { color: var(--crm-text); }
.vl-tag { background: rgba(35, 35, 38, .075) !important; color: var(--crm-text) !important; }
.crm-rt-editor:focus { outline-color: var(--crm-accent); }

/* Schaltflaechen weicher: Hauptaktion in hellem Taupe statt Graphit, kleine Aktionen getoent */
.crm-btn-primary { background: #dcd7cf; color: var(--crm-text); font-weight: 600; }
.crm-btn-primary:hover { background: #cdc8bf; }
.crm-btn-sm { background: var(--r-fill-hover); color: var(--crm-text); font-weight: 500; }
.crm-btn-sm:hover { background: rgba(35, 35, 38, .12); }

/* Auswahlfelder und Chip-Picker ohne Rand, getoent */
.kb-chip-picker, .crm-tag-select-box { border: 0; background: var(--r-fill); border-radius: 8px; }
.kb-chip-picker:hover, .crm-tag-select-box:hover { background: var(--r-fill-hover); }
.kb-chip-picker:focus-within, .crm-tag-select-box:focus-within { background: #fff; border: 0; box-shadow: var(--r-soft), var(--r-ring); }
.kb-chip-dropdown, .crm-tag-dropdown { border: 0; border-radius: 10px; box-shadow: var(--r-soft), 0 12px 30px -12px rgba(35, 35, 38, .25); }
.crm-file-dl-btn, .bh-script-btn { background: var(--r-fill); color: var(--crm-text); border: 0; }
.crm-file-dl-btn:hover, .bh-script-btn:hover:not(:disabled) { background: var(--r-fill-hover); color: var(--crm-text); }

/* Restliche Blau-/Indigo-/Slate-Toene entfernt (Quellen: style.css, Inline-Styles in den Ansichten) */
.crm-inbox-eintrag--ungelesen { border-left-width: 0; background: var(--r-fill); }
.crm-inbox-aktionen a { color: var(--crm-text); }
.crm-link-arrows button:hover { background: var(--r-fill-hover); }
.crm-link-add summary { color: var(--crm-text-muted); }
.crm-checkbox-chip:has(input:checked) { background: var(--r-fill-hover); color: var(--crm-text); border-color: transparent; }
#crm-sort-bar-active { background: var(--r-fill); color: var(--crm-text); border-color: transparent; }
.crm-sum-bar { background: var(--r-fill); border-color: transparent; }
.crm-sum-bar strong, .crm-sum-head strong, .crm-daw-link, .lager-stock-qty { color: var(--crm-text); }
.crm-daw-badge { background: var(--r-fill); color: var(--crm-text); }
.crm-daw-list-link:hover { color: var(--crm-accent-dark); }
.bh-script-status-running { background: var(--r-fill); color: var(--crm-text); border-color: transparent; }
.kanban-cards.drag-over { border-color: var(--crm-accent); background: rgba(143, 42, 42, .04); }
.kanban-progress { background: var(--r-fill-hover); color: var(--crm-text); }
.kanban-card-progress div { background: var(--crm-text-muted); }
.kanban-col[data-status="neu"] .kanban-col-header { color: var(--crm-text-muted); }
.crm-tag-option:hover { background: var(--r-fill); }
.crm-rt-leiste button { color: var(--crm-text); }
.crm-sm-sidebar a:hover { background: var(--r-fill); }
.crm-sm-sidebar a.is-aktiv { background: var(--r-btn); }

/* Inline-Styles in den PHP-Ansichten (nur per Attributselektor ueberschreibbar) */
[style*="#eef2ff"], [style*="#dbeafe"], [style*="#f0f4ff"] { background: var(--r-fill) !important; color: var(--crm-text) !important; border-color: transparent !important; }
[style*="#3730a3"], [style*="#1e40af"], [style*="#1a3a8f"] { color: var(--crm-text) !important; }
[style*="#c7d2fe"] { border-color: transparent !important; }
[style*="#a5b4fc"] { background-color: #cfd3dc !important; }
[style*="#2980b9"] { border-left-width: 0 !important; color: inherit !important; }
[style*="#1a237e"] { background: var(--r-btn) !important; }
[style*="#0d6efd"] { color: inherit !important; }

/* Eigenstaendige Fehlerseite und Eingabefelder mit Slate-Rand (Inline) */
.crm-login-body { background: var(--crm-sidebar-bg); }
.crm-login-card { border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
input[style*="#cbd5e1"] { border-color: transparent !important; background: var(--r-fill) !important; border-radius: 8px !important; }
input[style*="#cbd5e1"]:focus { background: #fff !important; box-shadow: var(--r-soft), var(--r-ring); outline: none; }
[style*="#4f6df5"] { color: var(--crm-text) !important; }
[style*="#0b7a8a"] { color: inherit !important; }

/* Hinweisboxen: Tonflaeche statt farbigem Randbalken (mwst.php, kontoabgleich.php) */
.crm-card[style*="border-left:3px"] { border-left-width: 0 !important; }
.crm-card[style*="#e67e22"] { background: #fbf3e6 !important; }
.crm-card[style*="#c0392b"] { background: #f8ebe8 !important; }
.crm-card[style*="#27ae60"] { background: #eaf4ee !important; }
.crm-card[style*="#2980b9"] { background: var(--r-fill) !important; }

/* Einzelne Eingabefelder ausserhalb der Detailformulare (Passwort, Importe, Filter) */
.crm-main input:is([type="text"], [type="password"], [type="number"], [type="email"], [type="date"], [type="search"], [type="url"], [type="tel"]):not(.kb-chip-search):not(.crm-tag-input),
.crm-main textarea:not(.crm-rt-editor) {
    border: 0; background: var(--r-fill); border-radius: 8px; padding: 8px 12px; font: inherit; color: var(--crm-text);
    transition: background .2s, box-shadow .2s;
}
.crm-main input:is([type="text"], [type="password"], [type="number"], [type="email"], [type="date"], [type="search"], [type="url"], [type="tel"]):not(.kb-chip-search):not(.crm-tag-input):hover,
.crm-main textarea:not(.crm-rt-editor):hover { background: var(--r-fill-hover); }
.crm-main input:is([type="text"], [type="password"], [type="number"], [type="email"], [type="date"], [type="search"], [type="url"], [type="tel"]):not(.kb-chip-search):not(.crm-tag-input):focus,
.crm-main textarea:not(.crm-rt-editor):focus { background: #fff; outline: none; box-shadow: var(--r-soft), var(--r-ring); }
input[type="file"] { font: inherit; font-size: .86rem; color: var(--crm-text-muted); }
input[type="file"]::file-selector-button {
    font: inherit; font-weight: 500; color: var(--crm-text); background: var(--r-fill-hover);
    border: 0; border-radius: 8px; padding: 7px 14px; margin-right: 12px; cursor: pointer; transition: background .2s;
}
input[type="file"]::file-selector-button:hover { background: rgba(35, 35, 38, .12); }

/* Buttons ohne Klasse (Importieren, Einlesen ...) im Hausstil */
.crm-main button:not([class]):not([style]), .crm-main input[type="submit"]:not([class]), .crm-main input[type="button"]:not([class]) {
    font: inherit; font-size: .86rem; font-weight: 500; color: var(--crm-text); background: var(--r-fill-hover);
    border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; transition: background .2s;
}
.crm-main button:not([class]):not([style]):hover, .crm-main input[type="submit"]:not([class]):hover { background: rgba(35, 35, 38, .12); }

/* Loeschen-Knoepfe: getoentes Rot statt Vollflaeche (Klasse und Inline-Variante) */
.crm-btn-danger, .crm-btn[style*="#c0392b"], .crm-btn[style*="#dc2626"], .crm-btn[style*="#c00"] {
    background: rgba(168, 55, 44, .10) !important; color: var(--crm-error) !important; border: 0 !important; font-weight: 500;
}
.crm-btn-danger:hover, .crm-btn[style*="#c0392b"]:hover, .crm-btn[style*="#dc2626"]:hover, .crm-btn[style*="#c00"]:hover { background: rgba(168, 55, 44, .18) !important; }

/* Bootstrap-artige Knoepfe (.btn) in Royalties und Werkmeldungen */
.btn { font: inherit; font-size: .86rem; font-weight: 500; color: var(--crm-text); background: var(--r-fill-hover); border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; transition: background .2s; }
.btn:hover { background: rgba(35, 35, 38, .12); }
.btn-primary, .btn-success { background: #dcd7cf; font-weight: 600; }
.btn-primary:hover, .btn-success:hover { background: #cdc8bf; }
.btn-sm { padding: 5px 11px; font-size: .8rem; }

/* Dateien-Seite (eigener Inline-Stil in dateien.php, daher mit body-Praefix) */
body .dn-filter select { padding: 6px 28px 6px 10px; font-size: .8rem; border: 0; border-radius: 8px; }
body .dn-filter input[type=search] { border: 0; background: var(--r-fill); border-radius: 8px; padding: 7px 12px; }
body .dn-gruppe, body .dn-gruppe[open] { border: 0; box-shadow: var(--r-soft); border-radius: 10px; }
body .dn-panel { border: 0; background: var(--r-fill); border-radius: 10px; }
body .dn-panel input, body .dn-panel select { border: 0; background: #fff; border-radius: 6px; }
body .dn-zeile > summary:hover::before { color: var(--crm-text); }
body .dn-chip, body .dn-chip-b, body .dn-chip-k, body .dn-chip-h { background: var(--r-fill-hover); color: var(--crm-text); }

/* ---- Social Media: ruhige Farbgebung ------------------------------------------------------
   Plattform-Logos einfarbig graphit (Glyphe bleibt erkennbar), Kennzahl-Kacheln in Tonwerten,
   Diagramme in Graphit/Taupe, Hinweisboxen als Tonflaechen. Statusfarben bleiben gedaempft. */
/* Plattform-Logos: dunkle Glyphe auf hellem, leicht getoentem Grund (Ton je Plattform ueber die Markenfarbe im Inline-Style) */
svg[viewBox="0 0 24 24"][style*="border-radius:50%"], svg.crm-social-icon { background: #e7e5e2 !important; }
svg[viewBox="0 0 24 24"][style*="border-radius:50%"] path, svg.crm-social-icon path { fill: var(--s-grau) !important; }
svg[viewBox][style*="#1877f2" i] { background: #e2e8f3 !important; }
svg[viewBox][style*="#1877f2" i] path { fill: #3b5a96 !important; }
svg[viewBox][style*="#e1306c" i] { background: #f1e1e6 !important; }
svg[viewBox][style*="#e1306c" i] path { fill: #a23f5e !important; }
svg[viewBox][style*="#ff0000" i] { background: #f1dfdd !important; }
svg[viewBox][style*="#ff0000" i] path { fill: #a33a31 !important; }
svg[viewBox][style*="#000000" i] { background: #e7e5e2 !important; }
svg[viewBox][style*="#000000" i] path { fill: #2b2b2f !important; }
svg[viewBox][style*="#0085ff" i] { background: #dfe9f3 !important; }
svg[viewBox][style*="#0085ff" i] path { fill: #386a99 !important; }
svg[viewBox][style*="#21759b" i] { background: #dce8ed !important; }
svg[viewBox][style*="#21759b" i] path { fill: #2c6582 !important; }
span.crm-social-icon, span[style*="border-radius:50%"][style*="width:26px"], span[style*="border-radius:50%"][style*="width:30px"], span[style*="border-radius:50%"][style*="width:36px"] { background: #e7e5e2 !important; }

.crm-sm-sidebar, .crm-sm-abschnitt, .crm-social-item { border: 0; box-shadow: var(--r-soft); border-radius: 12px; }
.crm-social-item { background: rgba(255, 255, 255, .75); box-shadow: none; }
.crm-social-klickbar:hover { background: #fff; box-shadow: var(--r-soft); border-color: transparent; }
.crm-sm-sidebar a:hover { background: var(--r-fill); }
.crm-sm-sidebar hr { border-top-color: rgba(35, 35, 38, .06); }
.crm-sm-tabs { border-bottom: 1px solid rgba(35, 35, 38, .08); }
.crm-sm-tabs a.is-aktiv { color: var(--crm-text); border-bottom-color: var(--crm-text); }

/* Kennzahl-Kacheln: Tonwerte statt Pastell */
.crm-sm-mint   { background: #e6e8e2; color: var(--crm-text); }
.crm-sm-pink   { background: #ebe4e2; color: var(--crm-text); }
.crm-sm-blau   { background: #e2e4e9; color: var(--crm-text); }
.crm-sm-orange { background: #ebe5d9; color: var(--crm-text); }
.crm-sm-grau   { background: #e9e7e2; color: var(--crm-text-muted); }
.crm-sm-rot    { background: #eddcd9; color: #6d2a22; }
.crm-sm-kachel-wert { font-weight: 300; letter-spacing: -.02em; }

/* Diagramme: Linien und Punkte in Graphit, Ringe/Balken in warmen Grautoenen */
.crm-social-spark polyline, .crm-social-spark path { stroke: var(--s-grau) !important; }
.crm-sm-chart path { stroke: var(--s-grau) !important; }
.crm-sm-chart circle[r="2"] { fill: var(--s-grau) !important; }
circle[stroke="#a5b4fc"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#a5b4fc"] { stroke: #5b5c64; background: #5b5c64 !important; }
circle[stroke="#f9a8d4"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#f9a8d4"] { stroke: #8a8b93; background: #8a8b93 !important; }
circle[stroke="#fdba74"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#fdba74"] { stroke: #a79d8e; background: #a79d8e !important; }
circle[stroke="#bbf7d0"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#bbf7d0"] { stroke: #c2c4bc; background: #c2c4bc !important; }
circle[stroke="#fde68a"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#fde68a"] { stroke: #d4cdbf; background: #d4cdbf !important; }
circle[stroke="#c4b5fd"], :is(span[style*="width:10px"], div[style*="height:8px"])[style*="background:#c4b5fd"] { stroke: #7a7568; background: #7a7568 !important; }
[style*="background:#f1f0f4"] { background: var(--r-fill) !important; }

/* Hinweisboxen (rot/gruen/gelb) als Tonflaechen */
.crm-card[style*="#fef2f2"] { background: #f6e9e7 !important; border-color: transparent !important; }
.crm-card[style*="#f0fdf4"] { background: #e9f1ec !important; border-color: transparent !important; }
.crm-card[style*="#fffbeb"], [style*="background:#fffbeb"] { background: #f4eee0 !important; border-color: transparent !important; }
[style*="#f8f8fa"] { background: var(--r-fill) !important; }

/* Status-Plaketten (Inline-Farben aus der Konfiguration): gedaempfte Toene statt Pastell */
span[style*="border-radius:999px"][style*="background:#bbf7d0"], span[style*="border-radius:999px"][style*="background:#dcfce7"] { background: #dfe9e1 !important; color: #2f6a47 !important; }
span[style*="border-radius:999px"][style*="background:#fef08a"], span[style*="border-radius:999px"][style*="background:#fde68a"], span[style*="border-radius:999px"][style*="background:#fef9c3"] { background: #efe8d2 !important; color: #7a5d1f !important; }
span[style*="border-radius:999px"][style*="background:#fecaca"], span[style*="border-radius:999px"][style*="background:#fee2e2"] { background: #efdad7 !important; color: #8a3128 !important; }
span[style*="border-radius:999px"][style*="background:#bfdbfe"], span[style*="border-radius:999px"][style*="background:#dbeafe"] { background: #dde3ea !important; color: #3e5670 !important; }
span[style*="border-radius:999px"][style*="background:#fed7aa"], span[style*="border-radius:999px"][style*="background:#ffedd5"] { background: #efe2d3 !important; color: #8a5321 !important; }
span[style*="border-radius:999px"][style*="background:#e9d5ff"], span[style*="border-radius:999px"][style*="background:#ddd6fe"], span[style*="border-radius:999px"][style*="background:#e0e7ff"] { background: #e4dfe8 !important; color: #5e4a78 !important; }

/* Status-Texte: gedaempft, nicht grell */
[style*="color:#16a34a"] { color: var(--crm-success) !important; }
[style*="color:#dc2626"] { color: var(--crm-error) !important; }
[style*="color:#2563eb"] { color: var(--crm-text) !important; }

/* "Filter aktiv" und "Excel": gedaempft statt Signalfarbe (Plakette rot bzw. blau, Excel gruen als Inline-Farbe) */
.crm-filter-badge, #wm-filter-badge { background: rgba(143, 42, 42, .10) !important; color: var(--crm-accent-dark) !important; font-size: .78rem; font-weight: 600; padding: 3px 11px; border-radius: 999px; }
.crm-btn[style*="#217346"], #crm-export-xlsx, #wm-export-xlsx, #rl-export-xlsx { background: var(--r-fill-hover) !important; color: var(--crm-text) !important; border: 0 !important; }
.crm-btn[style*="#217346"]:hover, #crm-export-xlsx:hover, #wm-export-xlsx:hover, #rl-export-xlsx:hover { background: rgba(35, 35, 38, .12) !important; }

/* Filterfelder mit gewaehltem Wert (assets/filter-aktiv.js): wie die "Filter aktiv"-Plakette getoent */
.crm-filters select.filter-aktiv, .dn-filter select.filter-aktiv { background-color: rgba(143, 42, 42, .10); color: var(--crm-accent-dark); font-weight: 500; }
.crm-filters select.filter-aktiv:hover, .dn-filter select.filter-aktiv:hover { background-color: rgba(143, 42, 42, .15); }
.crm-filters select.filter-aktiv:focus-visible, .dn-filter select.filter-aktiv:focus-visible { background-color: #fff; }

/* Die Sammelaktions-Leiste wird per hidden-Attribut ein-/ausgeblendet; das Inline-Style display:flex
   hob das auf, sie stand dauerhaft im Bild. */
#crm-bulk-bar[hidden] { display: none !important; }
/* Zeilenfarben in Listen (z.B. bezahlt = gruen): nur ein Hauch statt Pastellflaeche */
tr[style*="background:#f0fdf4"] { background: #f2f6f3 !important; }
tr[style*="background:#fef2f2"] { background: #f8efed !important; }
tr[style*="background:#fffbeb"], tr[style*="background:#fefce8"] { background: #f8f4ea !important; }
tr[style*="background:#eff6ff"], tr[style*="background:#eef2ff"] { background: #f1f3f6 !important; }

/* Sammelaktions-Leiste (list.php, komplett inline gestylt): hell statt Dunkelblau */
#crm-bulk-bar { background: var(--crm-card-bg) !important; color: var(--crm-text) !important; border-top: 0 !important; border-radius: 12px 12px 0 0 !important; box-shadow: 0 -10px 28px -14px rgba(35, 35, 38, .28) !important; }
#crm-bulk-bar select, #crm-bulk-bar .crm-bulk-multi-btn, #crm-bulk-bar input[type="text"], #crm-bulk-bar input[type="date"] { background: var(--r-fill) !important; color: var(--crm-text) !important; border: 0 !important; border-radius: 8px !important; }
#crm-bulk-bar button[onclick*="crmBulkUpdate"] { background: var(--crm-text) !important; color: #fff !important; border: 0 !important; border-radius: 8px !important; font-weight: 500 !important; }
#crm-bulk-bar button[onclick*="crmBulkDelete"] { background: transparent !important; color: var(--crm-error) !important; border: 0 !important; border-radius: 8px !important; font-weight: 500 !important; }
#crm-bulk-bar button[onclick*="crmBulkDelete"]:hover { background: rgba(168, 55, 44, .1) !important; }
#crm-bulk-bar button[onclick*="crmBulkClear"] { background: var(--r-fill) !important; color: var(--crm-text) !important; border: 0 !important; border-radius: 8px !important; }
.crm-bulk-multi-popup { background: var(--crm-card-bg) !important; color: var(--crm-text) !important; border: 0 !important; box-shadow: var(--r-soft), 0 14px 34px -14px rgba(35, 35, 38, .3) !important; }
.crm-bulk-multi-popup label { color: var(--crm-text) !important; }
.crm-bulk-multi-popup button { background: var(--r-fill) !important; color: var(--crm-text) !important; border: 0 !important; }

/* Emoji-Ersatz (siehe assets/icons-flach.js) und Such-Icon */
.ico {
    display: inline-block; flex: 0 0 auto;
    width: 1.05em; height: 1.05em; vertical-align: -.17em;
    background: currentColor;
    -webkit-mask: var(--ico) center / contain no-repeat;
            mask: var(--ico) center / contain no-repeat;
}
h1 .ico, h2 .ico { width: .95em; height: .95em; margin-right: .15em; color: var(--crm-text-muted); }
.crm-btn .ico, .crm-btn-sm .ico, .crm-btn-xs .ico { width: 1em; height: 1em; vertical-align: -.15em; }
.crm-search::before {
    content: ""; position: absolute; left: 14px; top: 50%; width: 16px; height: 16px;
    transform: translateY(-50%); pointer-events: none; z-index: 1;
    background: var(--crm-text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.crm-search input { padding-left: 38px; }
.crm-logout .ico { width: 1.35em; height: 1.35em; vertical-align: -.3em; }
.crm-burger .ico { width: 1.3em; height: 1.3em; vertical-align: middle; }

/* --- Handy ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .crm-main { padding: 8px 14px 32px; }
    .crm-search { min-width: 0; }
        .crm-topbar { padding: 10px 12px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* Abschnitte ohne eigenen Kasten (Verknüpfte Dateien, Mails, Releases, Videos, Werkmeldungen, Mix/Master, Release-Kacheln …)
   stehen wie die übrigen in einem weissen Kasten. Innerhalb eines Kastens (z. B. rockinCLOUD-Block) bleiben sie flach. */
.crm-main .crm-detail-section { background: var(--crm-card-bg, #fff); border-radius: 12px; box-shadow: var(--r-soft); padding: 22px 28px; margin: 1.25rem 0 0 !important; }
.crm-main .crm-card .crm-detail-section { background: none; box-shadow: none; border-radius: 0; padding: 0; }
.crm-main .crm-card .crm-detail-section:first-child { margin-top: 0 !important; }
/* Weisse Kästchen und Kacheln darin werden hellgrau, sonst verschwinden sie im Kasten */
.crm-main .crm-detail-section [style*="background:#fff"] { background: var(--r-fill, rgba(35,35,38,.045)) !important; border-color: transparent !important; }
.crm-main .crm-detail-section .crm-rk-k { background: var(--r-fill, rgba(35,35,38,.045)); }
