/* Nerds mit Herz - Anwendungsoberfläche */

:root {
    --nmh-bg:        #f4f6f9;
    --nmh-surface:   #ffffff;
    --nmh-line:      #dde3ea;
    --nmh-text:      #1f2430;
    --nmh-muted:     #5d6879;
    --nmh-primary:   #b8323c;
    --nmh-primary-d: #8e242c;
    --nmh-dark:      #232a36;
    --nmh-success:   #1f7a4d;
    --nmh-info:      #1f5f9e;
    --nmh-warn:      #a2650a;
    --nmh-danger:    #b1252b;
    --nmh-radius:    10px;
}

.nmh-app { margin: 0; padding: 0; background: var(--nmh-bg); }

body.nmh-app,
.nmh-root {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--nmh-text);
    line-height: 1.55;
    font-size: 15px;
}

.nmh-shell { display: flex; min-height: 100vh; }

/* ---- Seitenleiste ---- */

.nmh-sidebar {
    width: 268px;
    flex: 0 0 268px;
    background: var(--nmh-dark);
    color: #e6eaf1;
    display: flex;
    flex-direction: column;
}
.nmh-sidebar__brand {
    display: flex; align-items: center; gap: 8px;
    padding: 18px 18px 14px;
    font-weight: 700; font-size: 16px;
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.nmh-sidebar__brand .dashicons { color: var(--nmh-primary); }
.nmh-sidebar__foot {
    margin-top: auto; padding: 12px 18px;
    font-size: 12px; color: #97a1b2;
    border-top: 1px solid rgba(255,255,255,.09);
}
.nmh-nav { flex: 1; overflow-y: auto; padding: 6px 0 18px; }
.nmh-nav__group > summary {
    list-style: none; cursor: pointer;
    padding: 9px 18px;
    font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
    color: #9aa5b6; font-weight: 700;
    display: flex; align-items: center; gap: 7px;
}
.nmh-nav__group > summary::-webkit-details-marker { display: none; }
.nmh-nav__group > summary:hover { color: #fff; }
.nmh-nav__group ul { list-style: none; margin: 0; padding: 0 0 6px; }
.nmh-nav__group li a {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 18px 7px 26px;
    color: #cfd6e2; text-decoration: none; font-size: 14px;
}
.nmh-nav__group li a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nmh-nav__group li.is-active a {
    background: rgba(184,50,60,.22);
    color: #fff; font-weight: 600;
    box-shadow: inset 3px 0 0 var(--nmh-primary);
}
.nmh-nav__group .dashicons { font-size: 17px; width: 17px; height: 17px; opacity: .8; }
.nmh-nav__soon {
    margin-left: auto; font-size: 10px; text-transform: uppercase;
    letter-spacing: .04em; color: #8b94a5;
    border: 1px solid #4a5364; border-radius: 20px; padding: 0 6px;
}

/* ---- Hauptbereich ---- */

.nmh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nmh-topbar {
    display: flex; align-items: center; gap: 12px;
    background: var(--nmh-surface);
    border-bottom: 1px solid var(--nmh-line);
    padding: 10px 20px;
}
.nmh-topbar__toggle { display: none; background: none; border: 0; cursor: pointer; }
.nmh-topbar__spacer { flex: 1; }
.nmh-topbar__user { text-align: right; line-height: 1.25; }
.nmh-topbar__name { display: block; font-weight: 600; font-size: 14px; }
.nmh-topbar__role { display: block; font-size: 12px; color: var(--nmh-muted); }
.nmh-topbar__logout { margin: 0; }

.nmh-content { padding: 22px 26px 60px; max-width: 1180px; }

/* ---- Bausteine ---- */

.nmh-pagehead {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 16px; margin-bottom: 18px;
}
.nmh-pagehead__title { margin: 0; font-size: 24px; line-height: 1.2; }
.nmh-pagehead__desc { margin: 6px 0 0; color: var(--nmh-muted); max-width: 70ch; }

.nmh-card {
    background: var(--nmh-surface);
    border: 1px solid var(--nmh-line);
    border-radius: var(--nmh-radius);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.nmh-card h2 { margin-top: 0; font-size: 17px; }

.nmh-grid { display: grid; gap: 14px; }
.nmh-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.nmh-grid--3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.nmh-grid--4 { grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); }

.nmh-kpi {
    background: var(--nmh-surface);
    border: 1px solid var(--nmh-line);
    border-left: 4px solid var(--nmh-line);
    border-radius: var(--nmh-radius);
    padding: 14px 16px;
}
.nmh-kpi--success { border-left-color: var(--nmh-success); }
.nmh-kpi--info    { border-left-color: var(--nmh-info); }
.nmh-kpi--warn    { border-left-color: var(--nmh-warn); }
.nmh-kpi--danger  { border-left-color: var(--nmh-danger); }
.nmh-kpi__value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.nmh-kpi__label { font-size: 13px; color: var(--nmh-muted); margin-top: 2px; }
.nmh-kpi__hint  { font-size: 12px; color: var(--nmh-muted); margin-top: 5px; }

.nmh-notice {
    border: 1px solid var(--nmh-line);
    border-left: 4px solid var(--nmh-info);
    background: #fff;
    border-radius: 8px;
    padding: 11px 14px;
    margin-bottom: 14px;
}
.nmh-notice--success { border-left-color: var(--nmh-success); background: #f2faf6; }
.nmh-notice--info    { border-left-color: var(--nmh-info);    background: #f2f7fc; }
.nmh-notice--warn    { border-left-color: var(--nmh-warn);    background: #fdf8ee; }
.nmh-notice--danger  { border-left-color: var(--nmh-danger);  background: #fdf3f3; }

.nmh-badge {
    display: inline-block; font-size: 12px; font-weight: 600;
    padding: 2px 9px; border-radius: 20px;
    background: #eef1f5; color: var(--nmh-muted);
}
.nmh-badge--success { background: #e3f4ec; color: var(--nmh-success); }
.nmh-badge--info    { background: #e6effa; color: var(--nmh-info); }
.nmh-badge--warn    { background: #fbf1de; color: var(--nmh-warn); }
.nmh-badge--danger  { background: #fbe6e7; color: var(--nmh-danger); }

.nmh-btn {
    display: inline-block; cursor: pointer;
    background: #fff; color: var(--nmh-text);
    border: 1px solid var(--nmh-line);
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 14px; font-weight: 600;
    text-decoration: none;
}
.nmh-btn:hover { border-color: #b8c1cd; }
.nmh-btn--primary {
    background: var(--nmh-primary); border-color: var(--nmh-primary); color: #fff;
}
.nmh-btn--primary:hover { background: var(--nmh-primary-d); border-color: var(--nmh-primary-d); }
.nmh-btn--ghost { background: transparent; }
.nmh-btn--block { display: block; width: 100%; text-align: center; }
.nmh-btn--danger { color: var(--nmh-danger); border-color: #e6bcbe; }

.nmh-table-wrap { overflow-x: auto; }
.nmh-table { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
.nmh-table th, .nmh-table td {
    border-bottom: 1px solid var(--nmh-line);
    padding: 9px 11px; text-align: left; vertical-align: top;
}
.nmh-table th { background: #f7f9fb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--nmh-muted); }
.nmh-table--dummy { opacity: .72; }

.nmh-field { margin-bottom: 13px; }
.nmh-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.nmh-field input[type=text], .nmh-field input[type=email], .nmh-field input[type=password],
.nmh-field input[type=date], .nmh-field input[type=number], .nmh-field select, .nmh-field textarea {
    width: 100%; box-sizing: border-box;
    border: 1px solid var(--nmh-line); border-radius: 7px;
    padding: 8px 10px; font: inherit; background: #fff;
}
.nmh-field--check label { font-weight: 400; display: flex; gap: 7px; align-items: flex-start; }
.nmh-hint { display: block; font-size: 12px; color: var(--nmh-muted); margin-top: 4px; }
.nmh-req { color: var(--nmh-primary); }
.nmh-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.nmh-ref {
    display: inline-block; font-size: 12px;
    background: #eef1f5; color: var(--nmh-muted);
    border-radius: 4px; padding: 1px 6px; margin-right: 4px;
}

.nmh-empty { text-align: center; padding: 44px 20px; color: var(--nmh-muted); }
.nmh-empty h2 { margin: 0 0 6px; font-size: 18px; color: var(--nmh-text); }

.nmh-code {
    background: #232a36; color: #e6eaf1;
    padding: 13px 15px; border-radius: 8px;
    overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
}

/* ---- Platzhalter ---- */

.nmh-placeholder {
    background: var(--nmh-surface);
    border: 1px solid var(--nmh-line);
    border-radius: var(--nmh-radius);
    padding: 24px 26px;
}
.nmh-placeholder__head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 12px; }
.nmh-placeholder__head .dashicons {
    font-size: 30px; width: 30px; height: 30px; color: var(--nmh-primary); margin-top: 2px;
}
.nmh-placeholder__head h1 { margin: 0; font-size: 23px; line-height: 1.2; }
.nmh-placeholder__ver { margin: 3px 0 0; font-size: 13px; color: var(--nmh-muted); }
.nmh-placeholder__desc { max-width: 74ch; }
.nmh-placeholder__basis { margin: 12px 0 4px; font-size: 13px; }
.nmh-placeholder__sub { font-size: 15px; margin: 20px 0 8px; }
.nmh-placeholder__list { margin: 0 0 8px; padding-left: 20px; max-width: 82ch; }
.nmh-placeholder__list li { margin-bottom: 5px; }
.nmh-placeholder__hint { font-size: 13px; color: var(--nmh-muted); margin-top: 0; }
.nmh-placeholder__foot {
    margin-top: 22px; padding-top: 14px;
    border-top: 1px solid var(--nmh-line);
    font-size: 13px; color: var(--nmh-muted);
}

/* ---- Anmeldung und Einrichtung ---- */

.nmh-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.nmh-login__box {
    background: #fff; border: 1px solid var(--nmh-line);
    border-radius: 12px; padding: 30px; width: 100%; max-width: 400px;
}
.nmh-login__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; }
.nmh-login__brand .dashicons { color: var(--nmh-primary); }
.nmh-login__box h1 { font-size: 20px; margin: 0 0 14px; }

.nmh-setup { max-width: 780px; margin: 0 auto; padding: 36px 22px 70px; }
.nmh-setup__brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.nmh-setup__brand .dashicons { color: var(--nmh-primary); }
.nmh-setup h1 { margin: 0 0 4px; font-size: 26px; }
.nmh-setup__lead { color: var(--nmh-muted); margin-top: 0; }
.nmh-setup h2 { font-size: 19px; margin-top: 26px; }
.nmh-setup h3 { font-size: 15px; margin-top: 22px; }

.nmh-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 20px 0 22px; }
.nmh-steps__item {
    display: flex; align-items: center; gap: 7px;
    border: 1px solid var(--nmh-line); border-radius: 20px;
    padding: 5px 13px 5px 6px; font-size: 13px; background: #fff; color: var(--nmh-muted);
}
.nmh-steps__no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 21px; height: 21px; border-radius: 50%;
    background: #eef1f5; font-size: 12px; font-weight: 700;
}
.nmh-steps__item--active { border-color: var(--nmh-primary); color: var(--nmh-text); font-weight: 600; }
.nmh-steps__item--active .nmh-steps__no { background: var(--nmh-primary); color: #fff; }
.nmh-steps__item--done .nmh-steps__no { background: var(--nmh-success); color: #fff; }

/* ---- Schmale Bildschirme ---- */

@media (max-width: 860px) {
    .nmh-sidebar { position: fixed; z-index: 40; height: 100vh; transform: translateX(-100%); transition: transform .2s; }
    .nmh-shell--navopen .nmh-sidebar { transform: translateX(0); }
    .nmh-topbar__toggle { display: inline-flex; }
    .nmh-content { padding: 16px 14px 50px; }
}

/* ---- Fliesstext-Editor ---- */

.nmh-editor {
    border: 1px solid var(--nmh-line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.nmh-editor__bar {
    display: flex; flex-wrap: wrap; gap: 4px;
    padding: 6px 8px;
    background: #f7f9fb;
    border-bottom: 1px solid var(--nmh-line);
}
.nmh-editor__btn {
    background: #fff; border: 1px solid var(--nmh-line); border-radius: 5px;
    padding: 3px 9px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.6;
}
.nmh-editor__btn:hover { border-color: #b8c1cd; background: #f2f5f8; }
.nmh-editor__select {
    margin-left: auto; border: 1px solid var(--nmh-line); border-radius: 5px;
    padding: 3px 7px; font-size: 13px; background: #fff;
}
.nmh-editor__area {
    min-height: 240px; padding: 14px 16px; outline: none; font-size: 15px; line-height: 1.6;
}
.nmh-editor__area:focus { box-shadow: inset 0 0 0 2px rgba(184,50,60,.15); }
.nmh-editor__area h3 { font-size: 16px; margin: 16px 0 6px; }
.nmh-editor__area p { margin: 0 0 10px; }
.nmh-editor__area ul, .nmh-editor__area ol { margin: 0 0 10px; padding-left: 22px; }
.nmh-editor__area table { border-collapse: collapse; width: 100%; margin-bottom: 10px; }
.nmh-editor__area td, .nmh-editor__area th {
    border: 1px solid var(--nmh-line); padding: 5px 8px; text-align: left;
}

/* Platzhalterleiste über dem Editor */
.nmh-chips {
    display: flex; flex-wrap: wrap; gap: 5px;
    align-items: center; margin-bottom: 8px;
}
.nmh-chips__label { font-size: 12px; color: var(--nmh-muted); margin-right: 4px; }
.nmh-chip {
    background: #eef1f5; border: 1px solid var(--nmh-line);
    border-radius: 20px; padding: 2px 10px;
    font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--nmh-muted); cursor: pointer;
}
.nmh-chip:hover { background: #fff; border-color: #b8c1cd; color: var(--nmh-text); }
.nmh-field--editor .wp-editor-container { border: 1px solid var(--nmh-line); border-radius: 7px; }
.nmh-field--editor .mce-toolbar-grp { border-radius: 7px 7px 0 0; }

/* ---------- Kalender ---------- */

.nmh-cal__kopf {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--nmh-muted, #5d6879);
}
.nmh-cal__kopf > div { padding: 4px 6px; }

.nmh-cal__gitter {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.nmh-cal__woche {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.nmh-cal__tag {
    min-height: 96px;
    border: 1px solid var(--nmh-line, #e3e8ef);
    border-radius: 7px;
    padding: 4px 5px;
    background: #fff;
}
.nmh-cal__tag--woche { min-height: 220px; }
.nmh-cal__tag--fremd { background: #f7f9fb; color: #98a2b3; }
.nmh-cal__tag--we { background: #fafbfc; }
.nmh-cal__tag--heute {
    border-color: var(--nmh-accent, #b0233a);
    box-shadow: inset 0 0 0 1px var(--nmh-accent, #b0233a);
}
.nmh-cal__zahl { font-size: 12px; font-weight: 600; margin-bottom: 3px; }

.nmh-cal__item {
    display: block;
    font-size: 12px;
    line-height: 1.3;
    padding: 3px 5px;
    margin-bottom: 3px;
    border-radius: 5px;
    border-left: 3px solid #6b7c93;
    background: #eef2f7;
    cursor: context-menu;
}
.nmh-cal__item:focus { outline: 2px solid var(--nmh-accent, #b0233a); }
.nmh-cal__item--rot { border-left-color: #b0233a; background: #fbeaec; }
.nmh-cal__item--orange { border-left-color: #c2700c; background: #fdf1e3; }
.nmh-cal__item--gelb { border-left-color: #b59000; background: #fdf8e3; }
.nmh-cal__item--blau { border-left-color: #2f6fb0; background: #eaf1f9; }
.nmh-cal__item--ok { border-left-color: #2e7d52; background: #e9f5ee; opacity: .7; }
.nmh-cal__lock { font-size: 11px; }
.nmh-cal__wer { display: block; font-size: 11px; color: #5d6879; }
.nmh-cal__zeile { cursor: context-menu; }

.nmh-cal__menue {
    position: absolute;
    z-index: 9999;
    min-width: 240px;
    background: #fff;
    border: 1px solid var(--nmh-line, #e3e8ef);
    border-radius: 9px;
    box-shadow: 0 8px 26px rgba(16, 24, 40, .16);
    padding: 6px;
}
.nmh-cal__menuetitel {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    border-bottom: 1px solid var(--nmh-line, #e3e8ef);
    margin-bottom: 4px;
}
.nmh-cal__menue button {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: 0;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}
.nmh-cal__menue button:hover:not(:disabled) { background: #eef2f7; }
.nmh-cal__menue button:disabled { color: #98a2b3; cursor: not-allowed; }
.nmh-cal__gesperrt {
    font-size: 11px;
    color: #8a4b52;
    background: #fbeaec;
    border-radius: 6px;
    padding: 7px 9px;
    margin-top: 4px;
}

@media (max-width: 720px) {
    .nmh-cal__gitter, .nmh-cal__woche { grid-template-columns: repeat(2, 1fr); }
    .nmh-cal__kopf { display: none; }
    .nmh-cal__tag { min-height: 70px; }
}
