.term-caly {
    max-width: 480px;
    margin: 0 5px 0 auto; /* auto po lewej = przesuwa cały box w prawo, 10px odstępu od prawej krawędzi */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,9);
    padding: 14px;
    position: relative;
    top: 30px; /* odsunięcie spod górnego paska strony */
    overflow-y: auto;
   min-height: 500px;
    max-height: 80vh;
}

.term-wrap {
    font-family: system-ui, Arial, sans-serif;
    color: #222;
}

.term-naglowek {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.term-tytul-miesiaca {
    font-weight: 600;
    font-size: 1.1rem;
}

.term-nav {
    background: #2f6f4f;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
}
.term-nav:hover { background: #24583e; }

.term-wroc {
    background: #2f6f4f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    margin-bottom: 10px;
}
.term-wroc:hover { background: #24583e; }

.term-dni-tyg {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 4px;
}

.term-siatka {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.term-dzien {
    position: relative;
    aspect-ratio: 1 / 1;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.15s;
}
.term-dzien:hover { background: #eef6f0; }

.term-dzien-pusty {
    visibility: hidden;
    cursor: default;
}

.term-dzis {
    border-color: #2f6f4f;
    font-weight: 700;
}

.term-numer-dnia { font-size: 0.9rem; }

.term-znacznik {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: #2f6f4f;
    color: #fff;
    border-radius: 999px;
    font-size: 0.65rem;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

/* Modal dnia */
.term-modal-tlo {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.term-modal {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.term-modal-zamknij {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #888;
}

.term-modal-data {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color:#999;
}

.term-lista-zadan {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.term-zadanie {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px 10px;
    background: #eef1ef;;
}

.term-godzina {
    font-weight: 600;
    color: #2f6f4f;
    min-width: 92px;
}

.term-dzien-tyg {
    font-weight: 600;
    font-size: 0.8rem;
    color: #888;
}

.term-tresc { flex: 1; }
.term-tresc p { color: #666;text-align: left; }

.term-usun {
    background: none;
    border: none;
    color: #b03030;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
}

.term-edytuj {
    background: none;
    border: none;
    color: #2f6f4f;
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.term-edytuj:hover { color: #24583e; }

.term-publiczny-etykieta {
    background: #fff6e0;
    border: 1px solid #f0d9a0;
    border-radius: 6px;
    padding: 6px 8px;
}

.term-brak, .term-ladowanie {
    color: #888;
    font-style: italic;
    padding: 6px 0;
}

.term-form-dodaj {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.term-form-dodaj input,
.term-form-dodaj textarea {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.term-form-dodaj textarea { resize: vertical; min-height: 50px; }

.term-form-dodaj button {
    background: #2f6f4f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px;
    cursor: pointer;
    font-weight: 600;
}
.term-form-dodaj button:hover { background: #24583e; }

.term-cykl-etykieta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
}

.term-cykl {
    font-size: 0.75rem;
    color: #888;
    font-weight: 400;
    filter: grayscale(100%) brightness(100%);
}

/* Telefony */
@media (max-width: 400px) {
    .term-znacznik { font-size: 0.6rem; }
}

/* Pasek zakładek Kalendarz / Lista + X zamykający */
.term-baner-gosc {
    background: #eef6f0;
    border: 1px solid #cfe6d8;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #2f6f4f;
    text-align: center;
}
.term-baner-gosc button {
    background: #2f6f4f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 600;
    margin-left: 4px;
}
.term-baner-gosc button:hover { background: #24583e; }

.term-pasek {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.term-tab {
    background: #eef1ef;
    color: #444;
    border: none;
    border-radius: 6px 6px 0 0;
    padding: 7px 14px;
    cursor: pointer;
    font-size: 0.9rem;
}
.term-tab-aktywna {
    background: #fff;
    color: #2f6f4f;
    font-weight: 600;
    box-shadow: 0 -1px 4px rgba(0,0,0,0.08);
}

.term-zamknij {
    margin-left: auto;
    background: none;
    border: none;
    color: #888;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.term-zamknij:hover { color: #b03030; }

.term-paginacja {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}
