/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* MAIN CONTAINER */
.gantt-chart {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 4px;

    /* prevent horizontal overflow */
    overflow-x: hidden;
    overflow-y: hidden;

    padding: 0;
    margin: 0;
}

/* HEADER */
.header {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
}

/* ROWS CONTAINER */
.rows-container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ROWS */
.row {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    position: relative;
}

/* HEADER CELLS + TASK CELLS */
.day-of-week,
.task {
    flex: 1 1 0;          /* equal width, shrink allowed */
    min-width: 0;         /* ⭐ prevents content from pushing wider */
    overflow: hidden;     /* ⭐ prevents internal overflow */
    white-space: nowrap;  /* keeps THU 6 on one line */
    text-overflow: clip;

    text-align: center;
    font-weight: bold;
    position: relative;

    padding: 0;
    margin: 0;
}

/* REMOVE ALL BORDERS IN ROWS */
.task,
.row,
.rows-container {
    border: none !important;
}

/* REMOVE HEADER CELL BORDERS TOO */
.day-of-week {
    border: none !important;
}

/* ALTERNATING COLUMN COLORS */
.day-of-week:nth-child(odd),
.task:nth-child(odd) {
    background-color: #ffffff;
}

.day-of-week:nth-child(even),
.task:nth-child(even) {
    background-color: #f7f9fc;
}

/* HEADER LABEL WRAPPER */
.day-label {
    display: flex;
    flex-direction: column;
    width: 100%;          /* ⭐ prevents expansion */
    min-width: 0;         /* ⭐ prevents flex overflow */
    overflow: hidden;
}

/* WEEKDAY TEXT */
.weekday,
.daynum {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

/* TASK HEIGHT */
.task {
    height: 40px;
}

/* WEEKDAY PILL */
.weekday-pill {
    display: inline-block;
    padding: 4px 10px;
    background-color: #fafafa;
    border: 1px solid #ddd;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    user-select: none;
    text-align: center;
    white-space: nowrap;

    max-width: 100%;      /* ⭐ prevents pill from widening column */
    overflow: hidden;
}

/* EVENT BARS */
.event-bar-wk {
    position: absolute;
    top: 15%;
    height: 70%;
    background-color: #c79b21;
    border-radius: 4px;
    color: white;
    font-size: 12px;
    padding-left: 4px;
    display: flex;
    align-items: center;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* MOBILE: condensed but same grid */
@media (max-width: 768px) {
    .task {
        height: 32px;
    }
    .weekday,
    .weekday-pill,
    .event-bar-wk {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .task {
        height: 28px;
    }
    .weekday,
    .weekday-pill,
    .event-bar-wk {
        font-size: 10px;
    }
}
