/* ═══════════════════════════════════════════════════════════════
   Siechhaus — Medieval Fantasy Hospital
   Dark Theme mit Gold-Akzenten
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg: #1a1510; --bg2: #221c14; --bg3: #2a2218; --bg-card: #2a2218;
    --border: #3a3020; --border-light: #4a4030;
    --accent: #DEA726; --accent-dim: #b8891e;
    --text: #d8c8a8; --text-mid: #b0a080; --text-bright: #f0e8d8;
    --danger: #c0392b; --success: #27ae60; --info: #5a9ab5;
    --shadow: rgba(0,0,0,0.4);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cormorant Garamond', serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 16px; line-height: 1.5; }

/* ── Landing ── */
.landing { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, var(--bg2), var(--bg) 70%); }
.landing-content { text-align: center; max-width: 480px; padding: 20px; }
.landing-title { font-family: 'Cinzel Decorative', serif; font-size: 3rem; color: var(--accent); text-shadow: 0 2px 8px rgba(222,167,38,0.3); margin-bottom: 8px; }
.landing-subtitle { font-size: 1.15rem; color: var(--text-mid); margin-bottom: 32px; line-height: 1.6; }
.landing-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 32px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.auth-tab { flex: 1; background: transparent; border: 1px solid var(--border); border-radius: 4px; padding: 8px; color: var(--text-mid); font-family: 'Cinzel', serif; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: var(--accent); color: #1a1510; border-color: var(--accent); font-weight: 700; }
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-form input { padding: 10px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text-bright); font-family: 'Cormorant Garamond', serif; font-size: 1rem; }
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-error { color: var(--danger); font-size: 0.9rem; margin-top: 8px; min-height: 20px; }
.landing-features { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; font-size: 0.9rem; color: var(--text-mid); }
.landing-footer { margin-top: 24px; font-size: 0.85rem; color: var(--text-mid); display: flex; gap: 8px; justify-content: center; align-items: center; }
.landing-footer a { color: var(--text-mid); text-decoration: none; transition: color 0.15s; }
.landing-footer a:hover { color: var(--accent); }

/* ── Buttons ── */
.btn { padding: 10px 18px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg3); color: var(--text); font-family: 'Cinzel', serif; font-size: 0.95rem; cursor: pointer; transition: all 0.15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-gold { background: var(--accent); color: #1a1510; border-color: var(--accent-dim); font-weight: 700; }
.btn-gold:hover { background: #e8b42e; }
.btn-danger { background: var(--danger); color: #fff; border-color: #a93226; }
.btn-small { padding: 4px 10px; font-size: 0.8rem; }

/* ── Einheitliche Topbar (Navigation + Status + Zeit) ── */
.nav-btn {
    background: none; border: none; color: var(--text-mid); cursor: pointer;
    padding: 6px 10px; font-size: 0.82rem; font-family: 'Cinzel', serif; font-weight: 600;
    border-bottom: 2px solid transparent; transition: all 0.15s; position: relative;
    white-space: nowrap; letter-spacing: 0.3px;
}
.nav-btn:hover { color: var(--text-bright); }
.nav-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-badge {
    position: absolute; top: 0; right: 0; background: var(--danger); color: #fff;
    font-size: 0.55rem; font-weight: 700; min-width: 14px; height: 14px; line-height: 14px;
    text-align: center; border-radius: 7px; font-family: sans-serif;
    animation: alertPulse 1.5s infinite;
}
.topbar-sep { color: var(--border); font-size: 0.8rem; margin: 0 2px; }

/* ── Breadcrumb ── */
.breadcrumb {
    display: none; /* Nicht mehr nötig — Header im Room-Screen ersetzt Breadcrumb */
}
.bc-link { color: var(--accent-dim); cursor: pointer; text-decoration: none; }
.bc-link:hover { color: var(--accent); text-decoration: underline; }
.bc-sep { color: var(--text-mid); margin: 0 4px; opacity: 0.4; }
.bc-current { color: var(--text); font-weight: 600; }

.topbar {
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 6px 16px; display: flex; align-items: center; gap: 14px;
    position: sticky; top: 0; z-index: 100;
}
.topbar-brand { font-family: 'Cinzel Decorative',serif; font-size: 1.1rem; color: var(--accent); }
.topbar-stat { font-size: 0.88rem; color: var(--text-mid); }
.topbar-stat strong { color: var(--text-bright); font-family: 'Cinzel',serif; }
.topbar-time { font-family: 'Cinzel',serif; font-size: 0.95rem; color: var(--accent); }
.main-content { padding: 0; margin: 0 auto; min-height: calc(100vh - 45px); }

/* ── Chefbüro (Schreibtisch) ── */
.office-desk { max-width: 600px; margin: 0 auto; }
.office-title { font-family: 'Cinzel Decorative',serif; font-size: 1.6rem; color: var(--accent); text-align: center; margin-bottom: 16px; }
.desk-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.desk-item {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 16px; text-align: center; cursor: pointer; transition: all 0.15s;
}
.desk-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(222,167,38,0.15); }
.desk-wide { grid-column: span 2; }
.desk-gold { border-color: var(--accent-dim); cursor: default; }
.desk-gold:hover { transform: none; box-shadow: none; }
.desk-icon { font-size: 2rem; margin-bottom: 4px; }
.desk-label { font-family: 'Cinzel',serif; font-size: 1rem; color: var(--text-bright); font-weight: 700; }
.desk-hint { font-size: 0.8rem; color: var(--text-mid); margin-top: 2px; }

.office-tip {
    background: var(--bg-card); border: 1px solid var(--accent-dim); border-radius: 8px;
    padding: 14px; margin-bottom: 12px;
}
.tip-header { font-family: 'Cinzel',serif; font-size: 0.9rem; color: var(--accent); margin-bottom: 4px; }
.tip-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; }
.office-footer { text-align: center; }

/* ── Karte v2 (Raum-Übersicht) ── */
.map-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.map-alert {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px;
    background: rgba(222,167,38,0.08); border: 1px solid var(--accent-dim); border-radius: 8px;
    cursor: pointer; transition: all 0.15s; font-size: 0.9rem; color: var(--accent);
}
.map-alert:hover { background: rgba(222,167,38,0.15); }
.map-alert-icon { font-size: 1.5rem; }
.map-alert-action { margin-left: auto; font-weight: 600; font-size: 0.82rem; }
.map-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.map-room-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    overflow: hidden; cursor: pointer; transition: all 0.15s;
}
.map-room-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(222,167,38,0.12); }
.room-active { border-left: 3px solid var(--success); }
.room-warn { border-left: 3px solid var(--danger); }
.room-idle { border-left: 3px solid var(--text-mid); }
.mrc-header { display: flex; gap: 10px; align-items: center; padding: 12px 14px 8px; }
.mrc-icon { font-size: 2rem; }
.mrc-title { flex: 1; }
.mrc-name { font-family: 'Cinzel',serif; font-size: 0.95rem; color: var(--text-bright); font-weight: 700; }
.mrc-status { font-size: 0.78rem; margin-top: 2px; }
.mrc-body { padding: 0 14px 8px; }
.mrc-row { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 2px 0; border-bottom: 1px solid rgba(58,48,32,0.3); }
.mrc-row:last-child { border-bottom: none; }
.mrc-row span { color: var(--text-mid); } .mrc-row strong { color: var(--text-bright); }
.mrc-staff, .mrc-patients { padding: 4px 14px; display: flex; gap: 4px; flex-wrap: wrap; }
.mrc-staff-badge { font-size: 1rem; }
.mrc-patient-dot { font-size: 0.8rem; }
.mrc-enter { padding: 8px 14px; text-align: center; font-size: 0.78rem; color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); }

/* ── Raum-Innenansicht v2 ── */
.room-view { max-width: 900px; }
.rv-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rv-title { display: flex; align-items: center; gap: 10px; flex: 1; }
.rv-icon { font-size: 2.5rem; }
.rv-name { font-family: 'Cinzel Decorative',serif; font-size: 1.3rem; color: var(--accent); }
.rv-meta { font-size: 0.8rem; color: var(--text-mid); }
.rv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .rv-grid { grid-template-columns: 1fr; } }
.rv-col { display: flex; flex-direction: column; gap: 10px; }
.rv-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.rv-section-highlight { border-color: var(--accent-dim); background: rgba(222,167,38,0.03); }
.rv-section-danger { border-color: var(--danger); text-align: center; }
.rv-section-title { font-family: 'Cinzel',serif; font-size: 0.88rem; color: var(--accent); margin-bottom: 6px; font-weight: 600; }
.rv-empty { color: var(--text-mid); font-size: 0.82rem; font-style: italic; padding: 4px 0; }
.rv-badge-row { margin-bottom: 6px; }
.rv-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.rv-badge-warn { background: rgba(222,167,38,0.15); color: var(--accent); border: 1px solid var(--accent-dim); }
.rv-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 0.82rem; border-bottom: 1px solid rgba(58,48,32,0.3); }
.rv-item:last-child { border-bottom: none; }
.rv-person { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid rgba(58,48,32,0.3); }
.rv-person:last-child { border-bottom: none; }
.rv-person-icon { font-size: 1.3rem; }
.rv-person-info { flex: 1; }
.rv-person-name { font-size: 0.85rem; font-weight: 600; color: var(--text-bright); }
.rv-person-detail { font-size: 0.75rem; color: var(--text-mid); }
.rv-assign { display: flex; gap: 6px; margin-top: 8px; }
.rv-select { flex: 1; padding: 5px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-size: 0.82rem; }
.rv-buy-row { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }

/* ── Room Action Buttons ── */
/* ── Raum-Hintergrund (Legacy) ── */
.rv-room-bg { position: relative; margin-bottom: 12px; border-radius: 8px; overflow: hidden; border: 3px solid var(--border); }
.rv-room-bg-img { display: block; width: 100%; height: auto; }
.rv-room-frame-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.rv-room-frame-layer .map-frame { pointer-events: auto; }

/* ══ Universelle Raum-Ansicht (Vollbild + Frames) ══ */
.room-screen { display: flex; flex-direction: column; height: calc(100vh - 42px); }
.room-screen-header {
    display: flex; align-items: center; gap: 12px; padding: 4px 10px; flex-wrap: wrap;
    background: var(--bg2); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.room-screen-title { font-family: 'Cinzel', serif; font-size: 1rem; color: var(--accent); font-weight: 700; }
.room-screen-sub { font-size: 0.72rem; color: var(--text-mid); margin-left: auto; }
.room-screen-canvas {
    position: relative; flex: 1; overflow: hidden; background: #0e0c08;
    display: flex; align-items: center; justify-content: center;
}
/* Innerer Wrapper damit Frames relativ zum Bild positioniert werden */
.room-screen-img-wrap {
    position: relative; display: inline-block; max-width: 100%; max-height: 100%;
}
.room-screen-img { display: block; max-width: 100%; max-height: calc(100vh - 120px); width: auto; height: auto; }
.room-screen-placeholder {
    display: flex; align-items: center; justify-content: center;
    height: 400px; font-size: 3rem; color: var(--text-mid);
}
.room-screen-frames {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2;
}
.room-screen-frames .map-frame { pointer-events: auto; }
/* ── Pergament-Overlay (universelles UI-Panel auf Raum-Bild) ── */
.room-screen-overlay {
    position: absolute; top: 0; right: 0; bottom: 0; width: 0;
    overflow-y: auto; overflow-x: hidden;
    transition: width 0.3s ease; z-index: 10;
    /* Pergament-Stil */
    background: linear-gradient(180deg, #e0d0b4, #d4c4a4, #e0d0b4);
    border-left: 4px solid #8b6914;
    box-shadow: -4px 0 20px rgba(0,0,0,0.5), inset 2px 0 15px rgba(139,105,20,0.1);
}
.room-screen-overlay.open { width: 380px; padding: 16px 18px; }
@media (max-width: 600px) { .room-screen-overlay.open { width: 100%; } }

/* Overlay-Schließen-Button */
.room-screen-overlay .overlay-close {
    position: absolute; top: 8px; right: 10px; background: #6b4226; border: 2px solid #8b6914;
    color: #e8dcc4; font-size: 1rem; cursor: pointer; z-index: 2;
    width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3); transition: background 0.2s;
}
.room-screen-overlay .overlay-close:hover { background: #8b5a36; }

/* Pergament-Typografie im Overlay */
.room-screen-overlay { font-family: 'Cormorant Garamond', 'Georgia', serif; color: #3a2a1a; line-height: 1.4; }
.room-screen-overlay h3 {
    font-family: 'Cinzel', serif; font-size: 1rem; color: #4a2a0a;
    margin: 0 0 10px; padding-right: 32px; padding-bottom: 8px;
    border-bottom: 2px solid rgba(107,66,38,0.3);
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

/* Pergament-Formular-Elemente */
.po-group { margin-bottom: 10px; }
.po-label {
    display: block; font-family: 'Cinzel', serif; font-size: 0.75rem;
    color: #6b4a2a; font-weight: 700; margin-bottom: 3px; letter-spacing: 0.5px;
}
.po-input, .po-select, .po-textarea {
    width: 100%; padding: 6px 8px; box-sizing: border-box;
    background: rgba(255,255,255,0.5); border: 1px solid #a08050;
    border-radius: 3px; font-family: 'Cormorant Garamond', serif;
    font-size: 0.88rem; color: #2a1f14;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.po-input:focus, .po-select:focus, .po-textarea:focus {
    outline: none; border-color: #8b6914; background: rgba(255,255,255,0.7);
    box-shadow: 0 0 0 2px rgba(139,105,20,0.2);
}
.po-input[type="number"] { width: 70px; text-align: center; }
.po-input[type="range"] { accent-color: #8b6914; background: transparent; box-shadow: none; border: none; }
.po-textarea { min-height: 60px; resize: vertical; }

/* Pergament-Buttons */
.po-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px;
    background: #6b4226; color: #e8dcc4; border: 2px solid #8b6914;
    border-radius: 3px; font-family: 'Cinzel', serif; font-size: 0.82rem;
    font-weight: 700; cursor: pointer; transition: background 0.2s;
    text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.po-btn:hover { background: #8b5a36; }
.po-btn:disabled { opacity: 0.4; cursor: default; }
.po-btn-gold { background: #8b6914; }
.po-btn-gold:hover { background: #a07a1a; }
.po-btn-danger { background: #8b2a1a; border-color: #a03a2a; }
.po-btn-danger:hover { background: #a04030; }
.po-btn-sm { padding: 4px 8px; font-size: 0.72rem; }
.po-btn-block { width: 100%; justify-content: center; }

/* ── Hire-Grid (Personalsuche mit Bildern) ── */
.hire-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.hire-card {
    background: rgba(107,66,38,0.08); border: 2px solid rgba(107,66,38,0.2);
    border-radius: 6px; padding: 8px; text-align: center; cursor: pointer;
    transition: all 0.2s;
}
.hire-card:hover {
    border-color: #DEA726; background: rgba(222,167,38,0.12);
    transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.hire-card.hire-disabled { opacity: 0.4; cursor: not-allowed; }
.hire-portrait {
    width: 80px; height: 80px; object-fit: cover; border-radius: 50%;
    border: 3px solid rgba(107,66,38,0.3); margin: 0 auto 6px;
    display: block;
}
.hire-portrait-placeholder {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid rgba(107,66,38,0.2); margin: 0 auto 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; background: rgba(107,66,38,0.05);
}
.hire-name {
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.85rem;
    color: #2a1f14; margin-bottom: 2px;
}
.hire-salary { font-size: 0.72rem; color: #6b4a2a; }
.hire-cost {
    font-size: 0.7rem; color: #DEA726; font-weight: 600; margin-top: 4px;
    padding: 2px 6px; background: rgba(222,167,38,0.1); border-radius: 3px;
}

/* Pergament-Listen (Händler, Personal, Inventar) */
.po-list-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0; border-bottom: 1px solid rgba(107,66,38,0.2);
}
.po-list-item:last-child { border-bottom: none; }
.po-list-icon { font-size: 1.2rem; min-width: 28px; text-align: center; }
.po-list-icon img { width: 24px; height: 24px; object-fit: contain; }
.po-list-portrait {
    width: 42px; height: 42px; object-fit: cover; border-radius: 50%;
    border: 2px solid rgba(107,66,38,0.3); flex-shrink: 0;
}
.po-list-body { flex: 1; min-width: 0; }
.po-list-name { font-weight: 700; font-size: 0.85rem; color: #2a1f14; }
.po-list-detail { font-size: 0.72rem; color: #6b4a2a; }
.po-list-actions { display: flex; gap: 3px; align-items: center; flex-shrink: 0; }
.po-list-qty {
    width: 36px; padding: 3px; font-size: 0.75rem; text-align: center;
    background: rgba(255,255,255,0.5); border: 1px solid #a08050;
    border-radius: 3px; color: #2a1f14;
}

/* Pergament-Sektionen */
.po-section {
    margin-bottom: 12px; padding-bottom: 10px;
    border-bottom: 1px solid rgba(107,66,38,0.2);
}
.po-section:last-child { border-bottom: none; margin-bottom: 0; }
.po-section-title {
    font-family: 'Cinzel', serif; font-size: 0.82rem; color: #4a2a0a;
    font-weight: 700; margin-bottom: 6px;
    border-bottom: 1px solid rgba(107,66,38,0.15); padding-bottom: 3px;
}

/* Pergament-Info-Zeilen */
.po-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; }
.po-row-label { font-size: 0.82rem; color: #5a4a3a; }
.po-row-val { font-weight: 700; font-size: 0.85rem; color: #2a1f14; }

/* Pergament-Badges */
.po-badge {
    display: inline-block; padding: 2px 6px; border-radius: 3px;
    font-size: 0.68rem; font-weight: 700; font-family: 'Cinzel', serif;
}
.po-badge-gold { background: #8b6914; color: #e8dcc4; }
.po-badge-info { background: rgba(107,66,38,0.15); color: #4a2a0a; }
.po-badge-warn { background: #8b2a1a; color: #e8dcc4; }

/* Pergament-Karten (für Items im Overlay) */
.po-card {
    background: rgba(255,255,255,0.3); border: 1px solid rgba(107,66,38,0.25);
    border-radius: 4px; padding: 8px 10px; margin-bottom: 6px;
}
.po-card:hover { background: rgba(255,255,255,0.45); }

/* Pergament-Hinweise */
.po-hint { font-size: 0.72rem; color: #8b7355; font-style: italic; }
.po-empty { text-align: center; padding: 16px; color: #8b7355; font-style: italic; font-size: 0.88rem; }

/* Pergament-Trennlinie */
.po-divider { border: none; border-top: 1px solid rgba(107,66,38,0.2); margin: 10px 0; }

/* ── Stepper (‹ weniger | Wert | mehr ›) ── */
.po-stepper {
    display: inline-flex; align-items: center; border: 1px solid #a08050;
    border-radius: 3px; overflow: hidden; background: rgba(255,255,255,0.3);
}
.po-stepper-btn {
    width: 32px; height: 30px; border: none; background: #6b4226; color: #e8dcc4;
    font-size: 1rem; font-weight: 700; cursor: pointer; transition: background 0.15s;
    display: flex; align-items: center; justify-content: center;
}
.po-stepper-btn:hover { background: #8b5a36; }
.po-stepper-btn:active { background: #4a2a0a; }
.po-stepper-val {
    min-width: 50px; text-align: center; padding: 0 8px;
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.9rem; color: #2a1f14;
}

/* ── Pager (← Zurück | 3/12 | Weiter →) ── */
.po-pager {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 8px 0; border-top: 1px solid rgba(107,66,38,0.2); margin-top: 8px;
}
.po-pager-counter {
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.82rem; color: #4a2a0a;
    min-width: 50px; text-align: center;
}

/* ── Edit-Row (Label | Wert | [Ändern]) ── */
.po-edit-row {
    display: flex; align-items: center; gap: 6px; padding: 5px 0;
    border-bottom: 1px solid rgba(107,66,38,0.15);
}
.po-edit-row:last-child { border-bottom: none; }
.po-edit-display {
    flex: 1; text-align: right; font-weight: 700; font-size: 0.88rem; color: #2a1f14;
}
.po-edit-input { flex: 1; text-align: right; }

/* ── Actions-Leiste ── */
.po-actions {
    display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px;
    border-top: 1px solid rgba(107,66,38,0.2);
}

.rv-actions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.rv-actions .btn { display: flex; align-items: center; gap: 4px; }
.rv-action-count {
    display: inline-block; background: var(--accent-dim); color: var(--accent);
    padding: 1px 6px; border-radius: 10px; font-size: 0.72rem; font-weight: 700; min-width: 16px; text-align: center;
}

/* ── Room Overlay ── */
.rv-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100;
    background: rgba(10,8,5,0.8); display: flex; align-items: center; justify-content: center;
}
.rv-overlay-content {
    background: var(--bg-card); border: 1px solid var(--accent-dim); border-radius: 10px;
    width: 90%; max-width: 500px; max-height: 80vh; display: flex; flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.rv-overlay-header {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
.rv-overlay-title { font-family: 'Cinzel',serif; font-size: 0.95rem; color: var(--accent); font-weight: 600; }
.rv-overlay-body { padding: 12px 16px; overflow-y: auto; flex: 1; }
.rv-overlay-row {
    display: flex; justify-content: space-between; align-items: center; padding: 6px 0;
    border-bottom: 1px solid rgba(58,48,32,0.3); font-size: 0.82rem; gap: 8px;
}
.rv-overlay-row:last-child { border-bottom: none; }

/* ── Händler / Merchant ── */
.merch-loading { color: var(--text-mid); font-style: italic; padding: 8px 0; }
.merch-day { color: var(--accent); font-family: 'Cinzel',serif; font-size: 0.85rem; margin-bottom: 10px; font-weight: 600; }
.merch-section { margin-bottom: 14px; }
.merch-section-title {
    font-family: 'Cinzel',serif; font-size: 0.9rem; color: var(--accent); font-weight: 600;
    padding: 6px 0; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.merch-items { display: flex; flex-direction: column; gap: 2px; }
.merch-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    transition: border-color 0.15s;
}
.merch-item:hover { border-color: var(--accent-dim); }
.merch-item-disabled { opacity: 0.45; }
.merch-item-icon { font-size: 1.4rem; min-width: 28px; text-align: center; }
.merch-item-info { flex: 1; min-width: 0; }
.merch-item-name { font-size: 0.88rem; color: var(--text-bright); font-weight: 600; }
.merch-item-desc { font-size: 0.78rem; color: var(--text-mid); line-height: 1.3; margin-top: 1px; }
.merch-slots {
    display: inline-block; background: rgba(222,167,38,0.12); color: var(--accent);
    padding: 0 5px; border-radius: 3px; font-size: 0.75rem; font-weight: 600; margin-left: 4px;
}
.merch-stock {
    display: inline-block; background: rgba(192,57,43,0.12); color: var(--danger);
    padding: 0 5px; border-radius: 3px; font-size: 0.72rem; font-weight: 600; margin-left: 4px;
}
.merch-item-buy { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.merch-qty {
    width: 36px; padding: 3px; background: var(--bg2); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text); text-align: center; font-size: 0.82rem;
}

/* ── Cost Key ── */
.cost-grid { display: flex; flex-direction: column; gap: 6px; }
.cost-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.85rem;
}
.cost-label { font-weight: 600; color: var(--text-bright); min-width: 130px; font-size: 0.82rem; }
.cost-unit { color: var(--text-mid); font-size: 0.82rem; }
.cost-hint { color: var(--text-mid); font-size: 0.75rem; margin-left: auto; }
.cost-input {
    width: 50px; padding: 4px 6px; background: var(--bg2); border: 1px solid var(--border);
    border-radius: 3px; color: var(--text-bright); font-family: 'Cinzel',serif;
    font-size: 0.95rem; text-align: center;
}

/* ── Alert System ── */
.alert-badge { position: relative; cursor: pointer; margin-left: 4px; }
.alert-pulse {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 700;
    background: var(--danger); color: #fff; animation: alertPulse 1.5s infinite;
}
.alert-dot {
    display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem;
    background: var(--accent); color: #1a1510; font-weight: 600;
}
@keyframes alertPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); box-shadow: 0 0 8px rgba(192,57,43,0.5); } }
.alert-box { border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.alert-high { border: 1px solid var(--danger); background: rgba(192,57,43,0.08); }
.alert-info { border: 1px solid var(--accent-dim); background: rgba(222,167,38,0.05); }
.alert-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.15s; font-size: 0.88rem;
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: rgba(255,255,255,0.03); }
.alert-item-icon { font-size: 1.2rem; flex-shrink: 0; }
.alert-item-go { margin-left: auto; color: var(--accent); font-weight: 600; }

/* ── Stats Grid ── */
.stats-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.sg-item { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; text-align: center; }
.sg-val { font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 700; color: var(--text-bright); }
.sg-label { font-size: 0.72rem; color: var(--text-mid); margin-top: 2px; }
.sg-highlight { border-color: var(--accent); background: rgba(222,167,38,0.05); }
.sg-highlight .sg-val { color: var(--accent); }

/* ── Room Grid (Broker) ── */
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }

/* ── Broker: Parzellen + Optionen ── */
.broker-parcel-bar {
    display: flex; height: 14px; border-radius: 7px; overflow: hidden;
    background: var(--bg3); border: 1px solid var(--border); margin-bottom: 4px;
}
.broker-parcel-used { background: var(--accent); transition: width 0.4s; }
.broker-parcel-free { background: #27ae60; opacity: 0.6; transition: width 0.4s; }
.broker-option {
    flex: 1; min-width: 180px; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 6px; padding: 10px 12px;
}
.broker-option-title { font-family: 'Cinzel', serif; font-size: 0.88rem; color: var(--text-bright); font-weight: 700; }
.broker-option-price { font-size: 1.1rem; color: var(--accent); font-weight: 700; margin: 2px 0; }
.broker-option-detail { font-size: 0.72rem; color: var(--text-mid); }
.broker-qty {
    width: 50px; padding: 4px 6px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 4px; color: var(--text-bright); font-size: 0.85rem; text-align: center;
}
.broker-room-card { margin-bottom: 0; }

/* ── Cards ── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 12px; }
.card h2, .card h3 { font-family: 'Cinzel', serif; color: var(--accent); margin-bottom: 8px; }
.card h2 { font-size: 1.2rem; } .card h3 { font-size: 1rem; }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 12px; text-align: center; }
.stat-icon { font-size: 1.8rem; margin-bottom: 4px; }
.stat-value { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--text-bright); font-weight: 700; }
.stat-label { font-size: 0.85rem; color: var(--text-mid); }

/* ── Statistik-Desktop (Biing!-Style Fenster + Kacheln) ── */
.stat-desktop { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.stat-window {
    background: var(--bg2); border: 2px solid var(--border); border-radius: 6px;
    overflow: hidden;
}
.stat-window-wide { grid-column: 1 / -1; }
.stat-window-title {
    background: linear-gradient(180deg, #3a3020, #2a2018); color: var(--accent);
    font-family: 'Cinzel', serif; font-size: 0.85rem; font-weight: 700;
    padding: 6px 12px; border-bottom: 2px solid var(--border);
    user-select: none;
}
.stat-tiles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 6px;
    padding: 8px;
}
.stat-tile {
    background: var(--bg3); border: 2px solid var(--border); border-radius: 4px;
    padding: 8px 4px; text-align: center; cursor: pointer;
    transition: all 0.15s ease; position: relative;
}
.stat-tile:hover {
    border-color: var(--accent); background: rgba(222,167,38,0.08);
    transform: translateY(-2px); box-shadow: 0 3px 10px rgba(222,167,38,0.15);
}
.stat-tile:active { transform: translateY(0); }
.stat-tile-icon { font-size: 1.6rem; margin-bottom: 2px; }
.stat-tile-val {
    font-family: 'Cinzel', serif; font-size: 0.95rem; font-weight: 700;
    color: var(--text-bright); line-height: 1.2;
}
.stat-tile-label { font-size: 0.62rem; color: var(--text-mid); margin-top: 1px; line-height: 1.2; }
.stat-tile-sub { font-size: 0.58rem; color: var(--accent); margin-top: 1px; }
.stat-tile-gold { border-color: rgba(222,167,38,0.4); background: rgba(222,167,38,0.06); }
.stat-tile-gold .stat-tile-val { color: var(--accent); }
.stat-tile-green { border-color: rgba(39,174,96,0.4); }
.stat-tile-green .stat-tile-val { color: #27ae60; }
.stat-tile-red { border-color: rgba(192,57,43,0.4); }
.stat-tile-red .stat-tile-val { color: #c0392b; }

/* Detail-Overlay */
.stat-detail-overlay {
    position: fixed; inset: 0; z-index: 8500;
    background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
    animation: dr-fade-in 0.2s ease;
}
.stat-detail-card {
    background: var(--bg2); border: 2px solid var(--accent); border-radius: 8px;
    padding: 20px 24px; max-width: 460px; width: 92%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    max-height: 80vh; overflow-y: auto;
}
.sd-title {
    font-family: 'Cinzel', serif; font-size: 1.2rem; color: var(--accent);
    text-align: center; margin-bottom: 12px; font-weight: 700;
}
.sd-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.sd-row-highlight { background: rgba(222,167,38,0.08); border-left: 3px solid var(--accent); font-weight: 700; }
.sd-rank { font-size: 1.1rem; min-width: 30px; }
.sd-name { flex: 1; color: var(--text-bright); }
.sd-val { font-weight: 700; color: var(--accent); }
.sd-empty { text-align: center; color: var(--text-mid); padding: 16px; font-style: italic; }
.sd-text { color: var(--text); font-size: 0.9rem; line-height: 1.6; text-align: center; padding: 8px 0; }
.sd-kv { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.sd-kv span:first-child { color: var(--text-mid); }
.sd-kv span:last-child { font-weight: 700; color: var(--text-bright); }
.sd-summary { text-align: center; color: var(--text-mid); font-size: 0.82rem; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }

/* Balken in Detail */
.sd-bar-section { display: flex; flex-direction: column; gap: 6px; }
.sd-bar-item { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.sd-bar-item > span:first-child { min-width: 70px; color: var(--text-mid); }
.sd-bar-item > span:last-child { min-width: 65px; text-align: right; font-weight: 700; color: var(--text-bright); }
.sd-bar-track { flex: 1; height: 12px; background: var(--bg3); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.sd-bar { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.sd-bar-green { background: linear-gradient(90deg, #27ae60, #2ecc71); }
.sd-bar-red { background: linear-gradient(90deg, #c0392b, #e74c3c); }
.sd-bar-orange { background: linear-gradient(90deg, #d35400, #e67e22); }

/* Personal-Tabelle im Detail */
.sd-table { font-size: 0.78rem; }
.sd-table-head { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr; gap: 4px; padding: 4px 6px; color: var(--text-mid); font-weight: 600; border-bottom: 2px solid var(--border); }
.sd-table-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr; gap: 4px; padding: 4px 6px; border-bottom: 1px solid var(--border); align-items: center; }
.sd-table-row span { text-align: center; }
.sd-table-row span:first-child { text-align: left; color: var(--text-bright); }

/* ── Toast ── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 10px 16px; font-size: 0.9rem; color: var(--text); box-shadow: 0 4px 12px var(--shadow); animation: toast-in 0.3s ease; max-width: 360px; }
.toast.success { border-color: var(--success); } .toast.error { border-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: var(--accent-dim); }

/* ── Misc ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-mid); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; }
.badge-gold { background: var(--accent); color: #1a1510; }
.badge-info { background: var(--info); color: #fff; }

/* ── Room Grid ── */
.room-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.room-card { transition: border-color 0.15s; }
.room-card:hover { border-color: var(--accent-dim); }
.room-card-clickable { transition: all 0.15s; }
.room-card-clickable:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(222,167,38,0.2); transform: translateY(-1px); }
.dimmed { opacity: 0.5; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════
   PERGAMENT-AKTEN — Mittelalterliche Karteikarten
   ═══════════════════════════════════════════════════════════ */

/* Navigation (Durchblättern) */
.cs-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin-bottom: 8px; user-select: none;
}
.cs-nav span { font-family: 'Cinzel',serif; font-size: 0.85rem; color: var(--text-mid); min-width: 100px; text-align: center; }
.cs-nav button {
    background: var(--bg3); border: 1px solid var(--border); color: var(--text);
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.cs-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: rgba(222,167,38,0.1); }
.cs-nav button:disabled { opacity: 0.2; cursor: default; }

/* ── Pergament-Karte ── */
.parchment-card {
    background: #e8dcc8;
    background-image:
        linear-gradient(rgba(139,69,19,0.04) 1px, transparent 1px);
    background-size: 100% 24px;
    border: 2px solid #8b7355;
    border-radius: 4px;
    padding: 16px 18px;
    color: #2a1f14;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    position: relative;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.4), inset 0 0 30px rgba(139,69,19,0.08);
    max-width: 480px;
    margin: 0 auto;
}
/* Kein Padding wenn positionierte Seite (Hintergrundbild) */
.parchment-card.parch-positioned { padding: 0; overflow: hidden; }
/* Leichter "abgegriffener" Rand-Effekt */
.parchment-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(100,60,20,0.12);
    pointer-events: none;
}

/* Titel + Name */
.parch-title {
    font-family: 'Cinzel', serif; font-size: 0.85rem; color: #5a4230;
    text-align: center; margin-bottom: 2px; letter-spacing: 1px;
}
.parch-name {
    font-family: 'Cinzel Decorative', serif; font-size: 1.4rem; font-weight: 700;
    text-align: center; color: #2a1f14; margin-bottom: 10px;
}

/* Header: Portrait + Graph/Info */
.parch-header {
    display: flex; gap: 12px; margin-bottom: 10px;
}
.parch-portrait {
    width: 90px; height: 90px; border: 3px solid #8b7355;
    border-radius: 3px; overflow: hidden; flex-shrink: 0;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.3);
    background: #c4b49a;
}
.parch-portrait img {
    width: 100%; height: 100%; object-fit: cover;
}
.parch-portrait img[src^="data:"] {
    image-rendering: pixelated; /* Nur Pixel-Avatare pixelig */
}

/* Info-Block (neben Portrait bei Personal) */
.parch-info-block { flex: 1; }
.parch-role {
    font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700;
    color: #2a1f14; border-bottom: 1px solid #8b7355; padding-bottom: 3px;
    margin-bottom: 4px;
}
.parch-nr { float: right; font-size: 0.8rem; color: #8b7355; font-weight: 400; }

/* Graph (Patientenakte) */
.parch-graph { flex: 1; }
.parch-graph-title {
    font-family: 'Cinzel', serif; font-size: 0.8rem; color: #5a4230;
    margin-bottom: 3px;
}
.parch-graph-canvas {
    height: 70px; background: rgba(255,255,255,0.3); border: 1px solid #b8a88a;
    border-radius: 2px; overflow: hidden;
}
.parch-graph-canvas canvas { width: 100%; height: 100%; }

/* ── Tabelle (Werte-Zeilen) ── */
.parch-table {
    width: 100%; border-collapse: collapse; margin: 6px 0;
}
.parch-table td {
    padding: 3px 6px; border-bottom: 1px solid #c4b49a;
    vertical-align: middle;
}
.parch-table tr:last-child td { border-bottom: none; }
.parch-label {
    color: #6b5940; font-size: 0.82rem; white-space: nowrap; width: 1%;
}
.parch-val {
    color: #2a1f14; font-size: 0.92rem;
}
.parch-val strong {
    font-size: 1.05rem; font-weight: 700;
}
.parch-val em { color: #a05a3a; }

.parch-table-compact td { padding: 2px 4px; }

/* ── Sektionen (Bemerkungen, Verhalten, etc.) ── */
.parch-section {
    border: 1px solid #c4b49a; border-radius: 2px;
    margin: 8px 0; padding: 6px 10px;
    background: rgba(255,255,255,0.15);
}
.parch-section-title {
    font-family: 'Cinzel', serif; font-size: 0.82rem; font-weight: 600;
    color: #5a4230; border-bottom: 1px solid #c4b49a;
    padding-bottom: 3px; margin-bottom: 4px;
}
.parch-section-text {
    font-size: 0.9rem; color: #2a1f14; line-height: 1.45;
    font-style: italic;
}

/* ── Aktions-Buttons (Bewerber) ── */
.parch-actions {
    display: flex; gap: 8px; margin-top: 10px;
}
.parch-btn {
    padding: 8px 14px; border: 2px solid #8b7355; border-radius: 3px;
    font-family: 'Cinzel', serif; font-size: 0.85rem; cursor: pointer;
    transition: all 0.15s; text-align: center;
}
.parch-btn-hire {
    flex: 1; background: #5a8f3a; color: #fff; border-color: #4a7a2e; font-weight: 700;
}
.parch-btn-hire:hover { background: #6aa044; }
.parch-btn-reject {
    background: #a0402a; color: #fff; border-color: #8a3020;
}
.parch-btn-reject:hover { background: #b04a32; }

.parch-staff-actions {
    display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap;
}
.parch-staff-actions .parch-btn {
    font-size: 0.78rem; padding: 5px 8px; flex: 0 0 auto;
}

/* ── PERSONALAKTE — dunkles Leder mit Gold-Beschlägen ── */
.parchment-card.staff-card {
    background: #2a2218;
    background-image:
        linear-gradient(rgba(222,167,38,0.04) 1px, transparent 1px);
    background-size: 100% 24px;
    border: 2px solid #6a5535;
    color: #d8c8a8;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.5), inset 0 1px 0 rgba(222,167,38,0.1),
                inset 0 0 30px rgba(0,0,0,0.2);
}
.parchment-card.staff-card::before {
    content: ''; position: absolute; inset: 0; border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
    pointer-events: none;
}
.staff-card .parch-title { color: #DEA726; }
.staff-card .parch-name { color: #f0e0c0; }
.staff-card .parch-portrait { border-color: #DEA726; background: #1a1510; }
.staff-card .parch-role { color: #f0e0c0; border-bottom-color: #6a5535; }
.staff-card .parch-nr { color: #DEA726; }
.staff-card .parch-table td { border-bottom-color: #3a3020; }
.staff-card .parch-label { color: #b0a080; }
.staff-card .parch-val { color: #e0d8c0; }
.staff-card .parch-val strong { color: #f0e8d0; }
.staff-card .parch-val em { color: #c0392b; }
.staff-card .parch-section { border-color: #3a3020; background: rgba(255,255,255,0.03); }
.staff-card .parch-section-title { color: #DEA726; border-bottom-color: #3a3020; }
.staff-card .parch-section-text { color: #c8b898; }
.staff-card .parch-info-block { }
.staff-card .parch-table-compact td { border-bottom-color: #3a3020; }
.staff-card .parch-graph-canvas { background: rgba(0,0,0,0.3); border-color: #3a3020; }

/* Staff-Aktionen auf dunklem Hintergrund */
.staff-card .parch-staff-actions .parch-btn {
    border-color: #6a5535; color: #d8c8a8; background: #3a3020;
}
.staff-card .parch-staff-actions .parch-btn:hover {
    border-color: #DEA726; color: #DEA726;
}
.staff-card .parch-staff-actions .parch-btn-reject {
    background: #8a2020; border-color: #6a1515; color: #fff;
}

/* ── BEWERBER-AKTE — zwischen Personal und Patient (dunkler Pergament) ── */
.parchment-card.applicant-card {
    background: #3a3225;
    background-image:
        linear-gradient(rgba(222,167,38,0.03) 1px, transparent 1px);
    background-size: 100% 24px;
    border: 2px solid #7a6a50;
    color: #d0c0a0;
    box-shadow: 2px 3px 10px rgba(0,0,0,0.4), inset 0 0 20px rgba(60,40,20,0.15);
}
.applicant-card .parch-title { color: #DEA726; }
.applicant-card .parch-name { color: #e8d8b8; }
.applicant-card .parch-portrait { border-color: #8a7a5a; background: #2a2218; }
.applicant-card .parch-role { color: #e0d0b0; border-bottom-color: #5a4a35; }
.applicant-card .parch-nr { color: #b0a080; }
.applicant-card .parch-table td { border-bottom-color: #4a3a28; }
.applicant-card .parch-label { color: #a09070; }
.applicant-card .parch-val { color: #d8c8a8; }
.applicant-card .parch-val strong { color: #f0e0c0; }
.applicant-card .parch-section { border-color: #4a3a28; background: rgba(255,255,255,0.03); }
.applicant-card .parch-section-title { color: #c8a848; border-bottom-color: #4a3a28; }
.applicant-card .parch-section-text { color: #b8a888; }

/* ── PATIENTENAKTE Titel-Zeile (zur Abgrenzung) ── */
.patient-card-label {
    position: absolute; top: 6px; right: 10px;
    font-family: 'Cinzel',serif; font-size: 0.65rem; color: #8b7355;
    letter-spacing: 1px; text-transform: uppercase;
}
.staff-card-label {
    position: absolute; top: 6px; right: 10px;
    font-family: 'Cinzel',serif; font-size: 0.65rem; color: #DEA726;
    letter-spacing: 1px; text-transform: uppercase;
}

/* ── Eselsohr (Patientenakte umblättern) ── */
.parch-akte { position: relative; }
.akte-ear {
    position: absolute; bottom: 0; right: 0; width: 36px; height: 36px;
    background: linear-gradient(135deg, transparent 50%, #c4b49a 50%);
    cursor: pointer; display: flex; align-items: flex-end; justify-content: flex-end;
    transition: all 0.15s; border-radius: 0 0 4px 0;
}
.akte-ear:hover { background: linear-gradient(135deg, transparent 45%, #a89878 45%); }
.ear-text { font-size: 0.9rem; padding: 2px 5px 3px; color: #5a4230; }
.akte-page-indicator {
    position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 6px;
}
.akte-dot {
    width: 8px; height: 8px; border-radius: 50%; background: #c4b49a; border: 1px solid #8b7355;
    transition: background 0.2s;
}
.akte-dot.active { background: #8b4513; }

/* ── Zeitsteuerungs-Bar ── */
.time-controls { display: flex; gap: 3px; align-items: center; }
.time-controls .speed-btn {
    padding: 3px 7px; background: var(--bg3); border: 1px solid var(--border);
    color: var(--text-mid); border-radius: 3px; cursor: pointer; font-size: 0.75rem;
    font-family: 'Cinzel',serif; transition: all 0.15s;
}
.time-controls .speed-btn:hover { border-color: var(--accent); color: var(--accent); }
.time-controls .speed-btn.active { background: var(--accent); color: #1a1510; border-color: var(--accent); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   EVENT-LOG (Meldungs-Protokoll) — Dünne Leiste + schwebendes Overlay
   ═══════════════════════════════════════════════════════════════ */
.event-log {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 800;
    font-size: 0.82rem; border: none; border-image: none;
}
.event-log-header {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 14px; cursor: pointer; user-select: none;
    background: var(--bg2); border-top: 1px solid var(--border);
    height: 30px; box-sizing: border-box;
}
.event-log-header span:first-child { font-family: 'Cinzel', serif; font-weight: 600; color: var(--accent); font-size: 0.82rem; }
.event-log-latest {
    flex: 1; color: var(--text-mid); font-size: 0.78rem; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis; margin-left: 8px;
}
.event-log-badge {
    background: var(--danger); color: #fff; border-radius: 10px;
    padding: 0 6px; font-size: 0.7rem; font-weight: 700; min-width: 18px; text-align: center;
}
.event-log-toggle { margin-left: auto; color: var(--text-mid); font-size: 0.75rem; }
/* Floating-Panel: schwebt über der Leiste */
.event-log-body {
    display: none;
    position: absolute; bottom: 100%; left: 0; right: 0;
    max-height: 200px; overflow-y: auto;
    background: var(--bg2); border-top: 2px solid var(--accent-dim);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.5);
    padding: 4px 0;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.event-log.open .event-log-body { display: block; }
.event-log-entry {
    padding: 3px 14px; display: flex; gap: 8px; align-items: baseline;
    border-bottom: 1px solid rgba(58,48,32,0.3);
    animation: log-in 0.2s ease;
}
.event-log-entry:hover { background: rgba(222,167,38,0.04); }
.event-log-time { color: var(--text-mid); font-size: 0.72rem; white-space: nowrap; min-width: 42px; font-variant-numeric: tabular-nums; }
.event-log-msg { flex: 1; color: var(--text); line-height: 1.35; }
.event-log-entry.evt-error .event-log-msg { color: var(--danger); }
.event-log-entry.evt-success .event-log-msg { color: var(--success); }
.event-log-entry.evt-gold .event-log-msg { color: var(--accent); }
@keyframes log-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ═══════════════════════════════════════════════════════════════
   TAGESBERICHT (Daily Report Overlay)
   ═══════════════════════════════════════════════════════════════ */
/* ── Tagesbericht (Biing!-Style mit Pergament + Sektionen) ── */
.daily-report-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.78); display: flex; align-items: center; justify-content: center;
    animation: dr-fade-in 0.4s ease;
}
@keyframes dr-fade-in { from { opacity: 0; } to { opacity: 1; } }
.daily-report-card {
    max-width: 500px; width: 94%;
    animation: dr-pop 0.4s ease;
}
@keyframes dr-pop { from { opacity: 0; transform: scale(0.92) translateY(20px); } to { opacity: 1; transform: none; } }

.dr-parchment {
    background: linear-gradient(135deg, #e8dcc4, #d4c4a4, #e0d0b0);
    border: 4px solid #8b6914; border-radius: 6px;
    padding: 20px 22px; color: #3a2a1a;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7), inset 0 0 30px rgba(139,105,20,0.15);
    font-family: 'Cormorant Garamond', 'Georgia', serif; font-size: 0.92rem; line-height: 1.45;
}
.dr-title {
    font-family: 'Cinzel Decorative', serif; font-size: 1.3rem; font-weight: 700;
    color: #4a2a0a; text-align: center; margin-bottom: 2px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}
.dr-day {
    text-align: center; font-family: 'Cinzel', serif; font-size: 0.85rem;
    color: #6b4a2a; margin-bottom: 14px; font-weight: 600;
}

/* Sektionen (Icon links, Text rechts) */
.dr-section {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 10px 0; border-bottom: 1px solid rgba(107,66,38,0.25);
}
.dr-section:last-of-type { border-bottom: none; }
.dr-section-icon {
    font-size: 2rem; min-width: 48px; text-align: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    padding-top: 2px;
}
.dr-section-body { flex: 1; }
.dr-section-head {
    font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.95rem;
    color: #4a2a0a; margin-bottom: 3px;
    border-bottom: 1px solid rgba(107,66,38,0.2); padding-bottom: 2px;
}
.dr-section-body > div { margin-bottom: 2px; }
.dr-warn { color: #8b1a1a; font-weight: 600; }

/* Note/Grade-Icon */
.dr-grade-icon {
    font-family: 'Cinzel Decorative', serif !important; font-weight: 900;
    font-size: 2.2rem !important; line-height: 1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.dr-grade-S { color: #c9a600; } .dr-grade-A { color: #2a7a2a; } .dr-grade-B { color: #4a7a2a; }
.dr-grade-C { color: #6a5a3a; } .dr-grade-D { color: #8a4a1a; } .dr-grade-F { color: #8b1a1a; }

/* Score-Bars */
.dr-bars { margin-top: 6px; }
.dr-bar-row {
    display: flex; align-items: center; gap: 6px; font-size: 0.78rem; margin-bottom: 3px;
}
.dr-bar-row > span:first-child { min-width: 65px; color: #5a4a3a; font-weight: 600; }
.dr-bar-row > span:last-child { min-width: 30px; text-align: right; font-weight: 700; color: #4a2a0a; }
.dr-bar-track {
    flex: 1; height: 8px; background: rgba(107,66,38,0.15);
    border-radius: 4px; overflow: hidden; border: 1px solid rgba(107,66,38,0.2);
}
.dr-bar {
    height: 100%; border-radius: 3px;
    background: linear-gradient(90deg, #8b6914, #DEA726);
    transition: width 0.6s ease;
}

/* Weiter-Button */
.dr-close {
    display: block; width: 100%; padding: 10px; margin-top: 12px;
    background: #6b4226; color: #e8dcc4; border: 2px solid #8b6914; border-radius: 4px;
    font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: background 0.2s; text-shadow: 0 1px 0 rgba(0,0,0,0.3);
}
.dr-close:hover { background: #8b5a36; }

/* main-content braucht unten Platz für Event-Log */
.main-content { padding-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════
   PIXEL-ART UI PACK — Ornamentale Verzierungen
   ═══════════════════════════════════════════════════════════════ */

/* Globale Pixel-Rendering für UI-Pack-Bilder */
.ui-pixelart { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ── Topbar ── */
.topbar {
    background: var(--bg2);
    border-bottom: 2px solid #4a3a28;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    overflow: hidden;
}

/* ── Navigation (keine Pixel-Art mehr) ── */

/* ── Speed-Buttons ── */
.spd-btn {
    background: var(--bg3);
    border: 1px solid var(--border); color: var(--text-mid); cursor: pointer;
    padding: 4px 8px; font-size: 0.75rem; font-family: 'Cinzel',serif;
    border-radius: 3px; transition: all 0.15s; overflow: hidden;
}
.spd-btn:hover { background: var(--border); color: var(--accent); }
.spd-btn.active {
    background: var(--accent); color: #1a1510; font-weight: 700;
    border-color: var(--accent);
}

/* ── Cards & Sections — dezenter Pixel-Rand ── */
.card, .rv-section, .desk-item, .office-tip {
    border-image: url('/ui/basic_view/button&frame/frame_01.png') 4 fill / 4px / 0 stretch;
    image-rendering: pixelated;
    border-width: 4px;
    border-style: solid;
}

/* ── Map-Room-Cards ── */
.map-room-card {
    border-image: url('/ui/basic_view/button&frame/frame_01.png') 4 fill / 4px / 0 stretch;
    image-rendering: pixelated;
    border-width: 4px;
    border-style: solid;
    border-radius: 0;
}
.map-room-card:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 12px rgba(222,167,38,0.2);
    transform: translateY(-2px);
}
/* Status-Indikatoren überschreiben border-image mit farbigem left-border */
.map-room-card.room-active { border-image: none; border: 4px solid #3a3020; border-left: 4px solid var(--success); background: var(--bg-card); border-radius: 6px; }
.map-room-card.room-warn   { border-image: none; border: 4px solid #3a3020; border-left: 4px solid var(--danger); background: var(--bg-card); border-radius: 6px; }
.map-room-card.room-idle   { border-image: none; border: 4px solid #3a3020; border-left: 4px solid var(--text-mid); background: var(--bg-card); border-radius: 6px; }

/* ── Geländekarte (SVG-Canvas mit Klickbereichen) ── */
.map-canvas-container { margin: 12px 0; border-radius: 8px; overflow: hidden; border: 3px solid var(--border); }
.map-canvas { position: relative; display: inline-block; width: 100%; }
.map-bg-img { display: block; width: 100%; height: auto; }
.map-frame-layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.map-frame {
    position: absolute; box-sizing: border-box;
    border: 2px solid transparent; border-radius: 4px;
    pointer-events: auto; transition: all 0.2s ease;
}
.map-frame:hover {
    border-color: var(--accent); background: rgba(222,167,38,0.18);
    box-shadow: 0 0 12px rgba(222,167,38,0.3);
}
.map-frame.map-frame-active { border-color: rgba(76,175,80,0.5); }
.map-frame.map-frame-active:hover { border-color: var(--success); background: rgba(76,175,80,0.15); }
.map-frame.map-frame-warn { border-color: rgba(244,67,54,0.4); }
.map-frame.map-frame-warn:hover { border-color: var(--danger); background: rgba(244,67,54,0.12); }
.map-frame-label {
    position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
    font-size: 0.65rem; font-family: 'Cinzel',serif; font-weight: 700;
    color: #f0e6d0; text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.5);
    white-space: nowrap; pointer-events: none;
}
.map-frame-info {
    position: absolute; top: 2px; right: 4px;
    font-size: 0.6rem; color: #f0e6d0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
    pointer-events: none;
}
.map-frame-bg, .map-frame-hover {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: contain; image-rendering: pixelated; pointer-events: none;
}
.map-frame-bg { opacity: 0.7; }
.map-frame-hover { opacity: 0; transition: opacity 0.2s; }
.map-frame:hover .map-frame-hover { opacity: 0.85; }
.map-frame:hover .map-frame-bg { opacity: 0; }

/* ── Polygon-Frames: Hover-Effekt folgt dem Polygon via clip-path ── */
.map-frame-polygon { border: none !important; }
.map-frame-polygon:hover {
    background: rgba(222,167,38,0.25);
    box-shadow: none;
    filter: drop-shadow(0 0 8px rgba(222,167,38,0.5));
}
/* Unsichtbare Frames (Polygon noch nicht gezeichnet) — klickbar aber kein Rechteck */
.map-frame-invisible {
    border: none !important; background: none !important;
    box-shadow: none !important;
}
.map-frame-invisible:hover {
    background: none !important; border: none !important;
    box-shadow: none !important; filter: none !important;
}
/* Label AUSSERHALB des Polygons (sonst wird es vom clip-path abgeschnitten) */
/* Überschreibt .map-frame-label: bottom/left/transform die sonst strecken/verschieben */
.map-frame-label-external {
    position: absolute;
    bottom: auto !important;
    transform: translate(-50%, -50%); /* Zentriert auf dem Punkt */
    text-align: center;
    font-size: 0.7rem; font-family: 'Cinzel',serif; font-weight: 700;
    color: #f0e6d0; text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 6px rgba(0,0,0,0.5);
    white-space: nowrap; pointer-events: none;
    padding-bottom: 3px;
}

/* ── Patient-Slot (Figur auf SVG-Hintergrund) ── */
.patient-slot { border: none !important; background: none !important; }
.patient-slot:hover { background: none !important; box-shadow: none !important; border: none !important; }
.ps-figure {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.ps-icon { font-size: 2rem; line-height: 1; }
.ps-name {
    font-size: 0.55rem; font-family: 'Cinzel',serif; font-weight: 700;
    color: #f0e6d0; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ps-m .ps-icon { filter: hue-rotate(200deg) brightness(1.1); }
.ps-f .ps-icon { filter: hue-rotate(320deg) brightness(1.1); }
.ps-d .ps-icon { filter: hue-rotate(60deg) brightness(1.1); }
.ps-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Furniture-Slot (Möbel auf SVG-Hintergrund) ── */
.furniture-slot { border: none !important; background: none !important; }
.furniture-slot:hover { background: rgba(222,167,38,0.1) !important; border: 1px dashed var(--accent) !important; box-shadow: none !important; }
.fs-figure {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.fs-icon { font-size: 1.8rem; line-height: 1; }
.fs-name {
    font-size: 0.5rem; font-family: 'Cinzel',serif; font-weight: 700;
    color: #f0e6d0; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.fs-cond { font-size: 0.45rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.9); }
.fs-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Item-Slot (Equipment auf SVG-Hintergrund) ── */
.item-slot { border: none !important; background: none !important; }
.item-slot:hover { background: rgba(222,167,38,0.1) !important; border: 1px dashed var(--accent) !important; box-shadow: none !important; }
.is-figure {
    width: 100%; height: 100%; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}
.is-icon { font-size: 1.5rem; line-height: 1; }
.is-name {
    font-size: 0.5rem; font-family: 'Cinzel',serif; font-weight: 700;
    color: #f0e6d0; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
    white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.is-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

/* ── Patient-Browser Frame (Akten-Karte auf SVG) ── */
.patient-browser-frame { border: none !important; background: none !important; }
.patient-browser-frame:hover { box-shadow: none !important; }
.pb-card {
    width: 100%; height: 100%; background: rgba(30,25,18,0.85);
    border: 2px solid var(--accent); border-radius: 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4px; box-sizing: border-box; transition: border-color 0.2s;
}
.pb-card:hover { border-color: #fff; }
.pb-header { font-size: 0.6rem; font-family: 'Cinzel',serif; color: var(--accent); font-weight: 700; }
.pb-count { font-size: 0.9rem; color: var(--text-bright); font-weight: 700; }
.pb-gender { display: flex; gap: 6px; font-size: 0.6rem; color: var(--text-mid); }

/* ── Patient-Browser Overlay (Durchblättern) ── */
.pb-overlay {
    position: fixed; inset: 0; z-index: 8500;
    background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center;
}
.pb-dialog {
    background: var(--bg2); border: 2px solid var(--accent); border-radius: 10px;
    padding: 20px; max-width: 380px; width: 92%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.pb-title { font-family: 'Cinzel Decorative',serif; font-size: 1.1rem; color: var(--accent); text-align: center; margin-bottom: 10px; }
.pb-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pb-counter { font-size: 0.85rem; color: var(--text-mid); font-weight: 600; }
.pb-empty { text-align: center; color: var(--text-mid); padding: 20px; font-style: italic; }
.pb-patient { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 12px; }
.pb-patient-header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.pb-patient-icon { font-size: 2.2rem; }
.pb-patient-name { font-family: 'Cinzel',serif; font-size: 1rem; color: var(--text-bright); font-weight: 700; }
.pb-patient-detail { font-size: 0.82rem; color: var(--text-mid); }
.pb-patient-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pb-stat {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 8px; background: var(--bg); border-radius: 3px; font-size: 0.8rem;
}
.pb-stat span { color: var(--text-mid); }
.pb-stat strong { color: var(--text-bright); }

/* ── Stat-Cards ── */
.stat-card, .sg-item {
    border-image: url('/ui/basic_view/button&frame/frame_01.png') 4 fill / 4px / 0 stretch;
    image-rendering: pixelated;
    border-width: 4px;
    border-style: solid;
}

/* ── Overlay-Panel ── */
.rv-overlay-content, .daily-report-card {
    border-image: url('/ui/basic_view/board/board_02.png') 6 fill / 6px / 0 stretch;
    image-rendering: pixelated;
    border-width: 6px;
    border-style: solid;
    border-radius: 0;
}

/* ── Event-Log Pixel-Leiste ── */
.event-log-header {
    background: var(--bg3) url('/ui/basic_view/board/board_03.png') center/cover no-repeat;
    image-rendering: pixelated;
    border-top: 2px solid #5a4a38;
}
.event-log-body {
    border-image: url('/ui/basic_view/board/board_03.png') 4 fill / 4px / 0 stretch;
    image-rendering: pixelated;
}

/* ── Gold-Icon (Topbar) ── */
.topbar-gold-icon {
    width: 18px; height: 18px; vertical-align: middle;
    image-rendering: pixelated; margin-right: 2px;
}

/* ── Merchant-Items Pixel-Stil ── */
.merch-item {
    border-image: url('/ui/basic_view/button&frame/frame_01.png') 3 fill / 3px / 0 stretch;
    image-rendering: pixelated;
    border-width: 3px;
    border-style: solid;
    border-radius: 0;
}

/* ── Alert-Box Pixel-Rand (ohne fill, damit Farb-Hintergründe erhalten bleiben) ── */
.alert-box {
    border-image: url('/ui/basic_view/button&frame/frame_01.png') 3 / 3px / 0 stretch;
    image-rendering: pixelated;
    border-width: 3px;
    border-style: solid;
    border-radius: 0;
}

/* ── Highlight-/Danger-Sektionen behalten ihre Farben ── */
.rv-section-highlight {
    border-image: none;
    border: 1px solid var(--accent-dim);
}
.rv-section-danger {
    border-image: none;
    border: 1px solid var(--danger);
}

/* ── Btn-Gold Pixel-Stil ── */
.btn-gold {
    background: var(--accent) url('/ui/shop/button/button_square_02.png') center/100% 100% no-repeat;
    image-rendering: pixelated;
    border: none; border-radius: 2px;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.btn-gold:hover { filter: brightness(1.15); }

/* ── Breadcrumb Pixel-Leiste ── */
.breadcrumb {
    background: var(--bg) url('/ui/basic_view/board/board_03.png') center/cover no-repeat;
    image-rendering: pixelated;
    border-bottom: 1px solid #3a2a1a;
}

/* ══════════════════════════════════════════════════════════
   UNIVERSELLES CARD-OVERLAY-SYSTEM
   ══════════════════════════════════════════════════════════ */
.co-overlay {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center;
    animation: coFadeIn 0.15s ease;
}
@keyframes coFadeIn { from { opacity: 0; } to { opacity: 1; } }

.co-dialog {
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    max-width: 680px; width: 94%; max-height: 92vh;
    overflow-y: auto; overflow-x: hidden;
    animation: coSlideUp 0.2s ease;
    display: flex; flex-direction: column;
}
.co-dock-bottom {
    flex-shrink: 0; position: sticky; bottom: 0; z-index: 5;
    background: var(--bg2); border-top: 2px solid var(--accent);
    padding: 6px 8px; border-radius: 0 0 8px 8px;
}
@keyframes coSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.co-card-body { padding: 0; }

.co-close-x {
    position: absolute; top: -8px; right: -8px; z-index: 2;
    background: none; border: none; cursor: pointer; padding: 0;
    width: 28px; height: 28px;
    transition: transform 0.1s;
}
.co-close-x:hover { transform: scale(1.15); }
.co-close-x img { width: 100%; height: 100%; image-rendering: pixelated; }

/* Navigation (mehrere Einträge) */
.co-item-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px; padding: 4px 0;
}
.co-nav-btn {
    background: none; border: none; cursor: pointer; padding: 2px;
    width: 28px; height: 28px; transition: transform 0.1s;
}
.co-nav-btn:hover:not(:disabled) { transform: scale(1.15); }
.co-nav-btn:disabled { opacity: 0.3; cursor: default; }
.co-nav-btn img { width: 100%; height: 100%; image-rendering: pixelated; }
.co-nav-counter {
    font-family: 'Cinzel', serif; font-size: 0.85rem; color: var(--accent); font-weight: 700;
}

/* Karten-Body */
.co-card-body { position: relative; }
.co-page-hidden { display: none !important; }

/* Seiten-Dots */
.co-dots {
    display: flex; justify-content: center; gap: 6px; margin: 8px 0 4px;
}
.co-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(222,167,38,0.3); cursor: pointer;
    transition: background 0.2s;
}
.co-dot.active { background: var(--accent); }
.co-dot:hover { background: rgba(222,167,38,0.7); }

/* Button-Leiste */
.co-buttons {
    display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
    margin-top: 10px; padding-top: 10px;
    border-top: 1px solid rgba(222,167,38,0.2);
}

.co-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 5px 12px;
    background: url('/ui/basic_view/button&frame/button_03.png') center/100% 100% no-repeat;
    image-rendering: pixelated;
    border: none; cursor: pointer;
    font-family: 'Cinzel', serif; font-size: 0.75rem; color: #1a0f05; font-weight: 700;
    transition: transform 0.1s, filter 0.1s;
    min-height: 28px;
}
.co-btn:hover { transform: scale(1.05); filter: brightness(1.1); }
.co-btn:active { transform: scale(0.97); }

.co-btn-icon {
    width: 16px; height: 16px; image-rendering: pixelated; flex-shrink: 0;
}

/* Button-Varianten */
.co-btn-green {
    background-image: url('/ui/basic_view/button&frame/Button&frame_O/button_green.png');
    color: #0a3a0a;
}
.co-btn-red {
    background-image: url('/ui/basic_view/button&frame/Button&frame_X/button_red.png');
    color: #3a0a0a;
}
.co-btn-gold {
    background-image: url('/ui/shop/button/button_square_02.png');
    color: #1a0f05;
}
.co-btn-nav {
    background-image: none; background-color: transparent;
    padding: 3px 6px; min-height: 20px;
    color: var(--accent);
}
.co-btn-nav img { width: 20px; height: 20px; }

.co-btn-close {
    position: absolute; top: -8px; right: -8px;
    background: none; border: none; cursor: pointer; padding: 0;
    width: 28px; height: 28px;
}
.co-btn-close img { width: 100%; height: 100%; image-rendering: pixelated; }

/* ── Canvas Container für positionierte Karten-Seiten ── */
.co-canvas { overflow: visible; }
.co-canvas > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── Button-Dock Buttons — Admin-identisches Gradient-Styling ── */
.co-dock-btn {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    background: linear-gradient(180deg, rgba(222,167,38,0.25) 0%, rgba(139,105,20,0.3) 100%);
    border: 1px solid rgba(139,69,19,0.5); border-radius: 3px;
    padding: 4px 8px; cursor: pointer;
    font-family: 'Cinzel', serif; font-size: 0.85rem; color: #1a0f05; font-weight: 700;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
    transition: transform 0.1s, filter 0.1s;
    min-height: 0; min-width: 0; overflow: hidden;
    letter-spacing: 0.5px;
}
.co-dock-btn:hover { transform: scale(1.05); filter: brightness(1.1); }
.co-dock-btn:active { transform: scale(0.97); }
.co-dock-btn .co-btn-icon { width: 16px; height: 16px; image-rendering: pixelated; flex-shrink: 0; }
.co-dock-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dock-Button-Varianten */
.co-dock-btn.co-btn-green {
    background: linear-gradient(180deg, rgba(39,174,96,0.35) 0%, rgba(39,174,96,0.55) 100%);
    border-color: rgba(39,174,96,0.6); color: #0a3a0a;
}
.co-dock-btn.co-btn-red {
    background: linear-gradient(180deg, rgba(192,57,43,0.35) 0%, rgba(192,57,43,0.55) 100%);
    border-color: rgba(192,57,43,0.6); color: #3a0a0a;
}
.co-dock-btn.co-btn-gold {
    background: linear-gradient(180deg, rgba(222,167,38,0.35) 0%, rgba(222,167,38,0.55) 100%);
    border-color: rgba(222,167,38,0.6); color: #1a0f05;
}
.co-dock-btn.co-btn-nav {
    background: linear-gradient(180deg, rgba(222,167,38,0.2) 0%, rgba(139,105,20,0.25) 100%);
    border-color: rgba(139,69,19,0.4); color: #1a0f05;
}
.co-dock-btn.co-btn-nav .co-btn-icon { width: 18px; height: 18px; }

/* ── Card Modal (zentriertes Overlay für Karteikarten) ── */
.card-modal-overlay {
    position: fixed; inset: 0; z-index: 8000;
    background: rgba(0,0,0,0.7); display: flex;
    align-items: center; justify-content: center;
    animation: dr-fade-in 0.3s ease;
}
.card-modal {
    position: relative; max-width: 700px; width: 94%;
    max-height: 92vh; overflow-y: auto;
    background: var(--bg2); border: 2px solid var(--accent);
    border-radius: 10px; padding: 16px 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    animation: dr-pop 0.3s ease;
}
.card-modal-close {
    position: absolute; top: 6px; right: 8px; z-index: 10;
    background: none; border: none; color: var(--text-mid);
    font-size: 1.2rem; cursor: pointer;
}
.card-modal-close:hover { color: var(--accent); }
