*{box-sizing:border-box}
/* =========================================
   GLOBAL
   ========================================= */
html,body{
    margin:0;
    padding:0;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,Helvetica,sans-serif;
    color:#101828;
    background:#ffffff;
}

a{color:#2563eb;text-decoration:none}
a:hover{text-decoration:underline}

.container{
    max-width:1100px;
    margin:0 auto;
    padding:16px;
}

/* =========================================
   HEADER + NAVIGATION
   ========================================= */
.header{
    position:sticky;
    top:0;
    z-index:50;
    background: linear-gradient(135deg, #4b2cff, #ff3cac);
    color:white;
    border-bottom:1px solid rgba(255,255,255,0.25);
    backdrop-filter:saturate(1.1) blur(6px);
}

.navbar{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 16px;
}

.brand{
    font-weight:700;
    letter-spacing:.3px;
    color:white;
}

/* -----------------------------------------
   NAVIGATION LINKS (DESKTOP)
   ----------------------------------------- */
.nav-links{
    display:flex;
    gap:12px;

    /* ✅ wichtig für rechte Ausrichtung */
    flex:1;
    align-items:center;
}

.nav-links a{
    padding:8px 10px;
    border-radius:10px;
    color:white;
    font-weight:600;
}

.nav-links a.active,
.nav-links a:hover{
    background:rgba(255,255,255,0.18);
}

/* Flex-Element zum Rechts-Schieben von User + Logout */
.nav-flex{
    flex:1;
}

/* Hamburger Button (wird per Media-Query sichtbar) */
.nav-toggle{
    display:none;
    font-size:26px;
    background:none;
    border:none;
    color:white;
    cursor:pointer;
}

/* =========================================
   MOBILE MENU
   ========================================= */
@media (max-width:720px){

    .nav-toggle{
        display:block;
    }

    .nav-links{
        display:none;
        flex-direction:column;
        width:100%;

        margin-top:10px;
        background:linear-gradient(135deg,#4b2cff,#ff3cac);
        padding:10px 0;
        border-radius:10px;
    }

    .nav-links.show{
        display:flex;
    }

    .navbar{
        flex-direction:column;
        align-items:flex-start;
    }

    .nav-links a{
        width:100%;
        padding:12px 16px;
    }

    /* nav-flex wird mobil nicht gebraucht */
    .nav-flex{
        display:none;
    }
}

/* =========================================
   CONTENT
   ========================================= */
.main{padding:20px}

.card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:20px;
    box-shadow:0 10px 20px rgba(2,8,20,.03)
}

.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}

@media(max-width:980px){
    .grid-2,.grid-3{grid-template-columns:1fr}
}

/* =========================================
   FORM ELEMENTE
   ========================================= */
.btn{
    display:inline-flex;
    align-items:center;
    gap:8px;
    border:none;
    border-radius:12px;
    padding:10px 14px;
    cursor:pointer;
    background:#2563eb;
    color:#fff;
    font-weight:600;
}
.btn.ghost{
    background:transparent;
    color:#111827;
    border:1px solid #e5e7eb;
}

.input,textarea,select{
    width:100%;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:10px;
    background:#fff;
}
.input:focus,textarea:focus,select:focus{
    outline:none;
    border-color:#2563eb;
    box-shadow:0 0 0 3px rgba(37,99,235,.15);
}

.label{
    font-weight:600;
    margin-bottom:6px;
    display:block;
}

.badge{
    display:inline-block;
    padding:3px 8px;
    border-radius:999px;
    background:#eef2ff;
    color:#3730a3;
    font-weight:700;
    font-size:.75rem;
}

/* =========================================
   LOGIN
   ========================================= */
.login-wrap{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background: linear-gradient(135deg, #4b2cff, #ff3cac);
}

.login-card{
    width:380px;
    max-width:94vw;
    background:#fff;
    border-radius:18px;
    box-shadow:0 30px 80px rgba(0,0,0,.15);
    padding:28px;
}

.login-title{
    margin:0 0 10px 0;
    text-align:center;
}

.tabbar{
    display:flex;
    gap:8px;
    margin-bottom:12px;
}

.tabbar button{
    flex:1;
}

.tab-hidden{
    display:none;
}

/* =========================================
   MODAL
   ========================================= */
.modal-backdrop{
    position:fixed;
    inset:0;
    background:rgba(3,7,18,.55);
    display:none;
    align-items:center;
    justify-content:center;
    padding:16px;
    z-index:100;
}

.modal-backdrop.show {
    display: flex;
}

.modal {
    border:1px solid #e5e7eb;
    box-shadow:0 20px 60px rgba(0,0,0,.25);
	width: 600px;
    max-width:720px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden; /* Rundungen bleiben sichtbar */
    display: flex;
    flex-direction: column; /* Header oben, Body unten */
    max-height:80vh;       /* Modal darf maximal 90% Höhe einnehmen */
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;         /* Header bleibt sichtbar */
}

.modal-body {
    padding: 20px;
    overflow-y: auto;       /* Scrollbar nur im Content */
    flex-grow: 1;           /* Body füllt den restlichen Platz */
}
.modal header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:12px 16px;
    border-bottom:1px solid #e5e7eb;
}

.modal .content{
    padding:16px;
}

.show{
    display:flex;
}

/* =========================================
   VALIDIERUNG
   ========================================= */
.line-valid{
    background:#ecfdf5;
    border-color:#10b981;
}

.line-invalid{
    background:#fef2f2;
    border-color:#ef4444;
}

.footer{
    padding:32px;
    text-align:center;
    color:#9ca3af;
}
.brand {
    display:flex;
    align-items:center;
    gap:8px;
    color:white;
}
.logo {
    height: 35px;
    width: auto;
    border-radius: 6px;
    display: block;
}
#editorToolbar button {
    padding:6px 10px;
    background:#f3f4f6;
    border:1px solid #d1d5db;
    border-radius:6px;
    cursor:pointer;
}
#editorToolbar button:hover {
    background:#e5e7eb;
}
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

/* Kreis-Spinner */
.loader-spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}

@keyframes loader-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.tooltip-error {
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(3px); }
    to { opacity: 1; transform: translateY(0); }
}

.input-error {
    border-color:#dc2626 !important;
    background:#fee2e2 !important;
}
