:root {
    --bg-color: #f2f2f7;
    --card-bg: #ffffff;
    --text-main: #1c1c1e;
    --blue: #007aff;
    --red: #ff3b30;
    --gray: #8e8e93;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 16px;
}
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.nav-buttons { display: flex; gap: 16px; }
select, input[type="text"] {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #d1d1d6;
    font-size: 16px;
    background: var(--card-bg);
}
select { background: #e5e5ea; border: none; font-weight: 600; }
button { cursor: pointer; font-family: inherit; }
.menu-btn {
    background: none; border: none; font-size: 24px; color: var(--blue);
}
.menu-btn.reset { color: var(--red); font-size: 26px; }

/* CHECKLIST CARDS */
.group-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.group-card h3 {
    font-size: 18px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.color-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.task-item {
    display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #e5e5ea; font-size: 16px;
}
.task-item:last-child { border-bottom: none; }
.task-item input[type="checkbox"] {
    width: 24px; height: 24px; margin-right: 12px; accent-color: var(--blue);
}
.collapsible-list button {
    width: 100%; padding: 16px; margin-bottom: 12px; border-radius: 12px; border: none;
    background: var(--card-bg); font-size: 16px; text-align: left; font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); display: flex; align-items: center; gap: 8px;
}

/* MODAL NASTAVENÍ (iOS Sheet Style) */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); z-index: 1000; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 16px; background: var(--card-bg); border-bottom: 1px solid #d1d1d6;
    position: sticky; top: 0; z-index: 10;
}
.close-btn {
    background: none; border: none; color: var(--blue); font-size: 17px; font-weight: 600;
}
.modal-content { padding: 16px; }
.settings-section {
    background: var(--card-bg); border-radius: 12px; padding: 16px; margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.settings-section h3 { font-size: 16px; color: var(--gray); margin-bottom: 12px; text-transform: uppercase; }
.settings-list { margin-bottom: 16px; }
.settings-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid #e5e5ea; font-size: 16px;
}
.settings-row:last-child { border-bottom: none; }
.delete-btn { background: none; border: none; color: var(--red); font-size: 14px; }

/* FORMULÁŘE V NASTAVENÍ */
.settings-form { display: flex; gap: 10px; margin-top: 12px; }
.settings-form input[type="text"] { flex: 1; }
.settings-form button {
    background: var(--blue); color: #fff; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 600;
}
.settings-form.vertical { flex-direction: column; gap: 12px; }
.form-row { display: flex; justify-content: space-between; align-items: center; font-size: 16px; padding: 4px 0; }
.form-row input[type="color"] { border: none; background: none; width: 40px; height: 40px; }
.form-row input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--blue); }
.edit-btn { 
    background: none; 
    border: none; 
    color: var(--blue); 
    font-size: 14px; 
    margin-right: 16px; 
}
.drag-handle {
    cursor: grab;
    color: #c7c7cc;
    margin-right: 12px;
    font-size: 20px;
    display: inline-block;
    vertical-align: middle;
}
.settings-row-content {
    display: flex;
    align-items: center;
}
.drag-handle {
    cursor: grab;
    color: #c7c7cc;
    margin-right: 12px;
    font-size: 24px;
    padding: 10px 10px 10px 0; /* Větší zóna pro tlustší prsty */
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Zabrání scrollování obrazovky, když chytíme ikonku */
}
.drag-handle:active {
    cursor: grabbing;
}
/* ZAMYKACÍ OBRAZOVKA (iOS PIN styl) */
.lock-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-color); z-index: 9999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.3s;
}
.lock-content { text-align: center; }
.lock-content h2 { font-size: 20px; font-weight: 600; margin-bottom: 30px; color: var(--text-main); }
.pin-dots { display: flex; gap: 24px; justify-content: center; margin-bottom: 50px; height: 16px; }
.pin-dots .dot {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid var(--blue); transition: all 0.1s;
}
.pin-dots .dot.filled { background: var(--blue); }
.pin-dots .dot.error { border-color: var(--red); background: var(--red); }

.numpad {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 320px; margin: 0 auto;
}
.numpad button {
    width: 80px; height: 80px; border-radius: 50%; border: none;
    background: var(--card-bg); font-size: 36px; font-weight: 400;
    color: var(--text-main); box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.numpad button:active { background: #d1d1d6; transform: scale(0.95); }
.numpad button.empty { background: none; box-shadow: none; pointer-events: none; }
.numpad button.del { font-size: 28px; color: var(--gray); background: none; box-shadow: none; }