/* ═══════════════════════════════════════════════════════
   SunmaraWebManager — CSS Custom Properties + Classes
   ═══════════════════════════════════════════════════════ */

/* ── DM Sans (self-hosted, SIL OFL) — variable font, latin + latin-ext ── */
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('/fonts/dm-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 100 1000;
    font-display: swap;
    src: url('/fonts/dm-sans-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Theme Variables ── */
html {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #e5e5ea;
    --surface: #ffffff;
    --border: #e8e8ec;
    --border-light: #f4f4f5;
    --text: #18181b;
    --text-secondary: #52525b;
    --text-muted: #71717a;
    --text-faint: #a1a1aa;
    --group-border: #9999a3;
    --group-bg: #c0c0c0;
    --teal: #0d9488;
    --green: #10b981;
    --red: #ef4444;
}

html.dark {
    --bg: #525252;
    --surface: #2f2f2f;
    --border: #4a4a4a;
    --border-light: #3a3a3a;
    --text: rgba(255, 255, 255, 0.70);
    --text-secondary: rgba(255, 255, 255, 0.60);
    --text-muted: rgba(255, 255, 255, 0.50);
    --text-faint: rgba(255, 255, 255, 0.30);
    --group-border: rgba(255, 255, 255, 0.35);
    --group-bg: #424242;
}

html, body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ── MudBlazor Overrides ── */
.mud-dialog { border-radius: 18px !important; }
html.dark .mud-chip { color: #1a1a1a !important; }
html.dark .mud-chip .mud-icon-root { color: #1a1a1a !important; }
h1:focus { outline: none; }

/* ── Layout ── */
.wm-page        { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.wm-header      { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; gap: 16px; color: var(--text); }
.wm-header-logo { display: flex; align-items: center; gap: 12px; flex: 1; }
.wm-header-title { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1.2; }
.wm-header-sub  { font-size: 11px; color: var(--text-muted); }
.wm-content     { flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; padding: 28px 24px; }
.wm-user-menu   { text-transform: none; font-weight: 500; color: var(--text-secondary); }

/* ── Top Bar (Page Header) ── */
.wm-topbar       { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.wm-topbar-left  { display: flex; align-items: center; gap: 16px; }
.wm-topbar-right { display: flex; gap: 8px; align-items: center; }

/* ── Server IP Pill ── */
.wm-ip-pill    { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; }
.wm-ip-copy    { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px 4px; line-height: 1; }

/* ── Cards ── */
.wm-card       { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); overflow: hidden; transition: all 0.15s ease; }
.wm-card-empty { border-radius: 14px; text-align: center; background: var(--surface); }

/* ── Forms ── */
.wm-form-row   { display: flex; gap: 12px; align-items: flex-end; }

/* ── Server Stats (RAM/CPU + Disks + Network) ── */
.wm-server-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 14px;
    margin-top: -20px;
    margin-bottom: 8px;
}
.wm-server-stat-group  { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wm-server-stat-line   { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 22px; }
.wm-server-stat-name   { font-weight: 700; color: var(--text); letter-spacing: 0.3px; min-width: 38px; flex-shrink: 0; }
.wm-server-stat-bar    { flex: 1; min-width: 60px; }
.wm-server-stat-detail { color: var(--text-muted); font-size: 12px; font-weight: 600; min-width: 38px; text-align: right; flex-shrink: 0; }
.wm-server-stat-detail-net { min-width: 0; margin-left: auto; }
.wm-stat-bar-wrap      { position: relative; display: flex; align-items: center; }
.wm-stat-bar-wrap .mud-progress-linear { width: 100%; }
.wm-stat-peak-marker   { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 3px; height: 12px; background: #1e1b4b; border-radius: 1px; pointer-events: none; z-index: 1; }
html.dark .wm-stat-peak-marker { background: #c7d2fe; }

/* ── Split Layout ── */
.wm-split       { display: flex; gap: 6px; min-height: 60vh; animation: wmFadeIn 0.2s ease; }
.wm-tree-panel  { width: 340px; min-width: 280px; flex-shrink: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-y: auto; max-height: 80vh; padding: 8px; }
.wm-detail-panel { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; overflow-y: auto; max-height: 80vh; }
.wm-actions-bar  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.wm-actions-panel      { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-top: 4px; }
/* Action row = accordion item: header (zusammenklappbar) + body (Buttons). Linke 3px-Stripe zeigt Status visuell. */
.wm-action-row         { position: relative; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); overflow: hidden; }
.wm-action-row:last-child { border-bottom: none; }
.wm-action-row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--text-faint); opacity: 0.35; transition: opacity 0.15s, background 0.15s; }
.wm-action-row.expanded::before { opacity: 1; }
.wm-action-row[data-status="ok"]::before      { background: var(--green); }
.wm-action-row[data-status="warn"]::before    { background: #f59e0b; }
.wm-action-row[data-status="err"]::before     { background: var(--red); }
.wm-action-row[data-status="neutral"]::before { background: var(--text-faint); }
.wm-action-header      { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; cursor: pointer; user-select: none; min-height: 44px; transition: background 0.12s; }
.wm-action-header:hover { background: rgba(99, 102, 241, 0.06); }
.wm-action-row.expanded .wm-action-header { background: rgba(99, 102, 241, 0.05); }
.wm-action-row-label   { display: flex; align-items: center; gap: 8px; min-width: 150px; font-size: 13px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.wm-action-status      { flex: 1; font-size: 12px; color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-action-status[data-tone="ok"]   { color: var(--green);  font-weight: 600; }
.wm-action-status[data-tone="warn"] { color: #f59e0b;       font-weight: 600; }
.wm-action-status[data-tone="err"]  { color: var(--red);    font-weight: 600; }
.wm-action-chevron     { color: var(--text-faint); transition: transform 0.15s; flex-shrink: 0; }
.wm-action-row.expanded .wm-action-chevron { transform: rotate(90deg); color: var(--text-muted); }
.wm-action-body        { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 12px 12px 36px; border-top: 1px dashed var(--border); }
.wm-action-row-content { display: flex; align-items: center; gap: 6px; flex: 1; flex-wrap: wrap; }
.wm-domain-header     { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.wm-domain-title-row  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.wm-domain-chips      { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wm-actions-sep  { width: 1.5px; height: 20px; background: var(--group-border); flex-shrink: 0; }
@media (max-width: 768px) {
  .wm-split { flex-direction: column; }
  .wm-tree-panel { width: 100%; min-width: unset; max-height: none; }
  .wm-detail-panel { max-height: none; padding: 14px; }
  .wm-resizer { display: none; }
  /* Server IP pill mobilde çok yer kaplıyor — gizle */
  .wm-ip-pill { display: none; }
  /* Actions bar mobilde 2 satırda, ikonlar arası daha sıkı */
  .wm-actions-bar { gap: 4px; padding: 10px 0; justify-content: flex-start; }
  .wm-actions-bar .mud-button-root { padding: 6px; }
  /* Separator'lar mobilde gizli — satır kırılımını daha temiz yap */
  .wm-actions-sep, .wm-divider { display: none; }
  /* SSL uzun tarih metni mobilde tüm satıra yayılsın */
  .wm-actions-bar .mud-typography { font-size: 11px; }
  /* Domain header chips mobilde yeni satırda, sola dayalı */
  .wm-domain-chips { width: 100%; margin-top: 4px; }
  /* Action rows: mobilde label dar, status text küçük, body sıkışık */
  .wm-action-header { gap: 8px; padding: 10px 10px 10px 12px; }
  .wm-action-row-label { min-width: 110px; font-size: 12px; gap: 6px; }
  .wm-action-row-label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wm-action-status { font-size: 11px; }
  .wm-action-body { padding: 4px 10px 10px 28px; gap: 4px; }
}
.wm-resizer      { width: 8px; cursor: col-resize; display: flex; align-items: center; justify-content: center; flex-shrink: 0; user-select: none; border-radius: 4px; transition: background 0.15s; }
.wm-resizer:hover .wm-resizer-dots span, .wm-resizer.active .wm-resizer-dots span { background: var(--text-muted); }
.wm-resizer-dots  { display: flex; flex-direction: column; gap: 3px; }
.wm-resizer-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint); }
.wm-detail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); gap: 12px; }

/* ── Tree View ── */
.wm-tree-node    { padding: 4px 8px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 14px; transition: background 0.15s; user-select: none; }
.wm-tree-node:hover { background: var(--border-light); }
.wm-tree-node.selected { background: rgba(99, 102, 241, 0.22); font-weight: 600; }
html.dark .wm-tree-node.selected { background: rgba(99, 102, 241, 0.3); }
.wm-tree-node.group { font-weight: 600; color: var(--text); }
.wm-tree-node.domain { color: var(--text-secondary); font-weight: 400; }
.wm-tree-children { padding-left: 20px; }
.wm-mobile-menu   { display: none; }
@media (hover: none), (pointer: coarse) { .wm-mobile-menu { display: block; } }
.wm-tree-node.drop-target { background: rgba(99, 102, 241, 0.15); border: 1px dashed var(--primary); }
.wm-ctx-menu { position: fixed; z-index: 9999; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 6px 0; min-width: 200px; }

/* ── Domain List (legacy, still used for ungrouped) ── */
.wm-list       { display: flex; flex-direction: column; gap: 12px; animation: wmFadeIn 0.2s ease; }
@keyframes wmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.wm-domain-hdr { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; }
.wm-domain-hdr .wm-flex1 { flex: 1; }
.wm-chips      { display: flex; align-items: center; gap: 8px; }

/* ── Groups ── */
.wm-group        { border-radius: 14px; border: 2px dashed var(--group-border); padding: 4px; transition: all 0.2s; background: var(--group-bg); }
.wm-group.active { border-style: solid; border-color: var(--primary); background: rgba(99, 102, 241, 0.06); }
.wm-group-hdr    { display: flex; align-items: center; gap: 10px; padding: 8px 16px; cursor: pointer; }
.wm-group-count  { background: #e0e0e4 !important; color: #3a3a3a !important; }
html.dark .wm-group-count { background: #2f2f2f !important; color: #cfcfcf !important; }
.wm-group-rename { padding: 4px 16px 8px; display: flex; gap: 8px; align-items: center; }
.wm-group-body         { display: flex; flex-direction: column; gap: 8px; padding: 0 4px 4px; overflow: hidden; max-height: 5000px; transition: max-height 0.25s ease-in-out, opacity 0.2s ease; opacity: 1; }
.wm-group-body.ungrouped { gap: 12px; padding: 0; }
.wm-group-nested { margin-left: 12px; border-width: 1.5px; }

/* ── Expanded Content (inside domain card) ── */
.wm-expanded   { padding: 0 16px 8px; display: flex; flex-direction: column; gap: 0; }
.wm-section    { padding: 10px 4px; }

/* ── Upload ── */
.wm-upload-progress { padding: 20px 16px; background: rgba(13, 148, 136, 0.06); }
.wm-upload-row      { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wm-dropzone        { position: relative; padding: 24px 16px; border: 2px dashed var(--border); border-radius: 10px; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; cursor: pointer; }
.wm-dropzone.active { border-color: var(--teal); background: rgba(13, 148, 136, 0.08); }
.wm-dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ── Upload-Lock-Mechanismus ──
   Wrap = position: relative damit Overlay/Chip absolut darüber sitzen.
   "locked" : Dropzone gedimmt, Overlay (Klick zum Entsperren) sichtbar.
   "armed"  : Dropzone aktiv, kleine Lock-Off-Chip oben rechts, sanfte Pulse-Animation. */
.wm-upload-wrap { position: relative; }
.wm-upload-wrap.locked .wm-dropzone {
    opacity: 0.45;
    pointer-events: none;
    background-image: repeating-linear-gradient(135deg,
        rgba(0, 0, 0, 0.04) 0 10px, transparent 10px 20px);
}
.wm-upload-wrap.armed .wm-dropzone {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.12);
    animation: wm-upload-pulse 2.4s ease-in-out infinite;
}
@keyframes wm-upload-pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.10); }
    50%      { box-shadow: 0 0 0 5px rgba(13, 148, 136, 0.22); }
}

/* Lock-Overlay (klickbarer Button): zentriert, deckt die Dropzone vollständig.
   Stripe-Pattern + 🔒 Icon machen den "kapalı" Zustand sofort lesbar. */
.wm-upload-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    background: repeating-linear-gradient(135deg,
        rgba(99, 102, 241, 0.06) 0 10px, transparent 10px 20px),
        rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(1.5px);
    border: 2px dashed var(--border); border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    transition: background 0.15s, transform 0.1s;
}
.wm-upload-overlay:hover {
    background: repeating-linear-gradient(135deg,
        rgba(99, 102, 241, 0.10) 0 10px, transparent 10px 20px),
        rgba(255, 255, 255, 0.7);
    color: var(--text);
}
.wm-upload-overlay:active { transform: scale(0.99); }
.wm-upload-overlay-title { font-size: 14px; font-weight: 600; }
.wm-upload-overlay-sub   { font-size: 12px; color: var(--text-muted); }

html.dark .wm-upload-overlay {
    background: repeating-linear-gradient(135deg,
        rgba(255, 255, 255, 0.04) 0 10px, transparent 10px 20px),
        rgba(0, 0, 0, 0.45);
}
html.dark .wm-upload-overlay:hover {
    background: repeating-linear-gradient(135deg,
        rgba(255, 255, 255, 0.07) 0 10px, transparent 10px 20px),
        rgba(0, 0, 0, 0.55);
}

/* "Armed"-Chip oben rechts in der Dropzone — visueller Indikator dass Upload bereit ist.
   × Knopf darin schliesst die Sperre wieder. */
.wm-upload-armed-chip {
    position: absolute; top: 8px; right: 8px;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 4px 3px 8px;
    background: var(--teal); color: #fff;
    border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(13, 148, 136, 0.35);
}
.wm-upload-relock-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #fff; border: none; border-radius: 50%;
    width: 18px; height: 18px;
    font-size: 14px; line-height: 1; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.12s;
}
.wm-upload-relock-btn:hover { background: rgba(255, 255, 255, 0.45); }

/* ── Arm-Upload Confirm Dialog ──
   Gradient-Orb (🔓) oben, Domain-Name als Mono-Pill, Gradient-Button mit Glow.
   Ziel: das "Entsperren" zu einem bewussten, leicht zelebrierten Akt machen,
   damit der User die Domain wirklich liest. */
.wm-arm-dialog .mud-dialog-content {
    padding: 28px 28px 16px !important;
    text-align: center;
}
.wm-arm-dialog .mud-dialog-actions {
    padding: 8px 24px 20px;
    gap: 10px;
    justify-content: center;
}
.wm-arm-icon-orb {
    width: 72px; height: 72px; margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 60%, #047857 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: wm-arm-orb-float 2.6s ease-in-out infinite;
}
.wm-arm-icon-orb .mud-icon-root { font-size: 36px !important; color: #fff !important; }
@keyframes wm-arm-orb-float {
    0%, 100% { transform: translateY(0); box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
    50%      { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(13, 148, 136, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
}
.wm-arm-title {
    font-size: 18px; font-weight: 700; color: var(--text);
    margin-bottom: 14px;
}
.wm-arm-domain {
    display: inline-block;
    font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
    font-size: 15px; font-weight: 700;
    color: var(--teal);
    background: rgba(13, 148, 136, 0.10);
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: 8px;
    padding: 6px 14px;
    margin-bottom: 14px;
    word-break: break-all;
}
.wm-arm-text {
    font-size: 13px; color: var(--text-muted);
    line-height: 1.5;
    max-width: 360px; margin: 0 auto;
}
/* Footer-Buttons: Cancel links neutral, Confirm rechts dominant gradient */
.wm-arm-cancel-btn {
    background: transparent; border: 1px solid var(--border);
    color: var(--text-secondary);
    font: inherit; font-weight: 600; font-size: 13px;
    padding: 9px 18px; border-radius: 8px;
    cursor: pointer; transition: all 0.15s;
}
.wm-arm-cancel-btn:hover { background: var(--group-bg); color: var(--text); }
.wm-arm-confirm-btn {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: #fff; border: none;
    font: inherit; font-weight: 700; font-size: 13.5px;
    padding: 10px 22px; border-radius: 8px;
    cursor: pointer; transition: all 0.18s;
    display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.35);
    position: relative; overflow: hidden;
}
.wm-arm-confirm-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
    background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
}
.wm-arm-confirm-btn:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(13, 148, 136, 0.4); }
.wm-arm-confirm-btn .mud-icon-root { font-size: 18px !important; color: #fff !important; }
/* Beim Hover wackelt das Schloss-Icon kurz — visuelle Bestätigung dass etwas "freigeht" */
.wm-arm-confirm-btn:hover .mud-icon-root { animation: wm-arm-lock-wiggle 0.5s ease; }
@keyframes wm-arm-lock-wiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-12deg); }
    75%      { transform: rotate(12deg); }
}

html.dark .wm-arm-domain {
    background: rgba(13, 148, 136, 0.18);
    border-color: rgba(20, 184, 166, 0.4);
    color: #5eead4;
}
.wm-preserve-section  { margin: -4px 0 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.wm-preserve-header   { display: flex; align-items: center; gap: 6px; padding: 8px 12px; cursor: pointer; user-select: none; }
.wm-preserve-header:hover { background: rgba(99, 102, 241, 0.06); }
.wm-preserve-title    { font-size: 13px; font-weight: 600; color: var(--text-secondary); flex: 1; }
.wm-preserve-options  { padding: 4px 12px 8px 20px; border-top: 1px solid var(--border); }
.wm-preserve-label    { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--text); margin-right: 6px; }
.wm-preserve-desc     { font-size: 12px; color: var(--text-muted); }
.wm-table-row:hover td { background: rgba(99, 102, 241, 0.08); }
.wm-maintenance-badge { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); border-radius: 10px; color: #f59e0b; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.wm-maintenance-pw { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 12px; background: rgba(245,158,11,0.15); padding: 2px 8px; border-radius: 4px; margin-left: auto; }
.wm-sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
.wm-sortable-th:hover { color: var(--primary); }
.wm-search-box   { display: flex; align-items: center; gap: 6px; padding: 6px 10px; margin-bottom: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.wm-search-input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font-size: 13px; font-family: inherit; }
.wm-search-input::placeholder { color: var(--text-faint); }
.wm-summary-btn { border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 8px; }
.wm-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.wm-summary-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.wm-summary-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wm-summary-card-body { display: flex; flex-direction: column; }
.wm-summary-card-value { font-size: 22px; font-weight: 800; line-height: 1; color: var(--text); }
.wm-summary-card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.wm-summary-resource { margin-bottom: 10px; }
.wm-summary-resource-header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 13px; }
.wm-summary-resource-name { font-weight: 600; color: var(--text); }
.wm-summary-resource-detail { margin-left: auto; color: var(--text-muted); font-size: 12px; }

/* ── Deploy Progress ── */
.wm-deploy-progress { padding: 16px; }
.wm-deploy-row      { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wm-deploy-stats    { display: flex; justify-content: space-between; margin-top: 6px; }

/* ── Alerts ── */
.wm-alert-success { background: rgba(16, 185, 129, 0.08); display: flex; align-items: center; gap: 10px; }
.wm-alert-error   { background: rgba(239, 68, 68, 0.08); display: flex; align-items: center; gap: 10px; }

/* ── Actions Bar (SSL + IIS) ── */
.wm-actions    { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 4px; }
.wm-divider    { width: 1.5px; height: 24px; background: var(--group-border); margin: 0 6px; }
.wm-flex1      { flex: 1; }
.wm-text-red   { color: var(--red); }
.wm-text-green { color: var(--green); }

/* ── Login Page ── */
.wm-login-page   { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); font-family: inherit; }
.wm-login-card   { background: var(--surface); border-radius: 18px; padding: 40px; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08); }
.wm-login-brand  { text-align: center; margin-bottom: 32px; }
.wm-login-title  { font-size: 28px; font-weight: 800; color: var(--primary); }
.wm-login-sub    { color: var(--text-muted); font-size: 14px; }
.wm-login-error  { background: #fef2f2; color: #dc2626; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; }
.wm-login-field  { margin-bottom: 16px; }
.wm-login-field-lg { margin-bottom: 24px; }
.wm-login-label  { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.wm-login-input  { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; outline: none; box-sizing: border-box; background: var(--surface); color: var(--text); }
.wm-login-input:focus { border-color: var(--primary); }
.wm-login-btn    { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; font-family: inherit; }

/* ── Settings Page ── */
.wm-settings-page     { max-width: 640px; }
.wm-settings-header   { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }
.wm-settings-heading  { font-size: 22px; font-weight: 800; color: var(--text); margin: 0; }
.wm-settings-card     { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; }
.wm-settings-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.wm-settings-phantom-list { list-style: disc; margin: 0 0 12px 24px; padding: 0; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 13px; color: var(--text); max-height: 220px; overflow-y: auto; }
.wm-settings-phantom-list li { padding: 2px 0; }
.wm-settings-desc     { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.wm-settings-lang-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wm-settings-info-grid { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.wm-settings-label    { color: var(--text-muted); font-weight: 500; }
.wm-settings-value    { color: var(--text); word-break: break-all; }
.wm-settings-version  { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 13px; }
.wm-update-badge { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; background: #f59e0b; color: #1a1a1a; font-size: 12px; font-weight: 600; text-decoration: none; vertical-align: middle; }
.wm-update-badge:hover { background: #d97706; }
.wm-settings-drive        { margin-bottom: 14px; }
.wm-settings-drive:last-child { margin-bottom: 0; }
.wm-settings-drive-header { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.wm-settings-drive-name   { font-weight: 600; font-size: 14px; color: var(--text); }
.wm-settings-drive-format { font-size: 12px; color: var(--text-muted); }
.wm-settings-drive-stats  { display: flex; gap: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }

/* ── Diagnose Dialog ── */
.wm-diag-textarea { width: 100%; min-height: 50vh; max-height: 60vh; padding: 12px; background: #0f172a; color: #e2e8f0; border-radius: 8px; border: none; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; resize: vertical; white-space: pre; overflow: auto; }
.wm-diag-copy     { background: #594ae2; color: white; border: none; border-radius: 4px; padding: 8px 16px; font-weight: 600; font-size: 0.875rem; cursor: pointer; margin-right: 8px; font-family: inherit; }

/* ── Validation ── */
.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }

/* ── Blazor Error Boundary ── */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten." }

/* ── Guide Page ── */
.wm-guide-page       { max-width: 820px; }
.wm-guide-header     { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wm-guide-heading    { font-size: 22px; font-weight: 800; color: var(--text); margin: 0; }
.wm-guide-intro      { font-size: 14px; color: var(--text-secondary); margin: 0 0 24px; line-height: 1.6; }
.wm-guide-card       { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; margin-bottom: 16px; }
.wm-guide-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.wm-guide-text       { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin: 0 0 8px; }
.wm-guide-text:last-child { margin-bottom: 0; }
.wm-guide-text-muted { color: var(--text-muted); font-style: italic; }
.wm-guide-text code  { background: rgba(99,102,241,0.1); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 13px; }
.wm-guide-list       { padding-left: 4px; }
.wm-guide-code       { background: #0f172a; color: #e2e8f0; padding: 16px 20px; border-radius: 10px; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; overflow-x: auto; margin: 12px 0; white-space: pre; }
.wm-guide-card-note  { border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.05); }
html.dark .wm-guide-card-note { background: rgba(59,130,246,0.08); }
.wm-guide-card-prompt { border-color: rgba(99,102,241,0.3); }
.wm-guide-prompt-wrapper { position: relative; margin-top: 12px; }
.wm-guide-prompt     { width: 100%; min-height: 420px; padding: 16px 20px; background: #0f172a; color: #e2e8f0; border-radius: 10px; border: none; font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; resize: vertical; white-space: pre; overflow: auto; box-sizing: border-box; }
.wm-guide-copy-btn   { position: absolute; top: 10px; right: 10px; background: #6366f1; color: white; border: none; border-radius: 6px; padding: 6px 14px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.wm-guide-copy-btn:hover { background: #4f46e5; }

/* ── Alert bar (between topbar and stats; collapsible single-line strip) ── */
.wm-alert-bar          { background: var(--surface); border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0; margin-top: -20px; margin-bottom: 0; overflow: hidden; }
.wm-alert-bar + .wm-server-stats { border-top-left-radius: 0; border-top-right-radius: 0; margin-top: 0; }
.wm-alert-header       { display: flex; align-items: center; gap: 12px; padding: 6px 14px; min-height: 30px; cursor: pointer; user-select: none; }
.wm-alert-header.no-toggle { cursor: default; }
.wm-alert-header:hover:not(.no-toggle) { background: rgba(99,102,241,0.04); }
html.dark .wm-alert-header:hover:not(.no-toggle) { background: rgba(255,255,255,0.04); }
.wm-alert-counts       { display: inline-flex; gap: 6px; flex-shrink: 0; }
.wm-alert-count        { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1; }
.wm-alert-count-error  { background: rgba(239,68,68,0.18);  color: #b91c1c; }
.wm-alert-count-warn   { background: rgba(245,158,11,0.20); color: #b45309; }
.wm-alert-count-info   { background: rgba(99,102,241,0.18); color: var(--primary); }
html.dark .wm-alert-count-error { background: rgba(239,68,68,0.22); color: #fca5a5; }
html.dark .wm-alert-count-warn  { background: rgba(245,158,11,0.22); color: #fcd34d; }
html.dark .wm-alert-count-info  { background: rgba(99,102,241,0.22); color: #c7d2fe; }
.wm-alert-headline     { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-alert-headline-tone-error { color: #b91c1c; }
.wm-alert-headline-tone-warn  { color: #b45309; }
.wm-alert-headline-tone-info  { color: var(--primary); }
html.dark .wm-alert-headline-tone-error { color: #fca5a5; }
html.dark .wm-alert-headline-tone-warn  { color: #fcd34d; }
html.dark .wm-alert-headline-tone-info  { color: #c7d2fe; }
.wm-alert-headline-extra { color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.wm-alert-chevron      { flex-shrink: 0; color: var(--text-muted); display: inline-flex; transition: transform 0.2s ease; }
.wm-alert-chevron.open { transform: rotate(180deg); }
.wm-alert-body         { display: flex; flex-direction: column; border-top: 1px dashed var(--border); padding: 4px 14px 8px; gap: 2px; max-height: 240px; overflow-y: auto; animation: wmFadeIn 0.18s ease; scrollbar-width: thin; scrollbar-color: var(--text-faint) transparent; }
.wm-alert-body::-webkit-scrollbar { width: 6px; }
.wm-alert-body::-webkit-scrollbar-track { background: transparent; }
.wm-alert-body::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; opacity: 0.4; }
.wm-alert-body::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.wm-alert-row          { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; line-height: 1.4; text-decoration: none; color: var(--text); border-radius: 4px; }
button.wm-alert-row    { background: none; border: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.wm-alert-row:hover    { color: var(--primary); }
.wm-alert-row .mud-icon-root { font-size: 16px !important; width: 16px !important; height: 16px !important; flex-shrink: 0; }
.wm-alert-row-tone-error .mud-icon-root { color: #b91c1c; }
.wm-alert-row-tone-warn  .mud-icon-root { color: #b45309; }
.wm-alert-row-tone-info  .mud-icon-root { color: var(--primary); }
html.dark .wm-alert-row-tone-error .mud-icon-root { color: #fca5a5; }
html.dark .wm-alert-row-tone-warn  .mud-icon-root { color: #fcd34d; }
html.dark .wm-alert-row-tone-info  .mud-icon-root { color: #c7d2fe; }
.wm-alert-row-arrow    { margin-left: auto; color: var(--text-faint); font-size: 14px; }

/* ── Download dialog ── */
.wm-download-domain      { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; padding: 8px 12px; background: rgba(99,102,241,0.12); color: var(--primary); border-radius: 8px; margin-bottom: 12px; word-break: break-all; }
html.dark .wm-download-domain { background: rgba(99,102,241,0.18); color: #c7d2fe; }
.wm-download-body-text   { font-size: 13px; line-height: 1.5; margin: 8px 0; color: var(--text); }
.wm-download-body-muted  { color: var(--text-muted); font-size: 12px; }
.wm-download-live-row    { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; user-select: none; font-size: 13px; }
.wm-download-live-row input { width: 16px; height: 16px; cursor: pointer; }

/* ── User management dialog ── */
.wm-user-list-toolbar    { display: flex; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.wm-user-table           { width: 100%; border-collapse: collapse; font-size: 13px; }
.wm-user-table thead th  { text-align: left; padding: 8px; font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
.wm-user-table tbody td  { padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--text); }
.wm-user-table tbody tr:last-child td { border-bottom: none; }
.wm-user-username        { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 12px; color: var(--text); }
.wm-user-role-admin      { display: inline-block; padding: 2px 8px; border-radius: 4px; background: rgba(99,102,241,0.18); color: var(--primary); font-size: 11px; font-weight: 600; }
.wm-user-role-mitarbeiter { display: inline-block; padding: 2px 8px; border-radius: 4px; background: rgba(148,163,184,0.18); color: var(--text-muted); font-size: 11px; font-weight: 600; }
html.dark .wm-user-role-admin      { background: rgba(99,102,241,0.22); color: #c7d2fe; }
html.dark .wm-user-role-mitarbeiter { background: rgba(148,163,184,0.22); color: #cbd5e1; }
.wm-user-actions         { white-space: nowrap; text-align: right; }

/* ── Permissions dialog ── */
.wm-perm-row             { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--border); }
.wm-perm-row:last-child  { border-bottom: none; }
.wm-perm-row .wm-perm-user { flex: 1; }
.wm-perm-empty           { padding: 24px; text-align: center; color: var(--text-muted); font-style: italic; font-size: 13px; }
.wm-perm-folder-pill     { font-family: 'JetBrains Mono', Menlo, Consolas, monospace; font-size: 14px; font-weight: 600; padding: 8px 12px; background: rgba(99,102,241,0.12); color: var(--primary); border-radius: 8px; margin-bottom: 12px; word-break: break-all; }
html.dark .wm-perm-folder-pill { background: rgba(99,102,241,0.18); color: #c7d2fe; }
.wm-perm-summary         { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left: 6px; opacity: 0.85; }
.wm-perm-summary .mud-icon-root { font-size: 12px !important; width: 12px !important; height: 12px !important; }

/* ── Empty tree (Mitarbeiter without grants) ── */
.wm-tree-empty           { display: flex; flex-direction: column; align-items: center; padding: 32px 16px; text-align: center; gap: 8px; }
.wm-tree-empty-title     { font-size: 14px; font-weight: 600; color: var(--text); }
.wm-tree-empty-body      { font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 280px; }
