html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 40px;
}

/* ── Calendar grid ─────────────────────────────────────── */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-header {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    padding: 6px 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-cell {
    min-height: 72px;
    padding: 6px 8px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    transition: background-color 0.1s, border-color 0.1s;
    user-select: none;
}

.calendar-cell:hover {
    background-color: #f0f4ff;
    border-color: #c5d0f5;
}

.calendar-cell.today {
    border-color: #0d6efd;
    background-color: #eef3ff;
}

.calendar-cell.today:hover {
    background-color: #e0eaff;
}

.calendar-cell.weekend {
    background-color: #fafafa;
}

.calendar-cell.current-week {
    background-color: #fefce8;
    border-color: #fde68a;
}

.calendar-cell.current-week:hover {
    background-color: #fef9c3;
    border-color: #fbbf24;
}

/* today takes priority over current-week */
.calendar-cell.current-week.today {
    background-color: #eef3ff;
    border-color: #0d6efd;
}

.calendar-cell.empty {
    border: none;
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.day-number {
    font-size: 0.85rem;
    font-weight: 500;
    color: #343a40;
    line-height: 1;
}

.calendar-cell.today .day-number {
    color: #0d6efd;
    font-weight: 700;
}

.day-hours {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background-color: #198754;
    color: #fff;
    line-height: 1.6;
}

/* ── Day panel ─────────────────────────────────────────── */
.day-panel {
    position: sticky;
    top: 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1.25rem;
    min-height: 320px;
}

.day-panel-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.day-total-badge {
    background-color: #0d6efd;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Entry list ────────────────────────────────────────── */
.entries-list {
    margin-bottom: 0.5rem;
}

.entry-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.entry-item:last-child {
    border-bottom: none;
}

.entry-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.entry-info {
    flex: 1;
    min-width: 0;
}

.entry-hours {
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
    background-color: #f1f3f5;
    padding: 1px 6px;
    border-radius: 8px;
}

.entry-desc {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
    word-break: break-word;
}

.btn-ghost-danger {
    border: none;
    background: transparent;
    color: #adb5bd;
    padding: 2px 6px;
    line-height: 1;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.1s, background-color 0.1s;
}

.btn-ghost-danger:hover {
    color: #dc3545;
    background-color: #fff5f5;
}

/* ── Add entry form ────────────────────────────────────── */
.add-entry-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* ── Summary card (month panel / week panel) ───────────── */
.summary-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
}

/* ── Monthly project badges ────────────────────────────── */

.badge-project {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.775rem;
    color: #fff;
    font-weight: 500;
}

/* ── Color dot (Projects list) ─────────────────────────── */
.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    vertical-align: middle;
}

/* ── Color preset buttons (Create/Edit project) ────────── */
.color-preset-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s, border-color 0.1s;
}

.color-preset-btn:hover {
    transform: scale(1.2);
    border-color: #fff;
    box-shadow: 0 0 0 2px #6c757d;
}

/* ── htmx loading indicator ────────────────────────────── */
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
