/* assets/css/admin-styles.css - Modern SaaS Design (Fully Responsive) */

:root {
    /* Gleiche Farbpalette wie im Frontend */
    --primary: #0173a6;       /* Royal Blue */
    --primary-hover: #025377;
    --bg-body: #f1f5f9;       /* Slate-100 */
    --surface: #ffffff;
    --text-main: #1e293b;     /* Slate-800 */
    --text-light: #64748b;    /* Slate-500 */
    --border-color: #e2e8f0;  /* Slate-200 */
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success-bg: #dcfce7;
    --success-text: #166534;
    
    --radius: 12px;           /* Konsistente Rundung */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --header-height: 70px;
}

/* --- GRUNDLAGEN --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: var(--header-height); /* Platz für fixierten Header Desktop */
}

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

* { box-sizing: border-box; }

/* --- HEADER (DESKTOP) --- */
header {
    background: var(--surface);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid var(--border-color);
}

.left-section {
    display: flex;
    align-items: center;
    gap: 40px;
    height: 100%;
}

.brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 30px;
    height: 100%;
}

.nav-link {
    color: var(--text-light);
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
    top: 1px;
    white-space: nowrap; /* Kein Umbruch im Text */
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* --- LAYOUT --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

/* --- CARDS --- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden; 
    margin-bottom: 24px;
}

.card h2, .card h3 {
    margin: 0;
    padding: 20px 24px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-main);
}

.card-content {
    padding: 24px;
    overflow-x: auto; /* Wichtig für Tabellen auf Mobile */
}

/* --- TABELLEN --- */
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Erzwingt Scrollen auf Handy, statt Quetschen */
}

th {
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 16px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-main);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* --- FORMULARE --- */
label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-main);
}

input[type=text], input[type=email], input[type=password], 
input[type=number], input[type=date], input[type=time], textarea, select {
    width: 100%;
    padding: 10px 14px;
    min-height: 42px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    background: #fff;
    margin-bottom: 16px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea { resize: vertical; min-height: 100px; }

/* Checkbox Styling */
input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    accent-color: var(--primary);
    cursor: pointer;
    vertical-align: middle;
}

/* --- BUTTON STYLES --- */
.btn, .btn-primary, .btn-secondary, .btn-danger {
    display: inline-block;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-align: center;
    line-height: normal;
    font-family: inherit;
    margin-right: 5px;
    margin-bottom: 5px; /* Abstand auf Mobile */
}

.btn-primary { background-color: var(--primary); color: #ffffff !important; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary { background-color: #ffffff; border-color: #cbd5e1; color: #334155 !important; }
.btn-secondary:hover { background-color: #f1f5f9; border-color: #94a3b8; }

.btn-danger { background-color: #ef4444; color: #ffffff !important; }
.btn-danger:hover { background-color: #dc2626; }

.btn:disabled, .btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Kleine Anpassung für Links in Tabellen */
td a.btn-primary, td a.btn-secondary, td a.btn-danger {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

/* --- NOTICES --- */
.notice {
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid transparent;
    font-weight: 500;
}
.notice.success { background: var(--success-bg); color: var(--success-text); border-color: #bbf7d0; }
.notice.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

/* --- SPEZIAL: Video Toggle Box --- */
#vBox, #smtpBox {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

/* --- ARBEITSZEITEN ZEILE --- */
.az-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.az-row:last-child { border-bottom: none; }
.az-row input[type=time] { margin-bottom: 0; width: auto; padding: 6px 10px; height: 36px; }
.az-row label { margin-bottom: 0; display: flex; align-items: center; cursor: pointer; }
.vid-check:disabled + span { color: var(--text-light); text-decoration: line-through; }

/* --- LOGO STYLES --- */
.brand-logo {
    height: 40px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}
.center-logo {
    max-width: 250px;
    height: auto;
    margin: 0 auto 20px auto;
    display: block;
}

/* --- USER DROPDOWN MENU --- */
.user-dropdown { position: relative; display: inline-block; }
.user-trigger {
    background: transparent; border: 1px solid transparent; cursor: pointer;
    font-size: 14px; color: #334155; padding: 8px 12px; border-radius: 6px;
    display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.user-trigger:hover { background-color: #f1f5f9; }

.user-dropdown-content {
    display: none; position: absolute; right: 0; top: 100%;
    background-color: #ffffff; min-width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-radius: 8px; z-index: 1000;
    border: 1px solid #e2e8f0; margin-top: 0; overflow: hidden;
}
.user-dropdown-content a {
    color: #334155; padding: 12px 16px; text-decoration: none;
    display: block; font-size: 13px; text-align: left; transition: background 0.1s;
}
.user-dropdown-content a:hover { background-color: #f8fafc; color: var(--primary); }
.user-dropdown-content a.logout-link { border-top: 1px solid #f1f5f9; color: #ef4444; }
.user-dropdown-content a.logout-link:hover { background-color: #fef2f2; }
.user-dropdown:hover .user-dropdown-content { display: block; }
.user-dropdown-content::before {
    content: ""; position: absolute; top: -10px; left: 0; width: 100%; height: 10px; background: transparent; display: block;
}

/* ==========================================================================
   RESPONSIVE (MOBILE) STYLES - HIER PASSIERT DIE MAGIE
   ========================================================================== 
*/

@media (max-width: 900px) {
    /* 1. Grid auflösen (Alles untereinander) */
    .grid { grid-template-columns: 1fr; gap: 20px; }
    
    /* 2. Header Mobile-Umbau */
    body { padding-top: 0; } /* Header ist nicht mehr fixed */
    
    header {
        height: auto;
        min-height: 60px;
        position: relative; /* Scrollt mit */
        flex-wrap: wrap;
        padding: 10px 15px;
        align-items: flex-start;
    }
    
    /* Erste Zeile: Logo links, User rechts */
    .brand {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px; /* Platz für Nav darunter */
    }
    
    /* Logo kleiner */
    .brand-logo { height: 32px; }
    
    /* User Dropdown nach rechts schieben */
    .user-dropdown { position: static; } /* Positionierung innerhalb Brand */
    
    /* Navigation unter Logo/User */
    .left-section {
        width: 100%;
        display: block; /* Kein Flex mehr */
        padding-top: 5px;
        border-top: 1px solid #f1f5f9;
        overflow-x: auto; /* Seitliches Scrollen */
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-tabs {
        width: auto;
        display: flex;
        gap: 10px;
        padding-bottom: 5px; /* Platz für Scrollbar */
    }
    
    .nav-link {
        font-size: 13px;
        padding: 8px 12px;
        background: #f8fafc;
        border-radius: 20px; /* Pillen-Form auf Handy */
        border-bottom: none;
        color: var(--text-main);
    }
    .nav-link.active {
        background: var(--primary);
        color: #fff;
        border-bottom: none;
    }

    /* 3. Inputs & Formulare auf Mobile */
    input[type=text], input[type=email], input[type=password], 
    input[type=number], input[type=date], input[type=time], textarea, select {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    /* Formular-Grid 2-Spaltig auflösen */
    .grid[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* 4. Arbeitszeiten */
    .az-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .az-row > div { width: 100%; }
    .az-row input[type=time] { width: 45%; display: inline-block; }
    
    /* 5. User Dropdown Positionierung Fix */
    .user-dropdown-content {
        right: 10px; 
        left: auto;
        top: 45px; /* Unter dem Trigger */
        width: 200px;
    }
}
/* Styling für das Sperr-Accordion */
details.sperr-accordion {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}
details.sperr-accordion summary {
    background: #f8fafc;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
details.sperr-accordion summary:hover {
    background: #f1f5f9;
}
details.sperr-accordion summary::after {
    content: '+'; 
    font-size: 18px; 
    font-weight: bold;
}
details.sperr-accordion[open] summary::after {
    content: '-';
}
details.sperr-accordion[open] summary {
    border-bottom: 1px solid #e2e8f0;
}
.sperr-content {
    padding: 20px;
    background: #fff;
}
/* Kleine Liste für die Sperren */
.sperr-liste {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    border-top: 1px solid #eee;
}
.sperr-liste li {
    display: flex; 
    justify-content: space-between; 
    padding: 8px 10px; 
    border-bottom: 1px solid #f1f1f1;
    font-size: 13px;
}
.sperr-liste li:hover { background: #fafafa; }