:root {
    --bg: white;
    --text: #0f0f0f;
    --border: #e5e5e5;
    --accent: #ff7a00;
    --radius: 12px;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);

}

html,
body {
    height: 100%;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main#dashboard {
    flex: 1;
    /* 🔥 to jest klucz */
}



.topbar {
    display: flex;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

#projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    padding: 20px;
}

.project {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 00px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    transition: all ease 0.3s;
}

.project:hover {
    box-shadow: 0 00px 12px rgba(0, 0, 0, 0.15);
}


button,
input[type="file"]::file-selector-button,
select {
    margin-left: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    transition: all 0.2s ease;
}


button:hover,
input[type="file"]::file-selector-button:hover,
select:hover {
    border: 1px solid var(--accent);
    cursor: pointer;
}

select {
    outline: none;
}


.kanban-item.progress {
    height: auto;
    padding: 10px;
}

.progress {
    height: 10px;
    background: #f0f0f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
}

#addProjectBtn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 32px;
    border: none;
    cursor: pointer;
    z-index: 2;
}


.modal {
    position: fixed;
    inset: 0;
    /* top/right/bottom/left = 0 */
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: 12px;
    width: 360px;
    box-shadow: var(--shadow);
    position: relative;
    text-align: center;
}

.modal-content h2 {
    margin-bottom: 16px;
}

.modal-content input,
.modal-content select {
    width: 100%;
    padding: 8px;
    margin-bottom: 12px;
}

.modal-content button {
    padding: 10px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.btn-outline {
    margin-left: 8px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.btn-outline:hover {
    border-color: var(--accent);
}



.clickable {
    cursor: pointer;


}

.project-view {
    width: 90%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.back-btn {
    align-self: flex-start;
}

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

.step {
    display: flex;
    gap: 8px;
    align-items: center;
}

.collection-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.collection-item.done .name {
    text-decoration: line-through;
    opacity: 0.6;
}

.collection-item .date {
    font-size: 12px;
    color: #777;
    cursor: pointer;
}

.collection-item .delete-btn {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
}



.chart {
    margin: 24px 0;
}

.bars {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 120px;
}

.bar {
    flex: 1;
    text-align: center;
    font-size: 12px;
}

.bar-fill {
    background: #ff7a00;
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.2s ease;
}

.chart {
    margin: 24px 0 32px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 12px;
}

.chart canvas {
    display: block;
    width: 100%;
}

.heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-top: 16px;
}

/* Dzisiejszy dzień - obwódka */
.heat-day.today {
    outline: 2px solid #ff7a00;
    outline-offset: -2px;
    font-weight: bold;
}

/* Wybrany dzień - podkreślenie */
.heat-day.selected {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 4px;
    color: #000; /* Lub inny kolor, żeby się wyróżniał */
}

.day {
    height: 32px;
    border-radius: 6px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.day.undefined {
    background: #f2f2f2;
    color: #aaa;
}

.day.done {
    background: #2ecc71;
    color: #fff;
}

.day.missed {
    background: #e74c3c;
    color: #fff;
}

.day.skipped {
    background: #999;
    color: #fff;
}

.day.today {
    outline: 2px solid #ff7a00;
    outline-offset: 2px;
}

.week-summary {
    margin-top: 12px;
    color: #666;
    font-size: 12px;
}

.habit-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.habit-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.habit-percent {
    font-size: 28px;
    font-weight: 700;
    color: #ff7a00;
}

.habit-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

.checklist-view {
    width: 90%;
    margin: 0 5%;
}

.project-summary {
    margin-top: 8px;
}

.summary-main {
    font-size: 18px;
    font-weight: 600;
}

.summary-label {
    font-size: 12px;
    color: #777;
}

.checklist-add {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.checklist-add input {
    flex: 1;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.checklist-add button {
    padding: 0 14px;
    border-radius: 8px;
    border: none;
    background: var(--accent, orange);
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.checklist-items {
    display: flex;
    flex-direction: column;
}

.check-item {
    padding: 4px 0px;
}

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

.heat-day {
    height: 28px;
    font-size: 12px;
    text-align: center;
    line-height: 28px;
    border-radius: 4px;
    cursor: pointer;
}

.heat-day.empty {
    background: #eee;
}

.heat-day.partial {
    background: #f7c948;
}

.heat-day.done {
    background: #4caf50;
    color: #fff;
}

.heat-day.missed {
    background: #e53935;
    color: #fff;
}


.eksport {
    bottom: 0;
    width: 100%;
    z-index: 0;
    margin-bottom: 20px;
    border-top: solid 1px var(--border);
    padding-top: 17px;
    margin-top: 50px;
}



.przyciski-eksportu {
    margin-left: 15px;
}


.project {
    position: relative;
}

.delete-project {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;

    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    cursor: pointer;

    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.project:hover .delete-project {
    opacity: 1;
}

.delete-project:hover {
    color: #e74c3c;
    border: none;
}

/* =====================
   Projects
===================== */

.field {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 00px 8px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
    gap: 12px;
}

/* =====================
   Habit
===================== */


.habit h2 {
    margin-bottom: 15px;
}

.habit button {
    margin-bottom: 10px;
}


.habit .habit-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.habit .habit-stats b {
    font-size: 2.6em;
}

.habit .habit-stats .stat {
    position: relative;
}

.habit .habit-stats .stat:after {
    position: absolute;
    top: 5px;
    right: 5px;
}

#habit-stats-procent:after {
    content: "🏆";
}

#habit-stats-dni:after {
    content: "📅";
}

#habit-stats-streak:after {
    content: "🔥";
}


.year-summary-field-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.year-chart-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background-color: #f7f7f7;
    border: 1px solid #dbdbdb;
    border-radius: 15px;
}


#yearChart {
    display: block;
}

.year-stats b {
    font-size: 1.5em;
    padding-right: 2px;
}

.year-stats div {
    padding: 3px 0px;
}



/* =====================
   Collection
===================== */

.collection .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-top: 17px;
}

.collection .stats div {
    display: flex;
    flex-direction: column;
    border: solid 2px;
    border-radius: 16px;
    padding: 5px 12px;
    box-shadow: 0 00px 8px rgba(0, 0, 0, 0.08);
    background-color: white;
    position: relative;
}


.collection .stats div:first-child {
    border-color: #2ecc71;
}

.collection .stats div:nth-child(2) {
    border-color: var(--accent);
}

.collection .stats b {
    font-size: 2.3em;
}

.collection .stats p {
    margin: 0 0 5px 0;
}

.collection .stat:after {
    position: absolute;
    top: 10px;
    right: 7px;
}

#stat-suma:after {
    content: "🗂️";
}

#stat-add-month:after {
    content: "⬆️";
}


.kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.kanban-column-parent {
    background: #fff;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 0px 8px rgba(0, 0, 0, 0.08);
}


.kanban-item.done {
    opacity: 0.7;
}

.kanban-item {
    position: relative;
    padding-right: 56px;
}

.kanban-item .actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
}

.kanban-item:hover {
    background: #fff3e8;
    cursor: grab;
}


.kanban-item .date {
    font-size: 12px;
    color: #777;
}


.kanban h3 {
    margin: 0;
    font-size: 1.05em;
}

.kanban .kanban-column-parent h3 {
    border-radius: 13px;
    padding: 4px 0px 4px 6px;
}

.kanban .kanban-column-parent:nth-child(1) h3 {
    background-color: #c4c4c4;
}

.kanban .kanban-column-parent:nth-child(2) h3 {
    background-color: var(--accent);
}

.kanban .kanban-column-parent:nth-child(3) h3 {
    background-color: #2ecc71;
}


.kanban-item {
    height: auto;
    padding: 9px;
    background-color: #f7f7f7;
    border-radius: 99px;
    margin-top: 10px;
    border: solid 1px #dbdbdb;
}

.kanban-item.progress {
    border-left: 4px solid #ff7a00;

}

.kanban-item.done {
    border-left: 4px solid #2ecc71;

}

.kanban-item.new {
    border-left: 4px solid #777;

}

.kanban-column-parent {
    position: relative;
}


.kanban .add-item {
  position: relative;
  margin-top: 20px;
  margin-bottom: 8px;
}



h3.checklista {
    margin-bottom: 0px;
}

.check-item {
    cursor: grab;
}

.check-item.dragging {
    opacity: 0.5;
}

.check-item:hover {
    background: rgba(0, 0, 0, 0.03);
}

.check-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0px;
    border-top: solid 1px #ddd;
}

.check-item:first-child {
    border: none;
}

.check-actions {
    display: flex;
    gap: 6px;
}

.check-actions button {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
}

.check-actions button:hover {
    opacity: 1;
}

.edit-input {
    font-size: inherit;
    padding: 2px 4px;
}

button.edit-btn,
button.delete-btn {
    padding: 5px;
    margin-left: 0px;
}

button.back-btn {
    margin-left: 0px;
}

.checklist-view h4 {
    margin: 15px 0px 5px 0px;
}

/* =====================
   Sequential
===================== */

.step {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border: 2px solid rgba(0, 0, 0, 0.04);
}

.step-actions {
    display: flex;
    gap: 6px;
}

.step-actions button {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
}

.step-actions button:hover {
    opacity: 1;
}

.step.done .step-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.step {
    cursor: grab;
    position: relative;
}

.step.dragging {
    opacity: 0.5;
}

.step:hover {
    background: rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(0, 0, 0, 0.04);
}

.step.current {
    border: 2px solid #f5a623;
    background: #fffaf3;
}

.step.locked {
    opacity: 0.6;
}

.step-actions .lock {
    font-size: 14px;
    opacity: 0.7;
}

.sequential-progress .progress-header b {
    font-size: 2.2em;
}

.steps.field {
    margin-top: 0;
}

.sequential-progress .current-step {
    margin: 11px 0px 11px 20px;
}

.project-view.sequential .add-step #newStepText {
    height: 25px;
    border-radius: 5px;
    outline: 0;
    border: 1px solid var(--border);
}

.project-view.sequential .add-step #newStepText:focus {
    border: 1px solid var(--accent);
}

.steps .step {
    background-color: #ddd;
    border-radius: 11px;
    z-index: 2;
}


.steps .step.current {
    background-color: white;
}

.step:first-child:before {
    border-left: none;
}

.step:before {
    border-left: solid 2px rgba(0, 0, 0, 0.24);
    ;
    position: absolute;
    content: "";
    height: 12px;
    left: 9px;
    top: -2px;
    transform: translateY(-100%);
    z-index: -1;
}

.steps .current label:hover,
.steps .current input:hover {
    cursor: pointer;
}

.steps .done label:hover,
.steps .done input:hover {
    cursor: pointer;
}

.steps .locked label:hover,
.locked .done input:hover {
    cursor: not-allowed;
}



.dwie-kolumny {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.heat-header {
    text-align: center;
}

.language h3 {
    margin: 0;
    padding-bottom: 17px;
    font-size: 1.05em;
}

.day-panel {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.language-stats {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.weekly-plan .week-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
}

.weekly-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#loginOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

#loginOverlay.hidden {
    display: none;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 00px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 300px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 5px 0;
    border-radius: 5px;
    border: 1px solid #ddd;
    background: white;
    color: black;
    box-sizing: border-box;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background-color:var(--accent);
    border: solid 1px var(--accent);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-left: 0;
    margin-top: 12px;
    transform: all 0.3s ease;
}


.login-box button:hover {
    background-color: white !important;
      color: var(--accent);

}

#loginOverlay .login-box img {
    width: 30%;
}

@media (max-width: 767px) { 
.year-selector {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 10px 6px;
}

.project-view.language .dwie-kolumny {
  display: flex;
  flex-direction: column;
}

.project-view.language .dwie-kolumny .week-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 7px;
}

.habit .habit-stats {
  grid-template-columns: repeat(1, 1fr);
}

.year-summary-field-child {
  display: flex;
  flex-direction: column;

}

.year-summary-field-child  .year-stats {
      display: flex;
    width: 100%;
    justify-content: space-between;
}

.collection .stats {
  grid-template-columns: repeat(2, 1fr);
}
.kanban {
  grid-template-columns: repeat(1, 1fr);
}



.year-selector #addYearBtn {
  order: 1;
}

.year-selector #yearSelect {
  order: 2;
}

.year-selector #logoutBtn {
  order: 3;
}



}