/* ============================================================================
   Project Management Tool - Stylesheet
   Clean & minimal light design
   ============================================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-primary: #2563EB;
    --color-primary-hover: #1D4ED8;
    --color-primary-light: #EFF6FF;
    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-success: #16A34A;
    --color-warning: #F59E0B;
    --color-text: #1F2937;
    --color-text-light: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-bg: #FFFFFF;
    --color-bg-gray: #F9FAFB;
    --color-bg-hover: #F3F4F6;
    --color-border: #E5E7EB;
    --color-border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --nav-height: 56px;
}

html {
    font-size: 14px;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg-gray);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- Navigation ---------- */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 24px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--color-primary);
}

.nav-logo {
    height: 28px;
    width: auto;
}

.nav-center {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--color-text-light);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--color-bg-hover);
    color: var(--color-text);
    text-decoration: none;
}

.nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.nav-link--logout {
    color: var(--color-text-muted);
}

/* ---------- Main Content ---------- */
.main-content {
    padding: 0;
    max-width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-hover);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    background: var(--color-bg);
    border-color: var(--color-border);
    color: var(--color-text-light);
}

.btn-icon:hover {
    background: var(--color-bg-hover);
    color: var(--color-text);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group--half {
    flex: 1;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-range {
    width: 100%;
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
}

.radio-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.radio-label input[type="radio"] {
    accent-color: var(--color-primary);
}

/* ---------- Flash Messages ---------- */
.flash-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
}

.flash-message--error {
    background: #FEF2F2;
    color: var(--color-danger);
    border-color: #FECACA;
}

.flash-message--success {
    background: #F0FDF4;
    color: var(--color-success);
    border-color: #BBF7D0;
}

.flash-message--info {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: #BFDBFE;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
}

.flash-close:hover {
    opacity: 1;
}

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content--sm {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text-muted);
    line-height: 1;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--color-text);
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-top: 1px solid var(--color-border);
}

.modal-footer__right {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* ---------- Login Page ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--color-bg-gray);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: var(--color-bg);
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-text-light);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.login-error {
    background: #FEF2F2;
    color: var(--color-danger);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
}

.login-form .form-group {
    text-align: left;
}

.login-form .btn {
    margin-top: 8px;
}

/* ---------- Calendar Page ---------- */
.calendar-page {
    padding: 16px 24px;
    height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

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

.calendar-header__title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-left: 8px;
}

.calendar-header__right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View Switcher */
.view-switcher {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.view-btn {
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    background: var(--color-bg);
    border: none;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all 0.15s;
    font-family: inherit;
}

.view-btn:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.view-btn:hover {
    background: var(--color-bg-hover);
}

.view-btn.active {
    background: var(--color-primary);
    color: white;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.breadcrumb-item {
    cursor: pointer;
    color: var(--color-primary);
}

.breadcrumb-item:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    color: var(--color-text-muted);
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: 500;
}

/* ---------- Monthly Calendar Grid ---------- */
.calendar-container {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto;
    grid-auto-rows: 1fr;
    height: 100%;
}

.month-grid__header {
    display: contents;
}

.month-grid__day-name {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-text-light);
    background: var(--color-bg-gray);
    border-bottom: 1px solid var(--color-border);
}

.calendar-day {
    min-height: 80px;
    padding: 4px;
    border-bottom: 1px solid var(--color-border-light);
    border-right: 1px solid var(--color-border-light);
    cursor: pointer;
    transition: background 0.1s;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.calendar-day:hover {
    background: var(--color-bg-gray);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day--outside {
    background: var(--color-bg-gray);
    opacity: 0.5;
}

.calendar-day--today {
    background: var(--color-primary-light);
}

.calendar-day--holiday {
    background: #FEF2F2;
}

.calendar-day--pandora {
    background: #FFFBEB;
}

.calendar-day__header {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 24px;
    flex-shrink: 0;
}

.day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-day--today .day-number {
    background: var(--color-primary);
    color: white;
}

.day-type-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}

.day-type-indicator--pandora {
    background: var(--color-warning);
}

.day-type-indicator--holiday {
    background: var(--color-danger);
}

/* Day notes */
.day-note {
    font-size: 0.7rem;
    color: var(--color-primary);
    font-weight: 500;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.day-note--truncated {
    font-size: 0.65rem;
}

.day-note--editable {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    min-width: 120px;
    white-space: normal;
    overflow: visible;
}

.day-note--editable:hover {
    background: var(--color-bg-hover);
}

.day-note--placeholder {
    color: var(--color-text-muted);
    font-style: italic;
}

.day-note__input {
    font-size: 0.85rem;
    padding: 4px 8px;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    outline: none;
    width: 240px;
    max-width: 100%;
    font-family: inherit;
    color: var(--color-text);
}

.day-note__input:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* ---------- Exercise Badges (Month/Week compact) ---------- */
.day-exercises {
    display: flex;
    gap: 3px;
    margin-top: 1px;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.day-exercises--compact {
    justify-content: center;
    margin-top: 3px;
    flex-wrap: wrap;
}

.day-exercises--compact .exercise-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
}

.exercise-badge {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 2px;
    color: white;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.exercise-badge--strength {
    background: #8B5CF6;
}

.exercise-badge--cardio {
    background: #F97316;
}

.exercise-badge--skipped {
    opacity: 0.35;
    text-decoration: line-through;
}

/* ---------- Exercise Section (Day View) ---------- */
.day-exercises-section {
    display: flex;
    gap: 24px;
    padding: 8px 16px;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    align-items: center;
    flex-shrink: 0;
}

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

.exercise-item__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.exercise-item__label--strength {
    color: #8B5CF6;
}

.exercise-item__label--cardio {
    color: #F97316;
}

.exercise-item__name {
    font-size: 0.85rem;
    font-weight: 500;
    padding: 3px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
}

.exercise-item__name--selectable {
    cursor: pointer;
    position: relative;
    transition: all 0.15s;
}

.exercise-item__name--selectable:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-text-muted);
}

.exercise-item__name--skipped {
    opacity: 0.5;
    font-style: italic;
    color: var(--color-text-light);
}

.exercise-item__skip-btn,
.exercise-item__unskip-btn {
    font-size: 0.7rem;
    padding: 3px 6px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-muted);
    background: var(--color-bg);
    font-family: inherit;
    transition: all 0.15s;
}

.exercise-item__skip-btn:hover {
    color: var(--color-warning);
    border-color: var(--color-warning);
}

.exercise-item__unskip-btn:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.exercise-item--skipped .exercise-item__name {
    text-decoration: line-through;
}

/* Exercise dropdown */
.exercise-dropdown {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 100;
    min-width: 140px;
    overflow: hidden;
}

.exercise-dropdown__option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
}

.exercise-dropdown__option:hover {
    background: var(--color-bg-hover);
}

.exercise-dropdown__option--active {
    color: var(--color-primary);
    font-weight: 600;
    background: var(--color-primary-light);
}

.day-task-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-height: 0;
}

.task-block {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    cursor: pointer;
    line-height: 1.4;
    min-height: 18px;
    display: flex;
    align-items: center;
}

.task-block:hover {
    filter: brightness(0.9);
}

.task-block--completed {
    text-decoration: line-through;
    opacity: 0.7;
}

.task-block--past {
    border-left: 3px solid var(--color-warning);
}

.task-block--pinned {
    cursor: not-allowed;
    border-left: 2px solid rgba(255, 255, 255, 0.6);
}

.task-block-spacer {
    min-height: 0;
    pointer-events: none;
}

/* ---------- Weekly (Kanban) View ---------- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    height: 100%;
}

.week-column {
    border-right: 1px solid var(--color-border-light);
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.week-column:last-child {
    border-right: none;
}

.week-column__header {
    padding: 12px 8px;
    text-align: center;
    background: var(--color-bg-gray);
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
}

.week-column__header:hover {
    background: var(--color-bg-hover);
}

.week-column__day-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-light);
}

.week-column__date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}

.week-column__date {
    font-size: 1.1rem;
    font-weight: 600;
}

.week-column--today .week-column__date {
    background: var(--color-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.week-column__tasks {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
}

.task-card-spacer {
    min-height: 0;
    pointer-events: none;
}

.task-card {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: white;
    cursor: grab;
    transition: box-shadow 0.15s;
}

.task-card:hover {
    box-shadow: var(--shadow-md);
}

.task-card:active {
    cursor: grabbing;
}

.task-card__time {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-bottom: 2px;
}

.task-card__name {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.task-card__hours {
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 600;
}

.task-card__meta {
    font-size: 0.7rem;
    opacity: 0.75;
    margin-top: 4px;
}

.task-card--completed {
    opacity: 0.6;
}

.task-card--completed .task-card__name {
    text-decoration: line-through;
}

.task-card--pinned {
    cursor: not-allowed;
}

/* ---------- Day View (Hourly Timeline) ---------- */
.day-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.day-view__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--color-bg-gray);
    border-bottom: 1px solid var(--color-border);
}

.day-view__date {
    font-size: 1.1rem;
    font-weight: 600;
}

.day-type-toggle {
    display: flex;
    gap: 4px;
}

.day-type-btn {
    padding: 4px 12px;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text-light);
    transition: all 0.15s;
}

.day-type-btn:hover {
    background: var(--color-bg-hover);
}

.day-type-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.day-type-btn--pandora.active {
    background: var(--color-warning);
    border-color: var(--color-warning);
}

.day-type-btn--holiday.active {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.day-timeline {
    display: grid;
    grid-template-columns: 72px 1fr;
}

.timeline-hour {
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border-light);
    text-align: right;
    min-height: 60px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.timeline-hour--blocked {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        var(--color-bg-gray) 4px,
        var(--color-bg-gray) 8px
    );
    opacity: 0.6;
}

.timeline-slot {
    padding: 4px 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border-light);
    min-height: 60px;
}

.timeline-slot:hover {
    background: var(--color-bg-gray);
}

.timeline-slot--blocked {
    cursor: default;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        var(--color-bg-gray) 4px,
        var(--color-bg-gray) 8px
    );
    opacity: 0.6;
}

.timeline-slot--blocked:hover {
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        var(--color-bg-gray) 4px,
        var(--color-bg-gray) 8px
    );
}

.timeline-task {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    cursor: grab;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline-task:active {
    cursor: grabbing;
}

.timeline-task__name {
    font-weight: 500;
    display: flex;
    align-items: center;
}

.timeline-task__meta {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 2px;
}

.timeline-task--completed {
    opacity: 0.6;
}

.timeline-task--completed .timeline-task__name {
    text-decoration: line-through;
}

.timeline-task--pinned {
    cursor: not-allowed;
    border-left: 3px solid white;
}

.timeline-task--past {
    border-right: 3px solid var(--color-warning);
}

/* ---------- Completion Checkbox (all views) ---------- */
.task-complete-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    min-width: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 8px;
    color: white;
    font-size: 0.6rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.task-complete-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
}

.task-complete-btn--done {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
}

/* Month view: smaller checkbox */
.task-block .task-complete-btn {
    width: 14px;
    height: 14px;
    min-width: 14px;
    margin-right: 5px;
    border-width: 1.5px;
    font-size: 0.5rem;
}

/* ---------- Popover ---------- */
.popover {
    position: absolute;
    z-index: 500;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
}

.popover-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 16px;
    font-size: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    text-align: left;
}

.popover-btn:hover {
    background: var(--color-bg-hover);
}

/* ---------- Projects Page ---------- */
.projects-page {
    padding: 24px;
    max-width: 960px;
    margin: 0 auto;
}

.projects-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.projects-page__title {
    font-size: 1.5rem;
    font-weight: 700;
}

.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.project-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.project-card__color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    vertical-align: middle;
}

.project-card__name {
    font-size: 1rem;
    font-weight: 600;
    display: inline;
    vertical-align: middle;
}

.project-card__desc {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 8px;
}

.project-card__stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.project-card__progress {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.project-card__progress-bar {
    height: 100%;
    background: var(--color-success);
    border-radius: 2px;
    transition: width 0.3s;
}

.project-card__actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.project-card:hover .project-card__actions {
    opacity: 1;
}

.project-card__action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--color-bg-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.project-card__action-btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-light);
}

.empty-state__icon {
    font-size: 2.5rem;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.empty-state__title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
}

.empty-state__text {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ---------- Color Picker ---------- */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-picker-input {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 2px;
    cursor: pointer;
}

.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-input::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* ---------- Drag & Drop States ---------- */
.ui-sortable-helper {
    box-shadow: var(--shadow-lg) !important;
    transform: rotate(2deg);
    opacity: 0.9;
}

.ui-sortable-placeholder {
    background: var(--color-primary-light) !important;
    border: 2px dashed var(--color-primary) !important;
    border-radius: var(--radius-sm);
    visibility: visible !important;
    min-height: 40px;
}

.drop-target {
    background: var(--color-primary-light) !important;
    outline: 2px dashed var(--color-primary);
    outline-offset: -2px;
}

/* Dragging source element fades out */
.dragging {
    opacity: 0.3 !important;
}

/* Draggable clone helper styles */
.ui-draggable-dragging {
    box-shadow: var(--shadow-lg) !important;
    z-index: 1001 !important;
}

/* Day view: droppable empty slots highlight */
.timeline-slot.drop-target {
    outline-offset: -3px;
}

/* Month view: droppable day cells highlight */
.calendar-day.drop-target {
    outline-offset: -3px;
}

/* ---------- Undo Button ---------- */
.btn-undo {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    transition: all 0.2s;
}

.btn-undo:hover {
    background: var(--color-primary);
    color: white;
}

.btn-undo .undo-count {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ---------- Recurring Task UI ---------- */
#task-recurring-toggle {
    accent-color: var(--color-primary);
    margin-right: 6px;
}

.recurring-fields {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--color-bg-gray);
    border-left: 3px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.recurring-fields .form-group {
    margin-bottom: 12px;
}

.recurring-fields .form-group:last-child {
    margin-bottom: 0;
}

/* Scope Modal Buttons */
.scope-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.scope-btn {
    text-align: left;
    justify-content: flex-start;
}

.scope-btn i {
    width: 20px;
    text-align: center;
    color: var(--color-primary);
}

.scope-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Recurring Icon on Task Blocks */
.task-block__recurring-icon,
.task-card__recurring-icon,
.timeline-task__recurring-icon {
    font-size: 0.65em;
    opacity: 0.85;
    margin-right: 2px;
}

/* Month view consolidated task block extras */
.task-block__hours {
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 4px;
    font-weight: 600;
}

.task-block__part {
    font-size: 0.8em;
    opacity: 0.75;
    margin-left: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .calendar-page {
        height: auto;
        min-height: calc(100vh - var(--nav-height));
    }

    .calendar-day {
        min-height: 60px;
    }

    .month-grid__day-name {
        font-size: 0.65rem;
        padding: 8px 4px;
    }

    .week-grid {
        grid-template-columns: 1fr;
    }

    .week-column {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        min-height: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .nav-center {
        display: none;
    }
}
