:root {
    --primary-color: #0d6efd;
    --border-color: #dee2e6;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

main {
    flex: 1;
}

.navbar-brand {
    font-weight: 600;
}

.calendar-grid {
    user-select: none;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #6c757d;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
    padding: 4px;
}

.calendar-day:hover:not(.empty) {
    background-color: var(--primary-color);
    color: white;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
    font-weight: 600;
}

.calendar-day.selected {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.calendar-day.has-records::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background-color: #28a745;
    border-radius: 50%;
}

.calendar-day {
    position: relative;
}

.record-item {
    transition: background-color 0.15s ease;
}

.record-item:hover {
    background-color: #f8f9fa;
}

.record-item .d-flex {
    min-width: 0;
    flex-wrap: nowrap !important;
}

.record-item .flex-grow-1 {
    min-width: 0;
    max-width: calc(100% - 70px);
    overflow: hidden;
}

.record-item .btn-group {
    flex-shrink: 0;
    margin-left: auto;
}

.record-item p {
    word-break: break-word;
}

.see-more-btn {
    font-size: 0.75rem;
    color: #0d6efd;
    text-decoration: none;
}

.see-more-btn:hover {
    text-decoration: underline;
}

.see-more-text {
    color: #6c757d;
}

.clickable-card {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.clickable-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.records-box {
    transition: opacity 0.2s ease;
}

.records-box-secondary {
    opacity: 0.85;
    background-color: #fafafa;
}

.records-box-secondary .card-header {
    background-color: #f5f5f5;
}

.records-box-main {
    border: 2px solid #0d6efd;
}

.records-box-main .card-header {
    background-color: #e7f1ff;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.card {
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
}

.form-check-label {
    cursor: pointer;
}

.form-control-color {
    width: 100%;
    height: 38px;
    padding: 0.25rem;
}

@media (max-width: 767.98px) {
    .navbar .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .calendar-day {
        font-size: 0.75rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
    }
    
    .record-item .d-flex:not(.flex-wrap) {
        flex-direction: row !important;
        align-items: flex-start !important;
        flex-wrap: wrap;
    }
    
    .record-item .flex-grow-1 {
        max-width: calc(100% - 70px);
    }
    
    .record-item .btn-group {
        align-self: flex-end;
        margin-top: 0.5rem;
        margin-left: 0 !important;
        gap: 4px;
    }
    
    .record-item .btn-group .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .mb-3, .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    h4, h5 {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .calendar-day {
        font-size: 0.7rem;
    }
    
    .calendar-header-row {
        font-size: 0.65rem;
    }
}

.min-vh-100 {
    min-height: 100vh;
}

footer {
    border-top: 1px solid var(--border-color);
}

.alert {
    border-radius: 0.375rem;
}

.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

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

.task-id {
    display: inline-block;
    padding: 2px 6px;
    border: 1px dashed #000;
    background: #fff;
    font-style: italic;
    font-size: 0.85em;
    text-decoration: none !important;
    color: #000 !important;
    cursor: pointer;
}

.task-id:hover {
    background: #f5f5f5;
}
