:root {
    --md-primary: #6750a4;
    --md-on-primary: #ffffff;
    --md-surface: #fdfcff;
    --md-surface-variant: #e7e0ec;
    --md-outline: #79747e;
    --md-success: #3ddc84;
    --md-error: #ba1a1a;
    
    --radius: 16px;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: var(--md-surface);
    color: #1c1b1f;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.md3-layout { display: flex; height: 100vh; }

/* Navigation Rail */
.nav-rail {
    width: 250px;
    background-color: var(--md-surface-variant);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    border-right: 1px solid rgba(0,0,0,0.05);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--md-primary);
    padding-left: 12px;
}

.nav-links { display: flex; flex-direction: column; gap: 8px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: #49454f;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: 0.2s;
    text-align: left;
}

.nav-item:hover { background-color: rgba(29, 25, 43, 0.08); }
.nav-item.active { background-color: #e8def8; color: #1d192b; font-weight: 700; }

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px 40px;
    overflow-y: auto;
}

/* Page Switching Logic */
.page-section { display: none; animation: fadeIn 0.3s ease; }
.page-section.active { display: block; }

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

/* Komponenty */
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.top-bar h1 { margin: 0; font-size: 2rem; font-weight: 400; }
.progress-card { background: var(--md-primary); color: white; padding: 20px 30px; border-radius: var(--radius); margin-bottom: 40px; }
.track { height: 8px; background: rgba(255,255,255,0.3); border-radius: 4px; margin-top: 10px; }
.indicator { height: 100%; background: white; border-radius: 4px; transition: width 0.4s; }

/* Grid (Today) */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.med-card { background: white; border: 1px solid var(--md-outline); border-radius: 12px; padding: 16px; position: relative; display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
.med-card.taken { background: #f0fff4; border-color: transparent; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.card-actions { margin-top: 15px; }

/* Table (Manager) */
.med-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.med-table th { text-align: left; padding: 12px; border-bottom: 2px solid #eee; color: var(--md-outline); }
.med-table td { padding: 16px 12px; border-bottom: 1px solid #eee; }
.med-table tr:hover { background-color: #f9f9f9; }

/* Buttons */
.btn-filled { background: var(--md-primary); color: white; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 500;}
.btn-text { background: transparent; color: var(--md-primary); border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 500;}
.btn-icon { background: none; border: none; cursor: pointer; color: #49454f; padding: 8px; border-radius: 50%; }
.btn-icon:hover { background: #f0f0f0; }
.btn-icon.edit { color: var(--md-primary); }
.btn-icon.delete { color: var(--md-error); }

/* Stats & Calendar */
.stats-overview { display: flex; gap: 20px; margin-bottom: 40px; }
.stat-box { flex: 1; background: white; border: 1px solid #e0e0e0; border-radius: 16px; padding: 20px; text-align: center; }
.stat-box h2 { font-size: 2.5rem; margin: 0; color: var(--md-primary); }

.calendar-container { background: white; border: 1px solid #e0e0e0; border-radius: 20px; padding: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-top: 20px; }
.day-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #f5f5f5; font-size: 0.9rem; position: relative; }
.day-cell.today { border: 2px solid var(--md-primary); }

/* Barvy kalendáře */
.day-cell.status-full { background-color: #d1fae5; color: #065f46; } 
.day-cell.status-partial { background-color: #fff7ed; color: #9a3412; } 
.day-cell.status-none { background-color: #fee2e2; color: #991b1b; } 
.day-cell.future { background-color: #fff; border: 1px solid #eee; color: #ccc; }

.calendar-legend { margin-top: 20px; display: flex; gap: 20px; justify-content: center; font-size: 0.9rem; color: #666; }
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.full { background: #d1fae5; }
.dot.partial { background: #fff7ed; }
.dot.none { background: #fee2e2; }

/* Dialog & Inputy */
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.md3-dialog { border: none; border-radius: 20px; padding: 24px; box-shadow: 0 10px 40px rgba(0,0,0,0.2); width: 400px; }
.md3-dialog::backdrop { background: rgba(0,0,0,0.5); }
.input-field { margin-bottom: 15px; display: flex; flex-direction: column; position: relative; }
.input-field input { padding: 12px; border: 1px solid var(--md-outline); border-radius: 8px; font-size: 1rem; }
.input-field label { position: absolute; left: 12px; top: -8px; background: white; padding: 0 4px; font-size: 0.75rem; color: var(--md-primary); }

.section-label { font-size: 0.8rem; color: var(--md-outline); margin-bottom: 8px; display:block; }
.big-icon { font-size: 4rem; color: #e0e0e0; margin-bottom: 10px; }
.empty-state { text-align: center; color: #999; margin-top: 40px; }
.hidden { display: none; }

#btn-add-time {margin-top:5px}
#progress-bar {width: 0%}
#btn-enable-notif {background: #e8def8}