:root { --primary: #2563eb; --dark: #0f172a; --light: #f8fafc; --red: #e11d48; --green: #10b981; --amber: #f59e0b; }
body { font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; background: var(--light); color: var(--dark); overflow-y: scroll; }
header { background: var(--dark); color: white; padding: 1rem; text-align: center; border-bottom: 4px solid var(--primary); position: relative; }
.sticky-wrapper { position: sticky; top: 0; z-index: 1000; width: 100%; }
nav { display: flex; justify-content: center; gap: 10px; background: #fff; padding: 15px; border-bottom: 1px solid #ddd; }
nav button { padding: 10px 15px; cursor: pointer; border: none; border-radius: 6px; font-weight: bold; background: #e2e8f0; }
nav button.active { background: var(--primary); color: white; }
.container { max-width: 1600px; margin: 20px auto; padding: 0 20px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.admin-layout { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 25px; align-items: start; }
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.box { background: white; padding: 20px; border-radius: 12px; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; margin-bottom: 20px; }
.box h3 { margin-top: 0; border-bottom: 2px solid var(--primary); padding-bottom: 10px; margin-bottom: 15px; font-size: 1.1rem; text-transform: uppercase; }
.label-board { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 15px; padding: 8px; background: #f1f5f9; border-radius: 8px; }
.btn-label { padding: 8px 12px; font-size: 0.9rem; background: white; border: 1px solid #cbd5e1; border-radius: 4px; cursor: pointer; font-weight: 700; text-transform: uppercase; }
.btn-label.active { background: var(--primary); color: white; border-color: var(--primary); }
.quick-time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 4px; margin-bottom: 12px; background: #f8fafc; padding: 8px; border-radius: 6px; border: 1px solid #e2e8f0; }
.btn-time { padding: 4px 2px; font-size: 0.65rem; background: white; border: 1px solid #cbd5e1; border-radius: 3px; cursor: pointer; font-weight: bold; }
.btn-time.active { background: var(--primary); color: white; border-color: var(--primary); }
label { display: block; font-size: 0.8rem; font-weight: bold; margin-bottom: 4px; color: #1e293b; }
input, select, textarea { width: 100%; padding: 10px; margin-bottom: 12px; border: 2px solid #e2e8f0; border-radius: 6px; font-weight: bold; font-family: inherit; box-sizing: border-box; }
textarea { resize: vertical; min-height: 80px; font-weight: normal; }
.schedule-grid { background: white; border-radius: 8px; position: relative; border: 1px solid #cbd5e1; background-image: linear-gradient(#f1f5f9 1px, transparent 1px); background-size: 100% 60px; overflow: hidden; }
.time-row { height: 60px; border-bottom: 1px solid #e2e8f0; display: flex; }
.time-label { width: 70px; font-size: 0.75rem; color: #475569; text-align: center; font-weight: 800; padding-top: 5px; border-right: 2px solid #e2e8f0; background: #f8fafc; flex-shrink: 0; }
.event-block { position: absolute; border-radius: 6px; padding: 6px 8px; font-size: 0.8rem; border-left: 5px solid rgba(0,0,0,0.3); box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 10; color: white; font-weight: 600; box-sizing: border-box; overflow: hidden; cursor: grab; touch-action: none; }
.event-block strong { display: block; font-size: 0.95rem; text-transform: uppercase; }
.event-block.short { display: flex; flex-wrap: wrap; align-items: center; padding: 2px 6px; line-height: 1.2; }
.event-block.short strong { display: inline; margin-right: 6px; font-size: 0.9rem; }
.event-block.short div { margin-top: 0 !important; display: inline-block; margin-left: 6px; font-size: 0.85rem; }
.event-block.short .event-comment { display: inline; margin-left: 6px; padding-left: 6px; border-left: 1px solid rgba(255,255,255,0.5); }
.event-comment { font-weight: normal; font-size: 0.65rem; opacity: 0.95; display: block; white-space: pre-wrap; }
.color-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(35px, 1fr)); gap: 6px; margin-bottom: 15px; }
.color-circle { width: 100%; aspect-ratio: 1; border-radius: 6px; cursor: pointer; border: 3px solid transparent; }
.color-circle.selected { border-color: #000; transform: scale(1.1); }
.btn-save { background: var(--green); color: white; width: 100%; border: none; padding: 15px; border-radius: 8px; cursor: pointer; font-weight: 900; font-size: 1.1rem; }
.list-container { max-height: 400px; overflow-y: auto; border: 1px solid #eee; border-radius: 8px; }
.list-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid #f1f5f9; background: #fff; }
.list-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.list-color-tag { width: 8px; height: 45px; border-radius: 2px; flex-shrink: 0; }
.list-text { display: flex; flex-direction: column; overflow: hidden; font-size: 0.85rem; }
.btn-edit-list { background: var(--amber); color: white; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; margin-right: 5px; }
.btn-del-list { background: var(--red); color: white; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; }
.list-view-item { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 8px solid var(--primary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.list-view-item { background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; margin-bottom: 12px; border-left: 16px solid var(--primary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.list-view-time { font-weight: 800; font-size: 1.2rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.list-view-title { font-weight: 900; font-size: 1.4rem; text-transform: uppercase; margin-bottom: 8px; line-height: 1.2; }
.list-view-comment { font-size: 1rem; color: #334155; white-space: pre-wrap; background: #f1f5f9; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; }
.week-view-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 8px; overflow: hidden; }
.week-col { background: white; min-height: 400px; display: flex; flex-direction: column; border-right: 1px solid #f1f5f9; }
.week-col:last-child { border-right: none; }
.week-header { background: #f8fafc; padding: 8px 4px; text-align: center; font-weight: bold; font-size: 0.75rem; border-bottom: 1px solid #e2e8f0; text-transform: uppercase; }
.week-header.today { background: var(--primary); color: white; }
.week-body { padding: 4px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.week-event-small { font-size: 0.65rem; padding: 4px 5px; border-radius: 4px; color: white; font-weight: bold; overflow: hidden; white-space: normal; cursor: pointer; line-height: 1.2; display: flex; flex-direction: column; gap: 2px; }
.tour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 15px; padding-bottom: 40px; }
.tour-day-card { background: white; border: 1px solid #cbd5e1; border-radius: 12px; padding: 20px; cursor: pointer; transition: all 0.15s ease; text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.tour-day-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.tour-day-date { font-size: 0.9rem; color: #64748b; font-weight: bold; margin-bottom: 8px; }
.tour-day-title { font-size: 1.3rem; font-weight: 900; color: var(--dark); text-transform: uppercase; line-height: 1.2; }
.tour-overview-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 20px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; border-bottom: 1px solid #e2e8f0; }
.tour-overview-bar::-webkit-scrollbar { height: 14px; }
.tour-overview-bar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 7px; }
.tour-btn-small { flex: 0 0 auto; min-width: 120px; padding: 12px; border: 1px solid #cbd5e1; background: white; border-radius: 8px; cursor: pointer; text-align: center; transition: all 0.2s; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.tour-btn-small:hover { border-color: var(--primary); transform: translateY(-2px); }
.tour-btn-small.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 6px rgba(37,99,235,0.3); }
.tour-btn-small div:first-child { font-size: 1.0rem; opacity: 0.8; margin-bottom: 4px; }
.tour-btn-small div:last-child { font-size: 1.4rem; font-weight: 900; text-transform: uppercase; white-space: nowrap; }
.tour-selection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 20px 0; }
.tour-card { background: white; border: 1px solid #cbd5e1; border-radius: 16px; padding: 30px; cursor: pointer; transition: all 0.2s; text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 150px; }
.tour-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.tour-card h3 { margin: 0 0 10px 0; font-size: 1.5rem; color: var(--dark); font-weight: 900; text-transform: uppercase; }
.tour-card-icon { font-size: 3rem; margin-bottom: 15px; display: block; }
.btn-add-tour { background: var(--primary); color: white; border: none; padding: 15px; border-radius: 12px; font-weight: 900; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-bottom: 20px; text-transform: uppercase; box-shadow: 0 4px 6px rgba(37,99,235,0.2); }
.btn-add-tour:hover { background: #1d4ed8; }
.btn-delete-tour { position: absolute; top: 15px; right: 15px; background: rgba(254,226,226,0.5); color: #991b1b; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 1.2rem; }
.btn-delete-tour:hover { background: #fee2e2; transform: scale(1.1); }
.db-section { margin-top: 40px; padding-top: 20px; border-top: 2px dashed #cbd5e1; text-align: center; }
.btn-db { padding: 12px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; font-size: 1rem; margin: 5px; display: inline-flex; align-items: center; gap: 8px; }
.db-status { margin-top: 10px; font-size: 0.9rem; color: #64748b; font-style: italic; }
.cloud-input { width: 100%; padding: 8px; margin-bottom: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; }
.login-container { max-width: 400px; margin: 100px auto; padding: 30px; background: white; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); text-align: center; border: 1px solid #cbd5e1; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; }
.user-card { background: white; padding: 15px; border-radius: 8px; border: 1px solid #cbd5e1; position: relative; cursor: pointer; transition: border-color 0.2s; }
.user-card:hover { border-color: var(--primary); }
.user-card h4 { margin: 0 0 5px 0; color: var(--dark); font-size: 1.1rem; }
.role-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 0.7rem; font-weight: bold; text-transform: uppercase; margin-bottom: 8px; }
.role-admin { background: var(--red); color: white; } .role-user { background: var(--green); color: white; }
.db-indicator { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; cursor: help; transition: all 0.3s ease; }
.status-connected { color: #4ade80; filter: drop-shadow(0 0 5px rgba(74, 222, 128, 0.5)); }
.status-disconnected { color: #ef4444; filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5)); }
.status-loading { color: #f59e0b; opacity: 0.7; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.4; } 50% { opacity: 1; } 100% { opacity: 0.4; } }

/* --- MOBILE OPTIMIERUNGEN (Smartphone) --- */
@media (max-width: 768px) {
    /* Navigation kompakter */
    nav { padding: 10px 5px; gap: 5px; flex-wrap: wrap; }
    nav button { padding: 8px 10px; font-size: 0.8rem; flex: 1; }
    
    /* Editor Layout stapeln statt nebeneinander */
    .admin-layout { grid-template-columns: 1fr; gap: 15px; }
    .sidebar { position: static; width: 100%; }
    
    /* Buttons im Editor verkleinern */
    .btn-label { padding: 6px 8px; font-size: 0.75rem; margin-bottom: 2px; }
    .btn-time { padding: 4px 2px; font-size: 0.6rem; }
    .btn-save { padding: 12px; font-size: 1rem; }
    
    /* Tour Buttons oben kleiner */
    .tour-btn-small { min-width: 80px; padding: 8px; }
    .tour-btn-small div:first-child { font-size: 0.8rem; }
    .tour-btn-small div:last-child { font-size: 1rem; }
    
    /* Termine (Events) kompakter */
    .event-block { 
        padding: 2px 4px; 
        font-size: 0.7rem; 
        border-left-width: 3px; 
        line-height: 1.1;
    }
    .event-block strong { 
        font-size: 0.8rem; 
        margin-bottom: 1px; 
    }
    .event-comment { 
        font-size: 0.6rem; 
        margin-top: 1px;
    }
    
    /* Header kleiner */
    h1#app-title { font-size: 1.3rem; }
    #app-tour-dates { font-size: 0.8rem !important; }
    .container { padding: 0 10px; }

    /* --- NEU: Optimierungen für Listenansicht & Buttons --- */
    
    /* 1. List View Day kompakter machen */
    .list-view-item { padding: 12px 10px; margin-bottom: 10px; }
    .list-view-time { font-size: 1rem; margin-bottom: 2px; }
    .list-view-title { font-size: 1.1rem; margin-bottom: 4px; line-height: 1.2; }
    .list-view-comment { font-size: 0.85rem; padding: 8px; }

    /* 2. Ansichtsbuttons (Tag, Liste, Woche) verkleinern */
    /* Wir nutzen !important, um die Inline-Styles aus dem JS zu überschreiben */
    button[id^="btn-mode-"] {
        padding: 10px 5px !important;
        font-size: 0.85rem !important;
        flex: 1; /* Buttons teilen sich den Platz gleichmäßig */
        white-space: nowrap;
    }

    /* 3. Die drei großen Tagesauswahl-Buttons (Gestern, Heute, Morgen) ausblenden */
    #week-container, #week-container-admin {
        display: none !important;
    }
}