/* ============================================
   MEESTERTOOLS - Routines
   Versie: v1.0.0
   ============================================ */

/* ---------- Topbalk: datum + voortgang ---------- */
.rt-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--bg-white, #fff);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(108,99,255,.1));
    padding: 16px 20px;
    margin-bottom: 14px;
}
.rt-today { display: flex; flex-direction: column; }
.rt-today-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--primary, #6C63FF);
}
.rt-date {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark, #2D3436);
    text-transform: capitalize;
}
.rt-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    flex: 1 1 240px;
    max-width: 420px;
}
.rt-progress-track {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #ECECF3;
    overflow: hidden;
}
.rt-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-green, #6BCB77), #57c06a);
    transition: width .3s ease;
}
.rt-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-medium, #636E72);
    white-space: nowrap;
}

.rt-hint {
    font-size: 13.5px;
    color: var(--text-medium, #636E72);
    margin-bottom: 18px;
}

/* ---------- Checklist ---------- */
.rt-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 16px;
    align-items: start;
}
.rt-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    border: 1.5px solid #ECECF3;
    background: var(--bg-white, #fff);
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.rt-item:hover { border-color: var(--primary-light, #8B83FF); box-shadow: var(--shadow-sm, 0 2px 8px rgba(108,99,255,.1)); }

/* Het hokje: enige plek om af te vinken */
.rt-check {
    flex-shrink: 0;
    align-self: center;
    margin: 0 0 0 16px;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 7px;
    border: 2px solid #CBD0DE;
    background: var(--bg-light, #F8F9FE);
    position: relative;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.rt-check:hover { border-color: var(--accent-green, #6BCB77); }
.rt-check::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .18s cubic-bezier(.4,1.4,.6,1);
}

/* De balk naast het hokje: klik = uitvouwen (indien uitleg) */
.rt-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    text-align: left;
    background: none;
    border: none;
    font: inherit;
    color: inherit;
}
.rt-main-btn { cursor: pointer; }

.rt-label {
    flex: 1;
    min-width: 0;
    font-size: 15.5px;
    color: var(--text-dark, #2D3436);
    line-height: 1.3;
}
.rt-count {
    flex-shrink: 0;
    min-width: 24px;
    text-align: center;
    background: var(--bg-light, #F1F1F8);
    color: var(--text-medium, #636E72);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 12.5px;
    font-weight: 700;
}
.rt-count.is-zero { display: none; }
.rt-chev {
    flex-shrink: 0;
    color: var(--text-light, #B2BEC3);
    font-size: 13px;
    transition: transform .2s ease;
}
.rt-item.is-open .rt-chev { transform: rotate(180deg); }

/* Uitvouwbare uitleg */
.rt-desc {
    flex-basis: 100%;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.rt-item.is-open .rt-desc { max-height: 480px; }
.rt-desc-inner {
    padding: 10px 16px 14px 56px;
    font-size: 14px;
    color: var(--text-medium, #636E72);
    line-height: 1.5;
    border-top: 1px solid #F0F0F5;
}

/* aangevinkt vandaag */
.rt-item.is-checked {
    border-color: var(--accent-green, #6BCB77);
    background: #F1FAF2;
}
.rt-item.is-checked .rt-check {
    background: var(--accent-green, #6BCB77);
    border-color: var(--accent-green, #6BCB77);
}
.rt-item.is-checked .rt-check::after { transform: rotate(45deg) scale(1); }
.rt-item.is-checked .rt-label { color: #2C7A3D; font-weight: 600; }
.rt-item.is-checked .rt-count { background: #DBF0DF; color: #2C7A3D; }
.rt-item.is-checked .rt-desc-inner { border-top-color: #D6EBDA; }

/* ---------- Lege staat ---------- */
.rt-empty {
    text-align: center;
    color: var(--text-medium, #636E72);
    padding: 40px 20px;
}
.rt-empty-icon { font-size: 42px; margin-bottom: 10px; }

/* ---------- Toast ---------- */
.rt-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-dark, #2D3436);
    color: #fff;
    padding: 12px 22px;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    transition: all .25s ease;
    z-index: 5000;
}
.rt-toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Instellingen-modal ---------- */
.rt-settings-modal { max-width: 560px; }
.rt-manage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.rt-manage-sub { font-size: 13.5px; color: var(--text-medium, #636E72); }
.rt-grip-inline { letter-spacing: -3px; color: var(--text-light, #B2BEC3); }

.rt-edit-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46vh;
    overflow-y: auto;
    padding: 2px;
    margin-bottom: 14px;
}
.rt-edit-row {
    display: flex;
    flex-direction: column;
    gap: 7px;
    background: var(--bg-light, #F8F9FE);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm, 8px);
    padding: 8px;
}
.rt-edit-row.rt-dragging { opacity: .5; border-color: var(--primary, #6C63FF); }
.rt-edit-main {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rt-edit-desc {
    width: 100%;
    resize: vertical;
    min-height: 36px;
}
.rt-grip {
    flex-shrink: 0;
    cursor: grab;
    color: var(--text-light, #B2BEC3);
    font-size: 16px;
    letter-spacing: -4px;
    padding: 0 4px;
    user-select: none;
}
.rt-grip:active { cursor: grabbing; }
.rt-edit-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #E8E8F0;
    border-radius: var(--radius-sm, 8px);
    padding: 8px 10px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-dark, #2D3436);
    background: var(--bg-white, #fff);
}
.rt-edit-input:focus { outline: none; border-color: var(--primary, #6C63FF); }
.rt-edit-count {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-light, #B2BEC3);
}
.rt-edit-del {
    flex-shrink: 0;
    border: none;
    background: var(--bg-white, #fff);
    border-radius: var(--radius-sm, 8px);
    width: 34px;
    height: 34px;
    font-size: 15px;
    cursor: pointer;
}
.rt-edit-del:hover { background: #FFECEC; }

.rt-text {
    border: 1.5px solid #E8E8F0;
    border-radius: var(--radius-sm, 8px);
    padding: 10px 12px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--text-dark, #2D3436);
    background: var(--bg-white, #fff);
}
.rt-text:focus { outline: none; border-color: var(--primary, #6C63FF); }

.rt-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #F0F0F5;
    padding-top: 14px;
}
.rt-add .rt-text { width: 100%; }
.rt-add-desc { resize: vertical; min-height: 38px; }
.rt-add .rt-btn-primary { align-self: flex-end; }

.rt-btn {
    border: none;
    cursor: pointer;
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: all .15s ease;
}
.rt-btn-primary { background: var(--primary, #6C63FF); color: #fff; }
.rt-btn-primary:hover { background: var(--primary-dark, #5A52D5); }
.rt-btn-ghost { background: #EFEFFA; color: var(--primary-dark, #5A52D5); }
.rt-btn-ghost:hover { background: #E4E4F7; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .rt-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .rt-topbar { flex-direction: column; align-items: stretch; }
    .rt-progress { max-width: none; }
}
