/* =========================================
   URUMDESIGN - ADMIN & DASHBOARD STYLES
   ========================================= */

:root {
    --admin-primary: #2c303a;
    --admin-secondary: #d4af37;
    --admin-bg: #f4f6f8;
    --admin-text: #333;
    --admin-danger: #dc3545;
    --admin-success: #28a745;
    --admin-info: #17a2b8;
}

/* --- GLOBALE MODAL & OVERLAY STYLES --- */
.admin-modal-overlay {
    position: fixed; top: 0; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: auto !important; height: auto !important;
    background: rgba(0,0,0,0.85); z-index: 10000;
    display: flex;
    align-items: center; justify-content: center; backdrop-filter: blur(5px);
}
.admin-modal-box {
    background: var(--admin-bg); padding: 30px; border-radius: 12px;
    width: 95%; max-height: 90vh; overflow-y: auto;
    color: var(--admin-text); position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.admin-modal-close {
    position: absolute; top: 20px; right: 20px; background: none; border: none;
    font-size: 1.5rem; cursor: pointer; color: #888; transition: color 0.3s;
}
.admin-modal-close:hover { color: var(--admin-secondary); }

.admin-modal-title {
    margin-bottom: 10px; margin-top: 0; color: var(--admin-primary); font-family: var(--font-heading, serif);
    display: flex; align-items: center; gap: 10px; font-size: 1.8rem;
}
.admin-modal-subtitle {
    color: #666; margin-bottom: 25px; font-size: 0.95rem; line-height: 1.5;
}

.admin-tool-modal {
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.10), transparent 34%),
        linear-gradient(180deg, #f8f6f0, #eef1f5);
    max-width: min(1320px, 96vw);
    padding: clamp(18px, 2vw, 34px);
    width: min(1320px, 96vw);
}

.admin-tool-modal .admin-modal-close {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 999px;
    color: var(--admin-primary);
    height: 36px;
    line-height: 1;
    width: 36px;
    z-index: 2;
}

.admin-tool-modal .admin-modal-close:hover {
    background: var(--admin-secondary);
    color: #1a1d24;
}

.admin-tool-hero {
    align-items: flex-start;
    background:
        linear-gradient(135deg, rgba(32, 36, 44, 0.98), rgba(19, 22, 29, 0.96)),
        var(--admin-primary);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 28px;
    box-shadow: 0 22px 45px rgba(24, 27, 34, 0.18);
    color: #fff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: clamp(22px, 3vw, 34px);
}

.admin-tool-hero .admin-modal-title {
    color: #fff;
    margin-bottom: 8px;
}

.admin-tool-hero .admin-modal-subtitle {
    color: rgba(255, 255, 255, 0.68);
    margin: 0;
    max-width: 760px;
}

.admin-tool-eyebrow {
    color: var(--admin-secondary);
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.admin-tool-stats {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(96px, 1fr));
    min-width: min(440px, 100%);
}

.admin-tool-stat {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 18px;
    padding: 14px;
}

.admin-tool-stat strong,
.admin-tool-stat span {
    display: block;
}

.admin-tool-stat strong {
    color: #fff;
    font-size: clamp(1.15rem, 2vw, 1.7rem);
    line-height: 1;
}

.admin-tool-stat span {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.74rem;
    margin-top: 6px;
}

.admin-tool-panel {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(32, 36, 44, 0.08);
    border-radius: 22px;
    box-shadow: 0 14px 30px rgba(32, 36, 44, 0.07);
}

@media (max-width: 760px) {
    .admin-tool-hero {
        flex-direction: column;
    }

    .admin-tool-stats {
        grid-template-columns: 1fr;
        width: 100%;
    }
}

/* --- LOGIN BILDSCHIRM --- */
.admin-login-form {
    background: var(--bg-color, #fff); padding: 40px; border-radius: 10px;
    width: 320px; text-align: center; box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border-top: 3px solid var(--admin-secondary);
}
.admin-login-form h3 { color: var(--admin-primary); margin-bottom: 20px; font-family: var(--font-heading, serif); font-size: 1.5rem; margin-top: 0;}
.admin-error-msg { color: var(--admin-danger); margin-bottom: 15px; font-size: 0.9rem; font-weight: bold;}
.admin-cancel-link { display: block; color: #888; margin-top: 15px; text-decoration: none; font-size: 0.9rem; transition: color 0.2s;}
.admin-cancel-link:hover { color: var(--admin-secondary); }
.admin-login-password { margin-bottom: 20px; }

/* --- STANDARD BUTTONS --- */
.admin-btn-primary {
    background: var(--admin-secondary); color: #fff; border: none;
    padding: 12px 20px; cursor: pointer; border-radius: 4px;
    width: 100%; font-weight: bold; text-transform: uppercase; transition: transform 0.2s, background 0.2s;
}
.admin-btn-primary:hover { background: #b5952f; transform: translateY(-2px); }

.admin-btn-success {
    background: var(--admin-success); color: #fff; border: none; padding: 10px 20px;
    border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(40,167,69,0.3);
}
.admin-btn-success:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(40,167,69,0.4);}

.admin-btn-secondary {
    background: #e9ecef; color: #333; border: 1px solid #ccc; padding: 12px 20px;
    cursor: pointer; border-radius: 4px; font-weight: bold; transition: 0.2s;
}
.admin-btn-secondary:hover { background: #dde2e6; }
.admin-btn-group { display: flex; gap: 15px; }
.text-modal { display: none; z-index: 10002; }
.text-modal.is-open { display: flex; }
.text-modal__box { background: #fff; max-width: 700px; }
.text-modal__save { flex: 2; font-size: 1rem; padding: 12px; }
.text-modal__cancel { flex: 1; }

/* --- FORMULARE & EINGABEFELDER --- */
.admin-flex-form { display: flex; flex-wrap: wrap; gap: 25px; }
.admin-form-input, .admin-form-select {
    width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; font-family: var(--font-body, sans-serif);
}
.admin-form-textarea {
    width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #ccc;
    border-radius: 4px; font-family: monospace; font-size: 1rem; resize: vertical;
}
.admin-form-label { display: block; font-size: 0.85rem; font-weight: bold; margin-bottom: 5px; color: #444; }
.admin-hint-text { margin-top: 15px; font-size: 0.85rem; color: #666; }

/* --- KARTEN (Cards) & ALARME --- */
.admin-form-card { padding: 20px; border-radius: 8px; border: 1px solid #eee; background: #fff; }
.admin-card-title {
    font-size: 1.1rem; color: var(--admin-primary); margin-top: 0; margin-bottom: 15px;
    border-bottom: 2px solid var(--admin-secondary); padding-bottom: 5px;
}
.admin-alert { padding: 15px; border-radius: 5px; font-weight: bold; font-size: 0.9rem; margin-bottom: 15px; }
.admin-alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- SEITENMENÜ (SIDEBAR) --- */
.admin-sidebar {
    position: fixed; top: 0; left: 0; width: 300px; height: 100vh; background: #1a1d24; border-right: 2px solid var(--admin-secondary); color: #fff; z-index: 10000; padding: 25px 20px; display: flex; flex-direction: column; gap: 12px; font-family: var(--font-body, sans-serif); box-shadow: 5px 0 25px rgba(0,0,0,0.4); overflow-y: auto;
}
.admin-sidebar-title {
    font-weight: bold; font-size: 1.1rem; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 25px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 20px; text-align: center;
}
.admin-sidebar-greeting {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 400;
    margin-bottom: 8px;
    text-transform: none;
}
.admin-role-badge {
    background: var(--admin-secondary);
    border-radius: 4px;
    color: #000;
    font-size: 0.7rem;
    letter-spacing: 1px;
    padding: 3px 8px;
}
.admin-unread-badge {
    animation: pulse-ring 2s infinite;
    background: var(--admin-danger);
    border-radius: 10px;
    color: #fff;
    font-size: 0.75rem;
    margin-left: 5px;
    padding: 1px 6px;
}
.admin-sidebar-separator {
    background: rgba(255,255,255,0.1);
    height: 1px;
    margin: 10px 0;
}
.admin-sidebar-label {
    color: rgba(255,255,255,0.45);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    margin: 4px 2px -2px;
    text-transform: uppercase;
}
.admin-sidebar-spacer {
    margin-top: auto;
}
.admin-sidebar-logout {
    color: #ff6b6b;
    justify-content: center;
}
.admin-sidebar-btn {
    background: rgba(255,255,255,0.05); color: #e0e0e0; border: 1px solid rgba(255,255,255,0.05); padding: 12px 15px; border-radius: 6px; cursor: pointer; font-size: 0.95rem; text-align: left; display: flex; align-items: center; justify-content: flex-start; transition: 0.2s; text-decoration: none; font-weight: 500;
}
.admin-sidebar-btn:hover { background: rgba(212,175,55,0.15); border-color: var(--admin-secondary); color: #fff; transform: translateX(3px); }
.admin-sidebar-btn.primary { background: var(--admin-success); border-color: var(--admin-success); color: #fff; font-weight: bold; justify-content: center; box-shadow: 0 4px 10px rgba(40,167,69,0.3); margin-bottom: 15px; }
.admin-sidebar-btn.primary:hover { background: #218838; transform: translateY(-2px); }

/* --- VERSCHIEBUNG DES FRONTENDS --- */
body.admin-logged-in { padding-left: 300px !important; }
.admin-logged-in .navbar { left: 300px !important; width: calc(100% - 300px) !important; transition: none !important; }
.admin-logged-in .hero { margin-top: 0 !important; }

@media (max-width: 900px) {
    .admin-sidebar { width: 100%; min-height: 74px; height: auto; bottom: 0 !important; top: auto !important; left: 0 !important; right: 0 !important; flex-direction: row; flex-wrap: nowrap; padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-right: none; border-top: 2px solid var(--admin-secondary); gap: 10px; margin: 0; }
    .admin-sidebar-title { display: none; }
    .admin-sidebar-label { display: none; }
    .admin-sidebar-btn { white-space: nowrap; flex-shrink: 0; padding: 10px 15px; margin-bottom: 0 !important; justify-content: center; transform: none !important; }
    .admin-sidebar::-webkit-scrollbar { height: 4px; }
    .admin-sidebar::-webkit-scrollbar-track { background: #1a1d24; }
    .admin-sidebar::-webkit-scrollbar-thumb { background: var(--admin-secondary); border-radius: 4px; }
    body.admin-logged-in { background: var(--bg-color, #fff); padding-left: 0 !important; padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important; }
    .admin-logged-in .navbar { left: 0 !important; width: 100% !important; }
    .admin-logged-in .hero { margin-top: 60px !important; }
}

/* --- ADMIN SHELL REDESIGN --- */
.admin-shell {
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(32, 36, 44, 0.98), rgba(15, 17, 22, 0.98));
    border-right: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 18px 0 45px rgba(0, 0, 0, 0.34);
    gap: 16px;
    padding: 22px 16px;
    width: 320px;
}

.admin-shell-brand {
    align-items: center;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

.admin-shell-brand strong {
    color: #fff;
    display: block;
    font-family: var(--font-heading, serif);
    font-size: 1.35rem;
    letter-spacing: 0.02em;
}

.admin-shell-eyebrow {
    color: rgba(212, 175, 55, 0.88);
    display: block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.admin-shell-user {
    border-left: 2px solid rgba(212, 175, 55, 0.55);
    color: #fff;
    padding: 4px 0 4px 12px;
}

.admin-shell-user span,
.admin-shell-user small {
    display: block;
}

.admin-shell-user small {
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.78rem;
    margin-top: 2px;
}

.admin-shell-groups {
    display: grid;
    gap: 12px;
}

.admin-shell-group {
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 18px;
    padding: 10px;
}

.admin-shell-group__header {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 0 2px 8px;
}

.admin-shell-group__header span {
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.admin-shell-group__header small {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.68rem;
    text-align: right;
}

.admin-shell-group__items {
    display: grid;
    gap: 7px;
}

.admin-shell-item {
    align-items: center;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    display: grid;
    grid-template-columns: 34px 1fr auto;
    gap: 10px;
    padding: 10px;
    text-align: left;
    text-decoration: none;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
    width: 100%;
}

.admin-shell-item:hover,
.admin-shell-item.is-active {
    background: rgba(212, 175, 55, 0.14);
    border-color: rgba(212, 175, 55, 0.55);
    color: #fff;
    transform: translateX(2px);
}

.admin-shell-item.is-primary {
    background: linear-gradient(135deg, #2f9e62, #1f7f4a);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 14px 28px rgba(31, 127, 74, 0.28);
    color: #fff;
}

.admin-shell-item.is-quiet {
    opacity: 0.82;
}

.admin-shell-item__icon {
    align-items: center;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    color: var(--admin-secondary);
    display: flex;
    font-size: 0.82rem;
    font-weight: 900;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.admin-shell-item.is-primary .admin-shell-item__icon {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.admin-shell-item__text strong,
.admin-shell-item__text small {
    display: block;
}

.admin-shell-item__text strong {
    font-size: 0.92rem;
    line-height: 1.1;
}

.admin-shell-item__text small {
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    line-height: 1.25;
    margin-top: 3px;
}

.admin-shell-footer {
    margin-top: auto;
}

.admin-shell-logout {
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 14px;
    color: #ff8f8f;
    display: block;
    padding: 12px;
    text-align: center;
    text-decoration: none;
}

.admin-shell-logout:hover {
    background: rgba(255, 107, 107, 0.10);
}

.admin-mobile-dock,
.admin-mobile-drawer {
    display: none;
}

body.admin-logged-in { padding-left: 320px !important; }
.admin-logged-in .navbar { left: 320px !important; width: calc(100% - 320px) !important; }

@media (max-width: 900px) {
    .admin-sidebar.admin-shell {
        display: none;
    }

    .admin-mobile-dock {
        align-items: center;
        background:
            radial-gradient(circle at top, rgba(212, 175, 55, 0.18), transparent 55%),
            rgba(24, 27, 34, 0.94);
        border: 1px solid rgba(212, 175, 55, 0.35);
        border-radius: 22px 22px 0 0;
        bottom: 0;
        box-shadow: 0 -14px 36px rgba(0, 0, 0, 0.34);
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        left: 8px;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
        position: fixed;
        right: 8px;
        z-index: 10000;
    }

    .admin-shell-item.is-compact {
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        justify-content: center;
        min-height: 58px;
        padding: 8px 6px;
        text-align: center;
        transform: none !important;
    }

    .admin-shell-item.is-compact .admin-shell-item__icon {
        height: 28px;
        width: 28px;
    }

    .admin-shell-item.is-compact .admin-shell-item__text strong {
        font-size: 0.72rem;
    }

    .admin-mobile-drawer.is-open {
        display: block;
    }

    .admin-mobile-drawer__backdrop {
        background: rgba(0, 0, 0, 0.58);
        bottom: 0;
        left: 0;
        position: fixed;
        right: 0;
        top: 0;
        z-index: 10001;
    }

    .admin-mobile-drawer__panel {
        background: linear-gradient(180deg, #20242c, #12141a);
        border: 1px solid rgba(212, 175, 55, 0.30);
        border-radius: 24px 24px 0 0;
        bottom: 0;
        box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.4);
        color: #fff;
        left: 0;
        max-height: min(82vh, 720px);
        overflow-y: auto;
        padding: 18px 14px calc(92px + env(safe-area-inset-bottom, 0px));
        position: fixed;
        right: 0;
        z-index: 10002;
    }

    .admin-mobile-drawer__header {
        align-items: center;
        display: flex;
        justify-content: space-between;
        margin-bottom: 12px;
    }

    .admin-mobile-drawer__header button {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        color: #fff;
        cursor: pointer;
        font-size: 1.4rem;
        height: 38px;
        width: 38px;
    }

    body.admin-logged-in {
        padding-left: 0 !important;
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .admin-logged-in .navbar {
        left: 0 !important;
        width: 100% !important;
    }
}
