/* začátek */
/* ZÁKLAD */
body { margin: 0; font-family: 'Segoe UI', Tahoma, sans-serif; background: #f4f6f8; height: 100vh; display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
.container { flex: 1; display: flex; justify-content: center; align-items: center; }

/* PŘIHLÁŠENÍ */
#login-screen { background: white; padding: 40px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); text-align: center; width: 300px; }
input:not([type="checkbox"]) { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 16px; } 
button { padding: 12px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; background: #0052cc; color: white; width: 100%; margin-bottom: 10px; touch-action: manipulation; }
.secondary-btn { background: #ebecf0; color: #333; width: auto; display: inline-block; }
.add-btn { width: auto; background: #00875a; display: inline-block; margin-bottom: 0; }

/* HLAVNÍ LAYOUT */
.app-layout { display: flex; width: 100%; height: 100vh; background: white; overflow: hidden; }

/* LEVÝ PANEL */
.sidebar { width: 250px; background: #fafbfc; border-right: 1px solid #dfe1e6; display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; border-bottom: 1px solid #dfe1e6; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sidebar-header h2 { margin: 0; color: #0052cc; font-size: 24px; }

#install-pwa-btn {
    background: #f9ab00;
    color: #172b4d;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    display: none; 
    width: auto;
    margin: 0;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s, background 0.2s;
}
#install-pwa-btn:hover { background: #e39a00; transform: scale(1.05); }

.sidebar h3 { font-size: 12px; color: #5e6c84; padding: 15px 20px 5px; text-transform: uppercase; font-weight: bold; }
.user-legend { padding: 10px 15px; overflow-y: auto; }
.legend-item { display: flex; align-items: center; padding: 8px 10px; margin-bottom: 6px; border-radius: 4px; background: white; border: 1px solid #dfe1e6; font-size: 13px; font-weight: 500; color: #172b4d; cursor: pointer; border-left-width: 6px; user-select: none; }

/* HORNÍ NAVIGACE */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.top-bar { padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #dfe1e6; background: white; z-index: 20; }
.nav-controls, .view-switchers { display: flex; align-items: center; gap: 15px; }
.date-range { font-size: 18px; font-weight: bold; color: #172b4d; }
.btn-group { display: flex; border: 1px solid #dfe1e6; border-radius: 4px; overflow: hidden; }
.btn-group button { border-radius: 0; margin: 0; background: white; color: #5e6c84; border-right: 1px solid #dfe1e6; width: auto; padding: 8px 12px; }
.btn-group button:last-child { border-right: none; }
.btn-group button.active { background: #0052cc; color: white; font-weight: bold; }

/* MINI KALENDÁŘ */
.mini-calendar-module { padding: 15px; border-bottom: 1px solid #dfe1e6; }
.mini-cal-header { font-weight: bold; color: #172b4d; margin-bottom: 10px; text-align: center; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11px; color: #5e6c84; }
.mini-day { padding: 5px; cursor: pointer; border-radius: 4px; }
.mini-day.active { background: #0052cc; color: white; }

/* MŘÍŽKA - TÝDENNÍ POHLED */
.calendar-wrapper { flex: 1; overflow-y: auto; overflow-x: auto; background: white; -webkit-overflow-scrolling: touch; }
.weekly-grid { display: grid; border-top: none; min-width: 700px; } 

.time-col-header, .day-header { position: sticky; top: 0; background: white; z-index: 10; border-bottom: 1px solid #dfe1e6; border-right: 1px solid #dfe1e6; padding: 12px 5px; text-align: center; font-weight: bold; color: #5e6c84; font-size: 13px; }
.time-col-header { z-index: 11; left: 0; }
.all-day-label { background: #fafbfc; position: sticky; left: 0; z-index: 5; border-right: 1px solid #dfe1e6; border-bottom: 2px solid #dfe1e6; }
.all-day-cell { background: #fafbfc; border-right: 1px solid #dfe1e6; border-bottom: 2px solid #dfe1e6; min-height: 50px; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.time-label { position: sticky; left: 0; background: white; text-align: right; padding: 10px 8px; border-right: 1px solid #dfe1e6; border-bottom: 1px solid #f4f5f7; font-size: 12px; color: #5e6c84; z-index: 5; font-weight: 600; }
.grid-cell { border-right: 1px solid #dfe1e6; border-bottom: 1px solid #f4f5f7; min-height: 50px; position: relative; padding: 2px; }

/* MŘÍŽKA - MĚSÍČNÍ POHLED */
.week-number-cell { display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; background: #fafbfc; border-right: 1px solid #dfe1e6; border-bottom: 1px solid #dfe1e6; font-size: 11px; font-weight: bold; color: #5e6c84; }
.month-day-cell { border-right: 1px solid #dfe1e6; border-bottom: 1px solid #dfe1e6; min-height: 130px; display: flex; flex-direction: column; background: white; }

/* UDÁLOSTI */
.event-block { font-size: 11px; color: white; padding: 5px; border-radius: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; box-shadow: 0 1px 2px rgba(0,0,0,0.1); user-select: none; }

/* MODAL */
.modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 15px; box-sizing: border-box; }
.modal-content { background: white; padding: 20px; border-radius: 12px; width: 100%; max-width: 380px; text-align: center; max-height: 90vh; overflow-y: auto; }
.modal-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }

/* RESPONZIVITA - MOBILY (Ultra kompaktní hlavička) */
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #dfe1e6; flex-direction: row; align-items: center; padding: 0; height: auto; }
    .sidebar-header { display: flex; padding: 5px 8px; border-bottom: none; border-right: 1px solid #dfe1e6; width: auto; flex-shrink: 0; gap: 5px; }
    .sidebar-header h2 { font-size: 14px; margin: 0; }
    #install-pwa-btn { padding: 4px 6px; font-size: 9px; margin-left: 2px; }
    
    .mini-calendar-module, .sidebar h3 { display: none; }
    
    .user-legend { display: flex; flex-direction: row; overflow-x: auto; padding: 4px 8px; gap: 5px; scrollbar-width: none; }
    .user-legend::-webkit-scrollbar { display: none; }
    .legend-item { margin-bottom: 0; white-space: nowrap; flex-shrink: 0; padding: 4px 8px; font-size: 11px; border-left-width: 4px; }

    .top-bar { flex-direction: column; padding: 5px 8px; gap: 5px; }
    .nav-controls { width: 100%; justify-content: space-between; align-items: center; }
    
    /* Změna velikosti oříznutého data */
    .date-range { font-size: 14px; font-weight: bold; letter-spacing: -0.3px; }
    
    .view-switchers { width: 100%; justify-content: space-between; align-items: center; flex-wrap: nowrap; gap: 4px; }
    
    #user-display-name { font-size: 12px; margin-right: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60px; }
    
    /* Výrazné zmenšení tlačítek pro úsporu výšky */
    .btn-group button { padding: 5px 8px; font-size: 11px; }
    .icon-btn { padding: 5px 8px !important; font-size: 12px !important; }
    #today-btn { padding: 5px 8px !important; font-size: 11px !important; }
    .add-btn { padding: 5px 8px; font-size: 11px; }
    .secondary-btn { padding: 5px 8px; font-size: 11px; margin-left: 0 !important; }

    .weekly-grid { min-width: 850px; } 
}
/* konec */